Skip to contentSkip to conversation

mceusb: add support for cx231xx-based IR (e. g. Polaris)

PATCH In review Mauro Carvalho Chehab 2 participants 7 messages Oct 18, 2010 – Oct 21, 2010 1 message not in the archive Media (V4L/DVB)

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/3 mceusb: add support for cx231xx-based IR (e. g. Polaris)

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.

drivers/media/IR/mceusb.c +20 -0
index bc620e1..61ccb8f 100644
@@ -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		0x0572
 
 static 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
#3 lore raw

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

Looks good to me.

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

#4 lore raw

PATCH 2/3 cx231xx: Only register USB interface 1

In reply to a message not in the archive

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.

drivers/media/video/cx231xx/cx231xx-cards.c +8 -30
index 9c3a926..2db9856 100644
@@ -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
Reviewed-by on v1 2/3
#5 lore raw

Re: [PATCH 2/3] cx231xx: Only register USB interface 1

Quoted 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.

Looks good.

Signature · 2 lines
Jarod Wilson
[email protected]
#6 lore raw

PATCH 3/3 cx231xx: Remove IR support from the driver

In reply to a message not in the archive

Polaris 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
index 2db9856..dd20b04 100644
@@ -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
index 3ac313d..ff8ea37 100644
@@ -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