Skip to content

Commit

Permalink
USB: set correct configuration in probe of ti_usb_3410_5052
Browse files Browse the repository at this point in the history
This driver transfers firmware. It may just as well set the correct
configuration.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Oliver Neukum authored and gregkh committed Dec 17, 2008
1 parent 7c99200 commit 413ba6f
Showing 1 changed file with 3 additions and 52 deletions.
55 changes: 3 additions & 52 deletions drivers/usb/serial/ti_usb_3410_5052.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,56 +16,6 @@
* For questions or problems with this driver, contact Texas Instruments
* technical support, or Al Borchers <alborchers@steinerpoint.com>, or
* Peter Berger <pberger@brimson.com>.
*
* This driver needs this hotplug script in /etc/hotplug/usb/ti_usb_3410_5052
* or in /etc/hotplug.d/usb/ti_usb_3410_5052.hotplug to set the device
* configuration.
*
* #!/bin/bash
*
* BOOT_CONFIG=1
* ACTIVE_CONFIG=2
*
* if [[ "$ACTION" != "add" ]]
* then
* exit
* fi
*
* CONFIG_PATH=/sys${DEVPATH%/?*}/bConfigurationValue
*
* if [[ 0`cat $CONFIG_PATH` -ne $BOOT_CONFIG ]]
* then
* exit
* fi
*
* PRODUCT=${PRODUCT%/?*} # delete version
* VENDOR_ID=`printf "%d" 0x${PRODUCT%/?*}`
* PRODUCT_ID=`printf "%d" 0x${PRODUCT#*?/}`
*
* PARAM_PATH=/sys/module/ti_usb_3410_5052/parameters
*
* function scan() {
* s=$1
* shift
* for i
* do
* if [[ $s -eq $i ]]
* then
* return 0
* fi
* done
* return 1
* }
*
* IFS=$IFS,
*
* if (scan $VENDOR_ID 1105 `cat $PARAM_PATH/vendor_3410` &&
* scan $PRODUCT_ID 13328 `cat $PARAM_PATH/product_3410`) ||
* (scan $VENDOR_ID 1105 `cat $PARAM_PATH/vendor_5052` &&
* scan $PRODUCT_ID 20562 20818 20570 20575 `cat $PARAM_PATH/product_5052`)
* then
* echo $ACTIVE_CONFIG > $CONFIG_PATH
* fi
*/

#include <linux/kernel.h>
Expand Down Expand Up @@ -457,9 +407,10 @@ static int ti_startup(struct usb_serial *serial)
goto free_tdev;
}

/* the second configuration must be set (in sysfs by hotplug script) */
/* the second configuration must be set */
if (dev->actconfig->desc.bConfigurationValue == TI_BOOT_CONFIG) {
status = -ENODEV;
status = usb_driver_set_configuration(dev, TI_ACTIVE_CONFIG);
status = status ? status : -ENODEV;
goto free_tdev;
}

Expand Down

0 comments on commit 413ba6f

Please sign in to comment.