mceusb: add support for cx231xx-based IR (e. g. Polaris)
PATCH 1/3 mceusb: add support for cx231xx-based IR (e. g. Polaris)
In reply to a message not in the archiveFor now, it adds support for Conexant EVK and for Pixelview. We should probably find a better way to specify all Conexant Polaris devices, to avoid needing to repeat this setup on both mceusb and cx231xx-cards.
drivers/media/IR/mceusb.c +20 -0
@@ -104,6 +104,8 @@ static int debug;#define VENDOR_NORTHSTAR 0x04eb#define VENDOR_REALTEK 0x0bda#define VENDOR_TIVO 0x105a +#define VENDOR_PIXELVIEW 0x1554 +#define VENDOR_CONEXANT 0x0572static struct usb_device_id mceusb_dev_table[] = {/* Original Microsoft MCE IR Transceiver (often HP-branded) */
@@ -198,6 +200,10 @@ static struct usb_device_id mceusb_dev_table[] = { { USB_DEVICE(VENDOR_NORTHSTAR, 0xe004) },/* TiVo PC IR Receiver */ { USB_DEVICE(VENDOR_TIVO, 0x2000) }, +/* Pixelview SBTVD Hybrid */ + { USB_DEVICE_VER(VENDOR_PIXELVIEW, 0x5010, 0x4000, 0x4001) }, +/* Conexant SDK */ + { USB_DEVICE(VENDOR_CONEXANT, 0x58a1) }, /* Terminating entry */ { } };
@@ -229,6 +235,12 @@ static struct usb_device_id std_tx_mask_list[] = { {} }; +static struct usb_device_id cx_polaris_list[] = { + {USB_DEVICE (VENDOR_PIXELVIEW ,0x5010 ) }, + {USB_DEVICE (VENDOR_CONEXANT ,0x58a1 ) }, + {} +}; +/* data structure for each usb transceiver */ struct mceusb_dev {/* ir-core bits */
@@ -929,6 +941,7 @@ static int __devinit mceusb_dev_probe(struct usb_interface *intf,bool is_gen3;bool is_microsoft_gen1;bool tx_mask_inverted; +bool is_polaris;dev_dbg (&intf->dev,": %s called\n" , __func__);
@@ -937,6 +950,13 @@ static int __devinit mceusb_dev_probe(struct usb_interface *intf, is_gen3 =usb_match_id (intf, gen3_list) ?1 :0 ; is_microsoft_gen1 =usb_match_id (intf, microsoft_gen1_list) ?1 :0 ; tx_mask_inverted =usb_match_id (intf, std_tx_mask_list) ?0 :1 ; + is_polaris =usb_match_id (intf, cx_polaris_list) ?1 :0 ; + +if (is_polaris) { +/* Interface 0 is IR */ +if (idesc->desc.bInterfaceNumber) +return -ENODEV ; + }/* step through the endpoints to find first bulk in and out endpoint */ for (i =0 ; i < idesc->desc.bNumEndpoints; ++i) {
Signature · 1 line
1.7.1
PATCH 3/3 cx231xx: Remove IR support from the driver
In reply to a message not in the archivePolaris design uses MCE support. Instead of reinventing the wheel, just let mceusb handle the remote controller.
delete mode 100644 drivers/media/video/cx231xx/cx231xx-input.c
drivers/media/video/cx231xx/cx231xx-cards.c +0 -11
@@ -628,11 +628,6 @@ void cx231xx_card_setup(struct cx231xx *dev)else cx231xx_config_tuner (dev); } - -#if 0 -/* TBD IR will be added later */ -cx231xx_ir_init (dev); -#endif }/*
@@ -666,12 +661,6 @@ void cx231xx_config_i2c(struct cx231xx *dev)*/ void cx231xx_release_resources (struct cx231xx *dev) { - -#if 0 /* TBD IR related */ -if (dev->ir) -cx231xx_ir_fini (dev); -#endif -cx231xx_release_analog_resources (dev);cx231xx_remove_from_devlist (dev);
drivers/media/video/cx231xx/cx231xx-input.c deleted +0 -251
251 lines not on this page · raw message
drivers/media/video/cx231xx/cx231xx.h +0 -4
@@ -954,10 +954,6 @@ extern struct usb_device_id cx231xx_id_table[];extern const unsigned int cx231xx_bcount;int cx231xx_tuner_callback (void *ptr,int component,int command,int arg); -/* Provided by cx231xx-input.c */ -int cx231xx_ir_init (struct cx231xx *dev); -int cx231xx_ir_fini (struct cx231xx *dev); -/* cx23885-417.c */ extern int cx231xx_417_register (struct cx231xx *dev);extern void cx231xx_417_unregister (struct cx231xx *dev);
Signature · 1 line
1.7.1
PATCH 2/3 cx231xx: Only register USB interface 1
In reply to a message not in the archiveInterface 0 is used by IR. The current driver starts initializing on it, finishing on interface 6. Change the logic to only handle interface 1. This allows another driver (mceusb) to take care of the IR interface.
drivers/media/video/cx231xx/cx231xx-cards.c +8 -30
@@ -843,13 +843,12 @@ static int cx231xx_usb_probe(struct usb_interface *interface,char *speed;char descr[255 ] ="" ;struct usb_interface *lif =NULL ; -int skip_interface =0 ;struct usb_interface_assoc_descriptor *assoc_desc; udev =usb_get_dev (interface_to_usbdev (interface)); ifnum = interface->altsetting[0 ].desc.bInterfaceNumber; -if (!ifnum) { +if (ifnum ==1 ) {/* * Interface number 0 - IR interface */
@@ -936,13 +935,6 @@ static int cx231xx_usb_probe(struct usb_interface *interface,le16_to_cpu (udev->descriptor.idVendor),le16_to_cpu (udev->descriptor.idProduct), dev->max_iad_interface_count); - }else { -/* Get dev structure first */ - dev =usb_get_intfdata (udev->actconfig->interface[0 ]); -if (dev ==NULL ) { -cx231xx_err (DRIVER_NAME ": out of first interface!\n" ); -return -ENODEV ; - }/* store the interface 0 back */ lif = udev->actconfig->interface[0 ];
@@ -953,35 +945,21 @@ static int cx231xx_usb_probe(struct usb_interface *interface,/* get device number */ nr = dev->devno; -/* -* set skip interface, for all interfaces but -* interface 1 and the last one -*/ -if ((ifnum !=1 ) && ((ifnum) - != dev->max_iad_interface_count)) - skip_interface =1 ; - -if (ifnum ==1 ) { - assoc_desc = udev->actconfig->intf_assoc[0 ]; -if (assoc_desc->bFirstInterface != ifnum) { -cx231xx_err (DRIVER_NAME ": Not found " -"matching IAD interface\n" ); -return -ENODEV ; - } + assoc_desc = udev->actconfig->intf_assoc[0 ]; +if (assoc_desc->bFirstInterface != ifnum) { +cx231xx_err (DRIVER_NAME ": Not found " +"matching IAD interface\n" ); +return -ENODEV ; } - } - -if (skip_interface) + }else {return -ENODEV ; + }cx231xx_info ("registering interface %d\n" , ifnum);/* save our data pointer in this interface device */ usb_set_intfdata (lif, dev); -if ((ifnum) != dev->max_iad_interface_count) -return 0 ; -/* * AV device initialization - only done at the last interface */
Signature · 1 line
1.7.1
Quoted 6 lines · Mauro Carvalho Chehab
For now, it adds support for Conexant EVK and for Pixelview. We should probably find a better way to specify all Conexant Polaris devices, to avoid needing to repeat this setup on both mceusb and cx231xx-cards.
Signed-off-by Mauro Carvalho Chehab <[email protected]>
Looks good to me.
Signature · 2 lines
Jarod Wilson [email protected]
Re: [PATCH 2/3] cx231xx: Only register USB interface 1
In reply to Mauro Carvalho ChehabQuoted 6 lines · Mauro Carvalho Chehab
Interface 0 is used by IR. The current driver starts initializing on it, finishing on interface 6. Change the logic to only handle interface 1. This allows another driver (mceusb) to take care of the IR interface.
Signed-off-by Mauro Carvalho Chehab <[email protected]>
Looks good.
Signature · 2 lines
Jarod Wilson [email protected]
Re: [PATCH 3/3] cx231xx: Remove IR support from the driver
In reply to Mauro Carvalho ChehabQuoted 4 lines · Mauro Carvalho Chehab
Polaris design uses MCE support. Instead of reinventing the wheel, just let mceusb handle the remote controller.
Signed-off-by Mauro Carvalho Chehab <[email protected]>
Signature · 2 lines
Jarod Wilson [email protected]
Em 19-10-2010 15:50, Jarod Wilson escreveu:
Quoted 6 lines · Mauro Carvalho Chehab
Quoted 5 lines
For now, it adds support for Conexant EVK and for Pixelview. We should probably find a better way to specify all Conexant Polaris devices, to avoid needing to repeat this setup on both mceusb and cx231xx-cards.
Quoted 6 lines
Quoted 1 line
Signed-off-by Mauro Carvalho Chehab <[email protected]>Looks good to me.
Reviewed-by Jarod Wilson <[email protected]>
Thanks!
I'll remove the Pixelview ID from it, as it has an extra chip for IR decoding, so, we'll likely need to do something else for IR to work on it. So, I'm keeping, for now, just the Conexant EVK USB ID. Probably other cx231xx non-ISDB-T devices should work via mceusb as well.
Thanks,
Mauro