* [PATCH v1 0/2] serial: 8250_pci: Share WCH IDs
@ 2024-12-04 3:09 Andy Shevchenko
2024-12-04 3:09 ` [PATCH v1 1/2] serial: 8250_pci: Resolve WCH vendor ID ambiguity Andy Shevchenko
2024-12-04 3:09 ` [PATCH v1 2/2] serial: 8250_pci: Share WCH IDs with parport_serial driver Andy Shevchenko
0 siblings, 2 replies; 6+ messages in thread
From: Andy Shevchenko @ 2024-12-04 3:09 UTC (permalink / raw)
To: Cameron Williams, Andy Shevchenko, Greg Kroah-Hartman, Fenghua Yu,
linux-kernel, linux-serial, linux-pci
Cc: Sudip Mukherjee, Jiri Slaby, Bjorn Helgaas
There are a few WCH IDs that are used in two drivers, share them.
Actually share slightly more as it is logical to have group of IDs
related to the same family of the devices to be in one place.
Andy Shevchenko (2):
serial: 8250_pci: Resolve WCH vendor ID ambiguity
serial: 8250_pci: Share WCH IDs with parport_serial driver
drivers/parport/parport_serial.c | 12 +++--
drivers/tty/serial/8250/8250_pci.c | 76 ++++++++++++++----------------
include/linux/pci_ids.h | 11 +++++
3 files changed, 54 insertions(+), 45 deletions(-)
--
2.43.0.rc1.1336.g36b5255a03ac
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v1 1/2] serial: 8250_pci: Resolve WCH vendor ID ambiguity
2024-12-04 3:09 [PATCH v1 0/2] serial: 8250_pci: Share WCH IDs Andy Shevchenko
@ 2024-12-04 3:09 ` Andy Shevchenko
2024-12-04 3:09 ` [PATCH v1 2/2] serial: 8250_pci: Share WCH IDs with parport_serial driver Andy Shevchenko
1 sibling, 0 replies; 6+ messages in thread
From: Andy Shevchenko @ 2024-12-04 3:09 UTC (permalink / raw)
To: Cameron Williams, Andy Shevchenko, Greg Kroah-Hartman, Fenghua Yu,
linux-kernel, linux-serial, linux-pci
Cc: Sudip Mukherjee, Jiri Slaby, Bjorn Helgaas
There are two sites of the same brand: wch.cn and wch-ic.com.
They are property of the same company, but it appears that they
managed to get two different PCI vendor IDs. Rename them accordingly
using standard pattern, i.e. PCI_VENDOR_ID_...
While at it, move to PCI_VDEVICE() in the ID tables.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/tty/serial/8250/8250_pci.c | 82 +++++++++++++++---------------
1 file changed, 41 insertions(+), 41 deletions(-)
diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c
index 3c3f7c926afb..dfac79744d37 100644
--- a/drivers/tty/serial/8250/8250_pci.c
+++ b/drivers/tty/serial/8250/8250_pci.c
@@ -64,23 +64,23 @@
#define PCIE_DEVICE_ID_NEO_2_OX_IBM 0x00F6
#define PCI_DEVICE_ID_PLX_CRONYX_OMEGA 0xc001
#define PCI_DEVICE_ID_INTEL_PATSBURG_KT 0x1d3d
-#define PCI_VENDOR_ID_WCH 0x4348
-#define PCI_DEVICE_ID_WCH_CH352_2S 0x3253
-#define PCI_DEVICE_ID_WCH_CH353_4S 0x3453
-#define PCI_DEVICE_ID_WCH_CH353_2S1PF 0x5046
-#define PCI_DEVICE_ID_WCH_CH353_1S1P 0x5053
-#define PCI_DEVICE_ID_WCH_CH353_2S1P 0x7053
-#define PCI_DEVICE_ID_WCH_CH355_4S 0x7173
+#define PCI_VENDOR_ID_WCHCN 0x4348
+#define PCI_DEVICE_ID_WCHCN_CH352_2S 0x3253
+#define PCI_DEVICE_ID_WCHCN_CH353_4S 0x3453
+#define PCI_DEVICE_ID_WCHCN_CH353_2S1PF 0x5046
+#define PCI_DEVICE_ID_WCHCN_CH353_1S1P 0x5053
+#define PCI_DEVICE_ID_WCHCN_CH353_2S1P 0x7053
+#define PCI_DEVICE_ID_WCHCN_CH355_4S 0x7173
#define PCI_VENDOR_ID_AGESTAR 0x5372
#define PCI_DEVICE_ID_AGESTAR_9375 0x6872
#define PCI_DEVICE_ID_BROADCOM_TRUMANAGE 0x160a
#define PCI_DEVICE_ID_AMCC_ADDIDATA_APCI7800 0x818e
-#define PCIE_VENDOR_ID_WCH 0x1c00
-#define PCIE_DEVICE_ID_WCH_CH382_2S1P 0x3250
-#define PCIE_DEVICE_ID_WCH_CH384_4S 0x3470
-#define PCIE_DEVICE_ID_WCH_CH384_8S 0x3853
-#define PCIE_DEVICE_ID_WCH_CH382_2S 0x3253
+#define PCI_VENDOR_ID_WCHIC 0x1c00
+#define PCI_DEVICE_ID_WCHIC_CH382_2S1P 0x3250
+#define PCI_DEVICE_ID_WCHIC_CH384_4S 0x3470
+#define PCI_DEVICE_ID_WCHIC_CH384_8S 0x3853
+#define PCI_DEVICE_ID_WCHIC_CH382_2S 0x3253
#define PCI_DEVICE_ID_MOXA_CP102E 0x1024
#define PCI_DEVICE_ID_MOXA_CP102EL 0x1025
@@ -2817,80 +2817,80 @@ static struct pci_serial_quirk pci_serial_quirks[] = {
},
/* WCH CH353 1S1P card (16550 clone) */
{
- .vendor = PCI_VENDOR_ID_WCH,
- .device = PCI_DEVICE_ID_WCH_CH353_1S1P,
+ .vendor = PCI_VENDOR_ID_WCHCN,
+ .device = PCI_DEVICE_ID_WCHCN_CH353_1S1P,
.subvendor = PCI_ANY_ID,
.subdevice = PCI_ANY_ID,
.setup = pci_wch_ch353_setup,
},
/* WCH CH353 2S1P card (16550 clone) */
{
- .vendor = PCI_VENDOR_ID_WCH,
- .device = PCI_DEVICE_ID_WCH_CH353_2S1P,
+ .vendor = PCI_VENDOR_ID_WCHCN,
+ .device = PCI_DEVICE_ID_WCHCN_CH353_2S1P,
.subvendor = PCI_ANY_ID,
.subdevice = PCI_ANY_ID,
.setup = pci_wch_ch353_setup,
},
/* WCH CH353 4S card (16550 clone) */
{
- .vendor = PCI_VENDOR_ID_WCH,
- .device = PCI_DEVICE_ID_WCH_CH353_4S,
+ .vendor = PCI_VENDOR_ID_WCHCN,
+ .device = PCI_DEVICE_ID_WCHCN_CH353_4S,
.subvendor = PCI_ANY_ID,
.subdevice = PCI_ANY_ID,
.setup = pci_wch_ch353_setup,
},
/* WCH CH353 2S1PF card (16550 clone) */
{
- .vendor = PCI_VENDOR_ID_WCH,
- .device = PCI_DEVICE_ID_WCH_CH353_2S1PF,
+ .vendor = PCI_VENDOR_ID_WCHCN,
+ .device = PCI_DEVICE_ID_WCHCN_CH353_2S1PF,
.subvendor = PCI_ANY_ID,
.subdevice = PCI_ANY_ID,
.setup = pci_wch_ch353_setup,
},
/* WCH CH352 2S card (16550 clone) */
{
- .vendor = PCI_VENDOR_ID_WCH,
- .device = PCI_DEVICE_ID_WCH_CH352_2S,
+ .vendor = PCI_VENDOR_ID_WCHCN,
+ .device = PCI_DEVICE_ID_WCHCN_CH352_2S,
.subvendor = PCI_ANY_ID,
.subdevice = PCI_ANY_ID,
.setup = pci_wch_ch353_setup,
},
/* WCH CH355 4S card (16550 clone) */
{
- .vendor = PCI_VENDOR_ID_WCH,
- .device = PCI_DEVICE_ID_WCH_CH355_4S,
+ .vendor = PCI_VENDOR_ID_WCHCN,
+ .device = PCI_DEVICE_ID_WCHCN_CH355_4S,
.subvendor = PCI_ANY_ID,
.subdevice = PCI_ANY_ID,
.setup = pci_wch_ch355_setup,
},
/* WCH CH382 2S card (16850 clone) */
{
- .vendor = PCIE_VENDOR_ID_WCH,
- .device = PCIE_DEVICE_ID_WCH_CH382_2S,
+ .vendor = PCI_VENDOR_ID_WCHIC,
+ .device = PCI_DEVICE_ID_WCHIC_CH382_2S,
.subvendor = PCI_ANY_ID,
.subdevice = PCI_ANY_ID,
.setup = pci_wch_ch38x_setup,
},
/* WCH CH382 2S1P card (16850 clone) */
{
- .vendor = PCIE_VENDOR_ID_WCH,
- .device = PCIE_DEVICE_ID_WCH_CH382_2S1P,
+ .vendor = PCI_VENDOR_ID_WCHIC,
+ .device = PCI_DEVICE_ID_WCHIC_CH382_2S1P,
.subvendor = PCI_ANY_ID,
.subdevice = PCI_ANY_ID,
.setup = pci_wch_ch38x_setup,
},
/* WCH CH384 4S card (16850 clone) */
{
- .vendor = PCIE_VENDOR_ID_WCH,
- .device = PCIE_DEVICE_ID_WCH_CH384_4S,
+ .vendor = PCI_VENDOR_ID_WCHIC,
+ .device = PCI_DEVICE_ID_WCHIC_CH384_4S,
.subvendor = PCI_ANY_ID,
.subdevice = PCI_ANY_ID,
.setup = pci_wch_ch38x_setup,
},
/* WCH CH384 8S card (16850 clone) */
{
- .vendor = PCIE_VENDOR_ID_WCH,
- .device = PCIE_DEVICE_ID_WCH_CH384_8S,
+ .vendor = PCI_VENDOR_ID_WCHIC,
+ .device = PCI_DEVICE_ID_WCHIC_CH384_8S,
.subvendor = PCI_ANY_ID,
.subdevice = PCI_ANY_ID,
.init = pci_wch_ch38x_init,
@@ -3967,11 +3967,11 @@ static const struct pci_device_id blacklist[] = {
/* multi-io cards handled by parport_serial */
/* WCH CH353 2S1P */
- { PCI_DEVICE(0x4348, 0x7053), 0, 0, REPORT_CONFIG(PARPORT_SERIAL), },
+ { PCI_VDEVICE(WCHCN, 0x7053), REPORT_CONFIG(PARPORT_SERIAL), },
/* WCH CH353 1S1P */
- { PCI_DEVICE(0x4348, 0x5053), 0, 0, REPORT_CONFIG(PARPORT_SERIAL), },
+ { PCI_VDEVICE(WCHCN, 0x5053), REPORT_CONFIG(PARPORT_SERIAL), },
/* WCH CH382 2S1P */
- { PCI_DEVICE(0x1c00, 0x3250), 0, 0, REPORT_CONFIG(PARPORT_SERIAL), },
+ { PCI_VDEVICE(WCHIC, 0x3250), REPORT_CONFIG(PARPORT_SERIAL), },
/* Intel platforms with MID UART */
{ PCI_VDEVICE(INTEL, 0x081b), REPORT_8250_CONFIG(MID), },
@@ -6044,27 +6044,27 @@ static const struct pci_device_id serial_pci_tbl[] = {
* WCH CH353 series devices: The 2S1P is handled by parport_serial
* so not listed here.
*/
- { PCI_VENDOR_ID_WCH, PCI_DEVICE_ID_WCH_CH353_4S,
+ { PCI_VENDOR_ID_WCHCN, PCI_DEVICE_ID_WCHCN_CH353_4S,
PCI_ANY_ID, PCI_ANY_ID,
0, 0, pbn_b0_bt_4_115200 },
- { PCI_VENDOR_ID_WCH, PCI_DEVICE_ID_WCH_CH353_2S1PF,
+ { PCI_VENDOR_ID_WCHCN, PCI_DEVICE_ID_WCHCN_CH353_2S1PF,
PCI_ANY_ID, PCI_ANY_ID,
0, 0, pbn_b0_bt_2_115200 },
- { PCI_VENDOR_ID_WCH, PCI_DEVICE_ID_WCH_CH355_4S,
+ { PCI_VENDOR_ID_WCHCN, PCI_DEVICE_ID_WCHCN_CH355_4S,
PCI_ANY_ID, PCI_ANY_ID,
0, 0, pbn_b0_bt_4_115200 },
- { PCIE_VENDOR_ID_WCH, PCIE_DEVICE_ID_WCH_CH382_2S,
+ { PCI_VENDOR_ID_WCHIC, PCI_DEVICE_ID_WCHIC_CH382_2S,
PCI_ANY_ID, PCI_ANY_ID,
0, 0, pbn_wch382_2 },
- { PCIE_VENDOR_ID_WCH, PCIE_DEVICE_ID_WCH_CH384_4S,
+ { PCI_VENDOR_ID_WCHIC, PCI_DEVICE_ID_WCHIC_CH384_4S,
PCI_ANY_ID, PCI_ANY_ID,
0, 0, pbn_wch384_4 },
- { PCIE_VENDOR_ID_WCH, PCIE_DEVICE_ID_WCH_CH384_8S,
+ { PCI_VENDOR_ID_WCHIC, PCI_DEVICE_ID_WCHIC_CH384_8S,
PCI_ANY_ID, PCI_ANY_ID,
0, 0, pbn_wch384_8 },
/*
--
2.43.0.rc1.1336.g36b5255a03ac
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v1 2/2] serial: 8250_pci: Share WCH IDs with parport_serial driver
2024-12-04 3:09 [PATCH v1 0/2] serial: 8250_pci: Share WCH IDs Andy Shevchenko
2024-12-04 3:09 ` [PATCH v1 1/2] serial: 8250_pci: Resolve WCH vendor ID ambiguity Andy Shevchenko
@ 2024-12-04 3:09 ` Andy Shevchenko
2024-12-04 7:14 ` Jiri Slaby
2024-12-04 22:08 ` Bjorn Helgaas
1 sibling, 2 replies; 6+ messages in thread
From: Andy Shevchenko @ 2024-12-04 3:09 UTC (permalink / raw)
To: Cameron Williams, Andy Shevchenko, Greg Kroah-Hartman, Fenghua Yu,
linux-kernel, linux-serial, linux-pci
Cc: Sudip Mukherjee, Jiri Slaby, Bjorn Helgaas
parport_serial driver uses subset of WCH IDs that are present in 8250_pci.
Share them via pci_ids.h and switch parport_serial to use defined constants.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/parport/parport_serial.c | 12 ++++++++----
drivers/tty/serial/8250/8250_pci.c | 10 ++--------
include/linux/pci_ids.h | 11 +++++++++++
3 files changed, 21 insertions(+), 12 deletions(-)
diff --git a/drivers/parport/parport_serial.c b/drivers/parport/parport_serial.c
index 3644997a8342..24d4f3a3ec3d 100644
--- a/drivers/parport/parport_serial.c
+++ b/drivers/parport/parport_serial.c
@@ -266,10 +266,14 @@ static struct pci_device_id parport_serial_pci_tbl[] = {
{ 0x1409, 0x7168, 0x1409, 0xd079, 0, 0, timedia_9079c },
/* WCH CARDS */
- { 0x4348, 0x5053, PCI_ANY_ID, PCI_ANY_ID, 0, 0, wch_ch353_1s1p},
- { 0x4348, 0x7053, 0x4348, 0x3253, 0, 0, wch_ch353_2s1p},
- { 0x1c00, 0x3050, 0x1c00, 0x3050, 0, 0, wch_ch382_0s1p},
- { 0x1c00, 0x3250, 0x1c00, 0x3250, 0, 0, wch_ch382_2s1p},
+ { PCI_VENDOR_ID_WCHCN, PCI_DEVICE_ID_WCHCN_CH353_1S1P,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, wch_ch353_1s1p },
+ { PCI_VENDOR_ID_WCHCN, PCI_DEVICE_ID_WCHCN_CH353_2S1P,
+ 0x4348, 0x3253, 0, 0, wch_ch353_2s1p },
+ { PCI_VENDOR_ID_WCHIC, PCI_DEVICE_ID_WCHIC_CH382_0S1P,
+ 0x1c00, 0x3050, 0, 0, wch_ch382_0s1p },
+ { PCI_VENDOR_ID_WCHIC, PCI_DEVICE_ID_WCHIC_CH382_2S1P,
+ 0x1c00, 0x3250, 0, 0, wch_ch382_2s1p },
/* BrainBoxes PX272/PX306 MIO card */
{ PCI_VENDOR_ID_INTASHIELD, 0x4100,
diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c
index dfac79744d37..df4d0d832e54 100644
--- a/drivers/tty/serial/8250/8250_pci.c
+++ b/drivers/tty/serial/8250/8250_pci.c
@@ -64,23 +64,17 @@
#define PCIE_DEVICE_ID_NEO_2_OX_IBM 0x00F6
#define PCI_DEVICE_ID_PLX_CRONYX_OMEGA 0xc001
#define PCI_DEVICE_ID_INTEL_PATSBURG_KT 0x1d3d
-#define PCI_VENDOR_ID_WCHCN 0x4348
+
#define PCI_DEVICE_ID_WCHCN_CH352_2S 0x3253
-#define PCI_DEVICE_ID_WCHCN_CH353_4S 0x3453
-#define PCI_DEVICE_ID_WCHCN_CH353_2S1PF 0x5046
-#define PCI_DEVICE_ID_WCHCN_CH353_1S1P 0x5053
-#define PCI_DEVICE_ID_WCHCN_CH353_2S1P 0x7053
#define PCI_DEVICE_ID_WCHCN_CH355_4S 0x7173
+
#define PCI_VENDOR_ID_AGESTAR 0x5372
#define PCI_DEVICE_ID_AGESTAR_9375 0x6872
#define PCI_DEVICE_ID_BROADCOM_TRUMANAGE 0x160a
#define PCI_DEVICE_ID_AMCC_ADDIDATA_APCI7800 0x818e
-#define PCI_VENDOR_ID_WCHIC 0x1c00
-#define PCI_DEVICE_ID_WCHIC_CH382_2S1P 0x3250
#define PCI_DEVICE_ID_WCHIC_CH384_4S 0x3470
#define PCI_DEVICE_ID_WCHIC_CH384_8S 0x3853
-#define PCI_DEVICE_ID_WCHIC_CH382_2S 0x3253
#define PCI_DEVICE_ID_MOXA_CP102E 0x1024
#define PCI_DEVICE_ID_MOXA_CP102EL 0x1025
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index d2402bf4aea2..de5deb1a0118 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -2593,6 +2593,11 @@
#define PCI_VENDOR_ID_REDHAT 0x1b36
+#define PCI_VENDOR_ID_WCHIC 0x1c00
+#define PCI_DEVICE_ID_WCHIC_CH382_0S1P 0x3050
+#define PCI_DEVICE_ID_WCHIC_CH382_2S1P 0x3250
+#define PCI_DEVICE_ID_WCHIC_CH382_2S 0x3253
+
#define PCI_VENDOR_ID_SILICOM_DENMARK 0x1c2c
#define PCI_VENDOR_ID_AMAZON_ANNAPURNA_LABS 0x1c36
@@ -2647,6 +2652,12 @@
#define PCI_VENDOR_ID_AKS 0x416c
#define PCI_DEVICE_ID_AKS_ALADDINCARD 0x0100
+#define PCI_VENDOR_ID_WCHCN 0x4348
+#define PCI_DEVICE_ID_WCHCN_CH353_4S 0x3453
+#define PCI_DEVICE_ID_WCHCN_CH353_2S1PF 0x5046
+#define PCI_DEVICE_ID_WCHCN_CH353_1S1P 0x5053
+#define PCI_DEVICE_ID_WCHCN_CH353_2S1P 0x7053
+
#define PCI_VENDOR_ID_ACCESSIO 0x494f
#define PCI_DEVICE_ID_ACCESSIO_WDG_CSM 0x22c0
--
2.43.0.rc1.1336.g36b5255a03ac
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v1 2/2] serial: 8250_pci: Share WCH IDs with parport_serial driver
2024-12-04 3:09 ` [PATCH v1 2/2] serial: 8250_pci: Share WCH IDs with parport_serial driver Andy Shevchenko
@ 2024-12-04 7:14 ` Jiri Slaby
2024-12-04 9:53 ` Andy Shevchenko
2024-12-04 22:08 ` Bjorn Helgaas
1 sibling, 1 reply; 6+ messages in thread
From: Jiri Slaby @ 2024-12-04 7:14 UTC (permalink / raw)
To: Andy Shevchenko, Cameron Williams, Greg Kroah-Hartman, Fenghua Yu,
linux-kernel, linux-serial, linux-pci
Cc: Sudip Mukherjee, Bjorn Helgaas
On 04. 12. 24, 4:09, Andy Shevchenko wrote:
> parport_serial driver uses subset of WCH IDs that are present in 8250_pci.
> Share them via pci_ids.h and switch parport_serial to use defined constants.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> drivers/parport/parport_serial.c | 12 ++++++++----
> drivers/tty/serial/8250/8250_pci.c | 10 ++--------
> include/linux/pci_ids.h | 11 +++++++++++
> 3 files changed, 21 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/parport/parport_serial.c b/drivers/parport/parport_serial.c
> index 3644997a8342..24d4f3a3ec3d 100644
> --- a/drivers/parport/parport_serial.c
> +++ b/drivers/parport/parport_serial.c
> @@ -266,10 +266,14 @@ static struct pci_device_id parport_serial_pci_tbl[] = {
> { 0x1409, 0x7168, 0x1409, 0xd079, 0, 0, timedia_9079c },
>
> /* WCH CARDS */
> - { 0x4348, 0x5053, PCI_ANY_ID, PCI_ANY_ID, 0, 0, wch_ch353_1s1p},
> - { 0x4348, 0x7053, 0x4348, 0x3253, 0, 0, wch_ch353_2s1p},
> - { 0x1c00, 0x3050, 0x1c00, 0x3050, 0, 0, wch_ch382_0s1p},
> - { 0x1c00, 0x3250, 0x1c00, 0x3250, 0, 0, wch_ch382_2s1p},
> + { PCI_VENDOR_ID_WCHCN, PCI_DEVICE_ID_WCHCN_CH353_1S1P,
> + PCI_ANY_ID, PCI_ANY_ID, 0, 0, wch_ch353_1s1p },
> + { PCI_VENDOR_ID_WCHCN, PCI_DEVICE_ID_WCHCN_CH353_2S1P,
> + 0x4348, 0x3253, 0, 0, wch_ch353_2s1p },
> + { PCI_VENDOR_ID_WCHIC, PCI_DEVICE_ID_WCHIC_CH382_0S1P,
> + 0x1c00, 0x3050, 0, 0, wch_ch382_0s1p },
> + { PCI_VENDOR_ID_WCHIC, PCI_DEVICE_ID_WCHIC_CH382_2S1P,
> + 0x1c00, 0x3250, 0, 0, wch_ch382_2s1p },
I know this is the current pattern in the file. But what about using
PCI_DEVICE_DATA() for the first and PCI_DEVICE_SUB() + .driver_data for
the rest? Otherwise it occurs as a load of incomprehensible constants.
thanks,
--
js
suse labs
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v1 2/2] serial: 8250_pci: Share WCH IDs with parport_serial driver
2024-12-04 7:14 ` Jiri Slaby
@ 2024-12-04 9:53 ` Andy Shevchenko
0 siblings, 0 replies; 6+ messages in thread
From: Andy Shevchenko @ 2024-12-04 9:53 UTC (permalink / raw)
To: Jiri Slaby
Cc: Cameron Williams, Greg Kroah-Hartman, Fenghua Yu, linux-kernel,
linux-serial, linux-pci, Sudip Mukherjee, Bjorn Helgaas
On Wed, Dec 04, 2024 at 08:14:42AM +0100, Jiri Slaby wrote:
> On 04. 12. 24, 4:09, Andy Shevchenko wrote:
> > parport_serial driver uses subset of WCH IDs that are present in 8250_pci.
> > Share them via pci_ids.h and switch parport_serial to use defined constants.
> > { 0x1409, 0x7168, 0x1409, 0xd079, 0, 0, timedia_9079c },
> > /* WCH CARDS */
> > - { 0x4348, 0x5053, PCI_ANY_ID, PCI_ANY_ID, 0, 0, wch_ch353_1s1p},
> > - { 0x4348, 0x7053, 0x4348, 0x3253, 0, 0, wch_ch353_2s1p},
> > - { 0x1c00, 0x3050, 0x1c00, 0x3050, 0, 0, wch_ch382_0s1p},
> > - { 0x1c00, 0x3250, 0x1c00, 0x3250, 0, 0, wch_ch382_2s1p},
> > + { PCI_VENDOR_ID_WCHCN, PCI_DEVICE_ID_WCHCN_CH353_1S1P,
> > + PCI_ANY_ID, PCI_ANY_ID, 0, 0, wch_ch353_1s1p },
> > + { PCI_VENDOR_ID_WCHCN, PCI_DEVICE_ID_WCHCN_CH353_2S1P,
> > + 0x4348, 0x3253, 0, 0, wch_ch353_2s1p },
> > + { PCI_VENDOR_ID_WCHIC, PCI_DEVICE_ID_WCHIC_CH382_0S1P,
> > + 0x1c00, 0x3050, 0, 0, wch_ch382_0s1p },
> > + { PCI_VENDOR_ID_WCHIC, PCI_DEVICE_ID_WCHIC_CH382_2S1P,
> > + 0x1c00, 0x3250, 0, 0, wch_ch382_2s1p },
>
> I know this is the current pattern in the file. But what about using
> PCI_DEVICE_DATA() for the first and PCI_DEVICE_SUB() + .driver_data for the
> rest? Otherwise it occurs as a load of incomprehensible constants.
I can issue an additional patch, I was really thinking about this, but decided
to go the above way as it seems logical and moving to mentioned macros sounds
like unrelated to the point of the change.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v1 2/2] serial: 8250_pci: Share WCH IDs with parport_serial driver
2024-12-04 3:09 ` [PATCH v1 2/2] serial: 8250_pci: Share WCH IDs with parport_serial driver Andy Shevchenko
2024-12-04 7:14 ` Jiri Slaby
@ 2024-12-04 22:08 ` Bjorn Helgaas
1 sibling, 0 replies; 6+ messages in thread
From: Bjorn Helgaas @ 2024-12-04 22:08 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Cameron Williams, Greg Kroah-Hartman, Fenghua Yu, linux-kernel,
linux-serial, linux-pci, Sudip Mukherjee, Jiri Slaby,
Bjorn Helgaas
On Wed, Dec 04, 2024 at 05:09:22AM +0200, Andy Shevchenko wrote:
> parport_serial driver uses subset of WCH IDs that are present in 8250_pci.
> Share them via pci_ids.h and switch parport_serial to use defined constants.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> drivers/parport/parport_serial.c | 12 ++++++++----
> drivers/tty/serial/8250/8250_pci.c | 10 ++--------
> include/linux/pci_ids.h | 11 +++++++++++
Acked-by: Bjorn Helgaas <bhelgaas@google.com> # pci-ids.h
> 3 files changed, 21 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/parport/parport_serial.c b/drivers/parport/parport_serial.c
> index 3644997a8342..24d4f3a3ec3d 100644
> --- a/drivers/parport/parport_serial.c
> +++ b/drivers/parport/parport_serial.c
> @@ -266,10 +266,14 @@ static struct pci_device_id parport_serial_pci_tbl[] = {
> { 0x1409, 0x7168, 0x1409, 0xd079, 0, 0, timedia_9079c },
>
> /* WCH CARDS */
> - { 0x4348, 0x5053, PCI_ANY_ID, PCI_ANY_ID, 0, 0, wch_ch353_1s1p},
> - { 0x4348, 0x7053, 0x4348, 0x3253, 0, 0, wch_ch353_2s1p},
> - { 0x1c00, 0x3050, 0x1c00, 0x3050, 0, 0, wch_ch382_0s1p},
> - { 0x1c00, 0x3250, 0x1c00, 0x3250, 0, 0, wch_ch382_2s1p},
> + { PCI_VENDOR_ID_WCHCN, PCI_DEVICE_ID_WCHCN_CH353_1S1P,
> + PCI_ANY_ID, PCI_ANY_ID, 0, 0, wch_ch353_1s1p },
> + { PCI_VENDOR_ID_WCHCN, PCI_DEVICE_ID_WCHCN_CH353_2S1P,
> + 0x4348, 0x3253, 0, 0, wch_ch353_2s1p },
> + { PCI_VENDOR_ID_WCHIC, PCI_DEVICE_ID_WCHIC_CH382_0S1P,
> + 0x1c00, 0x3050, 0, 0, wch_ch382_0s1p },
> + { PCI_VENDOR_ID_WCHIC, PCI_DEVICE_ID_WCHIC_CH382_2S1P,
> + 0x1c00, 0x3250, 0, 0, wch_ch382_2s1p },
>
> /* BrainBoxes PX272/PX306 MIO card */
> { PCI_VENDOR_ID_INTASHIELD, 0x4100,
> diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c
> index dfac79744d37..df4d0d832e54 100644
> --- a/drivers/tty/serial/8250/8250_pci.c
> +++ b/drivers/tty/serial/8250/8250_pci.c
> @@ -64,23 +64,17 @@
> #define PCIE_DEVICE_ID_NEO_2_OX_IBM 0x00F6
> #define PCI_DEVICE_ID_PLX_CRONYX_OMEGA 0xc001
> #define PCI_DEVICE_ID_INTEL_PATSBURG_KT 0x1d3d
> -#define PCI_VENDOR_ID_WCHCN 0x4348
> +
> #define PCI_DEVICE_ID_WCHCN_CH352_2S 0x3253
> -#define PCI_DEVICE_ID_WCHCN_CH353_4S 0x3453
> -#define PCI_DEVICE_ID_WCHCN_CH353_2S1PF 0x5046
> -#define PCI_DEVICE_ID_WCHCN_CH353_1S1P 0x5053
> -#define PCI_DEVICE_ID_WCHCN_CH353_2S1P 0x7053
> #define PCI_DEVICE_ID_WCHCN_CH355_4S 0x7173
> +
> #define PCI_VENDOR_ID_AGESTAR 0x5372
> #define PCI_DEVICE_ID_AGESTAR_9375 0x6872
> #define PCI_DEVICE_ID_BROADCOM_TRUMANAGE 0x160a
> #define PCI_DEVICE_ID_AMCC_ADDIDATA_APCI7800 0x818e
>
> -#define PCI_VENDOR_ID_WCHIC 0x1c00
> -#define PCI_DEVICE_ID_WCHIC_CH382_2S1P 0x3250
> #define PCI_DEVICE_ID_WCHIC_CH384_4S 0x3470
> #define PCI_DEVICE_ID_WCHIC_CH384_8S 0x3853
> -#define PCI_DEVICE_ID_WCHIC_CH382_2S 0x3253
>
> #define PCI_DEVICE_ID_MOXA_CP102E 0x1024
> #define PCI_DEVICE_ID_MOXA_CP102EL 0x1025
> diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
> index d2402bf4aea2..de5deb1a0118 100644
> --- a/include/linux/pci_ids.h
> +++ b/include/linux/pci_ids.h
> @@ -2593,6 +2593,11 @@
>
> #define PCI_VENDOR_ID_REDHAT 0x1b36
>
> +#define PCI_VENDOR_ID_WCHIC 0x1c00
> +#define PCI_DEVICE_ID_WCHIC_CH382_0S1P 0x3050
> +#define PCI_DEVICE_ID_WCHIC_CH382_2S1P 0x3250
> +#define PCI_DEVICE_ID_WCHIC_CH382_2S 0x3253
> +
> #define PCI_VENDOR_ID_SILICOM_DENMARK 0x1c2c
>
> #define PCI_VENDOR_ID_AMAZON_ANNAPURNA_LABS 0x1c36
> @@ -2647,6 +2652,12 @@
> #define PCI_VENDOR_ID_AKS 0x416c
> #define PCI_DEVICE_ID_AKS_ALADDINCARD 0x0100
>
> +#define PCI_VENDOR_ID_WCHCN 0x4348
> +#define PCI_DEVICE_ID_WCHCN_CH353_4S 0x3453
> +#define PCI_DEVICE_ID_WCHCN_CH353_2S1PF 0x5046
> +#define PCI_DEVICE_ID_WCHCN_CH353_1S1P 0x5053
> +#define PCI_DEVICE_ID_WCHCN_CH353_2S1P 0x7053
> +
> #define PCI_VENDOR_ID_ACCESSIO 0x494f
> #define PCI_DEVICE_ID_ACCESSIO_WDG_CSM 0x22c0
>
> --
> 2.43.0.rc1.1336.g36b5255a03ac
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-12-04 22:08 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-04 3:09 [PATCH v1 0/2] serial: 8250_pci: Share WCH IDs Andy Shevchenko
2024-12-04 3:09 ` [PATCH v1 1/2] serial: 8250_pci: Resolve WCH vendor ID ambiguity Andy Shevchenko
2024-12-04 3:09 ` [PATCH v1 2/2] serial: 8250_pci: Share WCH IDs with parport_serial driver Andy Shevchenko
2024-12-04 7:14 ` Jiri Slaby
2024-12-04 9:53 ` Andy Shevchenko
2024-12-04 22:08 ` Bjorn Helgaas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox