From patchwork Fri Oct 12 15:55:46 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Mack X-Patchwork-Id: 1587281 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id ABA7B3FCFC for ; Fri, 12 Oct 2012 15:55:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933105Ab2JLPzy (ORCPT ); Fri, 12 Oct 2012 11:55:54 -0400 Received: from svenfoo.org ([82.94.215.22]:60570 "EHLO mail.zonque.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933028Ab2JLPzy (ORCPT ); Fri, 12 Oct 2012 11:55:54 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.zonque.de (Postfix) with ESMTP id F326BC00DC; Fri, 12 Oct 2012 17:55:51 +0200 (CEST) Received: from mail.zonque.de ([127.0.0.1]) by localhost (rambrand.bugwerft.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JW99qaWpHPFu; Fri, 12 Oct 2012 17:55:51 +0200 (CEST) Received: from tamtam.taperay.com (i59F72708.versanet.de [89.247.39.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.zonque.de (Postfix) with ESMTPSA id 923A9C00BF; Fri, 12 Oct 2012 17:55:51 +0200 (CEST) From: Daniel Mack To: linux-input@vger.kernel.org Cc: Daniel Mack , Linus Walleij , Dmitry Torokhov Subject: [PATCH] Input: gpio_keys: allocate pins Date: Fri, 12 Oct 2012 17:55:46 +0200 Message-Id: <1350057346-15998-1-git-send-email-zonque@gmail.com> X-Mailer: git-send-email 1.7.11.4 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org This allows DT driven boards to allocate and configure the pinmux once the driver is probed. Signed-off-by: Daniel Mack Cc: Linus Walleij Cc: Dmitry Torokhov --- drivers/input/keyboard/gpio_keys.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c index 6a68041..53dff7d 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c @@ -29,6 +29,7 @@ #include #include #include +#include struct gpio_button_data { const struct gpio_keys_button *button; @@ -664,6 +665,7 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev) const struct gpio_keys_platform_data *pdata = dev_get_platdata(dev); struct gpio_keys_drvdata *ddata; struct input_dev *input; + struct pinctrl *pinctrl; int i, error; int wakeup = 0; @@ -701,6 +703,11 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev) input->id.product = 0x0001; input->id.version = 0x0100; + /* request pin mux */ + pinctrl = devm_pinctrl_get_select_default(dev); + if (IS_ERR(pinctrl)) + dev_warn(dev, "pins are not configured from the driver\n"); + /* Enable auto repeat feature of Linux input subsystem */ if (pdata->rep) __set_bit(EV_REP, input->evbit);