linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Johan Hovold <johan@kernel.org>
Cc: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 09/12] USB: serial: xr: add support for XR22801, XR22802, XR22804
Date: Tue, 30 Mar 2021 16:39:34 +0200	[thread overview]
Message-ID: <20210330143934.9197-10-johan@kernel.org> (raw)
In-Reply-To: <20210330143934.9197-1-johan@kernel.org>

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: Johan Hovold <johan@kernel.org>
---
 drivers/usb/serial/xr_serial.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/drivers/usb/serial/xr_serial.c b/drivers/usb/serial/xr_serial.c
index 46e5e1b2f3c0..14dbda13ab4d 100644
--- a/drivers/usb/serial/xr_serial.c
+++ b/drivers/usb/serial/xr_serial.c
@@ -134,6 +134,7 @@ enum xr_type_id {
 	XR21V141X,
 	XR21B142X,
 	XR21B1411,
+	XR2280X,
 	XR_TYPE_COUNT,
 };
 
@@ -198,6 +199,24 @@ static const struct xr_type xr_types[] = {
 		.gpio_status	= 0xc10,
 		.custom_driver	= 0x20d,
 	},
+	[XR2280X] = {
+		.reg_width	= 16,
+		.reg_recipient	= USB_RECIP_DEVICE,
+		.set_reg	= 0x05,
+		.get_reg	= 0x05,
+
+		.uart_enable	= 0x40,
+		.flow_control	= 0x46,
+		.xon_char	= 0x47,
+		.xoff_char	= 0x48,
+		.tx_break	= 0x4a,
+		.gpio_mode	= 0x4c,
+		.gpio_direction	= 0x4d,
+		.gpio_set	= 0x4e,
+		.gpio_clear	= 0x4f,
+		.gpio_status	= 0x50,
+		.custom_driver	= 0x81,
+	},
 };
 
 struct xr_data {
@@ -906,6 +925,10 @@ static void xr_port_remove(struct usb_serial_port *port)
 	.driver_info = (type)
 
 static const struct usb_device_id id_table[] = {
+	{ XR_DEVICE(0x04e2, 0x1400, XR2280X) },
+	{ XR_DEVICE(0x04e2, 0x1401, XR2280X) },
+	{ XR_DEVICE(0x04e2, 0x1402, XR2280X) },
+	{ XR_DEVICE(0x04e2, 0x1403, XR2280X) },
 	{ XR_DEVICE(0x04e2, 0x1410, XR21V141X) },
 	{ XR_DEVICE(0x04e2, 0x1411, XR21B1411) },
 	{ XR_DEVICE(0x04e2, 0x1412, XR21V141X) },
-- 
2.26.3


  parent reply	other threads:[~2021-03-30 14:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-30 14:39 [PATCH 00/12] USB: serial: xr: add support for more device types Johan Hovold
2021-03-30 14:39 ` [PATCH 01/12] USB: serial: xr: add support for XR21V1412 and XR21V1414 Johan Hovold
2021-03-30 14:39 ` [PATCH 02/12] USB: serial: xr: rename GPIO-mode defines Johan Hovold
2021-03-30 14:39 ` [PATCH 03/12] USB: serial: xr: rename GPIO-pin defines Johan Hovold
2021-03-30 14:39 ` [PATCH 04/12] USB: serial: xr: move pin configuration to probe Johan Hovold
2021-03-30 14:39 ` [PATCH 05/12] USB: serial: xr: drop type prefix from shared defines Johan Hovold
2021-03-30 14:39 ` [PATCH 06/12] USB: serial: xr: add type abstraction Johan Hovold
2021-03-30 14:39 ` [PATCH 07/12] USB: serial: xr: add support for XR21B1421, XR21B1422 and XR21B1424 Johan Hovold
2021-03-30 14:39 ` [PATCH 08/12] USB: serial: xr: add support for XR21B1411 Johan Hovold
2021-03-30 14:39 ` Johan Hovold [this message]
2021-04-12  9:55 [PATCH RESEND 00/12] USB: serial: xr: add support for more device types Johan Hovold
2021-04-12  9:55 ` [PATCH 09/12] USB: serial: xr: add support for XR22801, XR22802, XR22804 Johan Hovold

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210330143934.9197-10-johan@kernel.org \
    --to=johan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mchehab+huawei@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).