aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/IR
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2010-06-18 04:53:12 -0400
committerIngo Molnar <mingo@elte.hu>2010-06-18 04:53:19 -0400
commit646b1db4956ba8bf748b835b5eba211133d91c2e (patch)
tree061166d873d9da9cf83044a7593ad111787076c5 /drivers/media/IR
parent0f2c3de2ba110626515234d5d584fb1b0c0749a2 (diff)
parent7e27d6e778cd87b6f2415515d7127eba53fe5d02 (diff)
Merge commit 'v2.6.35-rc3' into perf/core
Merge reason: Go from -rc1 base to -rc3 base, merge in fixes.
Diffstat (limited to 'drivers/media/IR')
-rw-r--r--drivers/media/IR/Kconfig2
-rw-r--r--drivers/media/IR/imon.c75
-rw-r--r--drivers/media/IR/ir-keytable.c17
-rw-r--r--drivers/media/IR/ir-sysfs.c7
-rw-r--r--drivers/media/IR/keymaps/Makefile3
-rw-r--r--drivers/media/IR/keymaps/rc-avermedia-m135a-rm-jx.c90
-rw-r--r--drivers/media/IR/keymaps/rc-avermedia-m135a.c147
-rw-r--r--drivers/media/IR/keymaps/rc-avermedia-m733a-rm-k6.c95
8 files changed, 301 insertions, 135 deletions
diff --git a/drivers/media/IR/Kconfig b/drivers/media/IR/Kconfig
index 195c6cf359f6..d22a8ec523fc 100644
--- a/drivers/media/IR/Kconfig
+++ b/drivers/media/IR/Kconfig
@@ -13,6 +13,7 @@ source "drivers/media/IR/keymaps/Kconfig"
13config IR_NEC_DECODER 13config IR_NEC_DECODER
14 tristate "Enable IR raw decoder for the NEC protocol" 14 tristate "Enable IR raw decoder for the NEC protocol"
15 depends on IR_CORE 15 depends on IR_CORE
16 select BITREVERSE
16 default y 17 default y
17 18
18 ---help--- 19 ---help---
@@ -22,6 +23,7 @@ config IR_NEC_DECODER
22config IR_RC5_DECODER 23config IR_RC5_DECODER
23 tristate "Enable IR raw decoder for the RC-5 protocol" 24 tristate "Enable IR raw decoder for the RC-5 protocol"
24 depends on IR_CORE 25 depends on IR_CORE
26 select BITREVERSE
25 default y 27 default y
26 28
27 ---help--- 29 ---help---
diff --git a/drivers/media/IR/imon.c b/drivers/media/IR/imon.c
index 5e2045670004..4bbd45f4284c 100644
--- a/drivers/media/IR/imon.c
+++ b/drivers/media/IR/imon.c
@@ -94,6 +94,7 @@ struct imon_context {
94 94
95 bool display_supported; /* not all controllers do */ 95 bool display_supported; /* not all controllers do */
96 bool display_isopen; /* display port has been opened */ 96 bool display_isopen; /* display port has been opened */
97 bool rf_device; /* true if iMON 2.4G LT/DT RF device */
97 bool rf_isassociating; /* RF remote associating */ 98 bool rf_isassociating; /* RF remote associating */
98 bool dev_present_intf0; /* USB device presence, interface 0 */ 99 bool dev_present_intf0; /* USB device presence, interface 0 */
99 bool dev_present_intf1; /* USB device presence, interface 1 */ 100 bool dev_present_intf1; /* USB device presence, interface 1 */
@@ -385,7 +386,7 @@ static int display_open(struct inode *inode, struct file *file)
385 err("%s: display port is already open", __func__); 386 err("%s: display port is already open", __func__);
386 retval = -EBUSY; 387 retval = -EBUSY;
387 } else { 388 } else {
388 ictx->display_isopen = 1; 389 ictx->display_isopen = true;
389 file->private_data = ictx; 390 file->private_data = ictx;
390 dev_dbg(ictx->dev, "display port opened\n"); 391 dev_dbg(ictx->dev, "display port opened\n");
391 } 392 }
@@ -422,7 +423,7 @@ static int display_close(struct inode *inode, struct file *file)
422 err("%s: display is not open", __func__); 423 err("%s: display is not open", __func__);
423 retval = -EIO; 424 retval = -EIO;
424 } else { 425 } else {
425 ictx->display_isopen = 0; 426 ictx->display_isopen = false;
426 dev_dbg(ictx->dev, "display port closed\n"); 427 dev_dbg(ictx->dev, "display port closed\n");
427 if (!ictx->dev_present_intf0) { 428 if (!ictx->dev_present_intf0) {
428 /* 429 /*
@@ -491,12 +492,12 @@ static int send_packet(struct imon_context *ictx)
491 } 492 }
492 493
493 init_completion(&ictx->tx.finished); 494 init_completion(&ictx->tx.finished);
494 ictx->tx.busy = 1; 495 ictx->tx.busy = true;
495 smp_rmb(); /* ensure later readers know we're busy */ 496 smp_rmb(); /* ensure later readers know we're busy */
496 497
497 retval = usb_submit_urb(ictx->tx_urb, GFP_KERNEL); 498 retval = usb_submit_urb(ictx->tx_urb, GFP_KERNEL);
498 if (retval) { 499 if (retval) {
499 ictx->tx.busy = 0; 500 ictx->tx.busy = false;
500 smp_rmb(); /* ensure later readers know we're not busy */ 501 smp_rmb(); /* ensure later readers know we're not busy */
501 err("%s: error submitting urb(%d)", __func__, retval); 502 err("%s: error submitting urb(%d)", __func__, retval);
502 } else { 503 } else {
@@ -682,7 +683,7 @@ static ssize_t store_associate_remote(struct device *d,
682 return -ENODEV; 683 return -ENODEV;
683 684
684 mutex_lock(&ictx->lock); 685 mutex_lock(&ictx->lock);
685 ictx->rf_isassociating = 1; 686 ictx->rf_isassociating = true;
686 send_associate_24g(ictx); 687 send_associate_24g(ictx);
687 mutex_unlock(&ictx->lock); 688 mutex_unlock(&ictx->lock);
688 689
@@ -950,7 +951,7 @@ static void usb_tx_callback(struct urb *urb)
950 ictx->tx.status = urb->status; 951 ictx->tx.status = urb->status;
951 952
952 /* notify waiters that write has finished */ 953 /* notify waiters that write has finished */
953 ictx->tx.busy = 0; 954 ictx->tx.busy = false;
954 smp_rmb(); /* ensure later readers know we're not busy */ 955 smp_rmb(); /* ensure later readers know we're not busy */
955 complete(&ictx->tx.finished); 956 complete(&ictx->tx.finished);
956} 957}
@@ -1215,7 +1216,7 @@ static bool imon_mouse_event(struct imon_context *ictx,
1215{ 1216{
1216 char rel_x = 0x00, rel_y = 0x00; 1217 char rel_x = 0x00, rel_y = 0x00;
1217 u8 right_shift = 1; 1218 u8 right_shift = 1;
1218 bool mouse_input = 1; 1219 bool mouse_input = true;
1219 int dir = 0; 1220 int dir = 0;
1220 1221
1221 /* newer iMON device PAD or mouse button */ 1222 /* newer iMON device PAD or mouse button */
@@ -1246,7 +1247,7 @@ static bool imon_mouse_event(struct imon_context *ictx,
1246 } else if (ictx->kc == KEY_CHANNELDOWN && (buf[2] & 0x40) != 0x40) { 1247 } else if (ictx->kc == KEY_CHANNELDOWN && (buf[2] & 0x40) != 0x40) {
1247 dir = -1; 1248 dir = -1;
1248 } else 1249 } else
1249 mouse_input = 0; 1250 mouse_input = false;
1250 1251
1251 if (mouse_input) { 1252 if (mouse_input) {
1252 dev_dbg(ictx->dev, "sending mouse data via input subsystem\n"); 1253 dev_dbg(ictx->dev, "sending mouse data via input subsystem\n");
@@ -1450,7 +1451,7 @@ static void imon_incoming_packet(struct imon_context *ictx,
1450 unsigned char *buf = urb->transfer_buffer; 1451 unsigned char *buf = urb->transfer_buffer;
1451 struct device *dev = ictx->dev; 1452 struct device *dev = ictx->dev;
1452 u32 kc; 1453 u32 kc;
1453 bool norelease = 0; 1454 bool norelease = false;
1454 int i; 1455 int i;
1455 u64 temp_key; 1456 u64 temp_key;
1456 u64 panel_key = 0; 1457 u64 panel_key = 0;
@@ -1465,7 +1466,7 @@ static void imon_incoming_packet(struct imon_context *ictx,
1465 idev = ictx->idev; 1466 idev = ictx->idev;
1466 1467
1467 /* filter out junk data on the older 0xffdc imon devices */ 1468 /* filter out junk data on the older 0xffdc imon devices */
1468 if ((buf[0] == 0xff) && (buf[7] == 0xff)) 1469 if ((buf[0] == 0xff) && (buf[1] == 0xff) && (buf[2] == 0xff))
1469 return; 1470 return;
1470 1471
1471 /* Figure out what key was pressed */ 1472 /* Figure out what key was pressed */
@@ -1517,7 +1518,7 @@ static void imon_incoming_packet(struct imon_context *ictx,
1517 !(buf[1] & 0x1 || buf[1] >> 2 & 0x1))) { 1518 !(buf[1] & 0x1 || buf[1] >> 2 & 0x1))) {
1518 len = 8; 1519 len = 8;
1519 imon_pad_to_keys(ictx, buf); 1520 imon_pad_to_keys(ictx, buf);
1520 norelease = 1; 1521 norelease = true;
1521 } 1522 }
1522 1523
1523 if (debug) { 1524 if (debug) {
@@ -1580,7 +1581,7 @@ not_input_data:
1580 (buf[6] == 0x5E && buf[7] == 0xDF))) { /* DT */ 1581 (buf[6] == 0x5E && buf[7] == 0xDF))) { /* DT */
1581 dev_warn(dev, "%s: remote associated refid=%02X\n", 1582 dev_warn(dev, "%s: remote associated refid=%02X\n",
1582 __func__, buf[1]); 1583 __func__, buf[1]);
1583 ictx->rf_isassociating = 0; 1584 ictx->rf_isassociating = false;
1584 } 1585 }
1585} 1586}
1586 1587
@@ -1790,9 +1791,9 @@ static bool imon_find_endpoints(struct imon_context *ictx,
1790 int ifnum = iface_desc->desc.bInterfaceNumber; 1791 int ifnum = iface_desc->desc.bInterfaceNumber;
1791 int num_endpts = iface_desc->desc.bNumEndpoints; 1792 int num_endpts = iface_desc->desc.bNumEndpoints;
1792 int i, ep_dir, ep_type; 1793 int i, ep_dir, ep_type;
1793 bool ir_ep_found = 0; 1794 bool ir_ep_found = false;
1794 bool display_ep_found = 0; 1795 bool display_ep_found = false;
1795 bool tx_control = 0; 1796 bool tx_control = false;
1796 1797
1797 /* 1798 /*
1798 * Scan the endpoint list and set: 1799 * Scan the endpoint list and set:
@@ -1808,13 +1809,13 @@ static bool imon_find_endpoints(struct imon_context *ictx,
1808 ep_type == USB_ENDPOINT_XFER_INT) { 1809 ep_type == USB_ENDPOINT_XFER_INT) {
1809 1810
1810 rx_endpoint = ep; 1811 rx_endpoint = ep;
1811 ir_ep_found = 1; 1812 ir_ep_found = true;
1812 dev_dbg(ictx->dev, "%s: found IR endpoint\n", __func__); 1813 dev_dbg(ictx->dev, "%s: found IR endpoint\n", __func__);
1813 1814
1814 } else if (!display_ep_found && ep_dir == USB_DIR_OUT && 1815 } else if (!display_ep_found && ep_dir == USB_DIR_OUT &&
1815 ep_type == USB_ENDPOINT_XFER_INT) { 1816 ep_type == USB_ENDPOINT_XFER_INT) {
1816 tx_endpoint = ep; 1817 tx_endpoint = ep;
1817 display_ep_found = 1; 1818 display_ep_found = true;
1818 dev_dbg(ictx->dev, "%s: found display endpoint\n", __func__); 1819 dev_dbg(ictx->dev, "%s: found display endpoint\n", __func__);
1819 } 1820 }
1820 } 1821 }
@@ -1835,8 +1836,8 @@ static bool imon_find_endpoints(struct imon_context *ictx,
1835 * newer iMON devices that use control urb instead of interrupt 1836 * newer iMON devices that use control urb instead of interrupt
1836 */ 1837 */
1837 if (!display_ep_found) { 1838 if (!display_ep_found) {
1838 tx_control = 1; 1839 tx_control = true;
1839 display_ep_found = 1; 1840 display_ep_found = true;
1840 dev_dbg(ictx->dev, "%s: device uses control endpoint, not " 1841 dev_dbg(ictx->dev, "%s: device uses control endpoint, not "
1841 "interface OUT endpoint\n", __func__); 1842 "interface OUT endpoint\n", __func__);
1842 } 1843 }
@@ -1847,7 +1848,7 @@ static bool imon_find_endpoints(struct imon_context *ictx,
1847 * and without... :\ 1848 * and without... :\
1848 */ 1849 */
1849 if (ictx->display_type == IMON_DISPLAY_TYPE_NONE) { 1850 if (ictx->display_type == IMON_DISPLAY_TYPE_NONE) {
1850 display_ep_found = 0; 1851 display_ep_found = false;
1851 dev_dbg(ictx->dev, "%s: device has no display\n", __func__); 1852 dev_dbg(ictx->dev, "%s: device has no display\n", __func__);
1852 } 1853 }
1853 1854
@@ -1856,7 +1857,7 @@ static bool imon_find_endpoints(struct imon_context *ictx,
1856 * that refers to e.g. /dev/lcd0 (a character device LCD or VFD). 1857 * that refers to e.g. /dev/lcd0 (a character device LCD or VFD).
1857 */ 1858 */
1858 if (ictx->display_type == IMON_DISPLAY_TYPE_VGA) { 1859 if (ictx->display_type == IMON_DISPLAY_TYPE_VGA) {
1859 display_ep_found = 0; 1860 display_ep_found = false;
1860 dev_dbg(ictx->dev, "%s: iMON Touch device found\n", __func__); 1861 dev_dbg(ictx->dev, "%s: iMON Touch device found\n", __func__);
1861 } 1862 }
1862 1863
@@ -1905,9 +1906,10 @@ static struct imon_context *imon_init_intf0(struct usb_interface *intf)
1905 1906
1906 ictx->dev = dev; 1907 ictx->dev = dev;
1907 ictx->usbdev_intf0 = usb_get_dev(interface_to_usbdev(intf)); 1908 ictx->usbdev_intf0 = usb_get_dev(interface_to_usbdev(intf));
1908 ictx->dev_present_intf0 = 1; 1909 ictx->dev_present_intf0 = true;
1909 ictx->rx_urb_intf0 = rx_urb; 1910 ictx->rx_urb_intf0 = rx_urb;
1910 ictx->tx_urb = tx_urb; 1911 ictx->tx_urb = tx_urb;
1912 ictx->rf_device = false;
1911 1913
1912 ictx->vendor = le16_to_cpu(ictx->usbdev_intf0->descriptor.idVendor); 1914 ictx->vendor = le16_to_cpu(ictx->usbdev_intf0->descriptor.idVendor);
1913 ictx->product = le16_to_cpu(ictx->usbdev_intf0->descriptor.idProduct); 1915 ictx->product = le16_to_cpu(ictx->usbdev_intf0->descriptor.idProduct);
@@ -1979,7 +1981,7 @@ static struct imon_context *imon_init_intf1(struct usb_interface *intf,
1979 } 1981 }
1980 1982
1981 ictx->usbdev_intf1 = usb_get_dev(interface_to_usbdev(intf)); 1983 ictx->usbdev_intf1 = usb_get_dev(interface_to_usbdev(intf));
1982 ictx->dev_present_intf1 = 1; 1984 ictx->dev_present_intf1 = true;
1983 ictx->rx_urb_intf1 = rx_urb; 1985 ictx->rx_urb_intf1 = rx_urb;
1984 1986
1985 ret = -ENODEV; 1987 ret = -ENODEV;
@@ -2047,6 +2049,12 @@ static void imon_get_ffdc_type(struct imon_context *ictx)
2047 dev_info(ictx->dev, "0xffdc iMON Knob, iMON IR"); 2049 dev_info(ictx->dev, "0xffdc iMON Knob, iMON IR");
2048 ictx->display_supported = false; 2050 ictx->display_supported = false;
2049 break; 2051 break;
2052 /* iMON 2.4G LT (usb stick), no display, iMON RF */
2053 case 0x4e:
2054 dev_info(ictx->dev, "0xffdc iMON 2.4G LT, iMON RF");
2055 ictx->display_supported = false;
2056 ictx->rf_device = true;
2057 break;
2050 /* iMON VFD, no IR (does have vol knob tho) */ 2058 /* iMON VFD, no IR (does have vol knob tho) */
2051 case 0x35: 2059 case 0x35:
2052 dev_info(ictx->dev, "0xffdc iMON VFD + knob, no IR"); 2060 dev_info(ictx->dev, "0xffdc iMON VFD + knob, no IR");
@@ -2197,15 +2205,6 @@ static int __devinit imon_probe(struct usb_interface *interface,
2197 goto fail; 2205 goto fail;
2198 } 2206 }
2199 2207
2200 if (product == 0xffdc) {
2201 /* RF products *also* use 0xffdc... sigh... */
2202 sysfs_err = sysfs_create_group(&interface->dev.kobj,
2203 &imon_rf_attribute_group);
2204 if (sysfs_err)
2205 err("%s: Could not create RF sysfs entries(%d)",
2206 __func__, sysfs_err);
2207 }
2208
2209 } else { 2208 } else {
2210 /* this is the secondary interface on the device */ 2209 /* this is the secondary interface on the device */
2211 ictx = imon_init_intf1(interface, first_if_ctx); 2210 ictx = imon_init_intf1(interface, first_if_ctx);
@@ -2233,6 +2232,14 @@ static int __devinit imon_probe(struct usb_interface *interface,
2233 2232
2234 imon_set_display_type(ictx, interface); 2233 imon_set_display_type(ictx, interface);
2235 2234
2235 if (product == 0xffdc && ictx->rf_device) {
2236 sysfs_err = sysfs_create_group(&interface->dev.kobj,
2237 &imon_rf_attribute_group);
2238 if (sysfs_err)
2239 err("%s: Could not create RF sysfs entries(%d)",
2240 __func__, sysfs_err);
2241 }
2242
2236 if (ictx->display_supported) 2243 if (ictx->display_supported)
2237 imon_init_display(ictx, interface); 2244 imon_init_display(ictx, interface);
2238 } 2245 }
@@ -2297,7 +2304,7 @@ static void __devexit imon_disconnect(struct usb_interface *interface)
2297 } 2304 }
2298 2305
2299 if (ifnum == 0) { 2306 if (ifnum == 0) {
2300 ictx->dev_present_intf0 = 0; 2307 ictx->dev_present_intf0 = false;
2301 usb_kill_urb(ictx->rx_urb_intf0); 2308 usb_kill_urb(ictx->rx_urb_intf0);
2302 input_unregister_device(ictx->idev); 2309 input_unregister_device(ictx->idev);
2303 if (ictx->display_supported) { 2310 if (ictx->display_supported) {
@@ -2307,7 +2314,7 @@ static void __devexit imon_disconnect(struct usb_interface *interface)
2307 usb_deregister_dev(interface, &imon_vfd_class); 2314 usb_deregister_dev(interface, &imon_vfd_class);
2308 } 2315 }
2309 } else { 2316 } else {
2310 ictx->dev_present_intf1 = 0; 2317 ictx->dev_present_intf1 = false;
2311 usb_kill_urb(ictx->rx_urb_intf1); 2318 usb_kill_urb(ictx->rx_urb_intf1);
2312 if (ictx->display_type == IMON_DISPLAY_TYPE_VGA) 2319 if (ictx->display_type == IMON_DISPLAY_TYPE_VGA)
2313 input_unregister_device(ictx->touch); 2320 input_unregister_device(ictx->touch);
diff --git a/drivers/media/IR/ir-keytable.c b/drivers/media/IR/ir-keytable.c
index 9374a006f43d..94a8577e72eb 100644
--- a/drivers/media/IR/ir-keytable.c
+++ b/drivers/media/IR/ir-keytable.c
@@ -490,11 +490,12 @@ int __ir_input_register(struct input_dev *input_dev,
490 if (rc < 0) 490 if (rc < 0)
491 goto out_table; 491 goto out_table;
492 492
493 if (ir_dev->props->driver_type == RC_DRIVER_IR_RAW) { 493 if (ir_dev->props)
494 rc = ir_raw_event_register(input_dev); 494 if (ir_dev->props->driver_type == RC_DRIVER_IR_RAW) {
495 if (rc < 0) 495 rc = ir_raw_event_register(input_dev);
496 goto out_event; 496 if (rc < 0)
497 } 497 goto out_event;
498 }
498 499
499 IR_dprintk(1, "Registered input device on %s for %s remote.\n", 500 IR_dprintk(1, "Registered input device on %s for %s remote.\n",
500 driver_name, rc_tab->name); 501 driver_name, rc_tab->name);
@@ -530,8 +531,10 @@ void ir_input_unregister(struct input_dev *input_dev)
530 IR_dprintk(1, "Freed keycode table\n"); 531 IR_dprintk(1, "Freed keycode table\n");
531 532
532 del_timer_sync(&ir_dev->timer_keyup); 533 del_timer_sync(&ir_dev->timer_keyup);
533 if (ir_dev->props->driver_type == RC_DRIVER_IR_RAW) 534 if (ir_dev->props)
534 ir_raw_event_unregister(input_dev); 535 if (ir_dev->props->driver_type == RC_DRIVER_IR_RAW)
536 ir_raw_event_unregister(input_dev);
537
535 rc_tab = &ir_dev->rc_tab; 538 rc_tab = &ir_dev->rc_tab;
536 rc_tab->size = 0; 539 rc_tab->size = 0;
537 kfree(rc_tab->scan); 540 kfree(rc_tab->scan);
diff --git a/drivers/media/IR/ir-sysfs.c b/drivers/media/IR/ir-sysfs.c
index d7da63e16c92..2098dd1488e0 100644
--- a/drivers/media/IR/ir-sysfs.c
+++ b/drivers/media/IR/ir-sysfs.c
@@ -221,9 +221,10 @@ int ir_register_class(struct input_dev *input_dev)
221 if (unlikely(devno < 0)) 221 if (unlikely(devno < 0))
222 return devno; 222 return devno;
223 223
224 if (ir_dev->props->driver_type == RC_DRIVER_SCANCODE) 224 if (ir_dev->props) {
225 ir_dev->dev.type = &rc_dev_type; 225 if (ir_dev->props->driver_type == RC_DRIVER_SCANCODE)
226 else 226 ir_dev->dev.type = &rc_dev_type;
227 } else
227 ir_dev->dev.type = &ir_raw_dev_type; 228 ir_dev->dev.type = &ir_raw_dev_type;
228 229
229 ir_dev->dev.class = &ir_input_class; 230 ir_dev->dev.class = &ir_input_class;
diff --git a/drivers/media/IR/keymaps/Makefile b/drivers/media/IR/keymaps/Makefile
index ec25258a955f..aea649fbcf5a 100644
--- a/drivers/media/IR/keymaps/Makefile
+++ b/drivers/media/IR/keymaps/Makefile
@@ -6,7 +6,8 @@ obj-$(CONFIG_RC_MAP) += rc-adstech-dvb-t-pci.o \
6 rc-avermedia.o \ 6 rc-avermedia.o \
7 rc-avermedia-cardbus.o \ 7 rc-avermedia-cardbus.o \
8 rc-avermedia-dvbt.o \ 8 rc-avermedia-dvbt.o \
9 rc-avermedia-m135a-rm-jx.o \ 9 rc-avermedia-m135a.o \
10 rc-avermedia-m733a-rm-k6.o \
10 rc-avertv-303.o \ 11 rc-avertv-303.o \
11 rc-behold.o \ 12 rc-behold.o \
12 rc-behold-columbus.o \ 13 rc-behold-columbus.o \
diff --git a/drivers/media/IR/keymaps/rc-avermedia-m135a-rm-jx.c b/drivers/media/IR/keymaps/rc-avermedia-m135a-rm-jx.c
deleted file mode 100644
index 101e7ea85941..000000000000
--- a/drivers/media/IR/keymaps/rc-avermedia-m135a-rm-jx.c
+++ /dev/null
@@ -1,90 +0,0 @@
1/* avermedia-m135a-rm-jx.h - Keytable for avermedia_m135a_rm_jx Remote Controller
2 *
3 * keymap imported from ir-keymaps.c
4 *
5 * Copyright (c) 2010 by Mauro Carvalho Chehab <mchehab@redhat.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 */
12
13#include <media/rc-map.h>
14
15/*
16 * Avermedia M135A with IR model RM-JX
17 * The same codes exist on both Positivo (BR) and original IR
18 * Mauro Carvalho Chehab <mchehab@infradead.org>
19 */
20
21static struct ir_scancode avermedia_m135a_rm_jx[] = {
22 { 0x0200, KEY_POWER2 },
23 { 0x022e, KEY_DOT }, /* '.' */
24 { 0x0201, KEY_MODE }, /* TV/FM or SOURCE */
25
26 { 0x0205, KEY_1 },
27 { 0x0206, KEY_2 },
28 { 0x0207, KEY_3 },
29 { 0x0209, KEY_4 },
30 { 0x020a, KEY_5 },
31 { 0x020b, KEY_6 },
32 { 0x020d, KEY_7 },
33 { 0x020e, KEY_8 },
34 { 0x020f, KEY_9 },
35 { 0x0211, KEY_0 },
36
37 { 0x0213, KEY_RIGHT }, /* -> or L */
38 { 0x0212, KEY_LEFT }, /* <- or R */
39
40 { 0x0217, KEY_SLEEP }, /* Capturar Imagem or Snapshot */
41 { 0x0210, KEY_SHUFFLE }, /* Amostra or 16 chan prev */
42
43 { 0x0303, KEY_CHANNELUP },
44 { 0x0302, KEY_CHANNELDOWN },
45 { 0x021f, KEY_VOLUMEUP },
46 { 0x021e, KEY_VOLUMEDOWN },
47 { 0x020c, KEY_ENTER }, /* Full Screen */
48
49 { 0x0214, KEY_MUTE },
50 { 0x0208, KEY_AUDIO },
51
52 { 0x0203, KEY_TEXT }, /* Teletext */
53 { 0x0204, KEY_EPG },
54 { 0x022b, KEY_TV2 }, /* TV2 or PIP */
55
56 { 0x021d, KEY_RED },
57 { 0x021c, KEY_YELLOW },
58 { 0x0301, KEY_GREEN },
59 { 0x0300, KEY_BLUE },
60
61 { 0x021a, KEY_PLAYPAUSE },
62 { 0x0219, KEY_RECORD },
63 { 0x0218, KEY_PLAY },
64 { 0x021b, KEY_STOP },
65};
66
67static struct rc_keymap avermedia_m135a_rm_jx_map = {
68 .map = {
69 .scan = avermedia_m135a_rm_jx,
70 .size = ARRAY_SIZE(avermedia_m135a_rm_jx),
71 .ir_type = IR_TYPE_NEC,
72 .name = RC_MAP_AVERMEDIA_M135A_RM_JX,
73 }
74};
75
76static int __init init_rc_map_avermedia_m135a_rm_jx(void)
77{
78 return ir_register_map(&avermedia_m135a_rm_jx_map);
79}
80
81static void __exit exit_rc_map_avermedia_m135a_rm_jx(void)
82{
83 ir_unregister_map(&avermedia_m135a_rm_jx_map);
84}
85
86module_init(init_rc_map_avermedia_m135a_rm_jx)
87module_exit(exit_rc_map_avermedia_m135a_rm_jx)
88
89MODULE_LICENSE("GPL");
90MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@redhat.com>");
diff --git a/drivers/media/IR/keymaps/rc-avermedia-m135a.c b/drivers/media/IR/keymaps/rc-avermedia-m135a.c
new file mode 100644
index 000000000000..e4471fb2ad1e
--- /dev/null
+++ b/drivers/media/IR/keymaps/rc-avermedia-m135a.c
@@ -0,0 +1,147 @@
1/* avermedia-m135a.c - Keytable for Avermedia M135A Remote Controllers
2 *
3 * Copyright (c) 2010 by Mauro Carvalho Chehab <mchehab@redhat.com>
4 * Copyright (c) 2010 by Herton Ronaldo Krzesinski <herton@mandriva.com.br>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 */
11
12#include <media/rc-map.h>
13
14/*
15 * Avermedia M135A with RM-JX and RM-K6 remote controls
16 *
17 * On Avermedia M135A with IR model RM-JX, the same codes exist on both
18 * Positivo (BR) and original IR, initial version and remote control codes
19 * added by Mauro Carvalho Chehab <mchehab@infradead.org>
20 *
21 * Positivo also ships Avermedia M135A with model RM-K6, extra control
22 * codes added by Herton Ronaldo Krzesinski <herton@mandriva.com.br>
23 */
24
25static struct ir_scancode avermedia_m135a[] = {
26 /* RM-JX */
27 { 0x0200, KEY_POWER2 },
28 { 0x022e, KEY_DOT }, /* '.' */
29 { 0x0201, KEY_MODE }, /* TV/FM or SOURCE */
30
31 { 0x0205, KEY_1 },
32 { 0x0206, KEY_2 },
33 { 0x0207, KEY_3 },
34 { 0x0209, KEY_4 },
35 { 0x020a, KEY_5 },
36 { 0x020b, KEY_6 },
37 { 0x020d, KEY_7 },
38 { 0x020e, KEY_8 },
39 { 0x020f, KEY_9 },
40 { 0x0211, KEY_0 },
41
42 { 0x0213, KEY_RIGHT }, /* -> or L */
43 { 0x0212, KEY_LEFT }, /* <- or R */
44
45 { 0x0217, KEY_SLEEP }, /* Capturar Imagem or Snapshot */
46 { 0x0210, KEY_SHUFFLE }, /* Amostra or 16 chan prev */
47
48 { 0x0303, KEY_CHANNELUP },
49 { 0x0302, KEY_CHANNELDOWN },
50 { 0x021f, KEY_VOLUMEUP },
51 { 0x021e, KEY_VOLUMEDOWN },
52 { 0x020c, KEY_ENTER }, /* Full Screen */
53
54 { 0x0214, KEY_MUTE },
55 { 0x0208, KEY_AUDIO },
56
57 { 0x0203, KEY_TEXT }, /* Teletext */
58 { 0x0204, KEY_EPG },
59 { 0x022b, KEY_TV2 }, /* TV2 or PIP */
60
61 { 0x021d, KEY_RED },
62 { 0x021c, KEY_YELLOW },
63 { 0x0301, KEY_GREEN },
64 { 0x0300, KEY_BLUE },
65
66 { 0x021a, KEY_PLAYPAUSE },
67 { 0x0219, KEY_RECORD },
68 { 0x0218, KEY_PLAY },
69 { 0x021b, KEY_STOP },
70
71 /* RM-K6 */
72 { 0x0401, KEY_POWER2 },
73 { 0x0406, KEY_MUTE },
74 { 0x0408, KEY_MODE }, /* TV/FM */
75
76 { 0x0409, KEY_1 },
77 { 0x040a, KEY_2 },
78 { 0x040b, KEY_3 },
79 { 0x040c, KEY_4 },
80 { 0x040d, KEY_5 },
81 { 0x040e, KEY_6 },
82 { 0x040f, KEY_7 },
83 { 0x0410, KEY_8 },
84 { 0x0411, KEY_9 },
85 { 0x044c, KEY_DOT }, /* '.' */
86 { 0x0412, KEY_0 },
87 { 0x0407, KEY_REFRESH }, /* Refresh/Reload */
88
89 { 0x0413, KEY_AUDIO },
90 { 0x0440, KEY_SCREEN }, /* Full Screen toggle */
91 { 0x0441, KEY_HOME },
92 { 0x0442, KEY_BACK },
93 { 0x0447, KEY_UP },
94 { 0x0448, KEY_DOWN },
95 { 0x0449, KEY_LEFT },
96 { 0x044a, KEY_RIGHT },
97 { 0x044b, KEY_OK },
98 { 0x0404, KEY_VOLUMEUP },
99 { 0x0405, KEY_VOLUMEDOWN },
100 { 0x0402, KEY_CHANNELUP },
101 { 0x0403, KEY_CHANNELDOWN },
102
103 { 0x0443, KEY_RED },
104 { 0x0444, KEY_GREEN },
105 { 0x0445, KEY_YELLOW },
106 { 0x0446, KEY_BLUE },
107
108 { 0x0414, KEY_TEXT },
109 { 0x0415, KEY_EPG },
110 { 0x041a, KEY_TV2 }, /* PIP */
111 { 0x041b, KEY_MHP }, /* Snapshot */
112
113 { 0x0417, KEY_RECORD },
114 { 0x0416, KEY_PLAYPAUSE },
115 { 0x0418, KEY_STOP },
116 { 0x0419, KEY_PAUSE },
117
118 { 0x041f, KEY_PREVIOUS },
119 { 0x041c, KEY_REWIND },
120 { 0x041d, KEY_FORWARD },
121 { 0x041e, KEY_NEXT },
122};
123
124static struct rc_keymap avermedia_m135a_map = {
125 .map = {
126 .scan = avermedia_m135a,
127 .size = ARRAY_SIZE(avermedia_m135a),
128 .ir_type = IR_TYPE_NEC,
129 .name = RC_MAP_AVERMEDIA_M135A,
130 }
131};
132
133static int __init init_rc_map_avermedia_m135a(void)
134{
135 return ir_register_map(&avermedia_m135a_map);
136}
137
138static void __exit exit_rc_map_avermedia_m135a(void)
139{
140 ir_unregister_map(&avermedia_m135a_map);
141}
142
143module_init(init_rc_map_avermedia_m135a)
144module_exit(exit_rc_map_avermedia_m135a)
145
146MODULE_LICENSE("GPL");
147MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@redhat.com>");
diff --git a/drivers/media/IR/keymaps/rc-avermedia-m733a-rm-k6.c b/drivers/media/IR/keymaps/rc-avermedia-m733a-rm-k6.c
new file mode 100644
index 000000000000..cf8d45717cb3
--- /dev/null
+++ b/drivers/media/IR/keymaps/rc-avermedia-m733a-rm-k6.c
@@ -0,0 +1,95 @@
1/* avermedia-m733a-rm-k6.h - Keytable for avermedia_m733a_rm_k6 Remote Controller
2 *
3 * Copyright (c) 2010 by Herton Ronaldo Krzesinski <herton@mandriva.com.br>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 */
10
11#include <media/rc-map.h>
12
13/*
14 * Avermedia M733A with IR model RM-K6
15 * This is the stock remote controller used with Positivo machines with M733A
16 * Herton Ronaldo Krzesinski <herton@mandriva.com.br>
17 */
18
19static struct ir_scancode avermedia_m733a_rm_k6[] = {
20 { 0x0401, KEY_POWER2 },
21 { 0x0406, KEY_MUTE },
22 { 0x0408, KEY_MODE }, /* TV/FM */
23
24 { 0x0409, KEY_1 },
25 { 0x040a, KEY_2 },
26 { 0x040b, KEY_3 },
27 { 0x040c, KEY_4 },
28 { 0x040d, KEY_5 },
29 { 0x040e, KEY_6 },
30 { 0x040f, KEY_7 },
31 { 0x0410, KEY_8 },
32 { 0x0411, KEY_9 },
33 { 0x044c, KEY_DOT }, /* '.' */
34 { 0x0412, KEY_0 },
35 { 0x0407, KEY_REFRESH }, /* Refresh/Reload */
36
37 { 0x0413, KEY_AUDIO },
38 { 0x0440, KEY_SCREEN }, /* Full Screen toggle */
39 { 0x0441, KEY_HOME },
40 { 0x0442, KEY_BACK },
41 { 0x0447, KEY_UP },
42 { 0x0448, KEY_DOWN },
43 { 0x0449, KEY_LEFT },
44 { 0x044a, KEY_RIGHT },
45 { 0x044b, KEY_OK },
46 { 0x0404, KEY_VOLUMEUP },
47 { 0x0405, KEY_VOLUMEDOWN },
48 { 0x0402, KEY_CHANNELUP },
49 { 0x0403, KEY_CHANNELDOWN },
50
51 { 0x0443, KEY_RED },
52 { 0x0444, KEY_GREEN },
53 { 0x0445, KEY_YELLOW },
54 { 0x0446, KEY_BLUE },
55
56 { 0x0414, KEY_TEXT },
57 { 0x0415, KEY_EPG },
58 { 0x041a, KEY_TV2 }, /* PIP */
59 { 0x041b, KEY_MHP }, /* Snapshot */
60
61 { 0x0417, KEY_RECORD },
62 { 0x0416, KEY_PLAYPAUSE },
63 { 0x0418, KEY_STOP },
64 { 0x0419, KEY_PAUSE },
65
66 { 0x041f, KEY_PREVIOUS },
67 { 0x041c, KEY_REWIND },
68 { 0x041d, KEY_FORWARD },
69 { 0x041e, KEY_NEXT },
70};
71
72static struct rc_keymap avermedia_m733a_rm_k6_map = {
73 .map = {
74 .scan = avermedia_m733a_rm_k6,
75 .size = ARRAY_SIZE(avermedia_m733a_rm_k6),
76 .ir_type = IR_TYPE_NEC,
77 .name = RC_MAP_AVERMEDIA_M733A_RM_K6,
78 }
79};
80
81static int __init init_rc_map_avermedia_m733a_rm_k6(void)
82{
83 return ir_register_map(&avermedia_m733a_rm_k6_map);
84}
85
86static void __exit exit_rc_map_avermedia_m733a_rm_k6(void)
87{
88 ir_unregister_map(&avermedia_m733a_rm_k6_map);
89}
90
91module_init(init_rc_map_avermedia_m733a_rm_k6)
92module_exit(exit_rc_map_avermedia_m733a_rm_k6)
93
94MODULE_LICENSE("GPL");
95MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@redhat.com>");