1. 22 Apr, 2021 18 commits
  2. 14 Apr, 2021 12 commits
  3. 13 Apr, 2021 10 commits
    • Mauro Carvalho Chehab's avatar
      USB: cdc-acm: add more Maxlinear/Exar models to ignore list · 039b81d5
      Mauro Carvalho Chehab authored
      Now that the xr_serial got support for other models, add their USB IDs
      as well.
      
      The Maxlinear/Exar USB UARTs 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
      correctly.
      
      Ensure that cdc_acm will not bind to these devices if the custom
      USB-serial driver is enabled.
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
      Link: https://lore.kernel.org/r/5155887a764cbc11f8da0217fe08a24a77d120b4.1616571453.git.mchehab+huawei@kernel.org
      [ johan: rewrite commit message, clean up entries ]
      Cc: Oliver Neukum <oneukum@suse.com>
      Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      039b81d5
    • Johan Hovold's avatar
      USB: serial: xr: add copyright notice · d801c8d4
      Johan Hovold authored
      Add another copyright notice for the work done in 2021.
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      d801c8d4
    • Johan Hovold's avatar
      USB: serial: xr: reset FIFOs on open · 06f79d57
      Johan Hovold authored
      Reset the transmit and receive FIFOs before enabling the UARTs as part
      of open() in order to flush any stale data.
      
      Note that the XR21V141X needs a type-specific implementation due to its
      UART Manager registers.
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      06f79d57
    • Johan Hovold's avatar
      USB: serial: xr: add support for XR22801, XR22802, XR22804 · 6da99f9d
      Johan Hovold authored
      The XR22801, XR22802 and XR22804 are compound devices with an embedded
      hub and up to seven downstream USB devices including one, two or four
      UARTs respectively.
      
      The UART function is similar to XR21B142X but most registers are offset
      by 0x40, the register requests are different and are directed at the
      device rather than interface, and 5 and 6-bit words are not supported.
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      6da99f9d
    • Johan Hovold's avatar
      USB: serial: xr: add support for XR21B1411 · 4099d4ba
      Johan Hovold authored
      The single-port XR21B1411 is similar to the XR21B142X type but uses
      12-bit registers and 16-bit register addresses, the register requests
      are different and are directed at the device rather than interface, and
      5 and 6-bit words are not supported.
      
      The register layout is very similar to XR21B142X except that most
      registers are offset by 0xc00 (corresponding to a channel index of 12 in
      the MSB of wIndex). As the device is single-port so that the derived
      channel index is 0, the current register accessors can be reused after
      simply changing the address width.
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      4099d4ba
    • Johan Hovold's avatar
      USB: serial: xr: add support for XR21B1421, XR21B1422 and XR21B1424 · 607f6718
      Johan Hovold authored
      The XR21B1421, XR21B1422 and XR21B1424 are the one-, two- and four-port
      models of a second XR21B142X type of the Maxlinear/Exar USB UARTs.
      
      The XR21B142X type differs from XR21V141X in several ways, including:
      
      	- register layout
      	- register width (16-bit instead of 8-bit)
      	- vendor register requests
      	- UART enable/disable sequence
      	- custom-driver mode flag
      	- three additional GPIOs (9 instead of 6)
      
      As for XR21V141X, the XR21B142X vendor requests encode the channel index
      in the MSB of wIndex, but it lacks the UART Manager registers which
      have been replaced by regular UART registers. The new type also uses the
      interface number of the control interface (0, 2, 4, 6) as channel index
      instead of the channel number (0, 1, 2, 3).
      
      The XR21B142X lacks the divisor and format registers used by XR21V141X
      and instead uses the CDC SET_LINE_CONTROL request to configure the line
      settings.
      
      Note that the currently supported XR21V141X type lacks the custom-driver
      mode flag that prevents the device from entering CDC-ACM mode when a CDC
      requests is received. This specifically means that the SET_LINE_CONTROL
      request cannot be used with XR21V141X even though it is otherwise
      supported.
      
      The UART enable sequence for XR21B142X does not involve explicitly
      enabling the FIFOs, but according to datasheet the UART must be disabled
      when writing any register but GPIO_SET, GPIO_CLEAR, TX_BREAK and
      ERROR_STATUS.
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      607f6718
    • Johan Hovold's avatar
      USB: serial: xr: add type abstraction · f865e614
      Johan Hovold authored
      There are at least four types of Maxlinear/Exar USB UARTs which differ
      in various ways such as in their register layouts:
      
      	XR21V141X
      	XR21B142X
      	XR21B1411
      	XR22804
      
      It is not clear whether the device type can be inferred from the
      descriptors so encode it in the device-id table for now.
      
      Add a type structure that can be used to abstract the register layout
      and other features, and use it when accessing the XR21V141X UART
      registers that are shared by all types.
      
      Note that the currently supported XR21V141X type is the only type that
      has a set of UART Manager registers and that these will need to be
      handled specifically.
      
      Similarly, XR21V141X is the only type which has the divisor registers
      and that needs to use the format register when configuring the line
      settings.
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      f865e614
    • Johan Hovold's avatar
      USB: serial: xr: drop type prefix from shared defines · 958d6b95
      Johan Hovold authored
      In preparation for adding support for further types, drop the type
      prefix from defines that are not specific to XR21V141X.
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      958d6b95
    • Johan Hovold's avatar
      USB: serial: xr: move pin configuration to probe · 49036fd0
      Johan Hovold authored
      There's no need to configure the pins on every open and judging from the
      vendor driver and datasheet it can be done before enabling the UART.
      
      Move pin configuration from open() to port probe and make sure to
      deassert DTR and RTS after configuring all pins as GPIO.
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      49036fd0
    • Johan Hovold's avatar
      USB: serial: xr: rename GPIO-pin defines · 5f70fe32
      Johan Hovold authored
      Rename the GPIO-pin defines so that they reflect how they are used.
      Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
      5f70fe32