diff options
author | Ingo Molnar <mingo@kernel.org> | 2012-05-30 10:59:04 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2012-05-30 10:59:04 +0200 |
commit | 063e04776172f93b16a5eefd5661a340c1126513 (patch) | |
tree | 19cb1623631c8cc5dcf0d91f4731feec7cbefa04 /drivers/media/rc | |
parent | 59cd358a7a5b2f6b61faa01dae6cfda3830ac62a (diff) | |
parent | 731a7378b81c2f5fa88ca1ae20b83d548d5613dc (diff) | |
download | blackbird-op-linux-063e04776172f93b16a5eefd5661a340c1126513.tar.gz blackbird-op-linux-063e04776172f93b16a5eefd5661a340c1126513.zip |
Merge branch 'linus' into perf/urgent
Merge back Linus's latest branch so that we pick up the uprobes changes.
( I tested this branch locally and while it's one from the middle of the
merge window it's a good one to base further work off. )
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'drivers/media/rc')
-rw-r--r-- | drivers/media/rc/Kconfig | 1 | ||||
-rw-r--r-- | drivers/media/rc/ati_remote.c | 146 | ||||
-rw-r--r-- | drivers/media/rc/fintek-cir.c | 13 | ||||
-rw-r--r-- | drivers/media/rc/imon.c | 2 | ||||
-rw-r--r-- | drivers/media/rc/ir-raw.c | 8 | ||||
-rw-r--r-- | drivers/media/rc/ir-sanyo-decoder.c | 4 | ||||
-rw-r--r-- | drivers/media/rc/ite-cir.c | 14 | ||||
-rw-r--r-- | drivers/media/rc/keymaps/Makefile | 3 | ||||
-rw-r--r-- | drivers/media/rc/keymaps/rc-asus-ps3-100.c | 91 | ||||
-rw-r--r-- | drivers/media/rc/keymaps/rc-it913x-v2.c | 2 | ||||
-rw-r--r-- | drivers/media/rc/keymaps/rc-medion-x10-digitainer.c | 123 | ||||
-rw-r--r-- | drivers/media/rc/keymaps/rc-medion-x10-or2x.c | 108 | ||||
-rw-r--r-- | drivers/media/rc/mceusb.c | 5 | ||||
-rw-r--r-- | drivers/media/rc/nuvoton-cir.c | 26 | ||||
-rw-r--r-- | drivers/media/rc/rc-loopback.c | 1 | ||||
-rw-r--r-- | drivers/media/rc/redrat3.c | 2 |
16 files changed, 469 insertions, 80 deletions
diff --git a/drivers/media/rc/Kconfig b/drivers/media/rc/Kconfig index a3fbb21350e9..f97eeb870455 100644 --- a/drivers/media/rc/Kconfig +++ b/drivers/media/rc/Kconfig @@ -69,6 +69,7 @@ config IR_JVC_DECODER config IR_SONY_DECODER tristate "Enable IR raw decoder for the Sony protocol" depends on RC_CORE + select BITREVERSE default y ---help--- diff --git a/drivers/media/rc/ati_remote.c b/drivers/media/rc/ati_remote.c index baf907b3ce76..7be377fc1be8 100644 --- a/drivers/media/rc/ati_remote.c +++ b/drivers/media/rc/ati_remote.c @@ -1,7 +1,7 @@ /* * USB ATI Remote support * - * Copyright (c) 2011 Anssi Hannula <anssi.hannula@iki.fi> + * Copyright (c) 2011, 2012 Anssi Hannula <anssi.hannula@iki.fi> * Version 2.2.0 Copyright (c) 2004 Torrey Hoffman <thoffman@arnor.net> * Version 2.1.1 Copyright (c) 2002 Vladimir Dergachev * @@ -151,13 +151,57 @@ MODULE_PARM_DESC(mouse, "Enable mouse device, default = yes"); #undef err #define err(format, arg...) printk(KERN_ERR format , ## arg) +struct ati_receiver_type { + /* either default_keymap or get_default_keymap should be set */ + const char *default_keymap; + const char *(*get_default_keymap)(struct usb_interface *interface); +}; + +static const char *get_medion_keymap(struct usb_interface *interface) +{ + struct usb_device *udev = interface_to_usbdev(interface); + + /* + * There are many different Medion remotes shipped with a receiver + * with the same usb id, but the receivers have subtle differences + * in the USB descriptors allowing us to detect them. + */ + + if (udev->manufacturer && udev->product) { + if (udev->actconfig->desc.bmAttributes & USB_CONFIG_ATT_WAKEUP) { + + if (!strcmp(udev->manufacturer, "X10 Wireless Technology Inc") + && !strcmp(udev->product, "USB Receiver")) + return RC_MAP_MEDION_X10_DIGITAINER; + + if (!strcmp(udev->manufacturer, "X10 WTI") + && !strcmp(udev->product, "RF receiver")) + return RC_MAP_MEDION_X10_OR2X; + } else { + + if (!strcmp(udev->manufacturer, "X10 Wireless Technology Inc") + && !strcmp(udev->product, "USB Receiver")) + return RC_MAP_MEDION_X10; + } + } + + dev_info(&interface->dev, + "Unknown Medion X10 receiver, using default ati_remote Medion keymap\n"); + + return RC_MAP_MEDION_X10; +} + +static const struct ati_receiver_type type_ati = { .default_keymap = RC_MAP_ATI_X10 }; +static const struct ati_receiver_type type_medion = { .get_default_keymap = get_medion_keymap }; +static const struct ati_receiver_type type_firefly = { .default_keymap = RC_MAP_SNAPSTREAM_FIREFLY }; + static struct usb_device_id ati_remote_table[] = { - { USB_DEVICE(ATI_REMOTE_VENDOR_ID, LOLA_REMOTE_PRODUCT_ID), .driver_info = (unsigned long)RC_MAP_ATI_X10 }, - { USB_DEVICE(ATI_REMOTE_VENDOR_ID, LOLA2_REMOTE_PRODUCT_ID), .driver_info = (unsigned long)RC_MAP_ATI_X10 }, - { USB_DEVICE(ATI_REMOTE_VENDOR_ID, ATI_REMOTE_PRODUCT_ID), .driver_info = (unsigned long)RC_MAP_ATI_X10 }, - { USB_DEVICE(ATI_REMOTE_VENDOR_ID, NVIDIA_REMOTE_PRODUCT_ID), .driver_info = (unsigned long)RC_MAP_ATI_X10 }, - { USB_DEVICE(ATI_REMOTE_VENDOR_ID, MEDION_REMOTE_PRODUCT_ID), .driver_info = (unsigned long)RC_MAP_MEDION_X10 }, - { USB_DEVICE(ATI_REMOTE_VENDOR_ID, FIREFLY_REMOTE_PRODUCT_ID), .driver_info = (unsigned long)RC_MAP_SNAPSTREAM_FIREFLY }, + { USB_DEVICE(ATI_REMOTE_VENDOR_ID, LOLA_REMOTE_PRODUCT_ID), .driver_info = (unsigned long)&type_ati }, + { USB_DEVICE(ATI_REMOTE_VENDOR_ID, LOLA2_REMOTE_PRODUCT_ID), .driver_info = (unsigned long)&type_ati }, + { USB_DEVICE(ATI_REMOTE_VENDOR_ID, ATI_REMOTE_PRODUCT_ID), .driver_info = (unsigned long)&type_ati }, + { USB_DEVICE(ATI_REMOTE_VENDOR_ID, NVIDIA_REMOTE_PRODUCT_ID), .driver_info = (unsigned long)&type_ati }, + { USB_DEVICE(ATI_REMOTE_VENDOR_ID, MEDION_REMOTE_PRODUCT_ID), .driver_info = (unsigned long)&type_medion }, + { USB_DEVICE(ATI_REMOTE_VENDOR_ID, FIREFLY_REMOTE_PRODUCT_ID), .driver_info = (unsigned long)&type_firefly }, {} /* Terminating entry */ }; @@ -445,6 +489,7 @@ static void ati_remote_input_report(struct urb *urb) int acc; int remote_num; unsigned char scancode; + u32 wheel_keycode = KEY_RESERVED; int i; /* @@ -484,26 +529,33 @@ static void ati_remote_input_report(struct urb *urb) */ scancode = data[2] & 0x7f; - /* Look up event code index in the mouse translation table. */ - for (i = 0; ati_remote_tbl[i].kind != KIND_END; i++) { - if (scancode == ati_remote_tbl[i].data) { - index = i; - break; + dbginfo(&ati_remote->interface->dev, + "channel 0x%02x; key data %02x, scancode %02x\n", + remote_num, data[2], scancode); + + if (scancode >= 0x70) { + /* + * This is either a mouse or scrollwheel event, depending on + * the remote/keymap. + * Get the keycode assigned to scancode 0x78/0x70. If it is + * set, assume this is a scrollwheel up/down event. + */ + wheel_keycode = rc_g_keycode_from_table(ati_remote->rdev, + scancode & 0x78); + + if (wheel_keycode == KEY_RESERVED) { + /* scrollwheel was not mapped, assume mouse */ + + /* Look up event code index in the mouse translation table. */ + for (i = 0; ati_remote_tbl[i].kind != KIND_END; i++) { + if (scancode == ati_remote_tbl[i].data) { + index = i; + break; + } + } } } - if (index >= 0) { - dbginfo(&ati_remote->interface->dev, - "channel 0x%02x; mouse data %02x; index %d; keycode %d\n", - remote_num, data[2], index, ati_remote_tbl[index].code); - if (!dev) - return; /* no mouse device */ - } else - dbginfo(&ati_remote->interface->dev, - "channel 0x%02x; key data %02x, scancode %02x\n", - remote_num, data[2], scancode); - - if (index >= 0 && ati_remote_tbl[index].kind == KIND_LITERAL) { input_event(dev, ati_remote_tbl[index].type, ati_remote_tbl[index].code, @@ -542,15 +594,29 @@ static void ati_remote_input_report(struct urb *urb) if (index < 0) { /* Not a mouse event, hand it to rc-core. */ - - /* - * We don't use the rc-core repeat handling yet as - * it would cause ghost repeats which would be a - * regression for this driver. - */ - rc_keydown_notimeout(ati_remote->rdev, scancode, - data[2]); - rc_keyup(ati_remote->rdev); + int count = 1; + + if (wheel_keycode != KEY_RESERVED) { + /* + * This is a scrollwheel event, send the + * scroll up (0x78) / down (0x70) scancode + * repeatedly as many times as indicated by + * rest of the scancode. + */ + count = (scancode & 0x07) + 1; + scancode &= 0x78; + } + + while (count--) { + /* + * We don't use the rc-core repeat handling yet as + * it would cause ghost repeats which would be a + * regression for this driver. + */ + rc_keydown_notimeout(ati_remote->rdev, scancode, + data[2]); + rc_keyup(ati_remote->rdev); + } return; } @@ -766,6 +832,7 @@ static int ati_remote_probe(struct usb_interface *interface, const struct usb_de struct usb_device *udev = interface_to_usbdev(interface); struct usb_host_interface *iface_host = interface->cur_altsetting; struct usb_endpoint_descriptor *endpoint_in, *endpoint_out; + struct ati_receiver_type *type = (struct ati_receiver_type *)id->driver_info; struct ati_remote *ati_remote; struct input_dev *input_dev; struct rc_dev *rc_dev; @@ -827,10 +894,15 @@ static int ati_remote_probe(struct usb_interface *interface, const struct usb_de snprintf(ati_remote->mouse_name, sizeof(ati_remote->mouse_name), "%s mouse", ati_remote->rc_name); - if (id->driver_info) - rc_dev->map_name = (const char *)id->driver_info; - else - rc_dev->map_name = RC_MAP_ATI_X10; + rc_dev->map_name = RC_MAP_ATI_X10; /* default map */ + + /* set default keymap according to receiver model */ + if (type) { + if (type->default_keymap) + rc_dev->map_name = type->default_keymap; + else if (type->get_default_keymap) + rc_dev->map_name = type->get_default_keymap(interface); + } ati_remote_rc_init(ati_remote); mutex_init(&ati_remote->open_mutex); diff --git a/drivers/media/rc/fintek-cir.c b/drivers/media/rc/fintek-cir.c index 4a3a238bcfbc..6aabf7ae3a31 100644 --- a/drivers/media/rc/fintek-cir.c +++ b/drivers/media/rc/fintek-cir.c @@ -556,11 +556,11 @@ static int fintek_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id if (request_irq(fintek->cir_irq, fintek_cir_isr, IRQF_SHARED, FINTEK_DRIVER_NAME, (void *)fintek)) - goto failure; + goto failure2; ret = rc_register_device(rdev); if (ret) - goto failure; + goto failure3; device_init_wakeup(&pdev->dev, true); fintek->rdev = rdev; @@ -570,12 +570,11 @@ static int fintek_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id return 0; +failure3: + free_irq(fintek->cir_irq, fintek); +failure2: + release_region(fintek->cir_addr, fintek->cir_port_len); failure: - if (fintek->cir_irq) - free_irq(fintek->cir_irq, fintek); - if (fintek->cir_addr) - release_region(fintek->cir_addr, fintek->cir_port_len); - rc_free_device(rdev); kfree(fintek); diff --git a/drivers/media/rc/imon.c b/drivers/media/rc/imon.c index 7f26fdf2e54e..5dd0386604f0 100644 --- a/drivers/media/rc/imon.c +++ b/drivers/media/rc/imon.c @@ -255,7 +255,7 @@ static struct usb_device_id imon_usb_id_table[] = { static struct usb_driver imon_driver = { .name = MOD_NAME, .probe = imon_probe, - .disconnect = imon_disconnect, + .disconnect = __devexit_p(imon_disconnect), .suspend = imon_suspend, .resume = imon_resume, .id_table = imon_usb_id_table, diff --git a/drivers/media/rc/ir-raw.c b/drivers/media/rc/ir-raw.c index 95e630998aaf..a82025121345 100644 --- a/drivers/media/rc/ir-raw.c +++ b/drivers/media/rc/ir-raw.c @@ -46,9 +46,9 @@ static int ir_raw_event_thread(void *data) while (!kthread_should_stop()) { spin_lock_irq(&raw->lock); - retval = kfifo_out(&raw->kfifo, &ev, sizeof(ev)); + retval = kfifo_len(&raw->kfifo); - if (!retval) { + if (retval < sizeof(ev)) { set_current_state(TASK_INTERRUPTIBLE); if (kthread_should_stop()) @@ -59,11 +59,9 @@ static int ir_raw_event_thread(void *data) continue; } + retval = kfifo_out(&raw->kfifo, &ev, sizeof(ev)); spin_unlock_irq(&raw->lock); - - BUG_ON(retval != sizeof(ev)); - mutex_lock(&ir_raw_handler_lock); list_for_each_entry(handler, &ir_raw_handler_list, list) handler->decode(raw->dev, ev); diff --git a/drivers/media/rc/ir-sanyo-decoder.c b/drivers/media/rc/ir-sanyo-decoder.c index d38fbdd0b25a..7e54ec57bcf9 100644 --- a/drivers/media/rc/ir-sanyo-decoder.c +++ b/drivers/media/rc/ir-sanyo-decoder.c @@ -56,7 +56,7 @@ static int ir_sanyo_decode(struct rc_dev *dev, struct ir_raw_event ev) { struct sanyo_dec *data = &dev->raw->sanyo; u32 scancode; - u8 address, not_address, command, not_command; + u8 address, command, not_command; if (!(dev->raw->enabled_protocols & RC_TYPE_SANYO)) return 0; @@ -154,7 +154,7 @@ static int ir_sanyo_decode(struct rc_dev *dev, struct ir_raw_event ev) break; address = bitrev16((data->bits >> 29) & 0x1fff) >> 3; - not_address = bitrev16((data->bits >> 16) & 0x1fff) >> 3; + /* not_address = bitrev16((data->bits >> 16) & 0x1fff) >> 3; */ command = bitrev8((data->bits >> 8) & 0xff); not_command = bitrev8((data->bits >> 0) & 0xff); diff --git a/drivers/media/rc/ite-cir.c b/drivers/media/rc/ite-cir.c index 0e49c99abf68..36fe5a349b95 100644 --- a/drivers/media/rc/ite-cir.c +++ b/drivers/media/rc/ite-cir.c @@ -1598,24 +1598,22 @@ static int ite_probe(struct pnp_dev *pdev, const struct pnp_device_id if (request_irq(itdev->cir_irq, ite_cir_isr, IRQF_SHARED, ITE_DRIVER_NAME, (void *)itdev)) - goto failure; + goto failure2; ret = rc_register_device(rdev); if (ret) - goto failure; + goto failure3; itdev->rdev = rdev; ite_pr(KERN_NOTICE, "driver has been successfully loaded\n"); return 0; +failure3: + free_irq(itdev->cir_irq, itdev); +failure2: + release_region(itdev->cir_addr, itdev->params.io_region_size); failure: - if (itdev->cir_irq) - free_irq(itdev->cir_irq, itdev); - - if (itdev->cir_addr) - release_region(itdev->cir_addr, itdev->params.io_region_size); - rc_free_device(rdev); kfree(itdev); diff --git a/drivers/media/rc/keymaps/Makefile b/drivers/media/rc/keymaps/Makefile index 49ce2662f56b..ab84d66c67c1 100644 --- a/drivers/media/rc/keymaps/Makefile +++ b/drivers/media/rc/keymaps/Makefile @@ -3,6 +3,7 @@ obj-$(CONFIG_RC_MAP) += rc-adstech-dvb-t-pci.o \ rc-anysee.o \ rc-apac-viewcomp.o \ rc-asus-pc39.o \ + rc-asus-ps3-100.o \ rc-ati-tv-wonder-hd-600.o \ rc-ati-x10.o \ rc-avermedia-a16d.o \ @@ -52,6 +53,8 @@ obj-$(CONFIG_RC_MAP) += rc-adstech-dvb-t-pci.o \ rc-lme2510.o \ rc-manli.o \ rc-medion-x10.o \ + rc-medion-x10-digitainer.o \ + rc-medion-x10-or2x.o \ rc-msi-digivox-ii.o \ rc-msi-digivox-iii.o \ rc-msi-tvanywhere.o \ diff --git a/drivers/media/rc/keymaps/rc-asus-ps3-100.c b/drivers/media/rc/keymaps/rc-asus-ps3-100.c new file mode 100644 index 000000000000..ba76609c5936 --- /dev/null +++ b/drivers/media/rc/keymaps/rc-asus-ps3-100.c @@ -0,0 +1,91 @@ +/* asus-ps3-100.h - Keytable for asus_ps3_100 Remote Controller + * + * Copyright (c) 2012 by Mauro Carvalho Chehab <mchehab@redhat.com> + * + * Based on a previous patch from Remi Schwartz <remi.schwartz@gmail.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + */ + +#include <media/rc-map.h> +#include <linux/module.h> + +static struct rc_map_table asus_ps3_100[] = { + { 0x081c, KEY_HOME }, /* home */ + { 0x081e, KEY_TV }, /* tv */ + { 0x0803, KEY_TEXT }, /* teletext */ + { 0x0829, KEY_POWER }, /* close */ + + { 0x080b, KEY_RED }, /* red */ + { 0x080d, KEY_YELLOW }, /* yellow */ + { 0x0806, KEY_BLUE }, /* blue */ + { 0x0807, KEY_GREEN }, /* green */ + + /* Keys 0 to 9 */ + { 0x082a, KEY_0 }, + { 0x0816, KEY_1 }, + { 0x0812, KEY_2 }, + { 0x0814, KEY_3 }, + { 0x0836, KEY_4 }, + { 0x0832, KEY_5 }, + { 0x0834, KEY_6 }, + { 0x080e, KEY_7 }, + { 0x080a, KEY_8 }, + { 0x080c, KEY_9 }, + + { 0x0815, KEY_VOLUMEUP }, + { 0x0826, KEY_VOLUMEDOWN }, + { 0x0835, KEY_CHANNELUP }, /* channel / program + */ + { 0x0824, KEY_CHANNELDOWN }, /* channel / program - */ + + { 0x0808, KEY_UP }, + { 0x0804, KEY_DOWN }, + { 0x0818, KEY_LEFT }, + { 0x0810, KEY_RIGHT }, + { 0x0825, KEY_ENTER }, /* enter */ + + { 0x0822, KEY_EXIT }, /* back */ + { 0x082c, KEY_AB }, /* recall */ + + { 0x0820, KEY_AUDIO }, /* TV audio */ + { 0x0837, KEY_SCREEN }, /* snapshot */ + { 0x082e, KEY_ZOOM }, /* full screen */ + { 0x0802, KEY_MUTE }, /* mute */ + + { 0x0831, KEY_REWIND }, /* backward << */ + { 0x0811, KEY_RECORD }, /* recording */ + { 0x0809, KEY_STOP }, + { 0x0805, KEY_FASTFORWARD }, /* forward >> */ + { 0x0821, KEY_PREVIOUS }, /* rew */ + { 0x081a, KEY_PAUSE }, /* pause */ + { 0x0839, KEY_PLAY }, /* play */ + { 0x0819, KEY_NEXT }, /* forward */ +}; + +static struct rc_map_list asus_ps3_100_map = { +.map = { + .scan = asus_ps3_100, + .size = ARRAY_SIZE(asus_ps3_100), + .rc_type = RC_TYPE_RC5, + .name = RC_MAP_ASUS_PS3_100, +} +}; + +static int __init init_rc_map_asus_ps3_100(void) +{ +return rc_map_register(&asus_ps3_100_map); +} + +static void __exit exit_rc_map_asus_ps3_100(void) +{ +rc_map_unregister(&asus_ps3_100_map); +} + +module_init(init_rc_map_asus_ps3_100) +module_exit(exit_rc_map_asus_ps3_100) + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@redhat.com>"); diff --git a/drivers/media/rc/keymaps/rc-it913x-v2.c b/drivers/media/rc/keymaps/rc-it913x-v2.c index 28e376e18b99..bd42a30ec06f 100644 --- a/drivers/media/rc/keymaps/rc-it913x-v2.c +++ b/drivers/media/rc/keymaps/rc-it913x-v2.c @@ -40,7 +40,7 @@ static struct rc_map_table it913x_v2_rc[] = { /* Type 2 */ /* keys stereo, snapshot unassigned */ { 0x866b00, KEY_0 }, - { 0x866b1b, KEY_1 }, + { 0x866b01, KEY_1 }, { 0x866b02, KEY_2 }, { 0x866b03, KEY_3 }, { 0x866b04, KEY_4 }, diff --git a/drivers/media/rc/keymaps/rc-medion-x10-digitainer.c b/drivers/media/rc/keymaps/rc-medion-x10-digitainer.c new file mode 100644 index 000000000000..966f9b3c71da --- /dev/null +++ b/drivers/media/rc/keymaps/rc-medion-x10-digitainer.c @@ -0,0 +1,123 @@ +/* + * Medion X10 RF remote keytable (Digitainer variant) + * + * Copyright (C) 2012 Anssi Hannula <anssi.hannula@iki.fi> + * + * This keymap is for a variant that has a distinctive scrollwheel instead of + * up/down buttons (tested with P/N 40009936 / 20018268), reportedly + * originally shipped with Medion Digitainer but now sold separately simply as + * an "X10" remote. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include <linux/module.h> +#include <media/rc-map.h> + +static struct rc_map_table medion_x10_digitainer[] = { + { 0x02, KEY_POWER }, + + { 0x2c, KEY_TV }, + { 0x2d, KEY_VIDEO }, + { 0x04, KEY_DVD }, /* CD/DVD */ + { 0x16, KEY_TEXT }, /* "teletext" icon, i.e. a screen with lines */ + { 0x06, KEY_AUDIO }, + { 0x2e, KEY_RADIO }, + { 0x31, KEY_EPG }, /* a screen with an open book */ + { 0x05, KEY_IMAGES }, /* Photo */ + { 0x2f, KEY_INFO }, + + { 0x78, KEY_UP }, /* scrollwheel up 1 notch */ + /* 0x79..0x7f: 2-8 notches, driver repeats 0x78 entry */ + + { 0x70, KEY_DOWN }, /* scrollwheel down 1 notch */ + /* 0x71..0x77: 2-8 notches, driver repeats 0x70 entry */ + + { 0x19, KEY_MENU }, + { 0x1d, KEY_LEFT }, + { 0x1e, KEY_OK }, /* scrollwheel press */ + { 0x1f, KEY_RIGHT }, + { 0x20, KEY_BACK }, + + { 0x09, KEY_VOLUMEUP }, + { 0x08, KEY_VOLUMEDOWN }, + { 0x00, KEY_MUTE }, + + { 0x1b, KEY_SELECT }, /* also has "U" rotated 90 degrees CCW */ + + { 0x0b, KEY_CHANNELUP }, + { 0x0c, KEY_CHANNELDOWN }, + { 0x1c, KEY_LAST }, + + { 0x32, KEY_RED }, /* also Audio */ + { 0x33, KEY_GREEN }, /* also Subtitle */ + { 0x34, KEY_YELLOW }, /* also Angle */ + { 0x35, KEY_BLUE }, /* also Title */ + + { 0x28, KEY_STOP }, + { 0x29, KEY_PAUSE }, + { 0x25, KEY_PLAY }, + { 0x21, KEY_PREVIOUS }, + { 0x18, KEY_CAMERA }, + { 0x23, KEY_NEXT }, + { 0x24, KEY_REWIND }, + { 0x27, KEY_RECORD }, + { 0x26, KEY_FORWARD }, + + { 0x0d, KEY_1 }, + { 0x0e, KEY_2 }, + { 0x0f, KEY_3 }, + { 0x10, KEY_4 }, + { 0x11, KEY_5 }, + { 0x12, KEY_6 }, + { 0x13, KEY_7 }, + { 0x14, KEY_8 }, + { 0x15, KEY_9 }, + { 0x17, KEY_0 }, + + /* these do not actually exist on this remote, but these scancodes + * exist on all other Medion X10 remotes and adding them here allows + * such remotes to be adequately usable with this keymap in case + * this keymap is wrongly used with them (which is quite possible as + * there are lots of different Medion X10 remotes): */ + { 0x1a, KEY_UP }, + { 0x22, KEY_DOWN }, +}; + +static struct rc_map_list medion_x10_digitainer_map = { + .map = { + .scan = medion_x10_digitainer, + .size = ARRAY_SIZE(medion_x10_digitainer), + .rc_type = RC_TYPE_OTHER, + .name = RC_MAP_MEDION_X10_DIGITAINER, + } +}; + +static int __init init_rc_map_medion_x10_digitainer(void) +{ + return rc_map_register(&medion_x10_digitainer_map); +} + +static void __exit exit_rc_map_medion_x10_digitainer(void) +{ + rc_map_unregister(&medion_x10_digitainer_map); +} + +module_init(init_rc_map_medion_x10_digitainer) +module_exit(exit_rc_map_medion_x10_digitainer) + +MODULE_DESCRIPTION("Medion X10 RF remote keytable (Digitainer variant)"); +MODULE_AUTHOR("Anssi Hannula <anssi.hannula@iki.fi>"); +MODULE_LICENSE("GPL"); diff --git a/drivers/media/rc/keymaps/rc-medion-x10-or2x.c b/drivers/media/rc/keymaps/rc-medion-x10-or2x.c new file mode 100644 index 000000000000..b077300ecb5c --- /dev/null +++ b/drivers/media/rc/keymaps/rc-medion-x10-or2x.c @@ -0,0 +1,108 @@ +/* + * Medion X10 OR22/OR24 RF remote keytable + * + * Copyright (C) 2012 Anssi Hannula <anssi.hannula@iki.fi> + * + * This keymap is for several Medion X10 remotes that have the Windows MCE + * button. This has been tested with a "RF VISTA Remote Control", OR24V, + * P/N 20035335, but should work with other variants that have the same + * buttons, such as OR22V and OR24E. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include <linux/module.h> +#include <media/rc-map.h> + +static struct rc_map_table medion_x10_or2x[] = { + { 0x02, KEY_POWER }, + { 0x16, KEY_TEXT }, /* "T" in a box, for teletext */ + + { 0x09, KEY_VOLUMEUP }, + { 0x08, KEY_VOLUMEDOWN }, + { 0x00, KEY_MUTE }, + { 0x0b, KEY_CHANNELUP }, + { 0x0c, KEY_CHANNELDOWN }, + + { 0x32, KEY_RED }, + { 0x33, KEY_GREEN }, + { 0x34, KEY_YELLOW }, + { 0x35, KEY_BLUE }, + + { 0x18, KEY_PVR }, /* record symbol inside a tv symbol */ + { 0x04, KEY_DVD }, /* disc symbol */ + { 0x31, KEY_EPG }, /* a tv schedule symbol */ + { 0x1c, KEY_TV }, /* play symbol inside a tv symbol */ + { 0x20, KEY_BACK }, + { 0x2f, KEY_INFO }, + + { 0x1a, KEY_UP }, + { 0x22, KEY_DOWN }, + { 0x1d, KEY_LEFT }, + { 0x1f, KEY_RIGHT }, + { 0x1e, KEY_OK }, + + { 0x1b, KEY_MEDIA }, /* Windows MCE button */ + + { 0x21, KEY_PREVIOUS }, + { 0x23, KEY_NEXT }, + { 0x24, KEY_REWIND }, + { 0x26, KEY_FORWARD }, + { 0x25, KEY_PLAY }, + { 0x28, KEY_STOP }, + { 0x29, KEY_PAUSE }, + { 0x27, KEY_RECORD }, + + { 0x0d, KEY_1 }, + { 0x0e, KEY_2 }, + { 0x0f, KEY_3 }, + { 0x10, KEY_4 }, + { 0x11, KEY_5 }, + { 0x12, KEY_6 }, + { 0x13, KEY_7 }, + { 0x14, KEY_8 }, + { 0x15, KEY_9 }, + { 0x17, KEY_0 }, + { 0x30, KEY_CLEAR }, + { 0x36, KEY_ENTER }, + { 0x37, KEY_NUMERIC_STAR }, + { 0x38, KEY_NUMERIC_POUND }, +}; + +static struct rc_map_list medion_x10_or2x_map = { + .map = { + .scan = medion_x10_or2x, + .size = ARRAY_SIZE(medion_x10_or2x), + .rc_type = RC_TYPE_OTHER, + .name = RC_MAP_MEDION_X10_OR2X, + } +}; + +static int __init init_rc_map_medion_x10_or2x(void) +{ + return rc_map_register(&medion_x10_or2x_map); +} + +static void __exit exit_rc_map_medion_x10_or2x(void) +{ + rc_map_unregister(&medion_x10_or2x_map); +} + +module_init(init_rc_map_medion_x10_or2x) +module_exit(exit_rc_map_medion_x10_or2x) + +MODULE_DESCRIPTION("Medion X10 OR22/OR24 RF remote keytable"); +MODULE_AUTHOR("Anssi Hannula <anssi.hannula@iki.fi>"); +MODULE_LICENSE("GPL"); diff --git a/drivers/media/rc/mceusb.c b/drivers/media/rc/mceusb.c index e150a2e29a4b..84e06d3aa696 100644 --- a/drivers/media/rc/mceusb.c +++ b/drivers/media/rc/mceusb.c @@ -520,7 +520,7 @@ static void mceusb_dev_printdata(struct mceusb_dev *ir, char *buf, { char codes[USB_BUFLEN * 3 + 1]; char inout[9]; - u8 cmd, subcmd, data1, data2, data3, data4, data5; + u8 cmd, subcmd, data1, data2, data3, data4; struct device *dev = ir->dev; int i, start, skip = 0; u32 carrier, period; @@ -553,7 +553,6 @@ static void mceusb_dev_printdata(struct mceusb_dev *ir, char *buf, data2 = buf[start + 3] & 0xff; data3 = buf[start + 4] & 0xff; data4 = buf[start + 5] & 0xff; - data5 = buf[start + 6] & 0xff; switch (cmd) { case MCE_CMD_NULL: @@ -1443,7 +1442,7 @@ static int mceusb_dev_resume(struct usb_interface *intf) static struct usb_driver mceusb_dev_driver = { .name = DRIVER_NAME, .probe = mceusb_dev_probe, - .disconnect = mceusb_dev_disconnect, + .disconnect = __devexit_p(mceusb_dev_disconnect), .suspend = mceusb_dev_suspend, .resume = mceusb_dev_resume, .reset_resume = mceusb_dev_resume, diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c index 8b2c071ac0ab..dc8a7dddccd4 100644 --- a/drivers/media/rc/nuvoton-cir.c +++ b/drivers/media/rc/nuvoton-cir.c @@ -1075,19 +1075,19 @@ static int nvt_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id) if (request_irq(nvt->cir_irq, nvt_cir_isr, IRQF_SHARED, NVT_DRIVER_NAME, (void *)nvt)) - goto failure; + goto failure2; if (!request_region(nvt->cir_wake_addr, CIR_IOREG_LENGTH, NVT_DRIVER_NAME)) - goto failure; + goto failure3; if (request_irq(nvt->cir_wake_irq, nvt_cir_wake_isr, IRQF_SHARED, NVT_DRIVER_NAME, (void *)nvt)) - goto failure; + goto failure4; ret = rc_register_device(rdev); if (ret) - goto failure; + goto failure5; device_init_wakeup(&pdev->dev, true); nvt->rdev = rdev; @@ -1099,17 +1099,15 @@ static int nvt_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id) return 0; +failure5: + free_irq(nvt->cir_wake_irq, nvt); +failure4: + release_region(nvt->cir_wake_addr, CIR_IOREG_LENGTH); +failure3: + free_irq(nvt->cir_irq, nvt); +failure2: + release_region(nvt->cir_addr, CIR_IOREG_LENGTH); failure: - if (nvt->cir_irq) - free_irq(nvt->cir_irq, nvt); - if (nvt->cir_addr) - release_region(nvt->cir_addr, CIR_IOREG_LENGTH); - - if (nvt->cir_wake_irq) - free_irq(nvt->cir_wake_irq, nvt); - if (nvt->cir_wake_addr) - release_region(nvt->cir_wake_addr, CIR_IOREG_LENGTH); - rc_free_device(rdev); kfree(nvt); diff --git a/drivers/media/rc/rc-loopback.c b/drivers/media/rc/rc-loopback.c index efc6a514348a..fae1615e0ff2 100644 --- a/drivers/media/rc/rc-loopback.c +++ b/drivers/media/rc/rc-loopback.c @@ -221,7 +221,6 @@ static int __init loop_init(void) rc->s_idle = loop_set_idle; rc->s_learning_mode = loop_set_learning_mode; rc->s_carrier_report = loop_set_carrier_report; - rc->priv = &loopdev; loopdev.txmask = RXMASK_REGULAR; loopdev.txcarrier = 36000; diff --git a/drivers/media/rc/redrat3.c b/drivers/media/rc/redrat3.c index ad95c67a4dba..2878b0ed9741 100644 --- a/drivers/media/rc/redrat3.c +++ b/drivers/media/rc/redrat3.c @@ -1277,7 +1277,7 @@ static int redrat3_dev_resume(struct usb_interface *intf) static struct usb_driver redrat3_dev_driver = { .name = DRIVER_NAME, .probe = redrat3_dev_probe, - .disconnect = redrat3_dev_disconnect, + .disconnect = __devexit_p(redrat3_dev_disconnect), .suspend = redrat3_dev_suspend, .resume = redrat3_dev_resume, .reset_resume = redrat3_dev_resume, |