diff options
Diffstat (limited to 'drivers/media/rc')
-rw-r--r-- | drivers/media/rc/Kconfig | 9 | ||||
-rw-r--r-- | drivers/media/rc/Makefile | 1 | ||||
-rw-r--r-- | drivers/media/rc/fintek-cir.c | 26 | ||||
-rw-r--r-- | drivers/media/rc/fintek-cir.h | 4 | ||||
-rw-r--r-- | drivers/media/rc/gpio-ir-recv.c | 205 | ||||
-rw-r--r-- | drivers/media/rc/ir-sony-decoder.c | 2 | ||||
-rw-r--r-- | drivers/media/rc/keymaps/Makefile | 3 | ||||
-rw-r--r-- | drivers/media/rc/keymaps/rc-it913x-v1.c | 95 | ||||
-rw-r--r-- | drivers/media/rc/keymaps/rc-it913x-v2.c | 94 | ||||
-rw-r--r-- | drivers/media/rc/keymaps/rc-kworld-pc150u.c | 102 | ||||
-rw-r--r-- | drivers/media/rc/keymaps/rc-nec-terratec-cinergy-xs.c | 52 | ||||
-rw-r--r-- | drivers/media/rc/mceusb.c | 2 | ||||
-rw-r--r-- | drivers/media/rc/rc-core-priv.h | 2 | ||||
-rw-r--r-- | drivers/media/rc/rc-main.c | 9 |
14 files changed, 593 insertions, 13 deletions
diff --git a/drivers/media/rc/Kconfig b/drivers/media/rc/Kconfig index 4df4affeea5..a3fbb21350e 100644 --- a/drivers/media/rc/Kconfig +++ b/drivers/media/rc/Kconfig @@ -266,4 +266,13 @@ config RC_LOOPBACK To compile this driver as a module, choose M here: the module will be called rc_loopback. +config IR_GPIO_CIR + tristate "GPIO IR remote control" + depends on RC_CORE + ---help--- + Say Y if you want to use GPIO based IR Receiver. + + To compile this driver as a module, choose M here: the module will + be called gpio-ir-recv. + endif #RC_CORE diff --git a/drivers/media/rc/Makefile b/drivers/media/rc/Makefile index fb3dee2dd84..29f364f88a9 100644 --- a/drivers/media/rc/Makefile +++ b/drivers/media/rc/Makefile @@ -26,3 +26,4 @@ obj-$(CONFIG_IR_REDRAT3) += redrat3.o obj-$(CONFIG_IR_STREAMZAP) += streamzap.o obj-$(CONFIG_IR_WINBOND_CIR) += winbond-cir.o obj-$(CONFIG_RC_LOOPBACK) += rc-loopback.o +obj-$(CONFIG_IR_GPIO_CIR) += gpio-ir-recv.o diff --git a/drivers/media/rc/fintek-cir.c b/drivers/media/rc/fintek-cir.c index 7f7079b12f2..392d4be91f8 100644 --- a/drivers/media/rc/fintek-cir.c +++ b/drivers/media/rc/fintek-cir.c @@ -117,7 +117,7 @@ static u8 fintek_cir_reg_read(struct fintek_dev *fintek, u8 offset) static void cir_dump_regs(struct fintek_dev *fintek) { fintek_config_mode_enable(fintek); - fintek_select_logical_dev(fintek, LOGICAL_DEV_CIR); + fintek_select_logical_dev(fintek, fintek->logical_dev_cir); pr_reg("%s: Dump CIR logical device registers:\n", FINTEK_DRIVER_NAME); pr_reg(" * CR CIR BASE ADDR: 0x%x\n", @@ -143,7 +143,7 @@ static int fintek_hw_detect(struct fintek_dev *fintek) u8 chip_major, chip_minor; u8 vendor_major, vendor_minor; u8 portsel, ir_class; - u16 vendor; + u16 vendor, chip; int ret = 0; fintek_config_mode_enable(fintek); @@ -176,6 +176,7 @@ static int fintek_hw_detect(struct fintek_dev *fintek) chip_major = fintek_cr_read(fintek, GCR_CHIP_ID_HI); chip_minor = fintek_cr_read(fintek, GCR_CHIP_ID_LO); + chip = chip_major << 8 | chip_minor; vendor_major = fintek_cr_read(fintek, GCR_VENDOR_ID_HI); vendor_minor = fintek_cr_read(fintek, GCR_VENDOR_ID_LO); @@ -192,6 +193,15 @@ static int fintek_hw_detect(struct fintek_dev *fintek) fintek->chip_major = chip_major; fintek->chip_minor = chip_minor; fintek->chip_vendor = vendor; + + /* + * Newer reviews of this chipset uses port 8 instead of 5 + */ + if ((chip != 0x0408) || (chip != 0x0804)) + fintek->logical_dev_cir = LOGICAL_DEV_CIR_REV2; + else + fintek->logical_dev_cir = LOGICAL_DEV_CIR_REV1; + spin_unlock_irqrestore(&fintek->fintek_lock, flags); return ret; @@ -200,7 +210,7 @@ static int fintek_hw_detect(struct fintek_dev *fintek) static void fintek_cir_ldev_init(struct fintek_dev *fintek) { /* Select CIR logical device and enable */ - fintek_select_logical_dev(fintek, LOGICAL_DEV_CIR); + fintek_select_logical_dev(fintek, fintek->logical_dev_cir); fintek_cr_write(fintek, LOGICAL_DEV_ENABLE, CIR_CR_DEV_EN); /* Write allocated CIR address and IRQ information to hardware */ @@ -381,7 +391,7 @@ static irqreturn_t fintek_cir_isr(int irq, void *data) fit_dbg_verbose("%s firing", __func__); fintek_config_mode_enable(fintek); - fintek_select_logical_dev(fintek, LOGICAL_DEV_CIR); + fintek_select_logical_dev(fintek, fintek->logical_dev_cir); fintek_config_mode_disable(fintek); /* @@ -422,7 +432,7 @@ static void fintek_enable_cir(struct fintek_dev *fintek) fintek_config_mode_enable(fintek); /* enable the CIR logical device */ - fintek_select_logical_dev(fintek, LOGICAL_DEV_CIR); + fintek_select_logical_dev(fintek, fintek->logical_dev_cir); fintek_cr_write(fintek, LOGICAL_DEV_ENABLE, CIR_CR_DEV_EN); fintek_config_mode_disable(fintek); @@ -439,7 +449,7 @@ static void fintek_disable_cir(struct fintek_dev *fintek) fintek_config_mode_enable(fintek); /* disable the CIR logical device */ - fintek_select_logical_dev(fintek, LOGICAL_DEV_CIR); + fintek_select_logical_dev(fintek, fintek->logical_dev_cir); fintek_cr_write(fintek, LOGICAL_DEV_DISABLE, CIR_CR_DEV_EN); fintek_config_mode_disable(fintek); @@ -611,7 +621,7 @@ static int fintek_suspend(struct pnp_dev *pdev, pm_message_t state) fintek_config_mode_enable(fintek); /* disable cir logical dev */ - fintek_select_logical_dev(fintek, LOGICAL_DEV_CIR); + fintek_select_logical_dev(fintek, fintek->logical_dev_cir); fintek_cr_write(fintek, LOGICAL_DEV_DISABLE, CIR_CR_DEV_EN); fintek_config_mode_disable(fintek); @@ -634,7 +644,7 @@ static int fintek_resume(struct pnp_dev *pdev) /* Enable CIR logical device */ fintek_config_mode_enable(fintek); - fintek_select_logical_dev(fintek, LOGICAL_DEV_CIR); + fintek_select_logical_dev(fintek, fintek->logical_dev_cir); fintek_cr_write(fintek, LOGICAL_DEV_ENABLE, CIR_CR_DEV_EN); fintek_config_mode_disable(fintek); diff --git a/drivers/media/rc/fintek-cir.h b/drivers/media/rc/fintek-cir.h index 1b10b2011f5..82516a1d39b 100644 --- a/drivers/media/rc/fintek-cir.h +++ b/drivers/media/rc/fintek-cir.h @@ -88,6 +88,7 @@ struct fintek_dev { u8 chip_major; u8 chip_minor; u16 chip_vendor; + u8 logical_dev_cir; /* hardware features */ bool hw_learning_capable; @@ -172,7 +173,8 @@ struct fintek_dev { #define LOGICAL_DEV_ENABLE 0x01 /* Logical device number of the CIR function */ -#define LOGICAL_DEV_CIR 0x05 +#define LOGICAL_DEV_CIR_REV1 0x05 +#define LOGICAL_DEV_CIR_REV2 0x08 /* CIR Logical Device (LDN 0x08) config registers */ #define CIR_CR_COMMAND_INDEX 0x04 diff --git a/drivers/media/rc/gpio-ir-recv.c b/drivers/media/rc/gpio-ir-recv.c new file mode 100644 index 00000000000..0d875450c5c --- /dev/null +++ b/drivers/media/rc/gpio-ir-recv.c @@ -0,0 +1,205 @@ +/* Copyright (c) 2012, Code Aurora Forum. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 and + * only version 2 as published by the Free Software Foundation. + * + * 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. + */ + +#include <linux/kernel.h> +#include <linux/init.h> +#include <linux/module.h> +#include <linux/interrupt.h> +#include <linux/gpio.h> +#include <linux/slab.h> +#include <linux/platform_device.h> +#include <linux/irq.h> +#include <media/rc-core.h> +#include <media/gpio-ir-recv.h> + +#define GPIO_IR_DRIVER_NAME "gpio-rc-recv" +#define GPIO_IR_DEVICE_NAME "gpio_ir_recv" + +struct gpio_rc_dev { + struct rc_dev *rcdev; + int gpio_nr; + bool active_low; +}; + +static irqreturn_t gpio_ir_recv_irq(int irq, void *dev_id) +{ + struct gpio_rc_dev *gpio_dev = dev_id; + int gval; + int rc = 0; + enum raw_event_type type = IR_SPACE; + + gval = gpio_get_value_cansleep(gpio_dev->gpio_nr); + + if (gval < 0) + goto err_get_value; + + if (gpio_dev->active_low) + gval = !gval; + + if (gval == 1) + type = IR_PULSE; + + rc = ir_raw_event_store_edge(gpio_dev->rcdev, type); + if (rc < 0) + goto err_get_value; + + ir_raw_event_handle(gpio_dev->rcdev); + +err_get_value: + return IRQ_HANDLED; +} + +static int __devinit gpio_ir_recv_probe(struct platform_device *pdev) +{ + struct gpio_rc_dev *gpio_dev; + struct rc_dev *rcdev; + const struct gpio_ir_recv_platform_data *pdata = + pdev->dev.platform_data; + int rc; + + if (!pdata) + return -EINVAL; + + if (pdata->gpio_nr < 0) + return -EINVAL; + + gpio_dev = kzalloc(sizeof(struct gpio_rc_dev), GFP_KERNEL); + if (!gpio_dev) + return -ENOMEM; + + rcdev = rc_allocate_device(); + if (!rcdev) { + rc = -ENOMEM; + goto err_allocate_device; + } + + rcdev->driver_type = RC_DRIVER_IR_RAW; + rcdev->allowed_protos = RC_TYPE_ALL; + rcdev->input_name = GPIO_IR_DEVICE_NAME; + rcdev->input_id.bustype = BUS_HOST; + rcdev->driver_name = GPIO_IR_DRIVER_NAME; + rcdev->map_name = RC_MAP_EMPTY; + + gpio_dev->rcdev = rcdev; + gpio_dev->gpio_nr = pdata->gpio_nr; + gpio_dev->active_low = pdata->active_low; + + rc = gpio_request(pdata->gpio_nr, "gpio-ir-recv"); + if (rc < 0) + goto err_gpio_request; + rc = gpio_direction_input(pdata->gpio_nr); + if (rc < 0) + goto err_gpio_direction_input; + + rc = rc_register_device(rcdev); + if (rc < 0) { + dev_err(&pdev->dev, "failed to register rc device\n"); + goto err_register_rc_device; + } + + platform_set_drvdata(pdev, gpio_dev); + + rc = request_any_context_irq(gpio_to_irq(pdata->gpio_nr), + gpio_ir_recv_irq, + IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING, + "gpio-ir-recv-irq", gpio_dev); + if (rc < 0) + goto err_request_irq; + + return 0; + +err_request_irq: + platform_set_drvdata(pdev, NULL); + rc_unregister_device(rcdev); +err_register_rc_device: +err_gpio_direction_input: + gpio_free(pdata->gpio_nr); +err_gpio_request: + rc_free_device(rcdev); + rcdev = NULL; +err_allocate_device: + kfree(gpio_dev); + return rc; +} + +static int __devexit gpio_ir_recv_remove(struct platform_device *pdev) +{ + struct gpio_rc_dev *gpio_dev = platform_get_drvdata(pdev); + + free_irq(gpio_to_irq(gpio_dev->gpio_nr), gpio_dev); + platform_set_drvdata(pdev, NULL); + rc_unregister_device(gpio_dev->rcdev); + gpio_free(gpio_dev->gpio_nr); + rc_free_device(gpio_dev->rcdev); + kfree(gpio_dev); + return 0; +} + +#ifdef CONFIG_PM +static int gpio_ir_recv_suspend(struct device *dev) +{ + struct platform_device *pdev = to_platform_device(dev); + struct gpio_rc_dev *gpio_dev = platform_get_drvdata(pdev); + + if (device_may_wakeup(dev)) + enable_irq_wake(gpio_to_irq(gpio_dev->gpio_nr)); + else + disable_irq(gpio_to_irq(gpio_dev->gpio_nr)); + + return 0; +} + +static int gpio_ir_recv_resume(struct device *dev) +{ + struct platform_device *pdev = to_platform_device(dev); + struct gpio_rc_dev *gpio_dev = platform_get_drvdata(pdev); + + if (device_may_wakeup(dev)) + disable_irq_wake(gpio_to_irq(gpio_dev->gpio_nr)); + else + enable_irq(gpio_to_irq(gpio_dev->gpio_nr)); + + return 0; +} + +static const struct dev_pm_ops gpio_ir_recv_pm_ops = { + .suspend = gpio_ir_recv_suspend, + .resume = gpio_ir_recv_resume, +}; +#endif + +static struct platform_driver gpio_ir_recv_driver = { + .probe = gpio_ir_recv_probe, + .remove = __devexit_p(gpio_ir_recv_remove), + .driver = { + .name = GPIO_IR_DRIVER_NAME, + .owner = THIS_MODULE, +#ifdef CONFIG_PM + .pm = &gpio_ir_recv_pm_ops, +#endif + }, +}; + +static int __init gpio_ir_recv_init(void) +{ + return platform_driver_register(&gpio_ir_recv_driver); +} +module_init(gpio_ir_recv_init); + +static void __exit gpio_ir_recv_exit(void) +{ + platform_driver_unregister(&gpio_ir_recv_driver); +} +module_exit(gpio_ir_recv_exit); + +MODULE_DESCRIPTION("GPIO IR Receiver driver"); +MODULE_LICENSE("GPL v2"); diff --git a/drivers/media/rc/ir-sony-decoder.c b/drivers/media/rc/ir-sony-decoder.c index d5e2b50aff1..dab98b37621 100644 --- a/drivers/media/rc/ir-sony-decoder.c +++ b/drivers/media/rc/ir-sony-decoder.c @@ -130,7 +130,7 @@ static int ir_sony_decode(struct rc_dev *dev, struct ir_raw_event ev) case 15: device = bitrev8((data->bits >> 0) & 0xFF); subdevice = 0; - function = bitrev8((data->bits >> 7) & 0xFD); + function = bitrev8((data->bits >> 7) & 0xFE); break; case 20: device = bitrev8((data->bits >> 5) & 0xF8); diff --git a/drivers/media/rc/keymaps/Makefile b/drivers/media/rc/keymaps/Makefile index 36e4d5e8dd6..49ce2662f56 100644 --- a/drivers/media/rc/keymaps/Makefile +++ b/drivers/media/rc/keymaps/Makefile @@ -41,8 +41,11 @@ obj-$(CONFIG_RC_MAP) += rc-adstech-dvb-t-pci.o \ rc-imon-mce.o \ rc-imon-pad.o \ rc-iodata-bctv7e.o \ + rc-it913x-v1.o \ + rc-it913x-v2.o \ rc-kaiomy.o \ rc-kworld-315u.o \ + rc-kworld-pc150u.o \ rc-kworld-plus-tv-analog.o \ rc-leadtek-y04g0051.o \ rc-lirc.o \ diff --git a/drivers/media/rc/keymaps/rc-it913x-v1.c b/drivers/media/rc/keymaps/rc-it913x-v1.c new file mode 100644 index 00000000000..0ac775fd109 --- /dev/null +++ b/drivers/media/rc/keymaps/rc-it913x-v1.c @@ -0,0 +1,95 @@ +/* ITE Generic remotes Version 1 + * + * Copyright (C) 2012 Malcolm Priestley (tvboxspy@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 it913x_v1_rc[] = { + /* Type 1 */ + { 0x61d601, KEY_VIDEO }, /* Source */ + { 0x61d602, KEY_3 }, + { 0x61d603, KEY_POWER }, /* ShutDown */ + { 0x61d604, KEY_1 }, + { 0x61d605, KEY_5 }, + { 0x61d606, KEY_6 }, + { 0x61d607, KEY_CHANNELDOWN }, /* CH- */ + { 0x61d608, KEY_2 }, + { 0x61d609, KEY_CHANNELUP }, /* CH+ */ + { 0x61d60a, KEY_9 }, + { 0x61d60b, KEY_ZOOM }, /* Zoom */ + { 0x61d60c, KEY_7 }, + { 0x61d60d, KEY_8 }, + { 0x61d60e, KEY_VOLUMEUP }, /* Vol+ */ + { 0x61d60f, KEY_4 }, + { 0x61d610, KEY_ESC }, /* [back up arrow] */ + { 0x61d611, KEY_0 }, + { 0x61d612, KEY_OK }, /* [enter arrow] */ + { 0x61d613, KEY_VOLUMEDOWN }, /* Vol- */ + { 0x61d614, KEY_RECORD }, /* Rec */ + { 0x61d615, KEY_STOP }, /* Stop */ + { 0x61d616, KEY_PLAY }, /* Play */ + { 0x61d617, KEY_MUTE }, /* Mute */ + { 0x61d618, KEY_UP }, + { 0x61d619, KEY_DOWN }, + { 0x61d61a, KEY_LEFT }, + { 0x61d61b, KEY_RIGHT }, + { 0x61d61c, KEY_RED }, + { 0x61d61d, KEY_GREEN }, + { 0x61d61e, KEY_YELLOW }, + { 0x61d61f, KEY_BLUE }, + { 0x61d643, KEY_POWER2 }, /* [red power button] */ + /* Type 2 - 20 buttons */ + { 0x807f0d, KEY_0 }, + { 0x807f04, KEY_1 }, + { 0x807f05, KEY_2 }, + { 0x807f06, KEY_3 }, + { 0x807f07, KEY_4 }, + { 0x807f08, KEY_5 }, + { 0x807f09, KEY_6 }, + { 0x807f0a, KEY_7 }, + { 0x807f1b, KEY_8 }, + { 0x807f1f, KEY_9 }, + { 0x807f12, KEY_POWER }, + { 0x807f01, KEY_MEDIA_REPEAT}, /* Recall */ + { 0x807f19, KEY_PAUSE }, /* Timeshift */ + { 0x807f1e, KEY_VOLUMEUP }, /* 2 x -/+ Keys not marked */ + { 0x807f03, KEY_VOLUMEDOWN }, /* Volume defined as right hand*/ + { 0x807f1a, KEY_CHANNELUP }, + { 0x807f02, KEY_CHANNELDOWN }, + { 0x807f0c, KEY_ZOOM }, + { 0x807f00, KEY_RECORD }, + { 0x807f0e, KEY_STOP }, +}; + +static struct rc_map_list it913x_v1_map = { + .map = { + .scan = it913x_v1_rc, + .size = ARRAY_SIZE(it913x_v1_rc), + .rc_type = RC_TYPE_NEC, + .name = RC_MAP_IT913X_V1, + } +}; + +static int __init init_rc_it913x_v1_map(void) +{ + return rc_map_register(&it913x_v1_map); +} + +static void __exit exit_rc_it913x_v1_map(void) +{ + rc_map_unregister(&it913x_v1_map); +} + +module_init(init_rc_it913x_v1_map) +module_exit(exit_rc_it913x_v1_map) + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Malcolm Priestley tvboxspy@gmail.com"); diff --git a/drivers/media/rc/keymaps/rc-it913x-v2.c b/drivers/media/rc/keymaps/rc-it913x-v2.c new file mode 100644 index 00000000000..28e376e18b9 --- /dev/null +++ b/drivers/media/rc/keymaps/rc-it913x-v2.c @@ -0,0 +1,94 @@ +/* ITE Generic remotes Version 2 + * + * Copyright (C) 2012 Malcolm Priestley (tvboxspy@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 it913x_v2_rc[] = { + /* Type 1 */ + /* 9005 remote */ + { 0x807f12, KEY_POWER2 }, /* Power (RED POWER BUTTON)*/ + { 0x807f1a, KEY_VIDEO }, /* Source */ + { 0x807f1e, KEY_MUTE }, /* Mute */ + { 0x807f01, KEY_RECORD }, /* Record */ + { 0x807f02, KEY_CHANNELUP }, /* Channel+ */ + { 0x807f03, KEY_TIME }, /* TimeShift */ + { 0x807f04, KEY_VOLUMEUP }, /* Volume- */ + { 0x807f05, KEY_SCREEN }, /* FullScreen */ + { 0x807f06, KEY_VOLUMEDOWN }, /* Volume- */ + { 0x807f07, KEY_0 }, /* 0 */ + { 0x807f08, KEY_CHANNELDOWN }, /* Channel- */ + { 0x807f09, KEY_PREVIOUS }, /* Recall */ + { 0x807f0a, KEY_1 }, /* 1 */ + { 0x807f1b, KEY_2 }, /* 2 */ + { 0x807f1f, KEY_3 }, /* 3 */ + { 0x807f0c, KEY_4 }, /* 4 */ + { 0x807f0d, KEY_5 }, /* 5 */ + { 0x807f0e, KEY_6 }, /* 6 */ + { 0x807f00, KEY_7 }, /* 7 */ + { 0x807f0f, KEY_8 }, /* 8 */ + { 0x807f19, KEY_9 }, /* 9 */ + + /* Type 2 */ + /* keys stereo, snapshot unassigned */ + { 0x866b00, KEY_0 }, + { 0x866b1b, KEY_1 }, + { 0x866b02, KEY_2 }, + { 0x866b03, KEY_3 }, + { 0x866b04, KEY_4 }, + { 0x866b05, KEY_5 }, + { 0x866b06, KEY_6 }, + { 0x866b07, KEY_7 }, + { 0x866b08, KEY_8 }, + { 0x866b09, KEY_9 }, + { 0x866b12, KEY_POWER }, + { 0x866b13, KEY_MUTE }, + { 0x866b0a, KEY_PREVIOUS }, /* Recall */ + { 0x866b1e, KEY_PAUSE }, + { 0x866b0c, KEY_VOLUMEUP }, + { 0x866b18, KEY_VOLUMEDOWN }, + { 0x866b0b, KEY_CHANNELUP }, + { 0x866b18, KEY_CHANNELDOWN }, + { 0x866b10, KEY_ZOOM }, + { 0x866b1d, KEY_RECORD }, + { 0x866b0e, KEY_STOP }, + { 0x866b11, KEY_EPG}, + { 0x866b1a, KEY_FASTFORWARD }, + { 0x866b0f, KEY_REWIND }, + { 0x866b1c, KEY_TV }, + { 0x866b1b, KEY_TEXT }, + +}; + +static struct rc_map_list it913x_v2_map = { + .map = { + .scan = it913x_v2_rc, + .size = ARRAY_SIZE(it913x_v2_rc), + .rc_type = RC_TYPE_NEC, + .name = RC_MAP_IT913X_V2, + } +}; + +static int __init init_rc_it913x_v2_map(void) +{ + return rc_map_register(&it913x_v2_map); +} + +static void __exit exit_rc_it913x_v2_map(void) +{ + rc_map_unregister(&it913x_v2_map); +} + +module_init(init_rc_it913x_v2_map) +module_exit(exit_rc_it913x_v2_map) + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Malcolm Priestley tvboxspy@gmail.com"); diff --git a/drivers/media/rc/keymaps/rc-kworld-pc150u.c b/drivers/media/rc/keymaps/rc-kworld-pc150u.c new file mode 100644 index 00000000000..233bb5ee087 --- /dev/null +++ b/drivers/media/rc/keymaps/rc-kworld-pc150u.c @@ -0,0 +1,102 @@ +/* kworld-pc150u.c - Keytable for kworld_pc150u Remote Controller + * + * keymap imported from ir-keymaps.c + * + * Copyright (c) 2010 by Kyle Strickland + * (based on kworld-plus-tv-analog.c by + * Mauro Carvalho Chehab <mchehab@redhat.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> + +/* Kworld PC150-U + Kyle Strickland <kyle@kyle.strickland.name> + */ + +static struct rc_map_table kworld_pc150u[] = { + { 0x0c, KEY_MEDIA }, /* Kworld key */ + { 0x16, KEY_EJECTCLOSECD }, /* -> ) */ + { 0x1d, KEY_POWER2 }, + + { 0x00, KEY_1 }, + { 0x01, KEY_2 }, + { 0x02, KEY_3 }, + { 0x03, KEY_4 }, + { 0x04, KEY_5 }, + { 0x05, KEY_6 }, + { 0x06, KEY_7 }, + { 0x07, KEY_8 }, + { 0x08, KEY_9 }, + { 0x0a, KEY_0 }, + + { 0x09, KEY_AGAIN }, + { 0x14, KEY_MUTE }, + + { 0x1e, KEY_LAST }, + { 0x17, KEY_ZOOM }, + { 0x1f, KEY_HOMEPAGE }, + { 0x0e, KEY_ESC }, + + { 0x20, KEY_UP }, + { 0x21, KEY_DOWN }, + { 0x42, KEY_LEFT }, + { 0x43, KEY_RIGHT }, + { 0x0b, KEY_ENTER }, + + { 0x10, KEY_CHANNELUP }, + { 0x11, KEY_CHANNELDOWN }, + + { 0x13, KEY_VOLUMEUP }, + { 0x12, KEY_VOLUMEDOWN }, + + { 0x19, KEY_TIME}, /* Timeshift */ + { 0x1a, KEY_STOP}, + { 0x1b, KEY_RECORD}, + { 0x4b, KEY_EMAIL}, + + { 0x40, KEY_REWIND}, + { 0x44, KEY_PLAYPAUSE}, + { 0x41, KEY_FORWARD}, + { 0x22, KEY_TEXT}, + + { 0x15, KEY_AUDIO}, /* ((*)) */ + { 0x0f, KEY_MODE}, /* display ratio */ + { 0x1c, KEY_SYSRQ}, /* snapshot */ + { 0x4a, KEY_SLEEP}, /* sleep timer */ + + { 0x48, KEY_SOUND}, /* switch theater mode */ + { 0x49, KEY_BLUE}, /* A */ + { 0x18, KEY_RED}, /* B */ + { 0x23, KEY_GREEN}, /* C */ +}; + +static struct rc_map_list kworld_pc150u_map = { + .map = { + .scan = kworld_pc150u, + .size = ARRAY_SIZE(kworld_pc150u), + .rc_type = RC_TYPE_UNKNOWN, /* Legacy IR type */ + .name = RC_MAP_KWORLD_PC150U, + } +}; + +static int __init init_rc_map_kworld_pc150u(void) +{ + return rc_map_register(&kworld_pc150u_map); +} + +static void __exit exit_rc_map_kworld_pc150u(void) +{ + rc_map_unregister(&kworld_pc150u_map); +} + +module_init(init_rc_map_kworld_pc150u) +module_exit(exit_rc_map_kworld_pc150u) + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Kyle Strickland <kyle@kyle.strickland.name>"); diff --git a/drivers/media/rc/keymaps/rc-nec-terratec-cinergy-xs.c b/drivers/media/rc/keymaps/rc-nec-terratec-cinergy-xs.c index f3b86c8db67..8d4dae2e2ec 100644 --- a/drivers/media/rc/keymaps/rc-nec-terratec-cinergy-xs.c +++ b/drivers/media/rc/keymaps/rc-nec-terratec-cinergy-xs.c @@ -18,6 +18,8 @@ */ static struct rc_map_table nec_terratec_cinergy_xs[] = { + + /* Terratec Grey IR, with most keys in orange */ { 0x1441, KEY_HOME}, { 0x1401, KEY_POWER2}, @@ -78,6 +80,56 @@ static struct rc_map_table nec_terratec_cinergy_xs[] = { { 0x144e, KEY_REWIND}, { 0x144f, KEY_FASTFORWARD}, { 0x145c, KEY_NEXT}, + + /* Terratec Black IR, with most keys in black */ + { 0x04eb01, KEY_POWER2}, + + { 0x04eb02, KEY_1}, + { 0x04eb03, KEY_2}, + { 0x04eb04, KEY_3}, + { 0x04eb05, KEY_4}, + { 0x04eb06, KEY_5}, + { 0x04eb07, KEY_6}, + { 0x04eb08, KEY_7}, + { 0x04eb09, KEY_8}, + { 0x04eb0a, KEY_9}, + { 0x04eb0c, KEY_0}, + + { 0x04eb0b, KEY_TEXT}, /* TXT */ + { 0x04eb0d, KEY_REFRESH}, /* Refresh */ + + { 0x04eb0e, KEY_HOME}, + { 0x04eb0f, KEY_EPG}, + + { 0x04eb10, KEY_UP}, + { 0x04eb11, KEY_LEFT}, + { 0x04eb12, KEY_OK}, + { 0x04eb13, KEY_RIGHT}, + { 0x04eb14, KEY_DOWN}, + + { 0x04eb15, KEY_BACKSPACE}, + { 0x04eb16, KEY_INFO}, + + { 0x04eb17, KEY_RED}, + { 0x04eb18, KEY_GREEN}, + { 0x04eb19, KEY_YELLOW}, + { 0x04eb1a, KEY_BLUE}, + + { 0x04eb1c, KEY_VOLUMEUP}, + { 0x04eb1e, KEY_VOLUMEDOWN}, + + { 0x04eb1d, KEY_MUTE}, + + { 0x04eb1b, KEY_CHANNELUP}, + { 0x04eb1f, KEY_CHANNELDOWN}, + + { 0x04eb40, KEY_RECORD}, + { 0x04eb4c, KEY_PLAY}, + { 0x04eb58, KEY_PAUSE}, + + { 0x04eb54, KEY_REWIND}, + { 0x04eb48, KEY_STOP}, + { 0x04eb5c, KEY_NEXT}, }; static struct rc_map_list nec_terratec_cinergy_xs_map = { diff --git a/drivers/media/rc/mceusb.c b/drivers/media/rc/mceusb.c index 21105bf9594..e150a2e29a4 100644 --- a/drivers/media/rc/mceusb.c +++ b/drivers/media/rc/mceusb.c @@ -361,6 +361,8 @@ static struct usb_device_id mceusb_dev_table[] = { { USB_DEVICE(VENDOR_FORMOSA, 0xe03c) }, /* Formosa Industrial Computing */ { USB_DEVICE(VENDOR_FORMOSA, 0xe03e) }, + /* Formosa Industrial Computing */ + { USB_DEVICE(VENDOR_FORMOSA, 0xe042) }, /* Fintek eHome Infrared Transceiver (HP branded) */ { USB_DEVICE(VENDOR_FINTEK, 0x5168) }, /* Fintek eHome Infrared Transceiver */ diff --git a/drivers/media/rc/rc-core-priv.h b/drivers/media/rc/rc-core-priv.h index b72f8580e31..96f0a8bb39e 100644 --- a/drivers/media/rc/rc-core-priv.h +++ b/drivers/media/rc/rc-core-priv.h @@ -35,7 +35,7 @@ struct ir_raw_event_ctrl { struct list_head list; /* to keep track of raw clients */ struct task_struct *thread; spinlock_t lock; - struct kfifo kfifo; /* fifo for the pulse/space durations */ + struct kfifo_rec_ptr_1 kfifo; /* fifo for the pulse/space durations */ ktime_t last_event; /* when last event occurred */ enum raw_event_type last_type; /* last event type */ struct rc_dev *dev; /* pointer to the parent rc_dev */ diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c index f6a930b70c6..6e16b09c24a 100644 --- a/drivers/media/rc/rc-main.c +++ b/drivers/media/rc/rc-main.c @@ -1029,6 +1029,7 @@ EXPORT_SYMBOL_GPL(rc_free_device); int rc_register_device(struct rc_dev *dev) { + static bool raw_init = false; /* raw decoders loaded? */ static atomic_t devno = ATOMIC_INIT(0); struct rc_map *rc_map; const char *path; @@ -1103,6 +1104,12 @@ int rc_register_device(struct rc_dev *dev) kfree(path); if (dev->driver_type == RC_DRIVER_IR_RAW) { + /* Load raw decoders, if they aren't already */ + if (!raw_init) { + IR_dprintk(1, "Loading raw decoders\n"); + ir_raw_init(); + raw_init = true; + } rc = ir_raw_event_register(dev); if (rc < 0) goto out_input; @@ -1176,8 +1183,6 @@ static int __init rc_core_init(void) return rc; } - /* Initialize/load the decoders/keymap code that will be used */ - ir_raw_init(); rc_map_register(&empty_map); return 0; |