From patchwork Tue Sep 10 12:30:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 2865931 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 53D32BF43F for ; Tue, 10 Sep 2013 12:59:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2417D2012F for ; Tue, 10 Sep 2013 12:59:11 +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 8B74B2013D for ; Tue, 10 Sep 2013 12:59:05 +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 1VJNVg-0003qd-1r; Tue, 10 Sep 2013 12:57:36 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VJNVC-0003d9-BW; Tue, 10 Sep 2013 12:57:06 +0000 Received: from casper.infradead.org ([2001:770:15f::2]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VJNUO-0002tb-KJ for linux-arm-kernel@merlin.infradead.org; Tue, 10 Sep 2013 12:56:16 +0000 Received: from mail-lb0-f176.google.com ([209.85.217.176]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VJN5u-0005hD-15 for linux-arm-kernel@lists.infradead.org; Tue, 10 Sep 2013 12:30:59 +0000 Received: by mail-lb0-f176.google.com with SMTP id y6so6159303lbh.35 for ; Tue, 10 Sep 2013 05:30:21 -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=7F02ErPAa6gLC4jv4sjWSoCxTft6lYxil6f/u8bcULw=; b=OSFAhYI3fOOpda+9++/icCxPiIq71p0i1ZWzT5TH0dInzJzUKDhoa083794pJP+hqq XUQG+0Jm1zVkPC61F5GYi+zvpMHAtAAkwulF1PzDkaLIdwJYGlZqCpGh9QxabQB5gz5A BMbbeFehy0LE26ekK0B+z2w3H9exdkKZ43bvp8v9N55IHygeMecZyN7r3SK+QW1ZNetT jfIxGeF+oMRPQ2rjmgTNPX/rJdXlC6Pgcdj/Y9L/phQhf2ALlsnnXtRw6eff/6FmHcDb TgQMezTEhYpl6tT+D56vbk//0/sH0pto58xIGPB0J/2r4GNsjkJK6vey1E/DhjVaVVPA eEpA== X-Gm-Message-State: ALoCoQljV7tQHesHWcCo8pVGDDOVa1LVZXbg2M6MO+uVQiZhBIiBydu5HfoYcGTzUNYyOsFSAFtA X-Received: by 10.112.198.39 with SMTP id iz7mr10758550lbc.24.1378816221177; Tue, 10 Sep 2013 05:30:21 -0700 (PDT) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id u18sm8480174lbp.4.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 10 Sep 2013 05:30:20 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org, Imre Kaloz , Krzysztof Halasa Subject: [PATCH 2/7] misc: ixp4-beeper: switch to use gpiolib Date: Tue, 10 Sep 2013 14:30:10 +0200 Message-Id: <1378816210-7977-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-20130910_133058_115054_8F576388 X-CRM114-Status: GOOD ( 14.00 ) X-Spam-Score: -2.6 (--) Cc: Greg Kroah-Hartman , Linus Walleij , Alexandre Courbot , Arnd Bergmann , 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=-4.9 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 The platform using this beeper has support for gpiolib, so there is no point to use the custom gpio_line* API. A strange ambiguity where a line was first set as input and then driven high was solved by first driving the line high as output and then switch it to input. Cc: Imre Kaloz Cc: Krzysztof Halasa Cc: Alexandre Courbot Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Signed-off-by: Linus Walleij Acked-by: Arnd Bergmann Acked-by: Greg Kroah-Hartman --- Arnd/Greg: seeking your ACK to take this through the GPIO tree as part of the attempt at cleaning out custom GPIO implementations. --- drivers/input/misc/ixp4xx-beeper.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/input/misc/ixp4xx-beeper.c b/drivers/input/misc/ixp4xx-beeper.c index f34beb2..f14afd0 100644 --- a/drivers/input/misc/ixp4xx-beeper.c +++ b/drivers/input/misc/ixp4xx-beeper.c @@ -20,6 +20,7 @@ #include #include #include +#include #include MODULE_AUTHOR("Alessandro Zummo "); @@ -35,15 +36,12 @@ static void ixp4xx_spkr_control(unsigned int pin, unsigned int count) spin_lock_irqsave(&beep_lock, flags); - if (count) { - gpio_line_config(pin, IXP4XX_GPIO_OUT); - gpio_line_set(pin, IXP4XX_GPIO_LOW); - + if (count) { + gpio_direction_output(pin, 0); *IXP4XX_OSRT2 = (count & ~IXP4XX_OST_RELOAD_MASK) | IXP4XX_OST_ENABLE; } else { - gpio_line_config(pin, IXP4XX_GPIO_IN); - gpio_line_set(pin, IXP4XX_GPIO_HIGH); - + gpio_direction_output(pin, 1); + gpio_direction_input(pin); *IXP4XX_OSRT2 = 0; }