All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: Johan Hovold <johan@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
	linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org
Subject: [PATCH v2 6/7] USB: serial: xr: add support for XR2280X devices
Date: Wed, 24 Mar 2021 08:41:10 +0100	[thread overview]
Message-ID: <385b5ba7739fd1d67b9b2b8fd70187ab19e8d00e.1616571453.git.mchehab+huawei@kernel.org> (raw)
In-Reply-To: <cover.1616571453.git.mchehab+huawei@kernel.org>

There's nothing special on those devices either. They just
use a different set of registers.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
 drivers/usb/serial/xr_serial.c | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/drivers/usb/serial/xr_serial.c b/drivers/usb/serial/xr_serial.c
index b1044dd3e994..72365ffbc1b8 100644
--- a/drivers/usb/serial/xr_serial.c
+++ b/drivers/usb/serial/xr_serial.c
@@ -99,6 +99,7 @@ struct xr_txrx_clk_mask {
 #define VIA_CDC_REGISTER		-1
 
 enum xr_model {
+	XR2280X,
 	XR21B1411,
 	XR21V141X,
 	XR21B142X,
@@ -133,6 +134,30 @@ enum xr_hal_type {
 };
 
 static const int xr_hal_table[MAX_XR_MODELS][MAX_XR_HAL_TYPE] = {
+	[XR2280X] = {
+		[REG_ENABLE] =				0x40,
+		[REG_FORMAT] =				0x45,
+		[REG_FLOW_CTRL] =			0x46,
+		[REG_XON_CHAR] =			0x47,
+		[REG_XOFF_CHAR] =			0x48,
+		[REG_TX_BREAK] =			0x4a,
+		[REG_RS485_DELAY] =			0x4b,
+		[REG_GPIO_MODE] =			0x4c,
+		[REG_GPIO_DIR] =			0x4d,
+		[REG_GPIO_SET] =			0x4e,
+		[REG_GPIO_CLR] =			0x4f,
+		[REG_GPIO_STATUS] =			0x50,
+		[REG_GPIO_INT_MASK] =			0x51,
+		[REG_CUSTOMIZED_INT] =			0x52,
+		[REG_GPIO_PULL_UP_ENABLE] =		0x54,
+		[REG_GPIO_PULL_DOWN_ENABLE] =		0x55,
+		[REG_LOOPBACK] =			0x56,
+		[REG_LOW_LATENCY] =			0x66,
+		[REG_CUSTOM_DRIVER] =			0x81,
+
+		[REQ_SET] =				5,
+		[REQ_GET] =				5,
+	},
 	[XR21B1411] = {
 		[REG_ENABLE] =				0xc00,
 		[REG_FORMAT] =				VIA_CDC_REGISTER,
@@ -215,6 +240,7 @@ static int xr_set_reg(struct usb_serial_port *port, u8 block, u8 reg, u8 val)
 	int ret;
 
 	switch (port_priv->model) {
+	case XR2280X:
 	case XR21B1411:
 		break;
 	case XR21V141X:
@@ -253,6 +279,7 @@ static int xr_get_reg(struct usb_serial_port *port, u8 block, u8 reg, u8 *val)
 		return -ENOMEM;
 
 	switch (port_priv->model) {
+	case XR2280X:
 	case XR21B1411:
 		break;
 	case XR21V141X:
@@ -902,6 +929,11 @@ static void xr_disconnect(struct usb_serial *serial)
 }
 
 static const struct usb_device_id id_table[] = {
+	{ USB_DEVICE(0x04e2, 0x1400), .driver_info = XR2280X},
+	{ USB_DEVICE(0x04e2, 0x1401), .driver_info = XR2280X},
+	{ USB_DEVICE(0x04e2, 0x1402), .driver_info = XR2280X},
+	{ USB_DEVICE(0x04e2, 0x1403), .driver_info = XR2280X},
+
 	{ USB_DEVICE(0x04e2, 0x1410), .driver_info = XR21V141X},
 	{ USB_DEVICE(0x04e2, 0x1411), .driver_info = XR21B1411},
 	{ USB_DEVICE(0x04e2, 0x1412), .driver_info = XR21V141X},
-- 
2.30.2


  parent reply	other threads:[~2021-03-24  7:42 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-24  7:41 [PATCH v2 0/7] Add support for the other MaxLinear/Exar UARTs Mauro Carvalho Chehab
2021-03-24  7:41 ` [PATCH v2 1/7] USB: serial: xr: simplify its namespace Mauro Carvalho Chehab
2021-03-24  7:41 ` [PATCH v2 2/7] USB: serial: xr: use a table for device-specific settings Mauro Carvalho Chehab
2021-03-30 14:44   ` Johan Hovold
2021-03-24  7:41 ` [PATCH v2 3/7] USB: serial: xr: add support for multi-port XR21V141X variants Mauro Carvalho Chehab
2021-03-30 14:50   ` Johan Hovold
2021-03-24  7:41 ` [PATCH v2 4/7] USB: serial: xr: add support for XR21B142X devices Mauro Carvalho Chehab
2021-03-30 15:04   ` Johan Hovold
2021-03-24  7:41 ` [PATCH v2 5/7] USB: serial: xr: add support for XR21B1411 Mauro Carvalho Chehab
2021-03-30 15:07   ` Johan Hovold
2021-03-24  7:41 ` Mauro Carvalho Chehab [this message]
2021-03-30 15:08   ` [PATCH v2 6/7] USB: serial: xr: add support for XR2280X devices Johan Hovold
2021-03-24  7:41 ` [PATCH v2 7/7] USB: cdc-acm: add other non-standard xr_serial models to ignore list Mauro Carvalho Chehab
2021-03-30 15:14   ` Johan Hovold
2021-03-30 14:35 ` [PATCH v2 0/7] Add support for the other MaxLinear/Exar UARTs 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=385b5ba7739fd1d67b9b2b8fd70187ab19e8d00e.1616571453.git.mchehab+huawei@kernel.org \
    --to=mchehab+huawei@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=johan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.