diff options
| author | Alexandre Peixoto Ferreira <alexandref75@gmail.com> | 2013-04-30 01:51:52 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-05-16 20:50:51 -0400 |
| commit | c2e314835af0e09652ef4571eb5e481757ebb90f (patch) | |
| tree | b93c2cccc2f321875f9ea27488c944a5443d4f6b /drivers/usb/class | |
| parent | 88d9b2b38c99d7d7f5eb557a56b6aaeaa392df86 (diff) | |
USB: usbtmc: Set rigol_quirk if device is listed
These patches implement a modification of the USBTMC
protocol to allow operation with Rigol equipment. It an idVendor and
idProduct is found on the usbtmc_id_quirk array, the rigol_quirk is set for
this device.
Signed-off-by: Alexandre Peixoto Ferreira <alexandref75@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/class')
| -rw-r--r-- | drivers/usb/class/usbtmc.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c index 9c370427d2ef..fd2f90d21d95 100644 --- a/drivers/usb/class/usbtmc.c +++ b/drivers/usb/class/usbtmc.c | |||
| @@ -1040,6 +1040,20 @@ static int usbtmc_probe(struct usb_interface *intf, | |||
| 1040 | mutex_init(&data->io_mutex); | 1040 | mutex_init(&data->io_mutex); |
| 1041 | data->zombie = 0; | 1041 | data->zombie = 0; |
| 1042 | 1042 | ||
| 1043 | /* Determine if it is a Rigol or not */ | ||
| 1044 | data->rigol_quirk = 0; | ||
| 1045 | dev_dbg(&intf->dev, "Trying to find if device Vendor 0x%04X Product 0x%04X has the RIGOL quirk\n", | ||
| 1046 | data->usb_dev->descriptor.idVendor, | ||
| 1047 | data->usb_dev->descriptor.idProduct); | ||
| 1048 | for(n = 0; usbtmc_id_quirk[n].idVendor > 0; n++) { | ||
| 1049 | if ((usbtmc_id_quirk[n].idVendor == data->usb_dev->descriptor.idVendor) && | ||
| 1050 | (usbtmc_id_quirk[n].idProduct == data->usb_dev->descriptor.idProduct)) { | ||
| 1051 | dev_dbg(&intf->dev, "Setting this device as having the RIGOL quirk\n"); | ||
| 1052 | data->rigol_quirk = 1; | ||
| 1053 | break; | ||
| 1054 | } | ||
| 1055 | } | ||
| 1056 | |||
| 1043 | /* Initialize USBTMC bTag and other fields */ | 1057 | /* Initialize USBTMC bTag and other fields */ |
| 1044 | data->bTag = 1; | 1058 | data->bTag = 1; |
| 1045 | data->TermCharEnabled = 0; | 1059 | data->TermCharEnabled = 0; |
