From patchwork Tue Jan 13 07:00:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 42978 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f72.google.com (mail-wg0-f72.google.com [74.125.82.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5B92025E1B for ; Tue, 13 Jan 2015 07:00:56 +0000 (UTC) Received: by mail-wg0-f72.google.com with SMTP id a1sf622035wgh.3 for ; Mon, 12 Jan 2015 23:00:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=w6e0fiCIhJq6s+MAyovn2I0z8UdJIq4CG20GKORht7s=; b=E6IASSg+pPBoy+oPCLLlBggmElnbYnGQWY9TruoUItIegzk4c6ff4Mo8UJHyjrvi67 yKMkUuBwhOUvrkI3ulF0C0Ga1WqKw94z8390YMjdjENJ4ygfe3Xh4sRtcRpCCjUEKHzf to0c5k/53BuLzB+453LpsnQ8iGP0bIDoCWm08rHp9vcej0FHIhQjOiR9zGe3v/y7qh0u QFcxCBTIP3tdlOI8gBEMb0EpUWxYUlZfajspQduVW0sNaKvh6TLuotaH1X2mjDZtnc5a MRqckkXKCgaurW5QtjN+72aeM5LAYdOkKbrg5R4n0F7ZvPCmxa5dF6mKL7jjXI41CRBE tFIw== X-Gm-Message-State: ALoCoQkkKuodFFBLQWdoOQuXDwpxBt2Hk4zO6IQia8z3xk5RBS0DnQf0ARQ6stx/yZ6LOyaIZoyR X-Received: by 10.180.108.165 with SMTP id hl5mr2614220wib.7.1421132455585; Mon, 12 Jan 2015 23:00:55 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.205.66 with SMTP id le2ls709580lac.90.gmail; Mon, 12 Jan 2015 23:00:55 -0800 (PST) X-Received: by 10.112.12.65 with SMTP id w1mr40452606lbb.68.1421132455330; Mon, 12 Jan 2015 23:00:55 -0800 (PST) Received: from mail-la0-f48.google.com (mail-la0-f48.google.com. [209.85.215.48]) by mx.google.com with ESMTPS id l8si2127798lag.2.2015.01.12.23.00.55 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 12 Jan 2015 23:00:55 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) client-ip=209.85.215.48; Received: by mail-la0-f48.google.com with SMTP id gf13so1049310lab.7 for ; Mon, 12 Jan 2015 23:00:55 -0800 (PST) X-Received: by 10.112.159.136 with SMTP id xc8mr40435401lbb.98.1421132455076; Mon, 12 Jan 2015 23:00:55 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.9.200 with SMTP id c8csp1294310lbb; Mon, 12 Jan 2015 23:00:54 -0800 (PST) X-Received: by 10.66.65.165 with SMTP id y5mr49240154pas.146.1421132453102; Mon, 12 Jan 2015 23:00:53 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ki8si25863734pbc.210.2015.01.12.23.00.49; Mon, 12 Jan 2015 23:00:53 -0800 (PST) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751257AbbAMHAi (ORCPT + 27 others); Tue, 13 Jan 2015 02:00:38 -0500 Received: from mail-la0-f49.google.com ([209.85.215.49]:38916 "EHLO mail-la0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750856AbbAMHAg (ORCPT ); Tue, 13 Jan 2015 02:00:36 -0500 Received: by mail-la0-f49.google.com with SMTP id hs14so1047812lab.8 for ; Mon, 12 Jan 2015 23:00:34 -0800 (PST) X-Received: by 10.152.26.201 with SMTP id n9mr41164928lag.50.1421132434711; Mon, 12 Jan 2015 23:00:34 -0800 (PST) Received: from localhost.localdomain (c83-251-167-210.bredband.comhem.se. [83.251.167.210]) by mx.google.com with ESMTPSA id qg5sm4723524lbb.42.2015.01.12.23.00.33 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Jan 2015 23:00:33 -0800 (PST) From: Linus Walleij To: Samuel Ortiz , Lee Jones , linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org Cc: Linus Walleij Subject: [PATCH] gpio: stmpe: enforce device tree only mode Date: Tue, 13 Jan 2015 08:00:29 +0100 Message-Id: <1421132429-6947-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.9.3 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linus.walleij@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Require that device tree be used with STMPE (all platforms use this) and enforce OF_GPIO, then delete the platform data. Signed-off-by: Linus Walleij Acked-by: Lee Jones --- MFD: folks: please ACK this so I can funnel it through the GPIO tree. --- drivers/gpio/Kconfig | 1 + drivers/gpio/gpio-stmpe.c | 23 +++-------------------- include/linux/mfd/stmpe.h | 16 ---------------- 3 files changed, 4 insertions(+), 36 deletions(-) diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index 633ec216e185..5b1821daa1bd 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -624,6 +624,7 @@ config GPIO_SX150X config GPIO_STMPE bool "STMPE GPIOs" depends on MFD_STMPE + depends on OF_GPIO select GPIOLIB_IRQCHIP help This enables support for the GPIOs found on the STMPE I/O diff --git a/drivers/gpio/gpio-stmpe.c b/drivers/gpio/gpio-stmpe.c index 359536eaca0d..926502145492 100644 --- a/drivers/gpio/gpio-stmpe.c +++ b/drivers/gpio/gpio-stmpe.c @@ -30,7 +30,7 @@ struct stmpe_gpio { struct stmpe *stmpe; struct device *dev; struct mutex irq_lock; - unsigned norequest_mask; + u32 norequest_mask; /* Caches of interrupt control registers for bus_lock */ u8 regs[CACHE_NR_REGS][CACHE_NR_BANKS]; u8 oldregs[CACHE_NR_REGS][CACHE_NR_BANKS]; @@ -350,13 +350,10 @@ static int stmpe_gpio_probe(struct platform_device *pdev) { struct stmpe *stmpe = dev_get_drvdata(pdev->dev.parent); struct device_node *np = pdev->dev.of_node; - struct stmpe_gpio_platform_data *pdata; struct stmpe_gpio *stmpe_gpio; int ret; int irq = 0; - pdata = stmpe->pdata->gpio; - irq = platform_get_irq(pdev, 0); stmpe_gpio = kzalloc(sizeof(struct stmpe_gpio), GFP_KERNEL); @@ -370,19 +367,14 @@ static int stmpe_gpio_probe(struct platform_device *pdev) stmpe_gpio->chip = template_chip; stmpe_gpio->chip.ngpio = stmpe->num_gpios; stmpe_gpio->chip.dev = &pdev->dev; -#ifdef CONFIG_OF stmpe_gpio->chip.of_node = np; -#endif stmpe_gpio->chip.base = -1; if (IS_ENABLED(CONFIG_DEBUG_FS)) stmpe_gpio->chip.dbg_show = stmpe_dbg_show; - if (pdata) - stmpe_gpio->norequest_mask = pdata->norequest_mask; - else if (np) - of_property_read_u32(np, "st,norequest-mask", - &stmpe_gpio->norequest_mask); + of_property_read_u32(np, "st,norequest-mask", + &stmpe_gpio->norequest_mask); if (irq < 0) dev_info(&pdev->dev, @@ -424,9 +416,6 @@ static int stmpe_gpio_probe(struct platform_device *pdev) NULL); } - if (pdata && pdata->setup) - pdata->setup(stmpe, stmpe_gpio->chip.base); - platform_set_drvdata(pdev, stmpe_gpio); return 0; @@ -443,15 +432,9 @@ static int stmpe_gpio_remove(struct platform_device *pdev) { struct stmpe_gpio *stmpe_gpio = platform_get_drvdata(pdev); struct stmpe *stmpe = stmpe_gpio->stmpe; - struct stmpe_gpio_platform_data *pdata = stmpe->pdata->gpio; - - if (pdata && pdata->remove) - pdata->remove(stmpe, stmpe_gpio->chip.base); gpiochip_remove(&stmpe_gpio->chip); - stmpe_disable(stmpe, STMPE_BLOCK_GPIO); - kfree(stmpe_gpio); return 0; diff --git a/include/linux/mfd/stmpe.h b/include/linux/mfd/stmpe.h index dd908fea8c5b..23a9722c8176 100644 --- a/include/linux/mfd/stmpe.h +++ b/include/linux/mfd/stmpe.h @@ -119,20 +119,6 @@ extern int stmpe_disable(struct stmpe *stmpe, unsigned int blocks); #define STMPE_GPIO_NOREQ_811_TOUCH (0xf0) /** - * struct stmpe_gpio_platform_data - STMPE GPIO platform data - * @norequest_mask: bitmask specifying which GPIOs should _not_ be - * requestable due to different usage (e.g. touch, keypad) - * STMPE_GPIO_NOREQ_* macros can be used here. - * @setup: board specific setup callback. - * @remove: board specific remove callback - */ -struct stmpe_gpio_platform_data { - unsigned norequest_mask; - void (*setup)(struct stmpe *stmpe, unsigned gpio_base); - void (*remove)(struct stmpe *stmpe, unsigned gpio_base); -}; - -/** * struct stmpe_ts_platform_data - stmpe811 touch screen controller platform * data * @sample_time: ADC converstion time in number of clock. @@ -183,7 +169,6 @@ struct stmpe_ts_platform_data { * @irq_over_gpio: true if gpio is used to get irq * @irq_gpio: gpio number over which irq will be requested (significant only if * irq_over_gpio is true) - * @gpio: GPIO-specific platform data * @ts: touchscreen-specific platform data */ struct stmpe_platform_data { @@ -195,7 +180,6 @@ struct stmpe_platform_data { int irq_gpio; int autosleep_timeout; - struct stmpe_gpio_platform_data *gpio; struct stmpe_ts_platform_data *ts; };