diff options
| author | Sascha Hauer <s.hauer@pengutronix.de> | 2011-02-11 02:32:18 -0500 |
|---|---|---|
| committer | Sascha Hauer <s.hauer@pengutronix.de> | 2011-02-11 02:33:14 -0500 |
| commit | f19693a17c6705e197eb24d4618060eaac1b535c (patch) | |
| tree | fc39dc23297c0e6be730cb0dfd74a34d9c0b8bfd /drivers/media/rc | |
| parent | 23b120cdfae4f5c29da69de750d545bad719ead4 (diff) | |
| parent | 100b33c8bd8a3235fd0b7948338d6cbb3db3c63d (diff) | |
Merge commit 'v2.6.38-rc4' into imx-for-2.6.39
Conflicts:
arch/arm/mach-mxs/clock-mx28.c
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/media/rc')
| -rw-r--r-- | drivers/media/rc/ene_ir.c | 23 | ||||
| -rw-r--r-- | drivers/media/rc/ene_ir.h | 2 | ||||
| -rw-r--r-- | drivers/media/rc/imon.c | 60 | ||||
| -rw-r--r-- | drivers/media/rc/ir-lirc-codec.c | 6 | ||||
| -rw-r--r-- | drivers/media/rc/ir-raw.c | 2 | ||||
| -rw-r--r-- | drivers/media/rc/keymaps/rc-dib0700-nec.c | 52 | ||||
| -rw-r--r-- | drivers/media/rc/keymaps/rc-rc6-mce.c | 6 | ||||
| -rw-r--r-- | drivers/media/rc/mceusb.c | 10 | ||||
| -rw-r--r-- | drivers/media/rc/nuvoton-cir.c | 6 | ||||
| -rw-r--r-- | drivers/media/rc/rc-main.c | 28 | ||||
| -rw-r--r-- | drivers/media/rc/streamzap.c | 14 |
11 files changed, 112 insertions, 97 deletions
diff --git a/drivers/media/rc/ene_ir.c b/drivers/media/rc/ene_ir.c index 80b3c319f698..1ac49139158d 100644 --- a/drivers/media/rc/ene_ir.c +++ b/drivers/media/rc/ene_ir.c | |||
| @@ -446,27 +446,27 @@ static void ene_rx_setup(struct ene_device *dev) | |||
| 446 | 446 | ||
| 447 | select_timeout: | 447 | select_timeout: |
| 448 | if (dev->rx_fan_input_inuse) { | 448 | if (dev->rx_fan_input_inuse) { |
| 449 | dev->rdev->rx_resolution = MS_TO_NS(ENE_FW_SAMPLE_PERIOD_FAN); | 449 | dev->rdev->rx_resolution = US_TO_NS(ENE_FW_SAMPLE_PERIOD_FAN); |
| 450 | 450 | ||
| 451 | /* Fan input doesn't support timeouts, it just ends the | 451 | /* Fan input doesn't support timeouts, it just ends the |
| 452 | input with a maximum sample */ | 452 | input with a maximum sample */ |
| 453 | dev->rdev->min_timeout = dev->rdev->max_timeout = | 453 | dev->rdev->min_timeout = dev->rdev->max_timeout = |
| 454 | MS_TO_NS(ENE_FW_SMPL_BUF_FAN_MSK * | 454 | US_TO_NS(ENE_FW_SMPL_BUF_FAN_MSK * |
| 455 | ENE_FW_SAMPLE_PERIOD_FAN); | 455 | ENE_FW_SAMPLE_PERIOD_FAN); |
| 456 | } else { | 456 | } else { |
| 457 | dev->rdev->rx_resolution = MS_TO_NS(sample_period); | 457 | dev->rdev->rx_resolution = US_TO_NS(sample_period); |
| 458 | 458 | ||
| 459 | /* Theoreticly timeout is unlimited, but we cap it | 459 | /* Theoreticly timeout is unlimited, but we cap it |
| 460 | * because it was seen that on one device, it | 460 | * because it was seen that on one device, it |
| 461 | * would stop sending spaces after around 250 msec. | 461 | * would stop sending spaces after around 250 msec. |
| 462 | * Besides, this is close to 2^32 anyway and timeout is u32. | 462 | * Besides, this is close to 2^32 anyway and timeout is u32. |
| 463 | */ | 463 | */ |
| 464 | dev->rdev->min_timeout = MS_TO_NS(127 * sample_period); | 464 | dev->rdev->min_timeout = US_TO_NS(127 * sample_period); |
| 465 | dev->rdev->max_timeout = MS_TO_NS(200000); | 465 | dev->rdev->max_timeout = US_TO_NS(200000); |
| 466 | } | 466 | } |
| 467 | 467 | ||
| 468 | if (dev->hw_learning_and_tx_capable) | 468 | if (dev->hw_learning_and_tx_capable) |
| 469 | dev->rdev->tx_resolution = MS_TO_NS(sample_period); | 469 | dev->rdev->tx_resolution = US_TO_NS(sample_period); |
| 470 | 470 | ||
| 471 | if (dev->rdev->timeout > dev->rdev->max_timeout) | 471 | if (dev->rdev->timeout > dev->rdev->max_timeout) |
| 472 | dev->rdev->timeout = dev->rdev->max_timeout; | 472 | dev->rdev->timeout = dev->rdev->max_timeout; |
| @@ -801,7 +801,7 @@ static irqreturn_t ene_isr(int irq, void *data) | |||
| 801 | 801 | ||
| 802 | dbg("RX: %d (%s)", hw_sample, pulse ? "pulse" : "space"); | 802 | dbg("RX: %d (%s)", hw_sample, pulse ? "pulse" : "space"); |
| 803 | 803 | ||
| 804 | ev.duration = MS_TO_NS(hw_sample); | 804 | ev.duration = US_TO_NS(hw_sample); |
| 805 | ev.pulse = pulse; | 805 | ev.pulse = pulse; |
| 806 | ir_raw_event_store_with_filter(dev->rdev, &ev); | 806 | ir_raw_event_store_with_filter(dev->rdev, &ev); |
| 807 | } | 807 | } |
| @@ -821,7 +821,7 @@ static void ene_setup_default_settings(struct ene_device *dev) | |||
| 821 | dev->learning_mode_enabled = learning_mode_force; | 821 | dev->learning_mode_enabled = learning_mode_force; |
| 822 | 822 | ||
| 823 | /* Set reasonable default timeout */ | 823 | /* Set reasonable default timeout */ |
| 824 | dev->rdev->timeout = MS_TO_NS(150000); | 824 | dev->rdev->timeout = US_TO_NS(150000); |
| 825 | } | 825 | } |
| 826 | 826 | ||
| 827 | /* Upload all hardware settings at once. Used at load and resume time */ | 827 | /* Upload all hardware settings at once. Used at load and resume time */ |
| @@ -1004,6 +1004,10 @@ static int ene_probe(struct pnp_dev *pnp_dev, const struct pnp_device_id *id) | |||
| 1004 | /* validate resources */ | 1004 | /* validate resources */ |
| 1005 | error = -ENODEV; | 1005 | error = -ENODEV; |
| 1006 | 1006 | ||
| 1007 | /* init these to -1, as 0 is valid for both */ | ||
| 1008 | dev->hw_io = -1; | ||
| 1009 | dev->irq = -1; | ||
| 1010 | |||
| 1007 | if (!pnp_port_valid(pnp_dev, 0) || | 1011 | if (!pnp_port_valid(pnp_dev, 0) || |
| 1008 | pnp_port_len(pnp_dev, 0) < ENE_IO_SIZE) | 1012 | pnp_port_len(pnp_dev, 0) < ENE_IO_SIZE) |
| 1009 | goto error; | 1013 | goto error; |
| @@ -1072,6 +1076,8 @@ static int ene_probe(struct pnp_dev *pnp_dev, const struct pnp_device_id *id) | |||
| 1072 | rdev->input_name = "ENE eHome Infrared Remote Transceiver"; | 1076 | rdev->input_name = "ENE eHome Infrared Remote Transceiver"; |
| 1073 | } | 1077 | } |
| 1074 | 1078 | ||
| 1079 | dev->rdev = rdev; | ||
| 1080 | |||
| 1075 | ene_rx_setup_hw_buffer(dev); | 1081 | ene_rx_setup_hw_buffer(dev); |
| 1076 | ene_setup_default_settings(dev); | 1082 | ene_setup_default_settings(dev); |
| 1077 | ene_setup_hw_settings(dev); | 1083 | ene_setup_hw_settings(dev); |
| @@ -1083,7 +1089,6 @@ static int ene_probe(struct pnp_dev *pnp_dev, const struct pnp_device_id *id) | |||
| 1083 | if (error < 0) | 1089 | if (error < 0) |
| 1084 | goto error; | 1090 | goto error; |
| 1085 | 1091 | ||
| 1086 | dev->rdev = rdev; | ||
| 1087 | ene_notice("driver has been succesfully loaded"); | 1092 | ene_notice("driver has been succesfully loaded"); |
| 1088 | return 0; | 1093 | return 0; |
| 1089 | error: | 1094 | error: |
diff --git a/drivers/media/rc/ene_ir.h b/drivers/media/rc/ene_ir.h index c179baf34cb4..337a41d4450b 100644 --- a/drivers/media/rc/ene_ir.h +++ b/drivers/media/rc/ene_ir.h | |||
| @@ -201,8 +201,6 @@ | |||
| 201 | #define dbg_verbose(format, ...) __dbg(2, format, ## __VA_ARGS__) | 201 | #define dbg_verbose(format, ...) __dbg(2, format, ## __VA_ARGS__) |
| 202 | #define dbg_regs(format, ...) __dbg(3, format, ## __VA_ARGS__) | 202 | #define dbg_regs(format, ...) __dbg(3, format, ## __VA_ARGS__) |
| 203 | 203 | ||
| 204 | #define MS_TO_NS(msec) ((msec) * 1000) | ||
| 205 | |||
| 206 | struct ene_device { | 204 | struct ene_device { |
| 207 | struct pnp_dev *pnp_dev; | 205 | struct pnp_dev *pnp_dev; |
| 208 | struct rc_dev *rdev; | 206 | struct rc_dev *rdev; |
diff --git a/drivers/media/rc/imon.c b/drivers/media/rc/imon.c index 6811512b4e83..e7dc6b46fdfa 100644 --- a/drivers/media/rc/imon.c +++ b/drivers/media/rc/imon.c | |||
| @@ -988,7 +988,6 @@ static int imon_ir_change_protocol(struct rc_dev *rc, u64 rc_type) | |||
| 988 | int retval; | 988 | int retval; |
| 989 | struct imon_context *ictx = rc->priv; | 989 | struct imon_context *ictx = rc->priv; |
| 990 | struct device *dev = ictx->dev; | 990 | struct device *dev = ictx->dev; |
| 991 | bool pad_mouse; | ||
| 992 | unsigned char ir_proto_packet[] = { | 991 | unsigned char ir_proto_packet[] = { |
| 993 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86 }; | 992 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86 }; |
| 994 | 993 | ||
| @@ -1000,29 +999,20 @@ static int imon_ir_change_protocol(struct rc_dev *rc, u64 rc_type) | |||
| 1000 | case RC_TYPE_RC6: | 999 | case RC_TYPE_RC6: |
| 1001 | dev_dbg(dev, "Configuring IR receiver for MCE protocol\n"); | 1000 | dev_dbg(dev, "Configuring IR receiver for MCE protocol\n"); |
| 1002 | ir_proto_packet[0] = 0x01; | 1001 | ir_proto_packet[0] = 0x01; |
| 1003 | pad_mouse = false; | ||
| 1004 | break; | 1002 | break; |
| 1005 | case RC_TYPE_UNKNOWN: | 1003 | case RC_TYPE_UNKNOWN: |
| 1006 | case RC_TYPE_OTHER: | 1004 | case RC_TYPE_OTHER: |
| 1007 | dev_dbg(dev, "Configuring IR receiver for iMON protocol\n"); | 1005 | dev_dbg(dev, "Configuring IR receiver for iMON protocol\n"); |
| 1008 | if (pad_stabilize && !nomouse) | 1006 | if (!pad_stabilize) |
| 1009 | pad_mouse = true; | ||
| 1010 | else { | ||
| 1011 | dev_dbg(dev, "PAD stabilize functionality disabled\n"); | 1007 | dev_dbg(dev, "PAD stabilize functionality disabled\n"); |
| 1012 | pad_mouse = false; | ||
| 1013 | } | ||
| 1014 | /* ir_proto_packet[0] = 0x00; // already the default */ | 1008 | /* ir_proto_packet[0] = 0x00; // already the default */ |
| 1015 | rc_type = RC_TYPE_OTHER; | 1009 | rc_type = RC_TYPE_OTHER; |
| 1016 | break; | 1010 | break; |
| 1017 | default: | 1011 | default: |
| 1018 | dev_warn(dev, "Unsupported IR protocol specified, overriding " | 1012 | dev_warn(dev, "Unsupported IR protocol specified, overriding " |
| 1019 | "to iMON IR protocol\n"); | 1013 | "to iMON IR protocol\n"); |
| 1020 | if (pad_stabilize && !nomouse) | 1014 | if (!pad_stabilize) |
| 1021 | pad_mouse = true; | ||
| 1022 | else { | ||
| 1023 | dev_dbg(dev, "PAD stabilize functionality disabled\n"); | 1015 | dev_dbg(dev, "PAD stabilize functionality disabled\n"); |
| 1024 | pad_mouse = false; | ||
| 1025 | } | ||
| 1026 | /* ir_proto_packet[0] = 0x00; // already the default */ | 1016 | /* ir_proto_packet[0] = 0x00; // already the default */ |
| 1027 | rc_type = RC_TYPE_OTHER; | 1017 | rc_type = RC_TYPE_OTHER; |
| 1028 | break; | 1018 | break; |
| @@ -1035,7 +1025,7 @@ static int imon_ir_change_protocol(struct rc_dev *rc, u64 rc_type) | |||
| 1035 | goto out; | 1025 | goto out; |
| 1036 | 1026 | ||
| 1037 | ictx->rc_type = rc_type; | 1027 | ictx->rc_type = rc_type; |
| 1038 | ictx->pad_mouse = pad_mouse; | 1028 | ictx->pad_mouse = false; |
| 1039 | 1029 | ||
| 1040 | out: | 1030 | out: |
| 1041 | return retval; | 1031 | return retval; |
| @@ -1517,7 +1507,7 @@ static void imon_incoming_packet(struct imon_context *ictx, | |||
| 1517 | spin_unlock_irqrestore(&ictx->kc_lock, flags); | 1507 | spin_unlock_irqrestore(&ictx->kc_lock, flags); |
| 1518 | return; | 1508 | return; |
| 1519 | } else { | 1509 | } else { |
| 1520 | ictx->pad_mouse = 0; | 1510 | ictx->pad_mouse = false; |
| 1521 | dev_dbg(dev, "mouse mode disabled, passing key value\n"); | 1511 | dev_dbg(dev, "mouse mode disabled, passing key value\n"); |
| 1522 | } | 1512 | } |
| 1523 | } | 1513 | } |
| @@ -1756,7 +1746,6 @@ static void imon_get_ffdc_type(struct imon_context *ictx) | |||
| 1756 | printk(KERN_CONT " (id 0x%02x)\n", ffdc_cfg_byte); | 1746 | printk(KERN_CONT " (id 0x%02x)\n", ffdc_cfg_byte); |
| 1757 | 1747 | ||
| 1758 | ictx->display_type = detected_display_type; | 1748 | ictx->display_type = detected_display_type; |
| 1759 | ictx->rdev->allowed_protos = allowed_protos; | ||
| 1760 | ictx->rc_type = allowed_protos; | 1749 | ictx->rc_type = allowed_protos; |
| 1761 | } | 1750 | } |
| 1762 | 1751 | ||
| @@ -1839,10 +1828,6 @@ static struct rc_dev *imon_init_rdev(struct imon_context *ictx) | |||
| 1839 | rdev->allowed_protos = RC_TYPE_OTHER | RC_TYPE_RC6; /* iMON PAD or MCE */ | 1828 | rdev->allowed_protos = RC_TYPE_OTHER | RC_TYPE_RC6; /* iMON PAD or MCE */ |
| 1840 | rdev->change_protocol = imon_ir_change_protocol; | 1829 | rdev->change_protocol = imon_ir_change_protocol; |
| 1841 | rdev->driver_name = MOD_NAME; | 1830 | rdev->driver_name = MOD_NAME; |
| 1842 | if (ictx->rc_type == RC_TYPE_RC6) | ||
| 1843 | rdev->map_name = RC_MAP_IMON_MCE; | ||
| 1844 | else | ||
| 1845 | rdev->map_name = RC_MAP_IMON_PAD; | ||
| 1846 | 1831 | ||
| 1847 | /* Enable front-panel buttons and/or knobs */ | 1832 | /* Enable front-panel buttons and/or knobs */ |
| 1848 | memcpy(ictx->usb_tx_buf, &fp_packet, sizeof(fp_packet)); | 1833 | memcpy(ictx->usb_tx_buf, &fp_packet, sizeof(fp_packet)); |
| @@ -1851,11 +1836,18 @@ static struct rc_dev *imon_init_rdev(struct imon_context *ictx) | |||
| 1851 | if (ret) | 1836 | if (ret) |
| 1852 | dev_info(ictx->dev, "panel buttons/knobs setup failed\n"); | 1837 | dev_info(ictx->dev, "panel buttons/knobs setup failed\n"); |
| 1853 | 1838 | ||
| 1854 | if (ictx->product == 0xffdc) | 1839 | if (ictx->product == 0xffdc) { |
| 1855 | imon_get_ffdc_type(ictx); | 1840 | imon_get_ffdc_type(ictx); |
| 1841 | rdev->allowed_protos = ictx->rc_type; | ||
| 1842 | } | ||
| 1856 | 1843 | ||
| 1857 | imon_set_display_type(ictx); | 1844 | imon_set_display_type(ictx); |
| 1858 | 1845 | ||
| 1846 | if (ictx->rc_type == RC_TYPE_RC6) | ||
| 1847 | rdev->map_name = RC_MAP_IMON_MCE; | ||
| 1848 | else | ||
| 1849 | rdev->map_name = RC_MAP_IMON_PAD; | ||
| 1850 | |||
| 1859 | ret = rc_register_device(rdev); | 1851 | ret = rc_register_device(rdev); |
| 1860 | if (ret < 0) { | 1852 | if (ret < 0) { |
| 1861 | dev_err(ictx->dev, "remote input dev register failed\n"); | 1853 | dev_err(ictx->dev, "remote input dev register failed\n"); |
| @@ -2108,18 +2100,6 @@ static struct imon_context *imon_init_intf0(struct usb_interface *intf) | |||
| 2108 | goto find_endpoint_failed; | 2100 | goto find_endpoint_failed; |
| 2109 | } | 2101 | } |
| 2110 | 2102 | ||
| 2111 | ictx->idev = imon_init_idev(ictx); | ||
| 2112 | if (!ictx->idev) { | ||
| 2113 | dev_err(dev, "%s: input device setup failed\n", __func__); | ||
| 2114 | goto idev_setup_failed; | ||
| 2115 | } | ||
| 2116 | |||
| 2117 | ictx->rdev = imon_init_rdev(ictx); | ||
| 2118 | if (!ictx->rdev) { | ||
| 2119 | dev_err(dev, "%s: rc device setup failed\n", __func__); | ||
| 2120 | goto rdev_setup_failed; | ||
| 2121 | } | ||
| 2122 | |||
| 2123 | usb_fill_int_urb(ictx->rx_urb_intf0, ictx->usbdev_intf0, | 2103 | usb_fill_int_urb(ictx->rx_urb_intf0, ictx->usbdev_intf0, |
| 2124 | usb_rcvintpipe(ictx->usbdev_intf0, | 2104 | usb_rcvintpipe(ictx->usbdev_intf0, |
| 2125 | ictx->rx_endpoint_intf0->bEndpointAddress), | 2105 | ictx->rx_endpoint_intf0->bEndpointAddress), |
| @@ -2133,13 +2113,25 @@ static struct imon_context *imon_init_intf0(struct usb_interface *intf) | |||
| 2133 | goto urb_submit_failed; | 2113 | goto urb_submit_failed; |
| 2134 | } | 2114 | } |
| 2135 | 2115 | ||
| 2116 | ictx->idev = imon_init_idev(ictx); | ||
| 2117 | if (!ictx->idev) { | ||
| 2118 | dev_err(dev, "%s: input device setup failed\n", __func__); | ||
| 2119 | goto idev_setup_failed; | ||
| 2120 | } | ||
| 2121 | |||
| 2122 | ictx->rdev = imon_init_rdev(ictx); | ||
| 2123 | if (!ictx->rdev) { | ||
| 2124 | dev_err(dev, "%s: rc device setup failed\n", __func__); | ||
| 2125 | goto rdev_setup_failed; | ||
| 2126 | } | ||
| 2127 | |||
| 2136 | return ictx; | 2128 | return ictx; |
| 2137 | 2129 | ||
| 2138 | urb_submit_failed: | ||
| 2139 | rc_unregister_device(ictx->rdev); | ||
| 2140 | rdev_setup_failed: | 2130 | rdev_setup_failed: |
| 2141 | input_unregister_device(ictx->idev); | 2131 | input_unregister_device(ictx->idev); |
| 2142 | idev_setup_failed: | 2132 | idev_setup_failed: |
| 2133 | usb_kill_urb(ictx->rx_urb_intf0); | ||
| 2134 | urb_submit_failed: | ||
| 2143 | find_endpoint_failed: | 2135 | find_endpoint_failed: |
| 2144 | mutex_unlock(&ictx->lock); | 2136 | mutex_unlock(&ictx->lock); |
| 2145 | usb_free_urb(tx_urb); | 2137 | usb_free_urb(tx_urb); |
diff --git a/drivers/media/rc/ir-lirc-codec.c b/drivers/media/rc/ir-lirc-codec.c index f011c5d9dea1..1c5cc65ea1e1 100644 --- a/drivers/media/rc/ir-lirc-codec.c +++ b/drivers/media/rc/ir-lirc-codec.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* ir-lirc-codec.c - ir-core to classic lirc interface bridge | 1 | /* ir-lirc-codec.c - rc-core to classic lirc interface bridge |
| 2 | * | 2 | * |
| 3 | * Copyright (C) 2010 by Jarod Wilson <jarod@redhat.com> | 3 | * Copyright (C) 2010 by Jarod Wilson <jarod@redhat.com> |
| 4 | * | 4 | * |
| @@ -47,6 +47,7 @@ static int ir_lirc_decode(struct rc_dev *dev, struct ir_raw_event ev) | |||
| 47 | /* Carrier reports */ | 47 | /* Carrier reports */ |
| 48 | if (ev.carrier_report) { | 48 | if (ev.carrier_report) { |
| 49 | sample = LIRC_FREQUENCY(ev.carrier); | 49 | sample = LIRC_FREQUENCY(ev.carrier); |
| 50 | IR_dprintk(2, "carrier report (freq: %d)\n", sample); | ||
| 50 | 51 | ||
| 51 | /* Packet end */ | 52 | /* Packet end */ |
| 52 | } else if (ev.timeout) { | 53 | } else if (ev.timeout) { |
| @@ -62,6 +63,7 @@ static int ir_lirc_decode(struct rc_dev *dev, struct ir_raw_event ev) | |||
| 62 | return 0; | 63 | return 0; |
| 63 | 64 | ||
| 64 | sample = LIRC_TIMEOUT(ev.duration / 1000); | 65 | sample = LIRC_TIMEOUT(ev.duration / 1000); |
| 66 | IR_dprintk(2, "timeout report (duration: %d)\n", sample); | ||
| 65 | 67 | ||
| 66 | /* Normal sample */ | 68 | /* Normal sample */ |
| 67 | } else { | 69 | } else { |
| @@ -85,6 +87,8 @@ static int ir_lirc_decode(struct rc_dev *dev, struct ir_raw_event ev) | |||
| 85 | 87 | ||
| 86 | sample = ev.pulse ? LIRC_PULSE(ev.duration / 1000) : | 88 | sample = ev.pulse ? LIRC_PULSE(ev.duration / 1000) : |
| 87 | LIRC_SPACE(ev.duration / 1000); | 89 | LIRC_SPACE(ev.duration / 1000); |
| 90 | IR_dprintk(2, "delivering %uus %s to lirc_dev\n", | ||
| 91 | TO_US(ev.duration), TO_STR(ev.pulse)); | ||
| 88 | } | 92 | } |
| 89 | 93 | ||
| 90 | lirc_buffer_write(dev->raw->lirc.drv->rbuf, | 94 | lirc_buffer_write(dev->raw->lirc.drv->rbuf, |
diff --git a/drivers/media/rc/ir-raw.c b/drivers/media/rc/ir-raw.c index 185baddcbf14..73230ff93b8a 100644 --- a/drivers/media/rc/ir-raw.c +++ b/drivers/media/rc/ir-raw.c | |||
| @@ -233,7 +233,7 @@ EXPORT_SYMBOL_GPL(ir_raw_event_handle); | |||
| 233 | 233 | ||
| 234 | /* used internally by the sysfs interface */ | 234 | /* used internally by the sysfs interface */ |
| 235 | u64 | 235 | u64 |
| 236 | ir_raw_get_allowed_protocols() | 236 | ir_raw_get_allowed_protocols(void) |
| 237 | { | 237 | { |
| 238 | u64 protocols; | 238 | u64 protocols; |
| 239 | mutex_lock(&ir_raw_handler_lock); | 239 | mutex_lock(&ir_raw_handler_lock); |
diff --git a/drivers/media/rc/keymaps/rc-dib0700-nec.c b/drivers/media/rc/keymaps/rc-dib0700-nec.c index c59851b203da..7a5f5300caf9 100644 --- a/drivers/media/rc/keymaps/rc-dib0700-nec.c +++ b/drivers/media/rc/keymaps/rc-dib0700-nec.c | |||
| @@ -19,35 +19,35 @@ | |||
| 19 | 19 | ||
| 20 | static struct rc_map_table dib0700_nec_table[] = { | 20 | static struct rc_map_table dib0700_nec_table[] = { |
| 21 | /* Key codes for the Pixelview SBTVD remote */ | 21 | /* Key codes for the Pixelview SBTVD remote */ |
| 22 | { 0x8613, KEY_MUTE }, | 22 | { 0x866b13, KEY_MUTE }, |
| 23 | { 0x8612, KEY_POWER }, | 23 | { 0x866b12, KEY_POWER }, |
| 24 | { 0x8601, KEY_1 }, | 24 | { 0x866b01, KEY_1 }, |
| 25 | { 0x8602, KEY_2 }, | 25 | { 0x866b02, KEY_2 }, |
| 26 | { 0x8603, KEY_3 }, | 26 | { 0x866b03, KEY_3 }, |
| 27 | { 0x8604, KEY_4 }, | 27 | { 0x866b04, KEY_4 }, |
| 28 | { 0x8605, KEY_5 }, | 28 | { 0x866b05, KEY_5 }, |
| 29 | { 0x8606, KEY_6 }, | 29 | { 0x866b06, KEY_6 }, |
| 30 | { 0x8607, KEY_7 }, | 30 | { 0x866b07, KEY_7 }, |
| 31 | { 0x8608, KEY_8 }, | 31 | { 0x866b08, KEY_8 }, |
| 32 | { 0x8609, KEY_9 }, | 32 | { 0x866b09, KEY_9 }, |
| 33 | { 0x8600, KEY_0 }, | 33 | { 0x866b00, KEY_0 }, |
| 34 | { 0x860d, KEY_CHANNELUP }, | 34 | { 0x866b0d, KEY_CHANNELUP }, |
| 35 | { 0x8619, KEY_CHANNELDOWN }, | 35 | { 0x866b19, KEY_CHANNELDOWN }, |
| 36 | { 0x8610, KEY_VOLUMEUP }, | 36 | { 0x866b10, KEY_VOLUMEUP }, |
| 37 | { 0x860c, KEY_VOLUMEDOWN }, | 37 | { 0x866b0c, KEY_VOLUMEDOWN }, |
| 38 | 38 | ||
| 39 | { 0x860a, KEY_CAMERA }, | 39 | { 0x866b0a, KEY_CAMERA }, |
| 40 | { 0x860b, KEY_ZOOM }, | 40 | { 0x866b0b, KEY_ZOOM }, |
| 41 | { 0x861b, KEY_BACKSPACE }, | 41 | { 0x866b1b, KEY_BACKSPACE }, |
| 42 | { 0x8615, KEY_ENTER }, | 42 | { 0x866b15, KEY_ENTER }, |
| 43 | 43 | ||
| 44 | { 0x861d, KEY_UP }, | 44 | { 0x866b1d, KEY_UP }, |
| 45 | { 0x861e, KEY_DOWN }, | 45 | { 0x866b1e, KEY_DOWN }, |
| 46 | { 0x860e, KEY_LEFT }, | 46 | { 0x866b0e, KEY_LEFT }, |
| 47 | { 0x860f, KEY_RIGHT }, | 47 | { 0x866b0f, KEY_RIGHT }, |
| 48 | 48 | ||
| 49 | { 0x8618, KEY_RECORD }, | 49 | { 0x866b18, KEY_RECORD }, |
| 50 | { 0x861a, KEY_STOP }, | 50 | { 0x866b1a, KEY_STOP }, |
| 51 | 51 | ||
| 52 | /* Key codes for the EvolutePC TVWay+ remote */ | 52 | /* Key codes for the EvolutePC TVWay+ remote */ |
| 53 | { 0x7a00, KEY_MENU }, | 53 | { 0x7a00, KEY_MENU }, |
diff --git a/drivers/media/rc/keymaps/rc-rc6-mce.c b/drivers/media/rc/keymaps/rc-rc6-mce.c index 3bf3337875d1..2f5dc0622b94 100644 --- a/drivers/media/rc/keymaps/rc-rc6-mce.c +++ b/drivers/media/rc/keymaps/rc-rc6-mce.c | |||
| @@ -3,6 +3,9 @@ | |||
| 3 | * | 3 | * |
| 4 | * Copyright (c) 2010 by Jarod Wilson <jarod@redhat.com> | 4 | * Copyright (c) 2010 by Jarod Wilson <jarod@redhat.com> |
| 5 | * | 5 | * |
| 6 | * See http://mediacenterguides.com/book/export/html/31 for details on | ||
| 7 | * key mappings. | ||
| 8 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | 9 | * 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 | 10 | * 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 | 11 | * the Free Software Foundation; either version 2 of the License, or |
| @@ -60,6 +63,9 @@ static struct rc_map_table rc6_mce[] = { | |||
| 60 | { 0x800f0426, KEY_EPG }, /* Guide */ | 63 | { 0x800f0426, KEY_EPG }, /* Guide */ |
| 61 | { 0x800f0427, KEY_ZOOM }, /* Aspect */ | 64 | { 0x800f0427, KEY_ZOOM }, /* Aspect */ |
| 62 | 65 | ||
| 66 | { 0x800f0432, KEY_MODE }, /* Visualization */ | ||
| 67 | { 0x800f0433, KEY_PRESENTATION }, /* Slide Show */ | ||
| 68 | { 0x800f0434, KEY_EJECTCD }, | ||
| 63 | { 0x800f043a, KEY_BRIGHTNESSUP }, | 69 | { 0x800f043a, KEY_BRIGHTNESSUP }, |
| 64 | 70 | ||
| 65 | { 0x800f0446, KEY_TV }, | 71 | { 0x800f0446, KEY_TV }, |
diff --git a/drivers/media/rc/mceusb.c b/drivers/media/rc/mceusb.c index 0fef6efad537..6df0a4980645 100644 --- a/drivers/media/rc/mceusb.c +++ b/drivers/media/rc/mceusb.c | |||
| @@ -48,7 +48,6 @@ | |||
| 48 | #define USB_BUFLEN 32 /* USB reception buffer length */ | 48 | #define USB_BUFLEN 32 /* USB reception buffer length */ |
| 49 | #define USB_CTRL_MSG_SZ 2 /* Size of usb ctrl msg on gen1 hw */ | 49 | #define USB_CTRL_MSG_SZ 2 /* Size of usb ctrl msg on gen1 hw */ |
| 50 | #define MCE_G1_INIT_MSGS 40 /* Init messages on gen1 hw to throw out */ | 50 | #define MCE_G1_INIT_MSGS 40 /* Init messages on gen1 hw to throw out */ |
| 51 | #define MS_TO_NS(msec) ((msec) * 1000) | ||
| 52 | 51 | ||
| 53 | /* MCE constants */ | 52 | /* MCE constants */ |
| 54 | #define MCE_CMDBUF_SIZE 384 /* MCE Command buffer length */ | 53 | #define MCE_CMDBUF_SIZE 384 /* MCE Command buffer length */ |
| @@ -817,7 +816,7 @@ static void mceusb_handle_command(struct mceusb_dev *ir, int index) | |||
| 817 | switch (ir->buf_in[index]) { | 816 | switch (ir->buf_in[index]) { |
| 818 | /* 2-byte return value commands */ | 817 | /* 2-byte return value commands */ |
| 819 | case MCE_CMD_S_TIMEOUT: | 818 | case MCE_CMD_S_TIMEOUT: |
| 820 | ir->rc->timeout = MS_TO_NS((hi << 8 | lo) / 2); | 819 | ir->rc->timeout = US_TO_NS((hi << 8 | lo) / 2); |
| 821 | break; | 820 | break; |
| 822 | 821 | ||
| 823 | /* 1-byte return value commands */ | 822 | /* 1-byte return value commands */ |
| @@ -856,9 +855,10 @@ static void mceusb_process_ir_data(struct mceusb_dev *ir, int buf_len) | |||
| 856 | break; | 855 | break; |
| 857 | case PARSE_IRDATA: | 856 | case PARSE_IRDATA: |
| 858 | ir->rem--; | 857 | ir->rem--; |
| 858 | init_ir_raw_event(&rawir); | ||
| 859 | rawir.pulse = ((ir->buf_in[i] & MCE_PULSE_BIT) != 0); | 859 | rawir.pulse = ((ir->buf_in[i] & MCE_PULSE_BIT) != 0); |
| 860 | rawir.duration = (ir->buf_in[i] & MCE_PULSE_MASK) | 860 | rawir.duration = (ir->buf_in[i] & MCE_PULSE_MASK) |
| 861 | * MS_TO_NS(MCE_TIME_UNIT); | 861 | * US_TO_NS(MCE_TIME_UNIT); |
| 862 | 862 | ||
| 863 | dev_dbg(ir->dev, "Storing %s with duration %d\n", | 863 | dev_dbg(ir->dev, "Storing %s with duration %d\n", |
| 864 | rawir.pulse ? "pulse" : "space", | 864 | rawir.pulse ? "pulse" : "space", |
| @@ -884,6 +884,8 @@ static void mceusb_process_ir_data(struct mceusb_dev *ir, int buf_len) | |||
| 884 | i, ir->rem + 1, false); | 884 | i, ir->rem + 1, false); |
| 885 | if (ir->rem) | 885 | if (ir->rem) |
| 886 | ir->parser_state = PARSE_IRDATA; | 886 | ir->parser_state = PARSE_IRDATA; |
| 887 | else | ||
| 888 | ir_raw_event_reset(ir->rc); | ||
| 887 | break; | 889 | break; |
| 888 | } | 890 | } |
| 889 | 891 | ||
| @@ -1061,7 +1063,7 @@ static struct rc_dev *mceusb_init_rc_dev(struct mceusb_dev *ir) | |||
| 1061 | rc->priv = ir; | 1063 | rc->priv = ir; |
| 1062 | rc->driver_type = RC_DRIVER_IR_RAW; | 1064 | rc->driver_type = RC_DRIVER_IR_RAW; |
| 1063 | rc->allowed_protos = RC_TYPE_ALL; | 1065 | rc->allowed_protos = RC_TYPE_ALL; |
| 1064 | rc->timeout = MS_TO_NS(1000); | 1066 | rc->timeout = US_TO_NS(1000); |
| 1065 | if (!ir->flags.no_tx) { | 1067 | if (!ir->flags.no_tx) { |
| 1066 | rc->s_tx_mask = mceusb_set_tx_mask; | 1068 | rc->s_tx_mask = mceusb_set_tx_mask; |
| 1067 | rc->s_tx_carrier = mceusb_set_tx_carrier; | 1069 | rc->s_tx_carrier = mceusb_set_tx_carrier; |
diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c index dd4caf8ef80b..273d9d674792 100644 --- a/drivers/media/rc/nuvoton-cir.c +++ b/drivers/media/rc/nuvoton-cir.c | |||
| @@ -460,7 +460,7 @@ static u32 nvt_rx_carrier_detect(struct nvt_dev *nvt) | |||
| 460 | return 0; | 460 | return 0; |
| 461 | } | 461 | } |
| 462 | 462 | ||
| 463 | carrier = (count * 1000000) / duration; | 463 | carrier = MS_TO_NS(count) / duration; |
| 464 | 464 | ||
| 465 | if ((carrier > MAX_CARRIER) || (carrier < MIN_CARRIER)) | 465 | if ((carrier > MAX_CARRIER) || (carrier < MIN_CARRIER)) |
| 466 | nvt_dbg("WTF? Carrier frequency out of range!"); | 466 | nvt_dbg("WTF? Carrier frequency out of range!"); |
| @@ -612,8 +612,8 @@ static void nvt_process_rx_ir_data(struct nvt_dev *nvt) | |||
| 612 | sample = nvt->buf[i]; | 612 | sample = nvt->buf[i]; |
| 613 | 613 | ||
| 614 | rawir.pulse = ((sample & BUF_PULSE_BIT) != 0); | 614 | rawir.pulse = ((sample & BUF_PULSE_BIT) != 0); |
| 615 | rawir.duration = (sample & BUF_LEN_MASK) | 615 | rawir.duration = US_TO_NS((sample & BUF_LEN_MASK) |
| 616 | * SAMPLE_PERIOD * 1000; | 616 | * SAMPLE_PERIOD); |
| 617 | 617 | ||
| 618 | if ((sample & BUF_LEN_MASK) == BUF_LEN_MASK) { | 618 | if ((sample & BUF_LEN_MASK) == BUF_LEN_MASK) { |
| 619 | if (nvt->rawir.pulse == rawir.pulse) | 619 | if (nvt->rawir.pulse == rawir.pulse) |
diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c index 72be8a02118c..512a2f4ada0e 100644 --- a/drivers/media/rc/rc-main.c +++ b/drivers/media/rc/rc-main.c | |||
| @@ -458,21 +458,27 @@ static int ir_getkeycode(struct input_dev *idev, | |||
| 458 | index = ir_lookup_by_scancode(rc_map, scancode); | 458 | index = ir_lookup_by_scancode(rc_map, scancode); |
| 459 | } | 459 | } |
| 460 | 460 | ||
| 461 | if (index >= rc_map->len) { | 461 | if (index < rc_map->len) { |
| 462 | if (!(ke->flags & INPUT_KEYMAP_BY_INDEX)) | 462 | entry = &rc_map->scan[index]; |
| 463 | IR_dprintk(1, "unknown key for scancode 0x%04x\n", | 463 | |
| 464 | scancode); | 464 | ke->index = index; |
| 465 | ke->keycode = entry->keycode; | ||
| 466 | ke->len = sizeof(entry->scancode); | ||
| 467 | memcpy(ke->scancode, &entry->scancode, sizeof(entry->scancode)); | ||
| 468 | |||
| 469 | } else if (!(ke->flags & INPUT_KEYMAP_BY_INDEX)) { | ||
| 470 | /* | ||
| 471 | * We do not really know the valid range of scancodes | ||
| 472 | * so let's respond with KEY_RESERVED to anything we | ||
| 473 | * do not have mapping for [yet]. | ||
| 474 | */ | ||
| 475 | ke->index = index; | ||
| 476 | ke->keycode = KEY_RESERVED; | ||
| 477 | } else { | ||
| 465 | retval = -EINVAL; | 478 | retval = -EINVAL; |
| 466 | goto out; | 479 | goto out; |
| 467 | } | 480 | } |
| 468 | 481 | ||
| 469 | entry = &rc_map->scan[index]; | ||
| 470 | |||
| 471 | ke->index = index; | ||
| 472 | ke->keycode = entry->keycode; | ||
| 473 | ke->len = sizeof(entry->scancode); | ||
| 474 | memcpy(ke->scancode, &entry->scancode, sizeof(entry->scancode)); | ||
| 475 | |||
| 476 | retval = 0; | 482 | retval = 0; |
| 477 | 483 | ||
| 478 | out: | 484 | out: |
diff --git a/drivers/media/rc/streamzap.c b/drivers/media/rc/streamzap.c index 6e2911c2abfb..e435d94c0776 100644 --- a/drivers/media/rc/streamzap.c +++ b/drivers/media/rc/streamzap.c | |||
| @@ -164,7 +164,7 @@ static void sz_push_full_pulse(struct streamzap_ir *sz, | |||
| 164 | sz->signal_start.tv_usec - | 164 | sz->signal_start.tv_usec - |
| 165 | sz->signal_last.tv_usec); | 165 | sz->signal_last.tv_usec); |
| 166 | rawir.duration -= sz->sum; | 166 | rawir.duration -= sz->sum; |
| 167 | rawir.duration *= 1000; | 167 | rawir.duration = US_TO_NS(rawir.duration); |
| 168 | rawir.duration &= IR_MAX_DURATION; | 168 | rawir.duration &= IR_MAX_DURATION; |
| 169 | } | 169 | } |
| 170 | sz_push(sz, rawir); | 170 | sz_push(sz, rawir); |
| @@ -177,7 +177,7 @@ static void sz_push_full_pulse(struct streamzap_ir *sz, | |||
| 177 | rawir.duration = ((int) value) * SZ_RESOLUTION; | 177 | rawir.duration = ((int) value) * SZ_RESOLUTION; |
| 178 | rawir.duration += SZ_RESOLUTION / 2; | 178 | rawir.duration += SZ_RESOLUTION / 2; |
| 179 | sz->sum += rawir.duration; | 179 | sz->sum += rawir.duration; |
| 180 | rawir.duration *= 1000; | 180 | rawir.duration = US_TO_NS(rawir.duration); |
| 181 | rawir.duration &= IR_MAX_DURATION; | 181 | rawir.duration &= IR_MAX_DURATION; |
| 182 | sz_push(sz, rawir); | 182 | sz_push(sz, rawir); |
| 183 | } | 183 | } |
| @@ -197,7 +197,7 @@ static void sz_push_full_space(struct streamzap_ir *sz, | |||
| 197 | rawir.duration = ((int) value) * SZ_RESOLUTION; | 197 | rawir.duration = ((int) value) * SZ_RESOLUTION; |
| 198 | rawir.duration += SZ_RESOLUTION / 2; | 198 | rawir.duration += SZ_RESOLUTION / 2; |
| 199 | sz->sum += rawir.duration; | 199 | sz->sum += rawir.duration; |
| 200 | rawir.duration *= 1000; | 200 | rawir.duration = US_TO_NS(rawir.duration); |
| 201 | sz_push(sz, rawir); | 201 | sz_push(sz, rawir); |
| 202 | } | 202 | } |
| 203 | 203 | ||
| @@ -273,6 +273,7 @@ static void streamzap_callback(struct urb *urb) | |||
| 273 | if (sz->timeout_enabled) | 273 | if (sz->timeout_enabled) |
| 274 | sz_push(sz, rawir); | 274 | sz_push(sz, rawir); |
| 275 | ir_raw_event_handle(sz->rdev); | 275 | ir_raw_event_handle(sz->rdev); |
| 276 | ir_raw_event_reset(sz->rdev); | ||
| 276 | } else { | 277 | } else { |
| 277 | sz_push_full_space(sz, sz->buf_in[i]); | 278 | sz_push_full_space(sz, sz->buf_in[i]); |
| 278 | } | 279 | } |
| @@ -290,6 +291,7 @@ static void streamzap_callback(struct urb *urb) | |||
| 290 | } | 291 | } |
| 291 | } | 292 | } |
| 292 | 293 | ||
| 294 | ir_raw_event_handle(sz->rdev); | ||
| 293 | usb_submit_urb(urb, GFP_ATOMIC); | 295 | usb_submit_urb(urb, GFP_ATOMIC); |
| 294 | 296 | ||
| 295 | return; | 297 | return; |
| @@ -430,13 +432,13 @@ static int __devinit streamzap_probe(struct usb_interface *intf, | |||
| 430 | sz->decoder_state = PulseSpace; | 432 | sz->decoder_state = PulseSpace; |
| 431 | /* FIXME: don't yet have a way to set this */ | 433 | /* FIXME: don't yet have a way to set this */ |
| 432 | sz->timeout_enabled = true; | 434 | sz->timeout_enabled = true; |
| 433 | sz->rdev->timeout = (((SZ_TIMEOUT * SZ_RESOLUTION * 1000) & | 435 | sz->rdev->timeout = ((US_TO_NS(SZ_TIMEOUT * SZ_RESOLUTION) & |
| 434 | IR_MAX_DURATION) | 0x03000000); | 436 | IR_MAX_DURATION) | 0x03000000); |
| 435 | #if 0 | 437 | #if 0 |
| 436 | /* not yet supported, depends on patches from maxim */ | 438 | /* not yet supported, depends on patches from maxim */ |
| 437 | /* see also: LIRC_GET_REC_RESOLUTION and LIRC_SET_REC_TIMEOUT */ | 439 | /* see also: LIRC_GET_REC_RESOLUTION and LIRC_SET_REC_TIMEOUT */ |
| 438 | sz->min_timeout = SZ_TIMEOUT * SZ_RESOLUTION * 1000; | 440 | sz->min_timeout = US_TO_NS(SZ_TIMEOUT * SZ_RESOLUTION); |
| 439 | sz->max_timeout = SZ_TIMEOUT * SZ_RESOLUTION * 1000; | 441 | sz->max_timeout = US_TO_NS(SZ_TIMEOUT * SZ_RESOLUTION); |
| 440 | #endif | 442 | #endif |
| 441 | 443 | ||
| 442 | do_gettimeofday(&sz->signal_start); | 444 | do_gettimeofday(&sz->signal_start); |
