aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorJarod Wilson <jarod@redhat.com>2010-05-24 11:02:05 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-06-01 00:23:26 -0400
commitbbe4690f6caef2b36c95dd50e59bc3f4e2eaa6ad (patch)
tree214da3d78e2d3d190d7f6b6c3cf1bb8e974ba865 /drivers/media
parentf789bf4013e5e003e5d75ec0b8fa280aa66f401f (diff)
V4L/DVB: IR/imon: add auto-config for 0xffdc rf device
Add auto-config support for iMON 2.4G LT RF device, based on debug output from Giulio Amodeo in Red Hat bugzilla #572288. Also flips the switch on only setting up the rf associate sysfs attr only if we think we're looking at an RF device, vs. previously, setting up the attr for all 0xffdc devices, so its possible (but a bit unlikely) there's another iMON RF device we'll have to fix up. Nb: should be applied after "IR/imon: clean up usage of bools", or there will be a slight contextual mismatch. Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/IR/imon.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/drivers/media/IR/imon.c b/drivers/media/IR/imon.c
index 2bae9ba2e40c..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 */
@@ -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 */
@@ -1908,6 +1909,7 @@ static struct imon_context *imon_init_intf0(struct usb_interface *intf)
1908 ictx->dev_present_intf0 = true; 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);
@@ -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 }