A couple of sysfs attributes were added for the FT232BM (and FT245BM) chip type in 2.6.11. This patch extends there use to the FT8U232AM (and FT8U245AM) and FT2232C chip types, where applicable.

Signed-off-by: Ian Abbott <[EMAIL PROTECTED]>
diff -ur b/drivers/usb/serial/ftdi_sio.c c/drivers/usb/serial/ftdi_sio.c
--- b/drivers/usb/serial/ftdi_sio.c	2005-03-29 11:42:14.000000000 +0100
+++ c/drivers/usb/serial/ftdi_sio.c	2005-03-29 12:00:37.000000000 +0100
@@ -1282,10 +1282,14 @@
 	priv = usb_get_serial_port_data(serial->port[0]);
 	udev = serial->dev;
 	
-	if (priv->chip_type == FT232BM) {
-		dbg("sysfs attributes for FT232BM");
+	/* XXX I've no idea if the original SIO supports the event_char
+	 * sysfs parameter, so I'm playing it safe.  */
+	if (priv->chip_type != SIO) {
+		dbg("sysfs attributes for %s", ftdi_chip_name[priv->chip_type]);
 		device_create_file(&udev->dev, &dev_attr_event_char);
-		device_create_file(&udev->dev, &dev_attr_latency_timer);
+		if (priv->chip_type == FT232BM || priv->chip_type == FT2232C) {
+			device_create_file(&udev->dev, &dev_attr_latency_timer);
+		}
 	}
 }
 
@@ -1299,9 +1303,12 @@
 	priv = usb_get_serial_port_data(serial->port[0]);
 	udev = serial->dev;
 	
-	if (priv->chip_type == FT232BM) {
+	/* XXX see create_sysfs_attrs */
+	if (priv->chip_type != SIO) {
 		device_remove_file(&udev->dev, &dev_attr_event_char);
-		device_remove_file(&udev->dev, &dev_attr_latency_timer);
+		if (priv->chip_type == FT232BM || priv->chip_type == FT2232C) {
+			device_remove_file(&udev->dev, &dev_attr_latency_timer);
+		}
 	}
 	
 }
@@ -1403,6 +1410,8 @@
 	priv->chip_type = FT8U232AM;
 	priv->baud_base = 48000000 / 2; /* Would be / 16, but FTDI supports 0.125, 0.25 and 0.5 divisor fractions! */
 	
+	create_sysfs_attrs(serial);
+	
 	return (0);
 } /* ftdi_8U232AM_startup */
 
@@ -1454,6 +1463,8 @@
 	}
 	priv->baud_base = 48000000 / 2; /* Would be / 16, but FT2232C supports multiple of 0.125 divisor fractions! */
 	
+	create_sysfs_attrs(serial);
+
 	return (0);
 } /* ftdi_FT2232C_startup */
 

Reply via email to