From patchwork Thu Jun 20 11:23:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 2755091 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 546AA9F472 for ; Thu, 20 Jun 2013 11:38:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 798452055B for ; Thu, 20 Jun 2013 11:38:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5191820557 for ; Thu, 20 Jun 2013 11:38:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965070Ab3FTLiZ (ORCPT ); Thu, 20 Jun 2013 07:38:25 -0400 Received: from mail-pa0-f51.google.com ([209.85.220.51]:37629 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965016Ab3FTLiY (ORCPT ); Thu, 20 Jun 2013 07:38:24 -0400 Received: by mail-pa0-f51.google.com with SMTP id lf11so6215064pab.38 for ; Thu, 20 Jun 2013 04:38:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state; bh=Ao74ZmjSh2kFGfzRclb4HWHpvc7uM2CbeQSdvHH6VLI=; b=mbY9Y+hZUkddhMPUCeZBKHPHIjc+JSV3ocFdrHouU9BIoQzT02+A4ljAqWxHNd26J7 g5Wq3rKelIw3uQInn5RbR3f4U4oabN9fgfIqFfo7JD5eP+MTq2sW9kxOz8xhrnyO2y5N j2AlcOVWIUh4fkF1T9xM9FmK7PiSrOpH6XHIXe/pqd7Vb8BrdKKrraxrOic4qtpZM6N7 ly1zNFDohkY6bfDFqQZ+IM5fTP6Y2t9Krnaet8hico3PAufqYfFoxpyWEg+7A9ec9vl4 iRIcQkPMe1ulN7+FsAktjpALHPskCdLQ8Dg1rN1sIfhAi3uIIas8an6uYiXpbfUyB4fu ZqSw== X-Received: by 10.66.252.129 with SMTP id zs1mr5472014pac.113.1371728304002; Thu, 20 Jun 2013 04:38:24 -0700 (PDT) Received: from linaro.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPSA id fn9sm513505pab.2.2013.06.20.04.38.20 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Jun 2013 04:38:23 -0700 (PDT) From: Sachin Kamat To: linux-input@vger.kernel.org Cc: linux-samsung-soc@vger.kernel.org, dmitry.torokhov@gmail.com, thomas.abraham@linaro.org, linus.walleij@linaro.org, sachin.kamat@linaro.org Subject: [PATCH Resend] Input: samsung-keypad - let device core setup the default pin configuration Date: Thu, 20 Jun 2013 16:53:29 +0530 Message-Id: <1371727409-27167-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-Gm-Message-State: ALoCoQkxhy/QPF0FnrY7FP3D7XFTjtJzgAP/sUnKIe/ff+7gFcB6lrWTFF4ZWejIhz6Y8+v7Ggca Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Thomas Abraham With device core now able to setup the default pin configuration, the pin configuration code based on the deprecated Samsung specific gpio bindings is removed. Signed-off-by: Thomas Abraham Acked-by: Linus Walleij Signed-off-by: Sachin Kamat --- Hi Dmitry, Looks like the earlier submission of this patch got lost. This patch is rebased onto the latest linux-next (next-20130620). Please consider applying. --- .../devicetree/bindings/input/samsung-keypad.txt | 24 ++------- drivers/input/keyboard/samsung-keypad.c | 52 +------------------- 2 files changed, 7 insertions(+), 69 deletions(-) diff --git a/Documentation/devicetree/bindings/input/samsung-keypad.txt b/Documentation/devicetree/bindings/input/samsung-keypad.txt index ce3e394..942d071 100644 --- a/Documentation/devicetree/bindings/input/samsung-keypad.txt +++ b/Documentation/devicetree/bindings/input/samsung-keypad.txt @@ -25,14 +25,6 @@ Required Board Specific Properties: - samsung,keypad-num-columns: Number of column lines connected to the keypad controller. -- row-gpios: List of gpios used as row lines. The gpio specifier for - this property depends on the gpio controller to which these row lines - are connected. - -- col-gpios: List of gpios used as column lines. The gpio specifier for - this property depends on the gpio controller to which these column - lines are connected. - - Keys represented as child nodes: Each key connected to the keypad controller is represented as a child node to the keypad controller device node and should include the following properties. @@ -41,6 +33,9 @@ Required Board Specific Properties: - linux,code: the key-code to be reported when the key is pressed and released. +- pinctrl-0: Should specify pin control groups used for this controller. +- pinctrl-names: Should contain only one value - "default". + Optional Properties specific to linux: - linux,keypad-no-autorepeat: do no enable autorepeat feature. - linux,keypad-wakeup: use any event on keypad as wakeup event. @@ -56,17 +51,8 @@ Example: linux,input-no-autorepeat; linux,input-wakeup; - row-gpios = <&gpx2 0 3 3 0 - &gpx2 1 3 3 0>; - - col-gpios = <&gpx1 0 3 0 0 - &gpx1 1 3 0 0 - &gpx1 2 3 0 0 - &gpx1 3 3 0 0 - &gpx1 4 3 0 0 - &gpx1 5 3 0 0 - &gpx1 6 3 0 0 - &gpx1 7 3 0 0>; + pinctrl-names = "default"; + pinctrl-0 = <&keypad_rows &keypad_columns>; key_1 { keypad,row = <0>; diff --git a/drivers/input/keyboard/samsung-keypad.c b/drivers/input/keyboard/samsung-keypad.c index 7b938b4..ac43a48 100644 --- a/drivers/input/keyboard/samsung-keypad.c +++ b/drivers/input/keyboard/samsung-keypad.c @@ -24,7 +24,6 @@ #include #include #include -#include #include #include @@ -79,10 +78,6 @@ struct samsung_keypad { unsigned int rows; unsigned int cols; unsigned int row_state[SAMSUNG_MAX_COLS]; -#ifdef CONFIG_OF - int row_gpios[SAMSUNG_MAX_ROWS]; - int col_gpios[SAMSUNG_MAX_COLS]; -#endif unsigned short keycodes[]; }; @@ -304,45 +299,6 @@ static struct samsung_keypad_platdata *samsung_keypad_parse_dt( return pdata; } - -static void samsung_keypad_parse_dt_gpio(struct device *dev, - struct samsung_keypad *keypad) -{ - struct device_node *np = dev->of_node; - int gpio, error, row, col; - - for (row = 0; row < keypad->rows; row++) { - gpio = of_get_named_gpio(np, "row-gpios", row); - keypad->row_gpios[row] = gpio; - if (!gpio_is_valid(gpio)) { - dev_err(dev, "keypad row[%d]: invalid gpio %d\n", - row, gpio); - continue; - } - - error = devm_gpio_request(dev, gpio, "keypad-row"); - if (error) - dev_err(dev, - "keypad row[%d] gpio request failed: %d\n", - row, error); - } - - for (col = 0; col < keypad->cols; col++) { - gpio = of_get_named_gpio(np, "col-gpios", col); - keypad->col_gpios[col] = gpio; - if (!gpio_is_valid(gpio)) { - dev_err(dev, "keypad column[%d]: invalid gpio %d\n", - col, gpio); - continue; - } - - error = devm_gpio_request(dev, gpio, "keypad-col"); - if (error) - dev_err(dev, - "keypad column[%d] gpio request failed: %d\n", - col, error); - } -} #else static struct samsung_keypad_platdata *samsung_keypad_parse_dt(struct device *dev) @@ -424,15 +380,11 @@ static int samsung_keypad_probe(struct platform_device *pdev) keypad->stopped = true; init_waitqueue_head(&keypad->wait); - if (pdev->dev.of_node) { -#ifdef CONFIG_OF - samsung_keypad_parse_dt_gpio(&pdev->dev, keypad); + if (pdev->dev.of_node) keypad->type = of_device_is_compatible(pdev->dev.of_node, "samsung,s5pv210-keypad"); -#endif - } else { + else keypad->type = platform_get_device_id(pdev)->driver_data; - } input_dev->name = pdev->name; input_dev->id.bustype = BUS_HOST;