Author: n_hibma
Date: Fri Apr  9 08:20:43 2010
New Revision: 206412
URL: http://svn.freebsd.org/changeset/base/206412

Log:
  Add the ID for the Matrix Orbital LCD display MOU-Axxx series.
  Simplify a switch statement in the uftdi driver to an if-then-else-endif
  as it encoded those two cases only.
  
  Reviewed by:  imp

Modified:
  stable/7/sys/dev/usb/uftdi.c
  stable/7/sys/dev/usb/usbdevs

Modified: stable/7/sys/dev/usb/uftdi.c
==============================================================================
--- stable/7/sys/dev/usb/uftdi.c        Fri Apr  9 06:47:36 2010        
(r206411)
+++ stable/7/sys/dev/usb/uftdi.c        Fri Apr  9 08:20:43 2010        
(r206412)
@@ -184,6 +184,9 @@ uftdi_match(device_t self)
        if (uaa->vendor == USB_VENDOR_MELCO &&
            (uaa->product == USB_PRODUCT_MELCO_PCOPRS1))
                return (UMATCH_VENDOR_PRODUCT);
+       if (uaa->vendor == USB_VENDOR_MATRIXORBITAL &&
+           (uaa->product == USB_PRODUCT_MATRIXORBITAL_MOUA))
+               return (UMATCH_VENDOR_PRODUCT);
 
        return (UMATCH_NONE);
 }
@@ -227,94 +230,13 @@ uftdi_attach(device_t self)
 
        id = usbd_get_interface_descriptor(iface);
        ucom->sc_iface = iface;
-       switch( uaa->vendor ){
-       case USB_VENDOR_FTDI:
-               switch( uaa->product ){
-               case USB_PRODUCT_FTDI_SERIAL_8U100AX:
-                       sc->sc_type = UFTDI_TYPE_SIO;
-                       sc->sc_hdrlen = 1;
-                       break;
-               case USB_PRODUCT_FTDI_SEMC_DSS20:
-               case USB_PRODUCT_FTDI_SERIAL_8U232AM:
-               case USB_PRODUCT_FTDI_SERIAL_2232C:
-               case USB_PRODUCT_FTDI_CFA_631:
-               case USB_PRODUCT_FTDI_CFA_632:
-               case USB_PRODUCT_FTDI_CFA_633:
-               case USB_PRODUCT_FTDI_CFA_634:
-               case USB_PRODUCT_FTDI_CFA_635:
-               case USB_PRODUCT_FTDI_USBSERIAL:
-               case USB_PRODUCT_FTDI_MX2_3:
-               case USB_PRODUCT_FTDI_MX4_5:
-               case USB_PRODUCT_FTDI_LK202:
-               case USB_PRODUCT_FTDI_LK204:
-               case USB_PRODUCT_FTDI_TACTRIX_OPENPORT_13M:
-               case USB_PRODUCT_FTDI_TACTRIX_OPENPORT_13S:
-               case USB_PRODUCT_FTDI_TACTRIX_OPENPORT_13U:
-               case USB_PRODUCT_FTDI_EISCOU:
-               case USB_PRODUCT_FTDI_UOPTBR:
-               case USB_PRODUCT_FTDI_EMCU2D:
-               case USB_PRODUCT_FTDI_PCMSFU:
-               case USB_PRODUCT_FTDI_EMCU2H:
-                       sc->sc_type = UFTDI_TYPE_8U232AM;
-                       sc->sc_hdrlen = 0;
-                       break;
-
-               default:                /* Can't happen */
-                       goto bad;
-               }
-               break;
-
-       case USB_VENDOR_INTREPIDCS:
-               switch( uaa->product ){
-               case USB_PRODUCT_INTREPIDCS_VALUECAN:
-               case USB_PRODUCT_INTREPIDCS_NEOVI:
-                       sc->sc_type = UFTDI_TYPE_8U232AM;
-                       sc->sc_hdrlen = 0;
-                       break;
-
-               default:                /* Can't happen */
-                       goto bad;
-               }
-               break;
-
-       case USB_VENDOR_SIIG2:
-               switch( uaa->product ){
-               case USB_PRODUCT_SIIG2_US2308:
-                       sc->sc_type = UFTDI_TYPE_8U232AM;
-                       sc->sc_hdrlen = 0;
-                       break;
 
-               default:                /* Can't happen */
-                       goto bad;
-               }
-               break;
-
-       case USB_VENDOR_BBELECTRONICS:
-               switch( uaa->product ){
-               case USB_PRODUCT_BBELECTRONICS_USOTL4:
-                       sc->sc_type = UFTDI_TYPE_8U232AM;
-                       sc->sc_hdrlen = 0;
-                       break;
-
-               default:                /* Can't happen */
-                       goto bad;
-               }
-               break;
-
-       case USB_VENDOR_MELCO:
-               switch( uaa->product ){
-               case USB_PRODUCT_MELCO_PCOPRS1:
-                       sc->sc_type = UFTDI_TYPE_8U232AM;
-                       sc->sc_hdrlen = 0;
-                       break;
-
-               default:                /* Can't happen */
-                       goto bad;
-               }
-               break;
-
-       default:                /* Can't happen */
-               goto bad;
+       if (uaa->vendor == USB_VENDOR_FTDI && uaa->product == 
USB_PRODUCT_FTDI_SERIAL_8U100AX) {
+               sc->sc_type = UFTDI_TYPE_SIO;
+               sc->sc_hdrlen = 1;
+       } else {
+               sc->sc_type = UFTDI_TYPE_8U232AM;
+               sc->sc_hdrlen = 0;
        }
 
        ucom->sc_bulkin_no = ucom->sc_bulkout_no = -1;

Modified: stable/7/sys/dev/usb/usbdevs
==============================================================================
--- stable/7/sys/dev/usb/usbdevs        Fri Apr  9 06:47:36 2010        
(r206411)
+++ stable/7/sys/dev/usb/usbdevs        Fri Apr  9 08:20:43 2010        
(r206412)
@@ -624,6 +624,7 @@ vendor AMIT         0x18c5  AMIT
 vendor QCOM            0x18e8  Qcom
 vendor LINKSYS3                0x1915  Linksys
 vendor QUALCOMMINC     0x19d2  Qualcomm, Incorporated
+vendor MATRIXORBITAL   0x1b3d  Matrix Orbital
 vendor STELERA         0x1a8d  Stelera Wireless
 vendor DRESDENELEKTRONIK 0x1cf1 dresden elektronik
 vendor DLINK           0x2001  D-Link
@@ -1175,7 +1176,10 @@ product DMI CFSM_RW              0xa109  CF/SM Reader
 /* DrayTek products */
 product DRAYTEK VIGOR550       0x0550  Vigor550
 
-/* dresden elektronik products */
+/* Matrix Orbital products */
+product MATRIXORBITAL MOUA     0x0153  Martrix Orbital MOU-Axxxx LCD displays
+
+/* Dresden Elektronik products */
 product DRESDENELEKTRONIK SENSORTERMINALBOARD  0x0001 SensorTerminalBoard
 product DRESDENELEKTRONIK WIRELESSHANDHELDTERMINAL  0x0004 Wireless Handheld 
Terminal
 
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to