From patchwork Fri Nov 25 10:09:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 84097 Delivered-To: patch@linaro.org Received: by 10.182.1.168 with SMTP id 8csp51735obn; Fri, 25 Nov 2016 02:10:00 -0800 (PST) X-Received: by 10.99.113.68 with SMTP id b4mr12738322pgn.33.1480068599648; Fri, 25 Nov 2016 02:09:59 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f16si43943293pga.83.2016.11.25.02.09.59; Fri, 25 Nov 2016 02:09:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753087AbcKYKJ6 (ORCPT + 4 others); Fri, 25 Nov 2016 05:09:58 -0500 Received: from mail-lf0-f49.google.com ([209.85.215.49]:34335 "EHLO mail-lf0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752993AbcKYKJ5 (ORCPT ); Fri, 25 Nov 2016 05:09:57 -0500 Received: by mail-lf0-f49.google.com with SMTP id o141so46857110lff.1 for ; Fri, 25 Nov 2016 02:09:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Ymy3fNGE6zvyTlPtAakjCMo2OoTffEubimGXyWpHXWc=; b=au9isZVzGd9HJtDM27xdMv7PmVvLCHtPDsI+jrahAoIGQAdMicOU6S95WeMo8k+NJX 6jLc1eScNAf4gSnJXGJCMKhe7RhT05MSWTjNXV0dOjt6OO8su4WVV0rycl5BY6IuBrI+ dAXFxiXJ8Kvpr60i+1vdNFn3YxSDOxtp8cMB4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Ymy3fNGE6zvyTlPtAakjCMo2OoTffEubimGXyWpHXWc=; b=KvIggq3B/Xgrz15rjzGjpYOyzBlx0mXgU5t5qwSQeVh7wlK+4+el5D2mq7qJdKFoGK SIeofHoxY21KqPq43zdHf+Nd99Bm6NYcrupADCFN5uQ25p0ytxP+tA8KfOLpwKcCv6Ef lgCZjwi0qyit4kEcUag7Wi9s6eohd0XkOD1R/dbki9W9kSOiMzRW6xtWsQqasrv5c/4E ozgukcgtst/WtoGnpR+Hh5jYkHjlF37vcGaDW91VZxlLvafRqL53dOMKZNurPRFJepuR uo1YTgeidxl3BXreIar44ne5lCCrGnveRm9cWGreA2mC3HiSAEvKBPEgIcV7cq8ugezt NeDw== X-Gm-Message-State: AKaTC02XDFdL+7Ch4jINDhyiLLVE2piorjeoWGjWbuJ/uHjLyUa4mLTCmLW4YVVLJSabvyy7 X-Received: by 10.46.9.129 with SMTP id 123mr3719604ljj.20.1480068595848; Fri, 25 Nov 2016 02:09:55 -0800 (PST) Received: from linuslaptop.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id c78sm5088022lfc.39.2016.11.25.02.09.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Nov 2016 02:09:55 -0800 (PST) From: Linus Walleij To: linux-gpio@vger.kernel.org, Alexandre Courbot , linux-arm-kernel@lists.infradead.org, Baruch Siach Cc: Sudeep Holla , Haojian Zhuang , Linus Walleij Subject: [PATCH 5/5] gpio: pl061: delete platform data handling Date: Fri, 25 Nov 2016 11:09:24 +0100 Message-Id: <1480068564-9447-5-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1480068564-9447-1-git-send-email-linus.walleij@linaro.org> References: <1480068564-9447-1-git-send-email-linus.walleij@linaro.org> Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Platform data is a remnant of board files and all boards using the PL061 have been migrated to use device tree or ACPI instead. The custom mechanism to set line by default as inputs/outputs has been superceded by the GPIO-internal hogging mechanism. Signed-off-by: Linus Walleij --- drivers/gpio/gpio-pl061.c | 41 +++-------------------------------------- 1 file changed, 3 insertions(+), 38 deletions(-) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-gpio" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/gpio/gpio-pl061.c b/drivers/gpio/gpio-pl061.c index cbcc631181e0..0a6bfd2b06e5 100644 --- a/drivers/gpio/gpio-pl061.c +++ b/drivers/gpio/gpio-pl061.c @@ -38,19 +38,6 @@ #define PL061_GPIO_NR 8 -struct pl061_platform_data { - /* number of the first GPIO */ - unsigned gpio_base; - - /* number of the first IRQ. - * If the IRQ functionality in not desired this must be set to 0. - */ - unsigned irq_base; - - u8 directions; /* startup directions, 1: out, 0: in */ - u8 values; /* startup values */ -}; - #ifdef CONFIG_PM struct pl061_context_save_regs { u8 gpio_data; @@ -306,26 +293,13 @@ static struct irq_chip pl061_irqchip = { static int pl061_probe(struct amba_device *adev, const struct amba_id *id) { struct device *dev = &adev->dev; - struct pl061_platform_data *pdata = dev_get_platdata(dev); struct pl061 *pl061; - int ret, irq, i, irq_base; + int ret, irq; pl061 = devm_kzalloc(dev, sizeof(*pl061), GFP_KERNEL); if (pl061 == NULL) return -ENOMEM; - if (pdata) { - pl061->gc.base = pdata->gpio_base; - irq_base = pdata->irq_base; - if (irq_base <= 0) { - dev_err(&adev->dev, "invalid IRQ base in pdata\n"); - return -ENODEV; - } - } else { - pl061->gc.base = -1; - irq_base = 0; - } - pl061->base = devm_ioremap_resource(dev, &adev->res); if (IS_ERR(pl061->base)) return PTR_ERR(pl061->base); @@ -336,6 +310,7 @@ static int pl061_probe(struct amba_device *adev, const struct amba_id *id) pl061->gc.free = gpiochip_generic_free; } + pl061->gc.base = -1; pl061->gc.get_direction = pl061_get_direction; pl061->gc.direction_input = pl061_direction_input; pl061->gc.direction_output = pl061_direction_output; @@ -362,7 +337,7 @@ static int pl061_probe(struct amba_device *adev, const struct amba_id *id) pl061->parent_irq = irq; ret = gpiochip_irqchip_add(&pl061->gc, &pl061_irqchip, - irq_base, handle_bad_irq, + 0, handle_bad_irq, IRQ_TYPE_NONE); if (ret) { dev_info(&adev->dev, "could not add irqchip\n"); @@ -371,16 +346,6 @@ static int pl061_probe(struct amba_device *adev, const struct amba_id *id) gpiochip_set_chained_irqchip(&pl061->gc, &pl061_irqchip, irq, pl061_irq_handler); - for (i = 0; i < PL061_GPIO_NR; i++) { - if (pdata) { - if (pdata->directions & (BIT(i))) - pl061_direction_output(&pl061->gc, i, - pdata->values & (BIT(i))); - else - pl061_direction_input(&pl061->gc, i); - } - } - amba_set_drvdata(adev, pl061); dev_info(&adev->dev, "PL061 GPIO chip @%pa registered\n", &adev->res.start);