From patchwork Fri May 17 16:24:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 2583821 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork1.kernel.org (Postfix) with ESMTP id 792473FD4E for ; Fri, 17 May 2013 16:27:54 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UdNUB-0008Tx-TA; Fri, 17 May 2013 16:26:29 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UdNTh-0001SA-Fv; Fri, 17 May 2013 16:25:57 +0000 Received: from mailout1.w1.samsung.com ([210.118.77.11]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UdNTE-0001O2-05 for linux-arm-kernel@lists.infradead.org; Fri, 17 May 2013 16:25:28 +0000 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MMY009ZMAXN4WA0@mailout1.w1.samsung.com> for linux-arm-kernel@lists.infradead.org; Fri, 17 May 2013 17:25:01 +0100 (BST) X-AuditID: cbfec7f5-b7f376d000001ec6-b8-519659ddcb7c Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 45.C2.07878.DD956915; Fri, 17 May 2013 17:25:01 +0100 (BST) Received: from amdc1227.digital.local ([106.116.147.199]) by eusync2.samsung.com (Oracle Communications Messaging Server 7u4-23.01(7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0MMY00K5ZAXKIM00@eusync2.samsung.com>; Fri, 17 May 2013 17:25:01 +0100 (BST) From: Tomasz Figa To: linux-samsung-soc@vger.kernel.org Subject: [PATCH 4/6] pinctrl: samsung: Add support for SoC-specific suspend/resume callbacks Date: Fri, 17 May 2013 18:24:30 +0200 Message-id: <1368807872-2601-5-git-send-email-t.figa@samsung.com> X-Mailer: git-send-email 1.8.2.1 In-reply-to: <1368807872-2601-1-git-send-email-t.figa@samsung.com> References: <1368807872-2601-1-git-send-email-t.figa@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrOLMWRmVeSWpSXmKPExsVy+t/xK7p3I6cFGnR9UbD4O+kYu8XZZQfZ LP4/es1q0bvgKpvF2aY37BZT/ixnstj0+BqrxYzz+5gsTl3/zGZxYcVGdotXB9tYLNbPeM1i cWzGEkYHXo/fvyYxesxuuMjicefaHjaPzUvqPa6caGL16NuyitFj+7V5zB6fN8l5bJwbGsAZ xWWTkpqTWZZapG+XwJVx4P8tloKZvBV7d5xkaWDs4+5i5OSQEDCROLLhJSOELSZx4d56ti5G Lg4hgaWMEufnHYdy+pgkJm6YxgRSxSagJvG54REbiC0ioCrxuW0BO0gRs8BOZonLD26ygCSE BeIk/j09DDaWBaTo8kawBl4BR4lZv56xQaxTkDi+fRtYDaeAk8SbWXOYQWwhoJqbXWdZJzDy LmBkWMUomlqaXFCclJ5rpFecmFtcmpeul5yfu4kRErhfdzAuPWZ1iFGAg1GJh/ej67RAIdbE suLK3EOMEhzMSiK8xz9ODRTiTUmsrEotyo8vKs1JLT7EyMTBKdXAGBOVoKd2xGvr2ZBviQ+b pqz+/D+lf+M0l323j1/vDKtufZYRlthzNH7yhA4B1ZiFyn/S3/39+Y3Rn/248NVud/tCu2Wa 35UNo1QC7WdOD81/9U9Mpkjne/qUZo4qmZA1p5Zs6Dh39Motttqnnnzeh7fdn7fI+tLuNysf nt+s53mvsWjFlcIbHkosxRmJhlrMRcWJAALdHg46AgAA X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130517_122528_171957_33452FFC X-CRM114-Status: UNSURE ( 9.56 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -7.5 (-------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-7.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [210.118.77.11 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.6 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: kgene.kim@samsung.com, =?UTF-8?q?Heiko=20St=C3=BCbner?= , arnd@arndb.de, Stephen Warren , Linus Walleij , Prathyush K , Doug Anderson , Kyungmin Park , Thomas Abraham , olof@lixom.net, Tomasz Figa , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org SoC-specific driver might require additional save and restore of registers. This patch adds pair of SoC-specific callbacks per pinctrl device to account for this. Signed-off-by: Tomasz Figa Signed-off-by: Kyungmin Park Tested-by: Doug Anderson Reviewed-by: Doug Anderson --- drivers/pinctrl/pinctrl-samsung.c | 6 ++++++ drivers/pinctrl/pinctrl-samsung.h | 3 +++ 2 files changed, 9 insertions(+) diff --git a/drivers/pinctrl/pinctrl-samsung.c b/drivers/pinctrl/pinctrl-samsung.c index 15db258..63ac22e 100644 --- a/drivers/pinctrl/pinctrl-samsung.c +++ b/drivers/pinctrl/pinctrl-samsung.c @@ -1010,6 +1010,9 @@ static void samsung_pinctrl_suspend_dev( reg, bank->pm_save[PINCFG_TYPE_FUNC]); } } + + if (ctrl->suspend) + ctrl->suspend(drvdata); } /** @@ -1026,6 +1029,9 @@ static void samsung_pinctrl_resume_dev(struct samsung_pinctrl_drv_data *drvdata) void __iomem *virt_base = drvdata->virt_base; int i; + if (ctrl->resume) + ctrl->resume(drvdata); + for (i = 0; i < ctrl->nr_banks; i++) { struct samsung_pin_bank *bank = &ctrl->pin_banks[i]; void __iomem *reg = virt_base + bank->pctl_offset; diff --git a/drivers/pinctrl/pinctrl-samsung.h b/drivers/pinctrl/pinctrl-samsung.h index 9f5cc81..b316d9f 100644 --- a/drivers/pinctrl/pinctrl-samsung.h +++ b/drivers/pinctrl/pinctrl-samsung.h @@ -187,6 +187,9 @@ struct samsung_pin_ctrl { int (*eint_gpio_init)(struct samsung_pinctrl_drv_data *); int (*eint_wkup_init)(struct samsung_pinctrl_drv_data *); + void (*suspend)(struct samsung_pinctrl_drv_data *); + void (*resume)(struct samsung_pinctrl_drv_data *); + char *label; };