From: Linus Walleij Date: Tue, 10 Sep 2013 11:30:10 +0000 (+0200) Subject: staging: media/lirc: switch to use gpiolib X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=b336cb29ae1b564d9368495f9d89e2e9bdc6023e;p=linux-beck.git staging: media/lirc: switch to use gpiolib 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: Alexandre Courbot Cc: Greg Kroah-Hartman Acked-by: Krzysztof Halasa Signed-off-by: Linus Walleij --- diff --git a/drivers/staging/media/lirc/lirc_serial.c b/drivers/staging/media/lirc/lirc_serial.c index af08e677b60f..f6bc4c91ab35 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);