diff options
author | tvboxspy <tvboxspy@gmail.com> | 2011-09-21 17:57:41 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-09-23 22:08:07 -0400 |
commit | 2ba0f94796febc26bbb12095f6ad15c2397de474 (patch) | |
tree | 568f4002c1dc2b53060f93980af40b81dd594366 /drivers/media/dvb/dvb-usb/it913x.c | |
parent | 7b1c8f58fcdbed75903943705ef41816e9648c1b (diff) |
[media] it913x: add remote control support
Add remote support for KWORLD UB499-2T-T09
The remote supplied is the same as KWORLD_315U.
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/dvb-usb/it913x.c')
-rw-r--r-- | drivers/media/dvb/dvb-usb/it913x.c | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/drivers/media/dvb/dvb-usb/it913x.c b/drivers/media/dvb/dvb-usb/it913x.c index 6d2f281510c3..f027a2c1c3e8 100644 --- a/drivers/media/dvb/dvb-usb/it913x.c +++ b/drivers/media/dvb/dvb-usb/it913x.c | |||
@@ -306,6 +306,30 @@ static struct i2c_algorithm it913x_i2c_algo = { | |||
306 | }; | 306 | }; |
307 | 307 | ||
308 | /* Callbacks for DVB USB */ | 308 | /* Callbacks for DVB USB */ |
309 | #define IT913X_POLL 250 | ||
310 | static int it913x_rc_query(struct dvb_usb_device *d) | ||
311 | { | ||
312 | u8 ibuf[4]; | ||
313 | int ret; | ||
314 | u32 key; | ||
315 | /* Avoid conflict with frontends*/ | ||
316 | if (mutex_lock_interruptible(&d->i2c_mutex) < 0) | ||
317 | return -EAGAIN; | ||
318 | |||
319 | ret = it913x_io(d->udev, READ_LONG, PRO_LINK, CMD_IR_GET, | ||
320 | 0, 0, &ibuf[0], sizeof(ibuf)); | ||
321 | |||
322 | if ((ibuf[2] + ibuf[3]) == 0xff) { | ||
323 | key = ibuf[2]; | ||
324 | key += ibuf[0] << 8; | ||
325 | deb_info(1, "INT Key =%08x", key); | ||
326 | if (d->rc_dev != NULL) | ||
327 | rc_keydown(d->rc_dev, key, 0); | ||
328 | } | ||
329 | mutex_unlock(&d->i2c_mutex); | ||
330 | |||
331 | return ret; | ||
332 | } | ||
309 | static int it913x_identify_state(struct usb_device *udev, | 333 | static int it913x_identify_state(struct usb_device *udev, |
310 | struct dvb_usb_device_properties *props, | 334 | struct dvb_usb_device_properties *props, |
311 | struct dvb_usb_device_description **desc, | 335 | struct dvb_usb_device_description **desc, |
@@ -575,6 +599,14 @@ static struct dvb_usb_device_properties it913x_properties = { | |||
575 | } | 599 | } |
576 | }, | 600 | }, |
577 | .identify_state = it913x_identify_state, | 601 | .identify_state = it913x_identify_state, |
602 | .rc.core = { | ||
603 | .protocol = RC_TYPE_NEC, | ||
604 | .module_name = "it913x", | ||
605 | .rc_query = it913x_rc_query, | ||
606 | .rc_interval = IT913X_POLL, | ||
607 | .allowed_protos = RC_TYPE_NEC, | ||
608 | .rc_codes = RC_MAP_KWORLD_315U, | ||
609 | }, | ||
578 | .i2c_algo = &it913x_i2c_algo, | 610 | .i2c_algo = &it913x_i2c_algo, |
579 | .num_device_descs = 1, | 611 | .num_device_descs = 1, |
580 | .devices = { | 612 | .devices = { |
@@ -615,5 +647,5 @@ module_exit(it913x_module_exit); | |||
615 | 647 | ||
616 | MODULE_AUTHOR("Malcolm Priestley <tvboxspy@gmail.com>"); | 648 | MODULE_AUTHOR("Malcolm Priestley <tvboxspy@gmail.com>"); |
617 | MODULE_DESCRIPTION("it913x USB 2 Driver"); | 649 | MODULE_DESCRIPTION("it913x USB 2 Driver"); |
618 | MODULE_VERSION("1.05"); | 650 | MODULE_VERSION("1.06"); |
619 | MODULE_LICENSE("GPL"); | 651 | MODULE_LICENSE("GPL"); |