}
}
+ /* load empty to enable rc */
+ if (!rc->map_name)
+ rc->map_name = RC_MAP_EMPTY;
+
rc->allowed_protos = RC_TYPE_NEC;
rc->query = af9015_rc_query;
rc->interval = 500;
* @bulk_mode: device supports bulk mode for rc (disable polling mode)
*/
struct dvb_usb_rc {
- char *map_name;
+ const char *map_name;
u64 allowed_protos;
int (*change_protocol)(struct rc_dev *dev, u64 rc_type);
int (*query) (struct dvb_usb_device *d);
if (dvb_usbv2_disable_rc_polling || !d->props->get_rc_config)
return 0;
+ d->rc.map_name = d->rc_map;
ret = d->props->get_rc_config(d, &d->rc);
if (ret < 0)
goto err;
+ /* disable rc when there is no keymap defined */
+ if (!d->rc.map_name)
+ return 0;
+
dev = rc_allocate_device();
if (!dev) {
ret = -ENOMEM;
usb_to_input_id(d->udev, &dev->input_id);
/* TODO: likely RC-core should took const char * */
dev->driver_name = (char *) d->props->driver_name;
+ dev->map_name = d->rc.map_name;
dev->driver_type = d->rc.driver_type;
dev->allowed_protos = d->rc.allowed_protos;
dev->change_protocol = d->rc.change_protocol;
dev->priv = d;
- if (d->rc.map_name)
- dev->map_name = d->rc.map_name;
- else
- dev->map_name = d->rc_map;
ret = rc_register_device(dev);
if (ret < 0) {