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: 2862061 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6A8CFBF43F for ; Mon, 9 Sep 2013 15:43:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 58069203E3 for ; Mon, 9 Sep 2013 15:43:01 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 85613202EB for ; Mon, 9 Sep 2013 15:42:56 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VJ3ar-0002NG-JI; Mon, 09 Sep 2013 15:41:38 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VJ3aQ-0001hI-0s; Mon, 09 Sep 2013 15:41:10 +0000 Received: from mail-lb0-f182.google.com ([209.85.217.182]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VJ3aD-0001co-PQ for linux-arm-kernel@lists.infradead.org; Mon, 09 Sep 2013 15:40:59 +0000 Received: by mail-lb0-f182.google.com with SMTP id c11so5182563lbj.13 for ; Mon, 09 Sep 2013 08:40:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=RyW9TCiBlQdU1v1aSxJUKPtamkBzGfpEJIQjG16TWus=; b=Ht+kJQ988ynEBshHeLJlop2FEyXh1WDDFlN7nJKV0LvEQvP0twSIKPOMBHNzehuxtx 9qXOTb35KqOp/dgnC97dZfGrZZUWWyd1bX2WleDRj8Btp1rtdAL2RLLDiSVu9ES3JQ27 SCgr5OrpxW4D0S4dLd58sDz0+LX9YlpZMrBktIv9aRWuqDL67tlgkt0eoJ6Nf/xZiFAd MvlN2n1D1pZBO16pPRlKo1EdjYxU54E/Fx9D3fJiO9+D3sLSg6TPqDKJNA4248Xa6RhI 9wJ5HPw7OJ1ZLxeErsbvNFT0bIQKwda3c9YGyTjQAHLl6rxZA+DRPKvhA49NE4JdaKIC 02Og== X-Gm-Message-State: ALoCoQlMoja5N1TSQI1nVYgzoYJxkJZvqP2dxMS0Z+1LfpUY5v9ny5o4nak4NyniJD+Ju3UKznX5 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 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130909_114058_076038_D005B5F3 X-CRM114-Status: GOOD ( 10.28 ) X-Spam-Score: -2.6 (--) Cc: Linus Walleij , Alexandre Courbot , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 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")