1. 01 2月, 2021 1 次提交
    • J
      USB: serial: cp210x: suppress modem-control errors · 5951b850
      Johan Hovold 提交于
      The CP210X_SET_MHS request cannot be used to control RTS when hardware
      flow control (auto-RTS) is enabled and instead returns an error which is
      currently logged as:
      
      	cp210x ttyUSB0: failed set request 0x7 status: -32
      
      when opening and closing a port (and on TIOCMSET requests).
      
      Add a crtscts flag to keep track of the hardware flow-control setting
      and use it to suppress any request to change RTS when auto-RTS is
      enabled.
      
      Note that RTS is still deasserted when disabling the UART as part of
      close.
      Reported-by: NPho Tran <pho.tran@silabs.com>
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      5951b850
  2. 28 1月, 2021 1 次提交
  3. 26 1月, 2021 11 次提交
  4. 21 1月, 2021 1 次提交
    • M
      USB: serial: add MaxLinear/Exar USB to Serial driver · c2d405aa
      Manivannan Sadhasivam 提交于
      Add support for MaxLinear/Exar USB to Serial converters. This driver
      only supports XR21V141X series but it can be extended to other series
      from Exar as well in future.
      
      This driver is inspired from the initial one submitted by Patong Yang:
      
      https://lore.kernel.org/r/20180404070634.nhspvmxcjwfgjkcv@advantechmxl-desktop
      
      While the initial driver was a custom tty USB driver exposing whole
      new serial interface ttyXRUSBn, this version is completely based on USB
      serial core thus exposing the interfaces as ttyUSBn. This will avoid
      the overhead of exposing a new USB serial interface which the userspace
      tools are unaware of.
      
      The Exar XR21V141X can be used in either ACM mode using the cdc-acm
      driver or in "custom driver" mode in which further features such as
      hardware and software flow control, GPIO control and in-band line-status
      reporting are available.
      
      In ACM mode the device always enables RTS/CTS flow control, something
      which could prevent transmission in case the CTS input isn't wired up
      corrently.
      
      A follow-on patch will prevent cdc_acm from binding whenever this driver
      is enabled.
      Signed-off-by: NManivannan Sadhasivam <mani@kernel.org>
      Link: https://lore.kernel.org/r/20201122170822.21715-2-mani@kernel.org
      [ johan: fix some style nits, group related functions, drop unused
      	 callbacks, and amend commit message; a few remaining
      	 non-trivial issues will be fixed separately ]
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      c2d405aa
  5. 18 1月, 2021 13 次提交
  6. 12 1月, 2021 1 次提交
  7. 04 1月, 2021 3 次提交
    • J
      USB: serial: iuu_phoenix: fix DMA from stack · 54d0a3ab
      Johan Hovold 提交于
      Stack-allocated buffers cannot be used for DMA (on all architectures) so
      allocate the flush command buffer using kmalloc().
      
      Fixes: 60a8fc01 ("USB: add iuu_phoenix driver")
      Cc: stable <stable@vger.kernel.org>     # 2.6.25
      Reviewed-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      54d0a3ab
    • D
      USB: serial: option: add LongSung M5710 module support · 0e2d6795
      Daniel Palmer 提交于
      Add a device-id entry for the LongSung M5710 module.
      
      T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=480  MxCh= 0
      D:  Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
      P:  Vendor=2df3 ProdID=9d03 Rev= 1.00
      S:  Manufacturer=Marvell
      S:  Product=Mobile Composite Device Bus
      S:  SerialNumber=<snip>
      C:* #Ifs= 5 Cfg#= 1 Atr=c0 MxPwr=500mA
      A:  FirstIf#= 0 IfCount= 2 Cls=e0(wlcon) Sub=01 Prot=03
      I:* If#= 0 Alt= 0 #EPs= 1 Cls=e0(wlcon) Sub=01 Prot=03 Driver=rndis_host
      E:  Ad=87(I) Atr=03(Int.) MxPS=  64 Ivl=4096ms
      I:* If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=rndis_host
      E:  Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=0c(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=0b(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      E:  Ad=89(I) Atr=03(Int.) MxPS=  64 Ivl=4096ms
      E:  Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=0f(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:* If#= 5 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
      E:  Ad=88(I) Atr=03(Int.) MxPS=  64 Ivl=4096ms
      E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=0a(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      Signed-off-by: NDaniel Palmer <daniel@0x0f.com>
      https://lore.kernel.org/r/20201227031716.1343300-1-daniel@0x0f.com
      [ johan: drop id defines, only bind to vendor class ]
      Cc: stable@vger.kernel.org
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      0e2d6795
    • B
      USB: serial: option: add Quectel EM160R-GL · d6c1ddd9
      Bjørn Mork 提交于
      New modem using ff/ff/30 for QCDM, ff/00/00 for  AT and NMEA,
      and ff/ff/ff for RMNET/QMI.
      
      T: Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=5000 MxCh= 0
      D: Ver= 3.20 Cls=ef(misc ) Sub=02 Prot=01 MxPS= 9 #Cfgs= 1
      P: Vendor=2c7c ProdID=0620 Rev= 4.09
      S: Manufacturer=Quectel
      S: Product=EM160R-GL
      S: SerialNumber=e31cedc1
      C:* #Ifs= 5 Cfg#= 1 Atr=a0 MxPwr=896mA
      I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=(none)
      E: Ad=81(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
      E: Ad=01(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
      I:* If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none)
      E: Ad=83(I) Atr=03(Int.) MxPS= 10 Ivl=32ms
      E: Ad=82(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
      E: Ad=02(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
      I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none)
      E: Ad=85(I) Atr=03(Int.) MxPS= 10 Ivl=32ms
      E: Ad=84(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
      E: Ad=03(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
      I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none)
      E: Ad=87(I) Atr=03(Int.) MxPS= 10 Ivl=32ms
      E: Ad=86(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
      E: Ad=04(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
      I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
      E: Ad=88(I) Atr=03(Int.) MxPS= 8 Ivl=32ms
      E: Ad=8e(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
      E: Ad=0f(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NBjørn Mork <bjorn@mork.no>
      [ johan: add model comment ]
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      d6c1ddd9
  8. 10 12月, 2020 3 次提交
  9. 09 12月, 2020 1 次提交
  10. 04 12月, 2020 5 次提交
    • J
      USB: serial: cp210x: clean up dtr_rts() · daa91919
      Johan Hovold 提交于
      Clean up dtr_rts() by renaming the port parameter and adding missing
      whitespace.
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      daa91919
    • J
      USB: serial: cp210x: refactor flow-control handling · ed921771
      Johan Hovold 提交于
      Add a helper function to be used to configure flow control.
      
      The flow-control code was the last caller that relied on the
      memset-on-failure behaviour of cp210x_read_reg_block(), which we can now
      drop in favour of bailing out on errors when retrieving the flow-control
      settings.
      
      This should also simplify adding support for software flow control.
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      ed921771
    • J
      USB: serial: cp210x: drop flow-control debugging · b339628e
      Johan Hovold 提交于
      Drop some unnecessary flow-control debugging.
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      b339628e
    • J
      USB: serial: cp210x: set terminal settings on open · 46827bda
      Johan Hovold 提交于
      Unlike other drivers cp210x have been retrieving the current terminal
      settings from the device on open and reflecting those in termios.
      
      Due to how set_termios() used to be implemented, this saved a few
      control requests on open but has instead caused problems like broken
      flow control and has required adding workarounds for swapped
      line-control in cp2108 and line-speed initialisation on cp2104.
      
      This unusual implementation also complicates adding new features for no
      good reason.
      
      Rip out the corresponding code and the above mentioned workarounds and
      instead initialise the terminal settings unconditionally on open.
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      46827bda
    • J
      USB: serial: cp210x: clean up line-control handling · d4297629
      Johan Hovold 提交于
      Update the line-control settings in one request unconditionally instead
      of setting the word-length, parity and stop-bit settings separately.
      
      This avoids multiple requests when several settings are changed even if
      this scheme could potentially also be used to detect unsupported device
      settings. Since all device types but CP2101 appears to support all
      settings, let's handle that one specifically and also report back the
      unsupported settings properly through termios by clearing the
      corresponding bits.
      
      Also drop the related unnecessary debug printks.
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      d4297629