diff options
author | Du, Changbin <changbin.du@gmail.com> | 2012-07-03 05:27:19 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-07-06 17:21:53 -0400 |
commit | 500c3201e2aed201f2de0468dfeb3ceb98a9f981 (patch) | |
tree | a0fa37f2603851bdc8c7249b6d2ffde39b369fad | |
parent | 87e9429490dfe610faaf209795942272bc7a730a (diff) |
[media] media: gpio-ir-recv: add allowed_protos for platform data
It's better to give platform code a chance to specify the allowed
protocols to use.
[mchehab@redhat.com: fix merge conflict with a patch that made
half of this change]
Signed-off-by: Du, Changbin <changbin.du@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/rc/gpio-ir-recv.c | 5 | ||||
-rw-r--r-- | include/media/gpio-ir-recv.h | 7 |
2 files changed, 8 insertions, 4 deletions
diff --git a/drivers/media/rc/gpio-ir-recv.c b/drivers/media/rc/gpio-ir-recv.c index 59fe60cd1e02..04cb272db16a 100644 --- a/drivers/media/rc/gpio-ir-recv.c +++ b/drivers/media/rc/gpio-ir-recv.c | |||
@@ -84,7 +84,6 @@ static int __devinit gpio_ir_recv_probe(struct platform_device *pdev) | |||
84 | 84 | ||
85 | rcdev->priv = gpio_dev; | 85 | rcdev->priv = gpio_dev; |
86 | rcdev->driver_type = RC_DRIVER_IR_RAW; | 86 | rcdev->driver_type = RC_DRIVER_IR_RAW; |
87 | rcdev->allowed_protos = RC_TYPE_ALL; | ||
88 | rcdev->input_name = GPIO_IR_DEVICE_NAME; | 87 | rcdev->input_name = GPIO_IR_DEVICE_NAME; |
89 | rcdev->input_phys = GPIO_IR_DEVICE_NAME "/input0"; | 88 | rcdev->input_phys = GPIO_IR_DEVICE_NAME "/input0"; |
90 | rcdev->input_id.bustype = BUS_HOST; | 89 | rcdev->input_id.bustype = BUS_HOST; |
@@ -93,6 +92,10 @@ static int __devinit gpio_ir_recv_probe(struct platform_device *pdev) | |||
93 | rcdev->input_id.version = 0x0100; | 92 | rcdev->input_id.version = 0x0100; |
94 | rcdev->dev.parent = &pdev->dev; | 93 | rcdev->dev.parent = &pdev->dev; |
95 | rcdev->driver_name = GPIO_IR_DRIVER_NAME; | 94 | rcdev->driver_name = GPIO_IR_DRIVER_NAME; |
95 | if (pdata->allowed_protos) | ||
96 | rcdev->allowed_protos = pdata->allowed_protos; | ||
97 | else | ||
98 | rcdev->allowed_protos = RC_TYPE_ALL; | ||
96 | rcdev->map_name = pdata->map_name ?: RC_MAP_EMPTY; | 99 | rcdev->map_name = pdata->map_name ?: RC_MAP_EMPTY; |
97 | 100 | ||
98 | gpio_dev->rcdev = rcdev; | 101 | gpio_dev->rcdev = rcdev; |
diff --git a/include/media/gpio-ir-recv.h b/include/media/gpio-ir-recv.h index 91546f35b7e1..0142736a59db 100644 --- a/include/media/gpio-ir-recv.h +++ b/include/media/gpio-ir-recv.h | |||
@@ -14,9 +14,10 @@ | |||
14 | #define __GPIO_IR_RECV_H__ | 14 | #define __GPIO_IR_RECV_H__ |
15 | 15 | ||
16 | struct gpio_ir_recv_platform_data { | 16 | struct gpio_ir_recv_platform_data { |
17 | int gpio_nr; | 17 | int gpio_nr; |
18 | bool active_low; | 18 | bool active_low; |
19 | const char *map_name; | 19 | u64 allowed_protos; |
20 | const char *map_name; | ||
20 | }; | 21 | }; |
21 | 22 | ||
22 | #endif /* __GPIO_IR_RECV_H__ */ | 23 | #endif /* __GPIO_IR_RECV_H__ */ |