From patchwork Mon Sep 9 15:40:31 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 19839 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f72.google.com (mail-qe0-f72.google.com [209.85.128.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id EAFB825A57 for ; Mon, 9 Sep 2013 15:40:37 +0000 (UTC) Received: by mail-qe0-f72.google.com with SMTP id 6sf7788736qea.3 for ; Mon, 09 Sep 2013 08:40:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=RyW9TCiBlQdU1v1aSxJUKPtamkBzGfpEJIQjG16TWus=; b=DbGmDLFqFnZPC6PA5JVDY5vTp3MYl0i3bhKjoj37bBl866sxuudBKz1Tjaa0FfdZJZ dlMBPo6UReJplOlNqDdxVS6dznDVsk/TJ6cVMt9ndju7dLj5i8V3VEin2sukh7eROWvg CxxJLg2XMf3dWj5fFNcrHzoRoQeAsXuEmS5qqnrEV8ZH+m+cf09n9m0R5kavYRd+vs0Y O7kPtdvUXqprpWpycAmVSxUM7a9Me25MLJ9LD1Klv1E16lc8bXgeAjAh+Yq5rNCkuVUy KiLdEr9BelHsId/Kabj80gPdSejb5n6TGhFMjP+BTP7S5OOx4zWRrHcnoOkMXqfuEZFW GXZQ== X-Received: by 10.236.7.130 with SMTP id 2mr6551379yhp.4.1378741237794; Mon, 09 Sep 2013 08:40:37 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.96.9 with SMTP id do9ls1753527qeb.80.gmail; Mon, 09 Sep 2013 08:40:37 -0700 (PDT) X-Received: by 10.52.116.74 with SMTP id ju10mr15130126vdb.20.1378741237660; Mon, 09 Sep 2013 08:40:37 -0700 (PDT) Received: from mail-ve0-f177.google.com (mail-ve0-f177.google.com [209.85.128.177]) by mx.google.com with ESMTPS id gw1si3294550vcb.62.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 09 Sep 2013 08:40:37 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.177 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.177; Received: by mail-ve0-f177.google.com with SMTP id db12so3501688veb.8 for ; Mon, 09 Sep 2013 08:40:37 -0700 (PDT) X-Gm-Message-State: ALoCoQm3XGnhAtEGksJtaI4OjXtgYQDRwdTwUb55NkHOdthsyqzI4pz136fX5SwVXftc6g7cFPPl X-Received: by 10.52.165.237 with SMTP id zb13mr1623022vdb.28.1378741237563; Mon, 09 Sep 2013 08:40:37 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp94132vcz; Mon, 9 Sep 2013 08:40:36 -0700 (PDT) X-Received: by 10.152.22.65 with SMTP id b1mr664694laf.46.1378741236163; Mon, 09 Sep 2013 08:40:36 -0700 (PDT) Received: from mail-la0-f47.google.com (mail-la0-f47.google.com [209.85.215.47]) by mx.google.com with ESMTPS id y5si5851893lbb.117.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 09 Sep 2013 08:40:36 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.215.47 is neither permitted nor denied by best guess record for domain of linus.walleij@linaro.org) client-ip=209.85.215.47; Received: by mail-la0-f47.google.com with SMTP id eo20so4971209lab.6 for ; Mon, 09 Sep 2013 08:40:35 -0700 (PDT) X-Received: by 10.152.6.97 with SMTP id z1mr2880293laz.26.1378741235576; Mon, 09 Sep 2013 08:40:35 -0700 (PDT) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id w10sm6250323lbv.6.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 09 Sep 2013 08:40:34 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org, Lennert Buytenhek , Dan Williams , Mikael Pettersson Cc: Alexandre Courbot , linux-arm-kernel@lists.infradead.org, Linus Walleij Subject: [PATCH 3/8] ARM: iop32x: read N2100 power key using gpiolib Date: Mon, 9 Sep 2013 17:40:31 +0200 Message-Id: <1378741231-12958-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.8.3.1 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linus.walleij@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.177 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Refrain from using the custom gpio_line_get() to read the power key on the N2100, use the gpiolib function gpio_get() instead. Also request the line when initializing the machine. Cc: Lennert Buytenhek Cc: Dan Williams Cc: Mikael Pettersson Signed-off-by: Linus Walleij --- arch/arm/mach-iop32x/n2100.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-iop32x/n2100.c b/arch/arm/mach-iop32x/n2100.c index cd199c1..d495b4f 100644 --- a/arch/arm/mach-iop32x/n2100.c +++ b/arch/arm/mach-iop32x/n2100.c @@ -306,7 +306,7 @@ static struct timer_list power_button_poll_timer; static void power_button_poll(unsigned long dummy) { - if (gpio_line_get(N2100_POWER_BUTTON) == 0) { + if (gpio_get_value(N2100_POWER_BUTTON) == 0) { ctrl_alt_del(); return; } @@ -339,6 +339,14 @@ static void __init n2100_init_machine(void) ret = gpio_request(N2100_HARDWARE_RESET, "reset"); if (ret) pr_err("could not request reset GPIO\n"); + ret = gpio_request(N2100_POWER_BUTTON, "power"); + if (ret) + pr_err("could not request power GPIO\n"); + else { + ret = gpio_direction_input(N2100_POWER_BUTTON); + if (ret) + pr_err("could not set power GPIO as input\n"); + } } MACHINE_START(N2100, "Thecus N2100")