From patchwork Thu Sep 27 03:55:24 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eunki Kim X-Patchwork-Id: 1511211 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 6F97F40079 for ; Thu, 27 Sep 2012 03:57:29 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TH5CY-0008AD-PC; Thu, 27 Sep 2012 03:55:50 +0000 Received: from mailout1.samsung.com ([203.254.224.24]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TH5CK-00089S-8H for linux-arm-kernel@lists.infradead.org; Thu, 27 Sep 2012 03:55:38 +0000 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MAZ00HZ3PK2X3L0@mailout1.samsung.com> for linux-arm-kernel@lists.infradead.org; Thu, 27 Sep 2012 12:55:25 +0900 (KST) X-AuditID: cbfee61b-b7f2b6d000000f14-eb-5063ce2d312a Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 1F.1C.03860.D2EC3605; Thu, 27 Sep 2012 12:55:25 +0900 (KST) Received: from DOEUNKIKIM03 ([12.23.118.132]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MAZ003Q8PKC5G60@mmp2.samsung.com> for linux-arm-kernel@lists.infradead.org; Thu, 27 Sep 2012 12:55:25 +0900 (KST) From: Eunki Kim To: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH 2/2] gpio: samsung: Fix input mode setting function for GPIO int Date: Thu, 27 Sep 2012 12:55:24 +0900 Message-id: <000101cd9c63$ecb606a0$c62213e0$@com> MIME-version: 1.0 X-Mailer: Microsoft Office Outlook 12.0 Thread-index: Ac2cY+ybwZ7xTA49T6yxN+cqC8gQiw== Content-language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrCLMWRmVeSWpSXmKPExsVy+t9jQV3dc8kBBr/v8FpsenyN1YHRY/OS +gDGKC6blNSczLLUIn27BK6MpgULWQt2cVW8/HubqYHxDEcXIyeHhICJxOX115kgbDGJC/fW s3UxcnEICUxnlOjZN5cZwlnGJLH42yRWkCo2AXWJeReXAtkcHCIC3hLLrymChJkF0iWOP3wH ViIsECBx7MAVRhCbRUBVYtKpu2A2r4ChxNQVv1ghbEGJH5PvsUD0akms33mcCcKWl9i85i0z yHgJoFWP/uqChEUE9CRenfrNDFEiIrHvxTvGCYwCs5BMmoVk0iwkk2YhaVnAyLKKUTS1ILmg OCk910ivODG3uDQvXS85P3cTIzgsn0nvYFzVYHGIUYCDUYmHN8A9OUCINbGsuDL3EKMEB7OS CO+zrKQAId6UxMqq1KL8+KLSnNTiQ4zSHCxK4rzCnwIDhATSE0tSs1NTC1KLYLJMHJxSDYwc 6a6XK+1eu73I+SttqrJvdsd/9Wfq0kwKebqVu1c8PKn8bG1dUP+J661tfUzzjWSnqB/+2+xe X9r3cKXJzkMmil6XHX2WXL18xFTu5MNrCz08bps7B4i+WZS1cq9Pp3MVq8Ma4Z6Za64Vvl67 dGb4jIqbbXuLbUNdvv5iVHn2cJ3oXd5UJkslluKMREMt5qLiRAAW9MMwRwIAAA== X-Spam-Note: CRM114 invocation failed X-Spam-Score: -7.6 (-------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-7.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [203.254.224.24 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.8 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] 0.1 HDRS_LCASE Odd capitalization of message header Cc: grant.likely@secretlab.ca, eunki_kim@samsung.com, linus.walleij@linaro.org, kgene.kim@samsung.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org This patch makes GPIO pin to INTERRUPT mode or INPUT mode according to bitmap_gpio_int. When the related bit of bitmap_gpio_int is set, it makes GPIO pin to INTERRUPT mode instrad of INPUT mode in the samsung_gpiolib_4bit_input function. Signed-off-by: Eunki Kim Cc: Kukjin Kim Acked-by: Linus Walleij --- drivers/gpio/gpio-samsung.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) } diff --git a/drivers/gpio/gpio-samsung.c b/drivers/gpio/gpio-samsung.c index ba126cc..19caef4 100644 --- a/drivers/gpio/gpio-samsung.c +++ b/drivers/gpio/gpio-samsung.c @@ -596,7 +596,10 @@ static int samsung_gpiolib_4bit_input(struct gpio_chip *chip, unsigned long con; con = __raw_readl(base + GPIOCON_OFF); - con &= ~(0xf << con_4bit_shift(offset)); + if (ourchip->bitmap_gpio_int & BIT(offset)) + con |= 0xf << con_4bit_shift(offset); + else + con &= ~(0xf << con_4bit_shift(offset)); __raw_writel(con, base + GPIOCON_OFF); gpio_dbg("%s: %p: CON now %08lx\n", __func__, base, con); @@ -1018,6 +1021,8 @@ static void __init samsung_gpiolib_add_4bit_chips(struct samsung_gpio_chip *chip if ((base != NULL) && (chip->base == NULL)) chip->base = base + ((i) * 0x20); + chip->bitmap_gpio_int = 0; + samsung_gpiolib_add(chip); }