From patchwork Mon Sep 10 11:26:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lubomir Rintel X-Patchwork-Id: 10593957 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 12A72921 for ; Mon, 10 Sep 2018 11:27:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 007CB28CEE for ; Mon, 10 Sep 2018 11:27:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E87D628D1C; Mon, 10 Sep 2018 11:27:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 747A828CEE for ; Mon, 10 Sep 2018 11:27:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728516AbeIJQVC (ORCPT ); Mon, 10 Sep 2018 12:21:02 -0400 Received: from shell.v3.sk ([90.176.6.54]:35754 "EHLO shell.v3.sk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728494AbeIJQVC (ORCPT ); Mon, 10 Sep 2018 12:21:02 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.v3.sk (Postfix) with ESMTP id 818AEB82D4; Mon, 10 Sep 2018 13:27:23 +0200 (CEST) Received: from shell.v3.sk ([127.0.0.1]) by localhost (zimbra.v3.sk [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 347wEIqnVdop; Mon, 10 Sep 2018 13:27:14 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zimbra.v3.sk (Postfix) with ESMTP id 48C40B82DB; Mon, 10 Sep 2018 13:27:07 +0200 (CEST) X-Virus-Scanned: amavisd-new at zimbra.v3.sk Received: from shell.v3.sk ([127.0.0.1]) by localhost (zimbra.v3.sk [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id ezdhPOdAxAm0; Mon, 10 Sep 2018 13:27:03 +0200 (CEST) Received: from belphegor.brq.redhat.com (nat-pool-brq-t.redhat.com [213.175.37.10]) by zimbra.v3.sk (Postfix) with ESMTPSA id 61130B82D0; Mon, 10 Sep 2018 13:27:01 +0200 (CEST) From: Lubomir Rintel To: linux-kernel@vger.kernel.org Cc: linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-input@vger.kernel.org, Rob Herring , Mark Rutland , Dmitry Torokhov , Michael Turquette , Stephen Boyd , Lubomir Rintel Subject: [PATCH 8/8] Input: olpc_apsp: allocate the GPIOs used Date: Mon, 10 Sep 2018 13:26:54 +0200 Message-Id: <20180910112654.42061-9-lkundrak@v3.sk> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180910112654.42061-1-lkundrak@v3.sk> References: <20180910112654.42061-1-lkundrak@v3.sk> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Take the GPIO lines are used by the SP. The driver doesn't touch the lines -- this is done to disallow anything else from fiddling with them because that would confuse the SP firmware. Also, the lines are now nicely visible in /sys/kernel/debug/gpio. Signed-off-by: Lubomir Rintel --- drivers/input/serio/olpc_apsp.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/input/serio/olpc_apsp.c b/drivers/input/serio/olpc_apsp.c index fe9e19014e70..287759c5f36d 100644 --- a/drivers/input/serio/olpc_apsp.c +++ b/drivers/input/serio/olpc_apsp.c @@ -24,6 +24,7 @@ #include #include #include +#include /* * The OLPC XO-1.75 and XO-4 laptops do not have a hardware PS/2 controller. @@ -76,6 +77,8 @@ struct olpc_apsp { struct serio *padio; void __iomem *base; struct clk *clk; + struct gpio_desc *clk_gpio; + struct gpio_desc *data_gpio; int open_count; int irq; }; @@ -211,6 +214,16 @@ static int olpc_apsp_probe(struct platform_device *pdev) if (IS_ERR(priv->clk)) return PTR_ERR(priv->clk); + priv->clk_gpio = devm_gpiod_get_optional(&pdev->dev, "clk", + GPIOD_ASIS); + if (IS_ERR(priv->clk_gpio)) + return PTR_ERR(priv->clk_gpio); + + priv->data_gpio = devm_gpiod_get_optional(&pdev->dev, "data", + GPIOD_ASIS); + if (IS_ERR(priv->data_gpio)) + return PTR_ERR(priv->data_gpio); + /* KEYBOARD */ kb_serio = kzalloc(sizeof(struct serio), GFP_KERNEL); if (!kb_serio)