ChangeSet 1.2181.4.92, 2005/03/29 21:42:13-08:00, [EMAIL PROTECTED]

[PATCH] ftdi_sio: Support sysfs attributes for more chip

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]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>


 drivers/usb/serial/ftdi_sio.c |   21 ++++++++++++++++-----
 1 files changed, 16 insertions(+), 5 deletions(-)


diff -Nru a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
--- a/drivers/usb/serial/ftdi_sio.c     2005-03-30 13:30:15 -08:00
+++ b/drivers/usb/serial/ftdi_sio.c     2005-03-30 13:30:15 -08:00
@@ -1287,10 +1287,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);
+               }
        }
 }
 
@@ -1304,9 +1308,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);
+               }
        }
        
 }
@@ -1408,6 +1415,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 */
 
@@ -1459,6 +1468,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 */
 



-------------------------------------------------------
This SF.net email is sponsored by Demarc:
A global provider of Threat Management Solutions.
Download our HomeAdmin security software for free today!
http://www.demarc.com/info/Sentarus/hamr30
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to