From patchwork Mon Oct 22 13:13:00 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Poddar, Sourav" X-Patchwork-Id: 1625791 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id A7C3FDF2F5 for ; Mon, 22 Oct 2012 13:14:41 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TQHoK-0001cr-CF; Mon, 22 Oct 2012 13:12:52 +0000 Received: from bear.ext.ti.com ([192.94.94.41]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TQHoH-0001cS-Jq for linux-arm-kernel@lists.infradead.org; Mon, 22 Oct 2012 13:12:50 +0000 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id q9MDCjKC017780; Mon, 22 Oct 2012 08:12:46 -0500 Received: from DBDE70.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id q9MDCgsx026882; Mon, 22 Oct 2012 18:42:43 +0530 (IST) Received: from dbdp32.itg.ti.com (172.24.170.251) by dbde70.ent.ti.com (172.24.170.148) with Microsoft SMTP Server id 14.1.323.3; Mon, 22 Oct 2012 18:42:42 +0530 Received: from a0131647.apr.dhcp.ti.com (smtpvbd.itg.ti.com [172.24.170.250]) by dbdp32.itg.ti.com (8.13.8/8.13.8) with ESMTP id q9MDCd7R009316; Mon, 22 Oct 2012 18:42:40 +0530 From: Sourav Poddar To: , Subject: [PATCHv2] Input: omap4-keypad: Add pinctrl support Date: Mon, 22 Oct 2012 18:43:00 +0530 Message-ID: <1350911580-20307-1-git-send-email-sourav.poddar@ti.com> X-Mailer: git-send-email 1.7.1 MIME-Version: 1.0 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 [192.94.94.41 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.7 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: devicetree-discuss@lists.ozlabs.org, Dmitry Torokhov , linux-kernel@vger.kernel.org, Felipe Balbi , linux-input@vger.kernel.org, Sourav Poddar , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org 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 Adapt keypad to use pinctrl framework. Tested on omap4430 sdp with 3.7-rc1 kernel. Cc: Felipe Balbi Cc: Dmitry Torokhov Signed-off-by: Sourav Poddar --- v1->v2 - Added "PROBE_DEFER" check drivers/input/keyboard/omap4-keypad.c | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/drivers/input/keyboard/omap4-keypad.c b/drivers/input/keyboard/omap4-keypad.c index c05f98c..502b832 100644 --- a/drivers/input/keyboard/omap4-keypad.c +++ b/drivers/input/keyboard/omap4-keypad.c @@ -31,6 +31,7 @@ #include #include #include +#include #include @@ -76,6 +77,7 @@ enum { struct omap4_keypad { struct input_dev *input; + struct pinctrl *pins; void __iomem *base; unsigned int irq; @@ -298,6 +300,15 @@ static int __devinit omap4_keypad_probe(struct platform_device *pdev) goto err_release_mem; } + keypad_data->pins = devm_pinctrl_get_select_default(&pdev->dev); + if (IS_ERR(keypad_data->pins)) { + if (PTR_ERR(keypad_data->pins) == -EPROBE_DEFER) + return -EPROBE_DEFER; + + dev_warn(&pdev->dev, "did not get pins for keypad error: %li\n", + PTR_ERR(keypad_data->pins)); + keypad_data->pins = NULL; + } /* * Enable clocks for the keypad module so that we can read