Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Du, Changbin and committed by
Mauro Carvalho Chehab
500c3201 87e94294

+8 -4
+4 -1
drivers/media/rc/gpio-ir-recv.c
··· 84 84 85 85 rcdev->priv = gpio_dev; 86 86 rcdev->driver_type = RC_DRIVER_IR_RAW; 87 - rcdev->allowed_protos = RC_TYPE_ALL; 88 87 rcdev->input_name = GPIO_IR_DEVICE_NAME; 89 88 rcdev->input_phys = GPIO_IR_DEVICE_NAME "/input0"; 90 89 rcdev->input_id.bustype = BUS_HOST; ··· 92 93 rcdev->input_id.version = 0x0100; 93 94 rcdev->dev.parent = &pdev->dev; 94 95 rcdev->driver_name = GPIO_IR_DRIVER_NAME; 96 + if (pdata->allowed_protos) 97 + rcdev->allowed_protos = pdata->allowed_protos; 98 + else 99 + rcdev->allowed_protos = RC_TYPE_ALL; 95 100 rcdev->map_name = pdata->map_name ?: RC_MAP_EMPTY; 96 101 97 102 gpio_dev->rcdev = rcdev;
+4 -3
include/media/gpio-ir-recv.h
··· 14 14 #define __GPIO_IR_RECV_H__ 15 15 16 16 struct gpio_ir_recv_platform_data { 17 - int gpio_nr; 18 - bool active_low; 19 - const char *map_name; 17 + int gpio_nr; 18 + bool active_low; 19 + u64 allowed_protos; 20 + const char *map_name; 20 21 }; 21 22 22 23 #endif /* __GPIO_IR_RECV_H__ */