From patchwork Tue Dec 11 14:00:04 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 13476 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id C0FDF23FC0 for ; Tue, 11 Dec 2012 14:00:21 +0000 (UTC) Received: from mail-ia0-f180.google.com (mail-ia0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 75B95A198FE for ; Tue, 11 Dec 2012 14:00:21 +0000 (UTC) Received: by mail-ia0-f180.google.com with SMTP id t4so6673094iag.11 for ; Tue, 11 Dec 2012 06:00:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:mime-version:content-type :x-gm-message-state; bh=8BsaXava8U/GykbLkvQLpzZaArYoGQBFq0TYll7SUww=; b=BS8H3iu01h55yJZkV/HveIwI5uLz/4HJOA8+CC1CZ4Sd+cuYIta7fjL4WVPkAa11RA HL5ub5A9qypITEw2TMDPA7K4kgTTXuaMJ/689kNOQZZ3RdI9QsudQrLUHX+h3c8Rzc1f 1WWY4mo9TfaLvaYA1eLpDkAncE/uOl0CxDpyW0wr5cLNOBsRwR0uhj9aoG7aAx3kcIDZ zApd79bpaxuKyxNedTdz/cHY1mewmbwCLCnKaka9x77Ucc20xYoKfhLmnWA5n8HIEosY UcE17AwV7vDaV0f1wQS5CpG+8ENn1snWvrEJGkPbtiKxj1EuahraeLExmfZcNPjlhjC9 EmdA== Received: by 10.50.185.166 with SMTP id fd6mr9727827igc.62.1355234420829; Tue, 11 Dec 2012 06:00:20 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp133199igt; Tue, 11 Dec 2012 06:00:20 -0800 (PST) Received: by 10.14.0.133 with SMTP id 5mr60119987eeb.29.1355234419964; Tue, 11 Dec 2012 06:00:19 -0800 (PST) Received: from eu1sys200aog102.obsmtp.com (eu1sys200aog102.obsmtp.com [207.126.144.113]) by mx.google.com with SMTP id s42si55094948eem.70.2012.12.11.06.00.13 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 11 Dec 2012 06:00:19 -0800 (PST) Received-SPF: neutral (google.com: 207.126.144.113 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=207.126.144.113; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.113 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) smtp.mail=linus.walleij@stericsson.com Received: from beta.dmz-us.st.com ([167.4.1.35]) (using TLSv1) by eu1sys200aob102.postini.com ([207.126.147.11]) with SMTP ID DSNKUMc8bGHSS7e8aq9+fjrqsHpUq7P7pPub@postini.com; Tue, 11 Dec 2012 14:00:19 UTC Received: from zeta.dmz-us.st.com (ns4.st.com [167.4.16.71]) by beta.dmz-us.st.com (STMicroelectronics) with ESMTP id C26DC5F; Tue, 11 Dec 2012 13:59:29 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-us.st.com (STMicroelectronics) with ESMTP id B1E5B4E; Tue, 11 Dec 2012 08:50:50 +0000 (GMT) Received: from exdcvycastm022.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm022", Issuer "exdcvycastm022" (not verified)) by relay1.stm.gmessaging.net (Postfix) with ESMTPS id 84EA924C2F7; Tue, 11 Dec 2012 15:00:00 +0100 (CET) Received: from steludxu4075.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.30) with Microsoft SMTP Server (TLS) id 8.3.83.0; Tue, 11 Dec 2012 15:00:06 +0100 From: Linus Walleij To: , Cc: Stephen Warren , Anmar Oueja , Julien Delacou , Linus Walleij Subject: [PATCH 2/2] pinctrl/nomadik: adopt pinctrl sleep mode management Date: Tue, 11 Dec 2012 15:00:04 +0100 Message-ID: <1355234404-17405-1-git-send-email-linus.walleij@stericsson.com> X-Mailer: git-send-email 1.7.11.3 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQljZ/dIVqZsRvvBrx02/hOwAnqVzOs0+UgjxhPaPD8ob9gTAIDHRrqJ4ltO3NhnsjqyQbSD From: Julien Delacou This fix makes pinctrl-nomadik able to handle suspend/resume events and change hogged pins states accordingly. Signed-off-by: Julien Delacou Signed-off-by: Linus Walleij --- drivers/pinctrl/pinctrl-nomadik.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/drivers/pinctrl/pinctrl-nomadik.c b/drivers/pinctrl/pinctrl-nomadik.c index 8ef3e85..1068faa 100644 --- a/drivers/pinctrl/pinctrl-nomadik.c +++ b/drivers/pinctrl/pinctrl-nomadik.c @@ -1847,6 +1847,28 @@ static const struct of_device_id nmk_pinctrl_match[] = { {}, }; +static int nmk_pinctrl_suspend(struct platform_device *pdev, pm_message_t state) +{ + struct nmk_pinctrl *npct; + + npct = platform_get_drvdata(pdev); + if (!npct) + return -EINVAL; + + return pinctrl_force_sleep(npct->pctl); +} + +static int nmk_pinctrl_resume(struct platform_device *pdev) +{ + struct nmk_pinctrl *npct; + + npct = platform_get_drvdata(pdev); + if (!npct) + return -EINVAL; + + return pinctrl_force_default(npct->pctl); +} + static int __devinit nmk_pinctrl_probe(struct platform_device *pdev) { const struct platform_device_id *platid = platform_get_device_id(pdev); @@ -1955,6 +1977,10 @@ static struct platform_driver nmk_pinctrl_driver = { }, .probe = nmk_pinctrl_probe, .id_table = nmk_pinctrl_id, +#ifdef CONFIG_PM + .suspend = nmk_pinctrl_suspend, + .resume = nmk_pinctrl_resume, +#endif }; static int __init nmk_gpio_init(void)