From patchwork Fri Sep 13 08:31:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 20014 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ye0-f197.google.com (mail-ye0-f197.google.com [209.85.213.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 864BB25E09 for ; Fri, 13 Sep 2013 08:31:54 +0000 (UTC) Received: by mail-ye0-f197.google.com with SMTP id q5sf899889yen.0 for ; Fri, 13 Sep 2013 01:31:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version: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=yJFVgdpzKkqJLTYs75yRnncX3MCz/JoZlobNagOz2f4=; b=AEXdpMbQ52srdqI8zb25aFqgQTUBPVWTQC7gZLlL0q4xdnvZq6srH09/kVNj9kKJCh rvOIORvRtVpE+4e654DS1x56L/+/MtUSzqRVVWoisDBJz5bvLPjLZDnAVZuJXTXJxVHD 9W2uvv/qoSFA31MjgJSlqU5KZFOjgR9YHYrmana+aA6Q3h2sOIS+q0imlnspApnsjlKn i75ixHx7FxCgO1J9LQ5iZQVa5h6UigzjMs8BBukp1vfPKnqhyjVzwomiC9OKd5IAT7Dj dN2JbEczIcDr0PRh0mvxhFHV+MwQojSk95F04YkGi2fgE5VI013WHMvphjlcHyxhbvDe c+Sg== X-Gm-Message-State: ALoCoQnFenjzYv07lX1bFWZnlxKE/1mbc07ovCyQjhjjOv/0o0t4iIaD5c16Dttww5wpqLWMxu7S X-Received: by 10.236.209.103 with SMTP id r67mr4967605yho.35.1379061113404; Fri, 13 Sep 2013 01:31:53 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.35.10 with SMTP id d10ls1050330qej.19.gmail; Fri, 13 Sep 2013 01:31:53 -0700 (PDT) X-Received: by 10.52.230.233 with SMTP id tb9mr8981400vdc.17.1379061113175; Fri, 13 Sep 2013 01:31:53 -0700 (PDT) Received: from mail-vb0-f49.google.com (mail-vb0-f49.google.com [209.85.212.49]) by mx.google.com with ESMTPS id gq6si2781201veb.129.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 01:31:53 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.49 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.49; Received: by mail-vb0-f49.google.com with SMTP id w16so677237vbb.8 for ; Fri, 13 Sep 2013 01:31:53 -0700 (PDT) X-Received: by 10.52.103.101 with SMTP id fv5mr461502vdb.31.1379061112955; Fri, 13 Sep 2013 01:31:52 -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 u4csp67824vcz; Fri, 13 Sep 2013 01:31:52 -0700 (PDT) X-Received: by 10.112.17.35 with SMTP id l3mr266024lbd.41.1379061111409; Fri, 13 Sep 2013 01:31:51 -0700 (PDT) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com [209.85.217.170]) by mx.google.com with ESMTPS id ax2si5234088lbc.108.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 01:31:51 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.217.170 is neither permitted nor denied by best guess record for domain of linus.walleij@linaro.org) client-ip=209.85.217.170; Received: by mail-lb0-f170.google.com with SMTP id w7so1844930lbi.1 for ; Fri, 13 Sep 2013 01:31:50 -0700 (PDT) X-Received: by 10.112.181.100 with SMTP id dv4mr654693lbc.34.1379061110768; Fri, 13 Sep 2013 01:31:50 -0700 (PDT) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id f17sm5674197lbo.12.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 01:31:49 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org, Imre Kaloz , Krzysztof Halasa , Dmitry Torokhov , Dmitry Torokhov Cc: Alexandre Courbot , linux-arm-kernel@lists.infradead.org, Linus Walleij Subject: [PATCH 2/7] input: misc: ixp4-beeper: switch to use gpiolib Date: Fri, 13 Sep 2013 10:31:42 +0200 Message-Id: <1379061102-22279-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.49 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: Dmitry Torokhov Acked-by: Arnd Bergmann Signed-off-by: Linus Walleij --- Hi Dmitry, requesting an ACK for this to take it through the GPIO tree as part of an IXP4 clean-up attempt. --- 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; }