1
0
Fork 0
Commit Graph

244 Commits (redonkable)

Author SHA1 Message Date
Scott Chen bfb1438e8c USB: serial: pl2303: add device-id for HP GC device
commit 031f9664f8 upstream.

This is adds a device id for HP LD381 which is a pl2303GC-base device.

Signed-off-by: Scott Chen <scott@labau.com.tw>
Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-10-17 10:11:23 +02:00
Scott Chen 6e1167db8d USB: serial: pl2303: add device-id for HP LD381
commit cecc113c1a upstream.

Add a device id for HP LD381 Display
LD381:   03f0:0f7f

Signed-off-by: Scott Chen <scott@labau.com.tw>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-25 08:25:50 +01:00
Mauro Carvalho Chehab ecefae6db0 docs: usb: rename files to .rst and add them to drivers-api
While there are a mix of things here, most of the stuff
were written from Kernel developer's PoV. So, add them to
the driver-api book.

A follow up for this patch would be to move documents from
there that are specific to sysadmins, adding them to the
admin-guide.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Acked-by: Johan Hovold <johan@kernel.org>
Acked-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-20 14:28:36 +02:00
Chris Packham c5f81656a1 USB: serial: pl2303: add Allied Telesis VT-Kit3
This is adds the vendor and device id for the AT-VT-Kit3 which is a
pl2303-based device.

Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
2019-05-21 11:26:14 +02:00
Johan Hovold f64c3ab230 USB: serial: pl2303: fix tranceiver suspend mode
Add helper function to update register bits instead of overwriting the
entire control register when updating the flow-control settings.

This specifically avoids having the tranceiver suspend mode (bit 0)
depend on the flow control setting.

The tranceiver is currently configured at probe to be disabled during
suspend, but this was overridden when disabling flow control or enabling
xon/xoff.

Fixes: 715f9527c1 ("USB: flow control fix for pl2303")
Fixes: 7041d9c3f0 ("USB: serial: pl2303: add support for tx xon/xoff flow control")
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
2019-04-03 09:46:50 +02:00
Johan Hovold 68270dab97 USB: serial: pl2303: fix non-supported xon/xoff
Older pl2303 devices do not support automatic xon/xoff flow control, so
add add a flag to prevent trying to enable it for legacy device types.

Refactor the IXON test into a helper function to improve readability.

Fixes: 7041d9c3f0 ("USB: serial: pl2303: add support for tx xon/xoff flow control")
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
2019-04-03 09:46:22 +02:00
Charles Yeh 4dcf9ddc9a USB: serial: pl2303: add new PID to support PL2303TB
Add new PID to support PL2303TB (TYPE_HX)

Signed-off-by: Charles Yeh <charlesyeh522@gmail.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
2019-01-17 17:24:39 +01:00
Scott Chen 8d503f206c USB: serial: pl2303: add ids for Hewlett-Packard HP POS pole displays
Add device ids to pl2303 for the HP POS pole displays:
LM920:   03f0:026b
TD620:   03f0:0956
LD960TA: 03f0:4439
LD220TA: 03f0:4349
LM940:   03f0:5039

Signed-off-by: Scott Chen <scott@labau.com.tw>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
2018-12-18 10:22:37 +01:00
Al Viro 9326ec59ec pl2303: switch to ->get_serial()
Reviewed-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2018-10-13 00:50:40 -04:00
Movie Song 29c692c96b USB: serial: pl2303: add a new device id for ATEN
Signed-off-by: Movie Song <MovieSong@aten-itlab.cn>
Cc: Johan Hovold <johan@kernel.org>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-02 10:37:04 +02:00
Florian Zumbiehl 7041d9c3f0 USB: serial: pl2303: add support for tx xon/xoff flow control
Support hardware-level Xon/Xoff flow control in transmit direction with
pl2303.

I only know how to get the hardware to do IXON/!IXANY with ^S/^Q as control
characters, so I preserve the old behaviour for all other cases.

Signed-off-by: Florian Zumbiehl <florz@florz.de>
[ johan: rewrite logic using pl2303_termios_change() helper ]
Signed-off-by: Johan Hovold <johan@kernel.org>
2018-05-22 10:08:05 +02:00
Greg Kroah-Hartman d08dd3f3dd USB: serial: pl2303: new device id for Chilitag
This adds a new device id for Chilitag devices to the pl2303 driver.

Reported-by: "Chu.Mike [朱堅宜]" <Mike-Chu@prolific.com.tw>
Cc: stable <stable@vger.kernel.org>
Acked-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-25 10:39:59 +01:00
Johan Hovold 627cfa89b1 USB: serial: fix module-license macros
Several GPL-2.0 drivers used "GPL" rather than "GPL v2" in their
MODULE_LICENSE macros; fix the macros to match the licenses.

Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-04 11:58:00 +01:00
Greg Kroah-Hartman 6ca98bc284 USB: serial: Remove redundant license text
Now that the SPDX tag is in all USB files, that identifies the license
in a specific and legally-defined manner.  So the extra GPL text wording
can be removed as it is no longer needed at all.

This is done on a quest to remove the 700+ different ways that files in
the kernel describe the GPL license text.  And there's unneeded stuff
like the address (sometimes incorrect) for the FSF which is never
needed.

No copyright headers or other non-license-description text was removed.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-04 11:55:38 +01:00
Greg Kroah-Hartman 5fd54ace47 USB: add SPDX identifiers to all remaining files in drivers/usb/
It's good to have SPDX identifiers in all files to make it easier to
audit the kernel tree for correct licenses.

Update the drivers/usb/ and include/linux/usb* files with the correct
SPDX license identifier based on the license text in the file itself.
The SPDX identifier is a legally binding shorthand, which can be used
instead of the full boiler plate text.

This work is based on a script and data from Thomas Gleixner, Philippe
Ombredanne, and Kate Stewart.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Kate Stewart <kstewart@linuxfoundation.org>
Cc: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Acked-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-04 11:48:02 +01:00
Greg Kroah-Hartman 3b6bcd3d09 USB: serial: pl2303: add new ATEN device id
This adds a new ATEN device id for a new pl2303-based device.

Reported-by: Peter Kuo <PeterKuo@aten.com.tw>
Cc: stable <stable@vger.kernel.org>
Cc: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-08-10 11:55:00 -07:00
Johan Hovold 9d717271d6 USB: serial: pl2303: clean up legacy endpoint hack
Implement the "horrible endpoint hack" for some legacy devices as a
quirk and clean up the code somewhat.

Note that the bulk-endpoint check can be removed as core will already
have verified this.

Signed-off-by: Johan Hovold <johan@kernel.org>
2017-03-28 11:00:07 +02:00
Johan Hovold 9fda620a5f USB: serial: move pl2303 hack out of usb-serial core
Some pl2303 devices require the use of the interrupt endpoint of an
unrelated interface. This has so far been dealt with in usb-serial core,
but can now be moved to a driver calc_num_ports callback.

Note that we relax the endpoint requirements checked by core and instead
verify that we have an interrupt-in endpoint in calc_num_ports for all
devices so that the hack can first be applied.

Signed-off-by: Johan Hovold <johan@kernel.org>
2017-03-28 10:59:01 +02:00
Johan Hovold 590298b223 USB: serial: pl2303: simplify endpoint check
Simplify the endpoint sanity check by letting core verify that the
required endpoints are present.

Signed-off-by: Johan Hovold <johan@kernel.org>
2017-03-16 10:33:46 +01:00
Greg Kroah-Hartman 54a21903df USB-serial updates for v4.11-rc1
These updates include
 
  - a new driver for Renesas uPD78F0730-based devices
 
  - several fixes of failures to check for short transfers, some of which could
    lead to minor information leaks, and in one case a loop-condition underflow
 
  - a fix of a long-standing regression in the ftdi_sio driver which resulted
    in excessive bulk-in interrupts
 
  - a fix for ftdi_sio line-status over-reporting which could lead to an
    endless stream of NULL-characters being forwarded to user space
 
  - a fix for a regression in the console driver
 
  - a fix for another mos7840 NULL-pointer dereference due to a missing endpoint
    sanity check
 
 Included are also some clean ups and fixes for various minor issues, as well as
 a couple of new device IDs that came in late.
 
 All but the final patch have been in linux-next with no reported issues.
 
 Signed-off-by: Johan Hovold <johan@kernel.org>
 -----BEGIN PGP SIGNATURE-----
 
 iQIuBAABCAAYBQJYnGAqERxqb2hhbkBrZXJuZWwub3JnAAoJEEEN5E/e4bSVONQP
 /ixZnWgUgAkDk0lHuXwZvYrmXssM2cEAuN1CZkddKyp8h0LhNSVy8Nat4zGJh4kc
 Nvdln6qPunaKrCL0nV7uaBLRKlCYFmmMLwGRSXOXe3CkQ05oM+o5SOvI+f8qqHWZ
 efEUtfBc24FAp7gM521sQkPVK6bwj2OzaLXw2DVYhuPip5ZvjNHiqjvpjMddV8mz
 mF+tE/qpbIWWP+QXuMPUZ4+gDPA7rq+AIeWAH3JDtZIXCivJBlDYWbX8GGEy7kFU
 p50xSZfcLjcfpz0UGhFPfRXGbABjWegVzwWrRBngeXoY1kyRuz4BtUKM22NcAOff
 IHCo+/9mu3lFa3Il9c7i23EbhTeY5Vrl4xiwuF9FWYiwNj0N8GZkFaoVuH3tofn2
 4S3oJhHvwe8IgKWAo9mnuk5Et9dGCh4WblTueucHwExfLwddaiM1Xv/y7SKGEeTd
 IZKxInXHn9niDcjMBeod91BMZBvrlt1Wri147LvF5kUk7eeB/i0M2IiflYXTfVAl
 Qq/5FAfDLvmjUWsZFRYQCTGd4ykuGeU2vAKeL8kaG6cadvJhBZfnz2J9UYYoVgLi
 zUKdCXcppumainjP4AxiR0hOk9wCEMjWtAuSWUNh5gfxTDMB1ObadIOBaWFuZSSI
 goj5jqNCc1xlzLsPmtUQmCBS8/Bv3ux67fxk2ys3tgKR
 =Ma49
 -----END PGP SIGNATURE-----

Merge tag 'usb-serial-4.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-next

Johan writes:

USB-serial updates for v4.11-rc1

These updates include

 - a new driver for Renesas uPD78F0730-based devices

 - several fixes of failures to check for short transfers, some of which could
   lead to minor information leaks, and in one case a loop-condition underflow

 - a fix of a long-standing regression in the ftdi_sio driver which resulted
   in excessive bulk-in interrupts

 - a fix for ftdi_sio line-status over-reporting which could lead to an
   endless stream of NULL-characters being forwarded to user space

 - a fix for a regression in the console driver

 - a fix for another mos7840 NULL-pointer dereference due to a missing endpoint
   sanity check

Included are also some clean ups and fixes for various minor issues, as well as
a couple of new device IDs that came in late.

All but the final patch have been in linux-next with no reported issues.

Signed-off-by: Johan Hovold <johan@kernel.org>
2017-02-09 13:57:05 +01:00
Marcel J.E. Mol d07830db1b USB: serial: pl2303: add ATEN device ID
Seems that ATEN serial-to-usb devices using pl2303 exist with
different device ids. This patch adds a missing device ID so it
is recognised by the driver.

Signed-off-by: Marcel J.E. Mol <marcel@mesa.nl>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
2017-01-31 17:27:04 +01:00
Johan Hovold b5fda434b1 USB: serial: pl2303: fix line-setting error handling
Make sure to return an error on zero-length transfers when retrieving
the line settings even if the driver currently ignores the return value.

Also remove a redundant check for short transfer when setting the line
settings.

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
2017-01-16 16:38:56 +01:00
Johan Hovold 76ab439ed1 USB: serial: pl2303: fix NULL-deref at open
Fix NULL-pointer dereference in open() should a type-0 or type-1 device
lack the expected endpoints:

Unable to handle kernel NULL pointer dereference at virtual address 00000030
...
PC is at pl2303_open+0x38/0xec [pl2303]

Note that a missing interrupt-in endpoint would have caused open() to
fail.

Fixes: 1da177e4c3 ("Linux-2.6.12-rc2")
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
2017-01-04 10:43:56 +01:00
Michał Pecio 49bda21266 USB: pl2303: fix baud-rate divisor calculations
This commit fixes the following issues:

1. The 9th bit of buf was believed to be the LSB of divisor's
exponent, but the hardware interprets it as MSB (9th bit) of the
mantissa. The exponent is actually one bit shorter and applies
to base 4, not 2 as previously believed.

2. Loop iterations doubled the exponent instead of incrementing.

3. The exponent wasn't checked for overflow.

4. The function returned requested rate instead of actual rate.

Due to issue #2, the old code deviated from the wrong formula
described in #1 and actually yielded correct rates when divisor
was lower than 4096 by using exponents of 0, 2 or 4 base-2,
interpreted as 0, 1, 2 base-4 with the 9th mantissa bit clear.
However, at 93.75 kbaud or less the rate turned out too slow
due to #2 or too fast due to #2 and #3.

I tested this patch by sending and validating 0x00,0x01,..,0xff
to an FTDI dongle at 234, 987, 2401, 9601, 31415, 115199, 250k,
500k, 750k, 1M, 1.5M, 3M+1 baud. All rates passed.

I also used pv to check speed at some rates unsupported by FTDI:
45 (the lowest possible), 2M, 4M, 5M and 6M-1. Looked sane.

Signed-off-by: Michal Pecio <michal.pecio@gmail.com>
Fixes: 399aa9a75a ("USB: pl2303: use divisors for unsupported baud
rates")
Cc: stable <stable@vger.kernel.org> # v3.18
[johan: update summary ]
Signed-off-by: Johan Hovold <johan@kernel.org>
2015-07-30 18:11:07 +02:00
Jason A. Donenfeld 48ef23a4f6 USB: pl2303: Remove support for Samsung I330
This phone is already supported by the visor driver.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Fixes: 1da177e4c3 ("Linux-2.6.12-rc2")
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
2015-04-29 12:34:24 +02:00
Johan Hovold 52772a7fd3 USB: pl2303: disable break on shutdown
Currently an enabled break state is not disabled on final close nor on
re-open and has to be disabled manually.

Fix this by disabling break on port shutdown.

Reported-by: Jari Ruusu <jariruusu@users.sourceforge.net>
Tested-by: Jari Ruusu <jariruusu@users.sourceforge.net>
Signed-off-by: Johan Hovold <johan@kernel.org>
2015-02-26 17:35:25 +01:00
Lauri Hintsala 399aa9a75a USB: pl2303: use divisors for unsupported baud rates
Use direct method for supported baud rates, otherwise use divisors.
Limit baud rate to 12 Mbaud with HX type.

This change has been tested to work with PL-2303HX at 115200, 500000,
1000000, 2000000, 2500000, 3000000 and 4000000 baud rates.

Signed-off-by: Lauri Hintsala <lauri.hintsala@bluegiga.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
2014-09-01 12:04:17 +02:00
Greg KH 91fcb1ce42 USB: serial: pl2303: add device id for ztek device
This adds a new device id to the pl2303 driver for the ZTEK device.

Reported-by: Mike Chu <Mike-Chu@prolific.com.tw>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
2014-08-18 13:09:27 +02:00
Aaron Sanders b16c02fbfb USB: pl2303: add ids for Hewlett-Packard HP POS pole displays
Add device ids to pl2303 for the Hewlett-Packard HP POS pole displays:

LD960: 03f0:0B39
LCM220: 03f0:3139
LCM960: 03f0:3239

[ Johan: fix indentation and sort PIDs numerically ]

Signed-off-by: Aaron Sanders <aaron.sanders@hp.com>
Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-16 13:56:07 -07:00
Paul Gortmaker 803a536243 usb: delete non-required instances of include <linux/init.h>
None of these files are actually using any __init type directives
and hence don't need to include <linux/init.h>.  Most are just a
left over from __devinit and __cpuinit removal, or simply due to
code getting copied from one driver to the next.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-08 15:01:39 -08:00
Johan Hovold a4bcb29459 USB: pl2303: switch to generic TIOCMIWAIT implementation
Switch to the generic TIOCMIWAIT implementation which does not suffer
from the races involved when using the deprecated sleep_on functions.

Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-03 12:42:23 -08:00
Johan Hovold dbfd2866ac USB: pl2303: only wake up MSR queue on changes
Only wake up MSR wait queue on actual modem-status changes.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-03 12:42:23 -08:00
Johan Hovold 6020c3bec3 USB: pl2303: clean up line-status handling
Clean up line-status handling somewhat.
Get tty-reference only when actually needed.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-03 12:42:23 -08:00
Johan Hovold b693468155 USB: pl2303: make type data const
Declare constant device-type data as const.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-03 12:42:23 -08:00
Johan Hovold 619c43543a USB: pl2303: use C_CMSPAR macro
Use the new C_CMSPAR macro for consistency.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-03 12:34:33 -08:00
Johan Hovold 5d85045f4b USB: pl2303: use direct baud-rate encoding when possible
Use direct baud-rate encoding rather than divisors for supported baud
rates.

This restores the way baud rates were set prior to commit 8d48fdf689
("USB: PL2303: correctly handle baudrates above 115200") which added
divisor encoding, but also switched to the new encoding method for all
baudrates above 115200.

As noted by Frank Schäfer <fschaefer.oss@googlemail.com>, baud rate 500k
was later errounously added to the supported baud-rate table although
it can only be set using divisors.

Note that the current implementation could easily be extended to support
arbitrary non-standard baud rates using divisors (e.g. by falling back
to divisors when the table lookup fails).

Cc: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-03 12:31:48 -08:00
Johan Hovold 20b4c78719 USB: pl2303: add helper function for direct baud-rate encoding
Add helper function for direct baud-rate encoding.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-03 12:31:48 -08:00
Johan Hovold c82c6d45a2 USB: pl2303: refactor baud-rate divisor handling
Refactor baud-rate divisor handling.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-03 12:31:48 -08:00
Johan Hovold 871996ede1 USB: pl2303: enforce baud-rate limits before lookup
Enforce any baud-rate limits before doing table lookup.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-03 12:31:48 -08:00
Johan Hovold 59afe10e8d USB: pl2303: refactor baud-rate table lookup
Refactor supported baud-rate table lookup.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-03 12:31:48 -08:00
Johan Hovold 79816824c1 USB: pl2303: rename pl2303_encode_baud_rate
Rename baud-rate encoding function to match tty naming.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-03 12:31:47 -08:00
Johan Hovold 359defdaa4 USB: pl2303: add device-type abstraction
Encode all device-type specifics in a struct rather than testing for
device type and spreading such information throughout the driver.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-03 12:31:47 -08:00
Johan Hovold 23c6acb968 USB: pl2303: add quirk for legacy devices
Add quirk for legacy devices (type 0 and 1) rather than testing on
device type throughout the driver.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-03 12:31:47 -08:00
Johan Hovold 7f966ac7a9 USB: pl2303: clean up type handling
Merge types 0 and 1, whose differences are unknown and have always been
treated the same.
Add TYPE_-prefix to both types.
Test for TYPE_01 (rather than !TYPE_HX) for legacy device quirks.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-03 12:31:47 -08:00
Johan Hovold f84ee3b2f5 USB: pl2303: use speed_t for baud rates
Use speed_t for baud rates throughout.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-03 12:31:47 -08:00
Johan Hovold 228e410537 USB: pl2303: add line-status quirk for Siemens phones
Implement line-status handling for Siemens phones as a quirk rather than
spreading such information all over the driver by matching on vendor and
and product ids.

Note that the SIEMENS_PRODUCT_ID_EF81, which was added after the
line-status handling for the other Siemens phones was fixed, might also
need this quirk.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-03 12:31:47 -08:00
Johan Hovold 294bb2c617 USB: pl2303: remove redundant line-request call
Remove redundant get_line_request (the read back settings are never
used).

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-03 12:31:47 -08:00
Johan Hovold 383d19c587 USB: pl2303: add error handling to line requests
Refactor and add error handling to line requests.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-03 12:31:47 -08:00
Johan Hovold a6ec8245bf USB: pl2303: add error handling to set_control_lines
Add error handling to set_control_lines.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-03 12:31:47 -08:00
Johan Hovold 362eb02603 USB: pl2303: add error handling to vendor read and write functions
Add error handling and clean up vendor read and write functions.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-03 12:31:47 -08:00