From fd0f6851eb46512a6df2961923a0c24edc0a55b9 Mon Sep 17 00:00:00 2001 From: Ravi Kumar V Date: Tue, 28 Feb 2012 01:51:40 -0300 Subject: [media] rc: Add support for GPIO based IR Receiver driver Adds GPIO based IR Receiver driver. It decodes signals using decoders available in rc framework. Signed-off-by: Ravi Kumar V Signed-off-by: Mauro Carvalho Chehab --- include/media/gpio-ir-recv.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 include/media/gpio-ir-recv.h (limited to 'include/media/gpio-ir-recv.h') diff --git a/include/media/gpio-ir-recv.h b/include/media/gpio-ir-recv.h new file mode 100644 index 000000000000..61a7fbb47127 --- /dev/null +++ b/include/media/gpio-ir-recv.h @@ -0,0 +1,22 @@ +/* Copyright (c) 2012, Code Aurora Forum. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 and + * only version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#ifndef __GPIO_IR_RECV_H__ +#define __GPIO_IR_RECV_H__ + +struct gpio_ir_recv_platform_data { + unsigned int gpio_nr; + bool active_low; +}; + +#endif /* __GPIO_IR_RECV_H__ */ + -- cgit v1.2.3 From 955b44304afca143b82304fe421e990ec607834a Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Sat, 10 Mar 2012 04:58:18 -0300 Subject: [media] gpio-ir-recv: a couple signedness bugs There are couple places where we check unsigned values for negative. I changed ->gpin_nr to signed because in gpio_ir_recv_probe() we do: if (pdata->gpio_nr < 0) return -EINVAL; I also change gval to a signed int in gpio_ir_recv_irq() because that's the type that gpio_get_value_cansleep() returns and we test for negative returns. Signed-off-by: Dan Carpenter Reviewed-by: Trilok Soni Signed-off-by: Mauro Carvalho Chehab --- drivers/media/rc/gpio-ir-recv.c | 4 ++-- include/media/gpio-ir-recv.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'include/media/gpio-ir-recv.h') diff --git a/drivers/media/rc/gpio-ir-recv.c b/drivers/media/rc/gpio-ir-recv.c index 6744479a5389..0d875450c5ce 100644 --- a/drivers/media/rc/gpio-ir-recv.c +++ b/drivers/media/rc/gpio-ir-recv.c @@ -26,14 +26,14 @@ struct gpio_rc_dev { struct rc_dev *rcdev; - unsigned int gpio_nr; + int gpio_nr; bool active_low; }; static irqreturn_t gpio_ir_recv_irq(int irq, void *dev_id) { struct gpio_rc_dev *gpio_dev = dev_id; - unsigned int gval; + int gval; int rc = 0; enum raw_event_type type = IR_SPACE; diff --git a/include/media/gpio-ir-recv.h b/include/media/gpio-ir-recv.h index 61a7fbb47127..67797bf5d432 100644 --- a/include/media/gpio-ir-recv.h +++ b/include/media/gpio-ir-recv.h @@ -14,7 +14,7 @@ #define __GPIO_IR_RECV_H__ struct gpio_ir_recv_platform_data { - unsigned int gpio_nr; + int gpio_nr; bool active_low; }; -- cgit v1.2.3