From patchwork Tue Sep 10 12:31:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 19853 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f198.google.com (mail-qc0-f198.google.com [209.85.216.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 15B62246A4 for ; Tue, 10 Sep 2013 12:31:31 +0000 (UTC) Received: by mail-qc0-f198.google.com with SMTP id l13sf4335960qcy.9 for ; Tue, 10 Sep 2013 05:31:30 -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=r+wh2+xgZF5MCak7eWYSiE07txrNO34oysWMPOWbt7Q=; b=brc09GnyVe+pHK6Zf1L4QGZm0QxxW5y0JKrA5YhSr3ZNGgr0QXGX2s9Pt5GCtdOnsM jInw8oBGFqTDAh+sGZ0uhRVvYk4ChORIBU85Vlm++fyDoeBRzBUfbfKO4Ef3aq8750md AnxQmvsNzOmYM7F3pqvbqg5E/YtzIpKSoZrOU5mL4GN1O8+ACWxCrFl/GWaDFpfQZtbg llFk7HIvD9+UgC1JQQpCDLjXNPTI+vXgaxzhzNn8XHgN1Sl1L6kTBm3yQx7tQOCG2TDq MVT268fhfxXEb2AbmB2fjOPuacC2BZfaiWCmlamETb3jfGR6XQ0VWm78Fh/iN0ViQRxg 8/7w== X-Received: by 10.236.69.35 with SMTP id m23mr8370943yhd.6.1378816290843; Tue, 10 Sep 2013 05:31:30 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.50.225 with SMTP id f1ls2180193qeo.66.gmail; Tue, 10 Sep 2013 05:31:30 -0700 (PDT) X-Received: by 10.52.98.131 with SMTP id ei3mr19119011vdb.4.1378816290604; Tue, 10 Sep 2013 05:31:30 -0700 (PDT) Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) by mx.google.com with ESMTPS id gw1si4384088vcb.62.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Sep 2013 05:31:30 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.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.220.177; Received: by mail-vc0-f177.google.com with SMTP id gf12so4840085vcb.8 for ; Tue, 10 Sep 2013 05:31:30 -0700 (PDT) X-Gm-Message-State: ALoCoQkYrSc6WhMEDSe2irfBcvWcr+JGCoWCkmxeO1RW8VsyiGdAF6EBYyIqG2uj64NNMMyN51By X-Received: by 10.221.44.136 with SMTP id ug8mr22644759vcb.13.1378816290527; Tue, 10 Sep 2013 05:31:30 -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 u4csp18448vcz; Tue, 10 Sep 2013 05:31:29 -0700 (PDT) X-Received: by 10.152.36.170 with SMTP id r10mr896510laj.48.1378816289321; Tue, 10 Sep 2013 05:31:29 -0700 (PDT) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com [209.85.217.171]) by mx.google.com with ESMTPS id nw5si7958142lbb.161.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Sep 2013 05:31:29 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.217.171 is neither permitted nor denied by best guess record for domain of linus.walleij@linaro.org) client-ip=209.85.217.171; Received: by mail-lb0-f171.google.com with SMTP id u14so6100279lbd.2 for ; Tue, 10 Sep 2013 05:31:28 -0700 (PDT) X-Received: by 10.152.22.35 with SMTP id a3mr1079002laf.45.1378816288495; Tue, 10 Sep 2013 05:31:28 -0700 (PDT) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id pw4sm8466063lbb.9.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 10 Sep 2013 05:31:27 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org, Imre Kaloz , Krzysztof Halasa , Greg Kroah-Hartman Cc: Alexandre Courbot , linux-arm-kernel@lists.infradead.org, Linus Walleij Subject: [PATCH 5/7] staging: media/lirc: switch to use gpiolib Date: Tue, 10 Sep 2013 14:31:23 +0200 Message-Id: <1378816283-8164-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.220.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: , The lirc serial module has special hooks to work with NSLU2, switch these over to use gpiolib, as that is available on the ixp4 platform. Not even compile tested as there is no way to select this driver from menuconfig on the ixp4 platform. Cc: Imre Kaloz Cc: Krzysztof Halasa Cc: Alexandre Courbot Cc: Greg Kroah-Hartman Signed-off-by: Linus Walleij --- Hi Greg: I'm seeking an ACK on this patch to take it through the GPIO tree as part of a clean-up attempt to remove custom GPIO APIs. --- drivers/staging/media/lirc/lirc_serial.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/staging/media/lirc/lirc_serial.c b/drivers/staging/media/lirc/lirc_serial.c index af08e67..f6bc4c9 100644 --- a/drivers/staging/media/lirc/lirc_serial.c +++ b/drivers/staging/media/lirc/lirc_serial.c @@ -67,7 +67,7 @@ #include #include #include - +#include #include #include #include @@ -321,7 +321,7 @@ static void on(void) * status LED and ground */ if (type == LIRC_NSLU2) { - gpio_line_set(NSLU2_LED_GRN, IXP4XX_GPIO_LOW); + gpio_set_value(NSLU2_LED_GRN, 0); return; } #endif @@ -335,7 +335,7 @@ static void off(void) { #ifdef CONFIG_LIRC_SERIAL_NSLU2 if (type == LIRC_NSLU2) { - gpio_line_set(NSLU2_LED_GRN, IXP4XX_GPIO_HIGH); + gpio_set_value(NSLU2_LED_GRN, 1); return; } #endif @@ -839,6 +839,16 @@ static int lirc_serial_probe(struct platform_device *dev) { int i, nlow, nhigh, result; +#ifdef CONFIG_LIRC_SERIAL_NSLU2 + /* This GPIO is used for a LED on the NSLU2 */ + result = devm_gpio_request(dev, NSLU2_LED_GRN, "lirc-serial"); + if (result) + return result; + result = gpio_direction_output(NSLU2_LED_GRN, 0); + if (result) + return result; +#endif + result = request_irq(irq, irq_handler, (share_irq ? IRQF_SHARED : 0), LIRC_DRIVER_NAME, (void *)&hardware);