From patchwork Fri Mar 4 17:01:50 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 347 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:41:52 -0000 Delivered-To: patches@linaro.org Received: by 10.224.60.68 with SMTP id o4cs21431qah; Fri, 4 Mar 2011 09:01:57 -0800 (PST) Received: by 10.227.71.197 with SMTP id i5mr771973wbj.113.1299258116916; Fri, 04 Mar 2011 09:01:56 -0800 (PST) Received: from mail-wy0-f178.google.com (mail-wy0-f178.google.com [74.125.82.178]) by mx.google.com with ESMTPS id f60si3505776wej.119.2011.03.04.09.01.56 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 04 Mar 2011 09:01:56 -0800 (PST) Received-SPF: neutral (google.com: 74.125.82.178 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=74.125.82.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.178 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) smtp.mail=lee.jones@linaro.org Received: by mail-wy0-f178.google.com with SMTP id 28so2726741wyf.37 for ; Fri, 04 Mar 2011 09:01:56 -0800 (PST) Received: by 10.227.202.73 with SMTP id fd9mr765484wbb.72.1299258116235; Fri, 04 Mar 2011 09:01:56 -0800 (PST) Received: from [192.168.0.2] (cpc2-aztw21-0-0-cust264.aztw.cable.virginmedia.com [77.100.97.9]) by mx.google.com with ESMTPS id x1sm1938482wbh.2.2011.03.04.09.01.54 (version=SSLv3 cipher=OTHER); Fri, 04 Mar 2011 09:01:55 -0800 (PST) Message-ID: <4D711AFE.4030004@linaro.org> Date: Fri, 04 Mar 2011 17:01:50 +0000 From: Lee Jones User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.14) Gecko/20110223 Lightning/1.0b2 Thunderbird/3.1.8 MIME-Version: 1.0 To: patches@linaro.org Subject: [PATCH 1/3] plat-nomadik: get rid of unused GPIO PM code From: Rabin Vincent The NOMADIK_GPIO_PM config option is disabled by default, not user visible, and never selected by any other option: the code is therefore unused. The GPIO registers need not be saved and restored since their values are preserved when vAPE (on DB8500) is powered down. Signed-off-by: Rabin Vincent Reviewed-by: Jonas Aberg Signed-off-by: Linus Walleij --- arch/arm/plat-nomadik/Kconfig | 6 --- arch/arm/plat-nomadik/gpio.c | 76 ++--------------------------------------- 2 files changed, 3 insertions(+), 79 deletions(-) u32 edge_rising; u32 edge_falling; - u32 backup[ARRAY_SIZE(backup_regs)]; - /* Bitmap, 1 = pull up, 0 = pull down */ - u32 pull; }; static struct nmk_gpio_chip * @@ -117,13 +102,10 @@ static void __nmk_gpio_set_pull(struct nmk_gpio_chip *nmk_chip, pdis &= ~bit; writel(pdis, nmk_chip->addr + NMK_GPIO_PDIS); - if (pull == NMK_GPIO_PULL_UP) { - nmk_chip->pull |= bit; + if (pull == NMK_GPIO_PULL_UP) writel(bit, nmk_chip->addr + NMK_GPIO_DATS); - } else if (pull == NMK_GPIO_PULL_DOWN) { - nmk_chip->pull &= ~bit; + else if (pull == NMK_GPIO_PULL_DOWN) writel(bit, nmk_chip->addr + NMK_GPIO_DATC); - } } static void __nmk_gpio_make_input(struct nmk_gpio_chip *nmk_chip, @@ -991,64 +973,12 @@ out: return ret; } -#ifdef CONFIG_NOMADIK_GPIO_PM -static int nmk_gpio_pm(struct platform_device *dev, bool suspend) -{ - struct nmk_gpio_chip *nmk_chip = platform_get_drvdata(dev); - int i; - u32 dir; - u32 dat; - - for (i = 0; i < ARRAY_SIZE(backup_regs); i++) { - if (suspend) - nmk_chip->backup[i] = readl(nmk_chip->addr + - backup_regs[i]); - else - writel(nmk_chip->backup[i], - nmk_chip->addr + backup_regs[i]); - } - - if (!suspend) { - /* - * Restore pull-up and pull-down on inputs and - * outputs. - */ - dir = readl(nmk_chip->addr + NMK_GPIO_DIR); - dat = readl(nmk_chip->addr + NMK_GPIO_DAT); - - writel((nmk_chip->pull & ~dir) | - (dat & dir), - nmk_chip->addr + NMK_GPIO_DATS); - - writel((~nmk_chip->pull & ~dir) | - (~dat & dir), - nmk_chip->addr + NMK_GPIO_DATC); - } - return 0; -} - -static int nmk_gpio_suspend(struct platform_device *dev, pm_message_t state) -{ - return nmk_gpio_pm(dev, true); -} - -static int nmk_gpio_resume(struct platform_device *dev) -{ - return nmk_gpio_pm(dev, false); -} -#else -#define nmk_gpio_suspend NULL -#define nmk_gpio_resume NULL -#endif - static struct platform_driver nmk_gpio_driver = { .driver = { .owner = THIS_MODULE, .name = "gpio", - }, + }, .probe = nmk_gpio_probe, - .suspend = nmk_gpio_suspend, - .resume = nmk_gpio_resume, }; static int __init nmk_gpio_init(void) diff --git a/arch/arm/plat-nomadik/Kconfig b/arch/arm/plat-nomadik/Kconfig index ad25c96..187f4e8 100644 --- a/arch/arm/plat-nomadik/Kconfig +++ b/arch/arm/plat-nomadik/Kconfig @@ -25,10 +25,4 @@ config NOMADIK_GPIO help Support for the Nomadik GPIO controller. -config NOMADIK_GPIO_PM - bool - depends on NOMADIK_GPIO && PM - help - Support PM for the Nomadik GPIO controller. - endif diff --git a/arch/arm/plat-nomadik/gpio.c b/arch/arm/plat-nomadik/gpio.c index acc9de2..5e6653f 100644 --- a/arch/arm/plat-nomadik/gpio.c +++ b/arch/arm/plat-nomadik/gpio.c @@ -35,18 +35,6 @@ * Symbols in this file are called "nmk_gpio" for "nomadik gpio" */ -static const u32 backup_regs[] = { - NMK_GPIO_PDIS, - NMK_GPIO_DIR, - NMK_GPIO_AFSLA, - NMK_GPIO_AFSLB, - NMK_GPIO_SLPC, - NMK_GPIO_RIMSC, - NMK_GPIO_FIMSC, - NMK_GPIO_RWIMSC, - NMK_GPIO_FWIMSC, -}; - #define NMK_GPIO_PER_CHIP 32 struct nmk_gpio_chip { @@ -62,9 +50,6 @@ struct nmk_gpio_chip { /* Keep track of configured edges */