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: 2865921 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 4BEADBF43F for ; Tue, 10 Sep 2013 12:59:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 95B462012F for ; Tue, 10 Sep 2013 12:59:04 +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 2FF03200E9 for ; Tue, 10 Sep 2013 12:59:03 +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 1VJNVa-0003kV-Rr; Tue, 10 Sep 2013 12:57:32 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VJNV6-0003ce-6a; Tue, 10 Sep 2013 12:57:00 +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 1VJNUL-0002tb-Pk for linux-arm-kernel@merlin.infradead.org; Tue, 10 Sep 2013 12:56:13 +0000 Received: from mail-la0-f49.google.com ([209.85.215.49]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VJN71-0005jB-IP for linux-arm-kernel@lists.infradead.org; Tue, 10 Sep 2013 12:32:08 +0000 Received: by mail-la0-f49.google.com with SMTP id ev20so5914036lab.8 for ; Tue, 10 Sep 2013 05:31:28 -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=r+wh2+xgZF5MCak7eWYSiE07txrNO34oysWMPOWbt7Q=; b=Silbni0ldKh7LLs8QJapmYeX2timu86ywUgdExuWXcGGFeXz1zoUcxIkvZMABYqo3c ZH31CzQ7fh09vNAx7p88Bgx6bUvgD4g9Yv4DG8Js8q9NIcwx2odoVIfSExRiSS7V9IlA JhqyYZhTXcexokTqlsknQGpuqyNN8LZ89hTofTVJkvFKFnPQUabldqs+JHxRpGXnQLta 0vYLra/kzWChweV74NjibHlILoJZo1uxCRo7IIr4dIbKfBmu3DmYM0mlQu53cIn6UEc+ 8vSkypClYVguHtcFP2sNCh/ykoOz18tBGiElpeM8KRkQ4Tv6khzUNb2C2XJrMOhiAEOo TkCg== X-Gm-Message-State: ALoCoQmyL4q+fPJ2BQZJFTtkxzJeOLvJ2vEsdXleQoreHTgdqi8U4Qpf2OrW6FHhD2LVJMA09Ntn 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 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130910_133207_645981_34E40DE0 X-CRM114-Status: GOOD ( 17.88 ) 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=-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 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 Acked-by: Krzysztof Halasa --- 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);