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: 19850 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f199.google.com (mail-ve0-f199.google.com [209.85.128.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C29C6246A4 for ; Tue, 10 Sep 2013 12:30:23 +0000 (UTC) Received: by mail-ve0-f199.google.com with SMTP id db12sf7860581veb.10 for ; Tue, 10 Sep 2013 05:30:23 -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=7F02ErPAa6gLC4jv4sjWSoCxTft6lYxil6f/u8bcULw=; b=Ce8dKigPDE53kaQVZoLmiPAC1ocR/IVsClr5OWehyzESOGSZEbLhvxqfKDQVN64blZ 5eSIh0A3mxgAW8Qc8bUL1xE/m6EuP7Mfo2WeWxkgzzVUI2lMgh/sYYjOaxN2XbykAWZD RGBifizcapWNb2kzCPeNFrS0i0IDycx/nC0UbHAp4+jCPipvZEU0o2E2WoGQWeYUUBlt +eNaVFUphm4CXogqhc2g4N6CJYRuD/3OzZ2Sb1Bujv0CNlt/7nngD0BTuA6ibiZ6jCwg h0mMx563+NrSatcNoiPzOXp1g28GNn3Cirg+qG7HdnQs/lLpo1XX1S9lVRVI16dr4Rch 4bLQ== X-Received: by 10.236.4.69 with SMTP id 45mr8144786yhi.20.1378816223368; Tue, 10 Sep 2013 05:30:23 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.134.74 with SMTP id pi10ls2107745qeb.35.gmail; Tue, 10 Sep 2013 05:30:23 -0700 (PDT) X-Received: by 10.221.51.206 with SMTP id vj14mr22824832vcb.17.1378816223126; Tue, 10 Sep 2013 05:30:23 -0700 (PDT) Received: from mail-vb0-f50.google.com (mail-vb0-f50.google.com [209.85.212.50]) by mx.google.com with ESMTPS id f8si4378804vec.85.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Sep 2013 05:30:23 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.50 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.50; Received: by mail-vb0-f50.google.com with SMTP id x14so5130304vbb.9 for ; Tue, 10 Sep 2013 05:30:23 -0700 (PDT) X-Gm-Message-State: ALoCoQmaTPGWAcez8C9dHA2bQKzQbZil69szts8iOM3+E4Zpu/pXmQhslVdO4mEchfPlHJfqfaUA X-Received: by 10.52.24.4 with SMTP id q4mr340585vdf.34.1378816223019; Tue, 10 Sep 2013 05:30:23 -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 u4csp18377vcz; Tue, 10 Sep 2013 05:30:22 -0700 (PDT) X-Received: by 10.152.44.225 with SMTP id h1mr21434289lam.15.1378816221837; Tue, 10 Sep 2013 05:30:21 -0700 (PDT) Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com [209.85.217.174]) by mx.google.com with ESMTPS id d5si7832820laf.105.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Sep 2013 05:30:21 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.217.174 is neither permitted nor denied by best guess record for domain of linus.walleij@linaro.org) client-ip=209.85.217.174; Received: by mail-lb0-f174.google.com with SMTP id w6so6059357lbh.5 for ; Tue, 10 Sep 2013 05:30:21 -0700 (PDT) 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 Cc: Alexandre Courbot , linux-arm-kernel@lists.infradead.org, Linus Walleij , Arnd Bergmann , Greg Kroah-Hartman 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-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.212.50 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: , 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 --- 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; }