From: Alexander Gerasiov <[email protected]>
WCH CH382L is a PCI-E adapter with 1 parallel port. It is similair to CH382
but serial ports are not soldered on board. Detected as
Serial controller: Device 1c00:3050 (rev 10) (prog-if 05 [16850])
Signed-off-by: Alexander Gerasiov <[email protected]>
Signed-off-by: Sudip Mukherjee <[email protected]>
---
drivers/parport/parport_serial.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/parport/parport_serial.c b/drivers/parport/parport_serial.c
index e15b484..f26fc87 100644
--- a/drivers/parport/parport_serial.c
+++ b/drivers/parport/parport_serial.c
@@ -65,6 +65,7 @@ enum parport_pc_pci_cards {
wch_ch353_1s1p,
wch_ch353_2s1p,
wch_ch382_2s1p,
+ wch_ch382_0s1p,
sunix_2s1p,
};
@@ -153,6 +154,7 @@ static int netmos_parallel_init(struct pci_dev *dev, struct parport_pc_pci *par,
/* wch_ch353_1s1p*/ { 1, { { 1, -1}, } },
/* wch_ch353_2s1p*/ { 1, { { 2, -1}, } },
/* wch_ch382_2s1p*/ { 1, { { 2, -1}, } },
+ /* wch_ch382_0s1p*/ { 1, { { 2, -1}, } },
/* sunix_2s1p */ { 1, { { 3, -1 }, } },
};
@@ -260,6 +262,7 @@ static int netmos_parallel_init(struct pci_dev *dev, struct parport_pc_pci *par,
{ 0x4348, 0x5053, PCI_ANY_ID, PCI_ANY_ID, 0, 0, wch_ch353_1s1p},
{ 0x4348, 0x7053, 0x4348, 0x3253, 0, 0, wch_ch353_2s1p},
{ 0x1c00, 0x3250, 0x1c00, 0x3250, 0, 0, wch_ch382_2s1p},
+ { 0x1c00, 0x3050, 0x1c00, 0x3050, 0, 0, wch_ch382_0s1p},
/*
* More SUNIX variations. At least one of these has part number
@@ -504,6 +507,12 @@ static int netmos_parallel_init(struct pci_dev *dev, struct parport_pc_pci *par,
.uart_offset = 8,
.first_offset = 0xC0,
},
+ [wch_ch382_0s1p] = {
+ .flags = FL_BASE0,
+ .num_ports = 0,
+ .base_baud = 115200,
+ .uart_offset = 8,
+ },
[sunix_2s1p] = {
.flags = FL_BASE0|FL_BASE_BARS,
.num_ports = 2,
--
1.9.1
On Sat, Jun 17, 2017 at 4:02 PM, Sudip Mukherjee
<[email protected]> wrote:
> From: Alexander Gerasiov <[email protected]>
>
> WCH CH382L is a PCI-E adapter with 1 parallel port. It is similair to CH382
> but serial ports are not soldered on board. Detected as
> Serial controller: Device 1c00:3050 (rev 10) (prog-if 05 [16850])
> wch_ch382_2s1p,
> + wch_ch382_0s1p,
> /* wch_ch382_2s1p*/ { 1, { { 2, -1}, } },
> + /* wch_ch382_0s1p*/ { 1, { { 2, -1}, } },
> { 0x1c00, 0x3250, 0x1c00, 0x3250, 0, 0, wch_ch382_2s1p},
> + { 0x1c00, 0x3050, 0x1c00, 0x3050, 0, 0, wch_ch382_0s1p},
Just a nit, wouldn't be better to preserve alphanumerical sorting?
(Exchange lines in above pairs)
> + [wch_ch382_0s1p] = {
...
> [sunix_2s1p] = {
Similar here, though it's not visible in the patch.
--
With Best Regards,
Andy Shevchenko
Hello Andy,
While preparing the update I suddenly found, that parport_serial.c is
not the right place for this card. Since there is no serial ports on
the board, it would be better to put it into parport_pc.c
So I'll resubmit the patch right after I get access to the hardware to
check, that I did it the right way.
On Sat, 17 Jun 2017 16:45:49 +0300
Andy Shevchenko <[email protected]> wrote:
> On Sat, Jun 17, 2017 at 4:02 PM, Sudip Mukherjee
> <[email protected]> wrote:
> > From: Alexander Gerasiov <[email protected]>
> >
> > WCH CH382L is a PCI-E adapter with 1 parallel port. It is similair
> > to CH382 but serial ports are not soldered on board. Detected as
> > Serial controller: Device 1c00:3050 (rev 10) (prog-if 05 [16850])
>
> > wch_ch382_2s1p,
> > + wch_ch382_0s1p,
>
> > /* wch_ch382_2s1p*/ { 1, { { 2, -1}, } },
> > + /* wch_ch382_0s1p*/ { 1, { { 2, -1}, } },
>
> > { 0x1c00, 0x3250, 0x1c00, 0x3250, 0, 0, wch_ch382_2s1p},
> > + { 0x1c00, 0x3050, 0x1c00, 0x3050, 0, 0, wch_ch382_0s1p},
>
> Just a nit, wouldn't be better to preserve alphanumerical sorting?
> (Exchange lines in above pairs)
>
> > + [wch_ch382_0s1p] = {
> ...
> > [sunix_2s1p] = {
>
> Similar here, though it's not visible in the patch.
>
--
Best regards,
Alexander Gerasiov
Contacts:
e-mail: [email protected] Homepage: http://gerasiov.net Skype: gerasiov
PGP fingerprint: 04B5 9D90 DF7C C2AB CD49 BAEA CA87 E9E8 2AAC 33F1
On Sun, Jun 18, 2017 at 09:37:48PM +0300, Alexander Gerasiov wrote:
> Hello Andy,
>
> While preparing the update I suddenly found, that parport_serial.c is
> not the right place for this card. Since there is no serial ports on
> the board, it would be better to put it into parport_pc.c
Yes, that will be better. Thanks.
I should have pointed that out but I was confused as I saw MOSCHIP 9900,
which is parallel only, in that file also. But now digging into the past
I found the reason for that.
So, yes, your change should be in parport_pc.c
--
Regards
Sudip
On Sun, 18 Jun 2017 22:06:59 +0100
Sudip Mukherjee <[email protected]> wrote:
> On Sun, Jun 18, 2017 at 09:37:48PM +0300, Alexander Gerasiov wrote:
> > Hello Andy,
> >
> > While preparing the update I suddenly found, that parport_serial.c is
> > not the right place for this card. Since there is no serial ports on
> > the board, it would be better to put it into parport_pc.c
>
> Yes, that will be better. Thanks.
Are the uarts physically present but the connector unwired, or are they
not detectable at all ?
If it's the former then can you add a comment in parport_serial.c giving
the ID and explaining why it's not present, even if you put the code into
parport_pc.
Alan
Hello Alan,
On Mon, 19 Jun 2017 19:37:34 +0100
Alan Cox <[email protected]> wrote:
> On Sun, 18 Jun 2017 22:06:59 +0100
> Sudip Mukherjee <[email protected]> wrote:
>
> > On Sun, Jun 18, 2017 at 09:37:48PM +0300, Alexander Gerasiov
> > wrote:
> > > Hello Andy,
> > >
> > > While preparing the update I suddenly found, that
> > > parport_serial.c is not the right place for this card. Since
> > > there is no serial ports on the board, it would be better to put
> > > it into parport_pc.c
> >
> > Yes, that will be better. Thanks.
>
> Are the uarts physically present but the connector unwired, or are
> they not detectable at all ?
>
> If it's the former then can you add a comment in parport_serial.c
> giving the ID and explaining why it's not present, even if you put
> the code into parport_pc.
According to http://wiki.linuxcnc.org/cgi-bin/wiki.pl?WCH
the chip itself does not differ from one in card with dev-id 3253. So
technically one can solder connectors and use this card as 2serial +
1parallel.
But he could also remove link between pins 62 and 63 and get the board
indentified as 3252.
So, I believe, it would be less confusing (for users) if we do not
create serial devices for this adapter.
--
Best regards,
Alexander Gerasiov
Contacts:
e-mail: [email protected] Homepage: http://gerasiov.net Skype: gerasiov
PGP fingerprint: 04B5 9D90 DF7C C2AB CD49 BAEA CA87 E9E8 2AAC 33F1
WCH CH382L is a PCI-E adapter with 1 parallel port. It is similair to CH382
but serial ports are not soldered on board. Detected as
Serial controller: Device 1c00:3050 (rev 10) (prog-if 05 [16850])
Signed-off-by: Alexander Gerasiov <[email protected]>
---
drivers/parport/parport_pc.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c
index 78530d1714dc..f00a87cd9ea9 100644
--- a/drivers/parport/parport_pc.c
+++ b/drivers/parport/parport_pc.c
@@ -2646,6 +2646,7 @@ enum parport_pc_pci_cards {
netmos_9901,
netmos_9865,
quatech_sppxp100,
+ wch_ch382_1p,
};
@@ -2708,6 +2709,7 @@ static struct parport_pc_pci {
/* netmos_9901 */ { 1, { { 0, -1 }, } },
/* netmos_9865 */ { 1, { { 0, -1 }, } },
/* quatech_sppxp100 */ { 1, { { 0, 1 }, } },
+ /* wch_ch382_1p*/ { 1, { { 2, -1}, } },
};
static const struct pci_device_id parport_pc_pci_tbl[] = {
@@ -2797,6 +2799,8 @@ static const struct pci_device_id parport_pc_pci_tbl[] = {
/* Quatech SPPXP-100 Parallel port PCI ExpressCard */
{ PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_SPPXP_100,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, quatech_sppxp100 },
+ /* WCH CH382L PCI-E single parallel port card */
+ { 0x1c00, 0x3050, 0x1c00, 0x3050, 0, 0, wch_ch382_1p},
{ 0, } /* terminate list */
};
MODULE_DEVICE_TABLE(pci, parport_pc_pci_tbl);
--
2.11.0
On Wed, Jul 5, 2017 at 11:02 PM, Alexander Gerasiov <[email protected]> wrote:
> WCH CH382L is a PCI-E adapter with 1 parallel port. It is similair to CH382
> but serial ports are not soldered on board. Detected as
> Serial controller: Device 1c00:3050 (rev 10) (prog-if 05 [16850])
>
> Signed-off-by: Alexander Gerasiov <[email protected]>
> ---
> drivers/parport/parport_pc.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c
> index 78530d1714dc..f00a87cd9ea9 100644
> --- a/drivers/parport/parport_pc.c
> +++ b/drivers/parport/parport_pc.c
> @@ -2646,6 +2646,7 @@ enum parport_pc_pci_cards {
> netmos_9901,
> netmos_9865,
> quatech_sppxp100,
> + wch_ch382_1p,
> };
>
>
> @@ -2708,6 +2709,7 @@ static struct parport_pc_pci {
> /* netmos_9901 */ { 1, { { 0, -1 }, } },
> /* netmos_9865 */ { 1, { { 0, -1 }, } },
> /* quatech_sppxp100 */ { 1, { { 0, 1 }, } },
> + /* wch_ch382_1p*/ { 1, { { 2, -1}, } },
Didn't you miss a space?
> };
>
> static const struct pci_device_id parport_pc_pci_tbl[] = {
> @@ -2797,6 +2799,8 @@ static const struct pci_device_id parport_pc_pci_tbl[] = {
> /* Quatech SPPXP-100 Parallel port PCI ExpressCard */
> { PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_SPPXP_100,
> PCI_ANY_ID, PCI_ANY_ID, 0, 0, quatech_sppxp100 },
> + /* WCH CH382L PCI-E single parallel port card */
> + { 0x1c00, 0x3050, 0x1c00, 0x3050, 0, 0, wch_ch382_1p},
> { 0, } /* terminate list */
> };
> MODULE_DEVICE_TABLE(pci, parport_pc_pci_tbl);
> --
> 2.11.0
>
--
With Best Regards,
Andy Shevchenko
WCH CH382L is a PCI-E adapter with 1 parallel port. It is similair to CH382
but serial ports are not soldered on board. Detected as
Serial controller: Device 1c00:3050 (rev 10) (prog-if 05 [16850])
Signed-off-by: Alexander Gerasiov <[email protected]>
---
drivers/parport/parport_pc.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c
index 489492b608cf..aa6bb50384ee 100644
--- a/drivers/parport/parport_pc.c
+++ b/drivers/parport/parport_pc.c
@@ -2646,6 +2646,7 @@ enum parport_pc_pci_cards {
netmos_9901,
netmos_9865,
quatech_sppxp100,
+ wch_ch382l,
};
@@ -2708,6 +2709,7 @@ static struct parport_pc_pci {
/* netmos_9901 */ { 1, { { 0, -1 }, } },
/* netmos_9865 */ { 1, { { 0, -1 }, } },
/* quatech_sppxp100 */ { 1, { { 0, 1 }, } },
+ /* wch_ch382l */ { 1, { { 2, -1 }, } },
};
static const struct pci_device_id parport_pc_pci_tbl[] = {
@@ -2797,6 +2799,8 @@ static const struct pci_device_id parport_pc_pci_tbl[] = {
/* Quatech SPPXP-100 Parallel port PCI ExpressCard */
{ PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_SPPXP_100,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, quatech_sppxp100 },
+ /* WCH CH382L PCI-E single parallel port card */
+ { 0x1c00, 0x3050, 0x1c00, 0x3050, 0, 0, wch_ch382l},
{ 0, } /* terminate list */
};
MODULE_DEVICE_TABLE(pci, parport_pc_pci_tbl);
--
2.11.0
WCH CH382L is a PCI-E adapter with 1 parallel port. It is similair to CH382
but serial ports are not soldered on board. Detected as
Serial controller: Device 1c00:3050 (rev 10) (prog-if 05 [16850])
Signed-off-by: Alexander Gerasiov <[email protected]>
---
drivers/parport/parport_pc.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c
index 489492b608cf..380916bff9e0 100644
--- a/drivers/parport/parport_pc.c
+++ b/drivers/parport/parport_pc.c
@@ -2646,6 +2646,7 @@ enum parport_pc_pci_cards {
netmos_9901,
netmos_9865,
quatech_sppxp100,
+ wch_ch382l,
};
@@ -2708,6 +2709,7 @@ static struct parport_pc_pci {
/* netmos_9901 */ { 1, { { 0, -1 }, } },
/* netmos_9865 */ { 1, { { 0, -1 }, } },
/* quatech_sppxp100 */ { 1, { { 0, 1 }, } },
+ /* wch_ch382l */ { 1, { { 2, -1 }, } },
};
static const struct pci_device_id parport_pc_pci_tbl[] = {
@@ -2797,6 +2799,8 @@ static const struct pci_device_id parport_pc_pci_tbl[] = {
/* Quatech SPPXP-100 Parallel port PCI ExpressCard */
{ PCI_VENDOR_ID_QUATECH, PCI_DEVICE_ID_QUATECH_SPPXP_100,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, quatech_sppxp100 },
+ /* WCH CH382L PCI-E single parallel port card */
+ { 0x1c00, 0x3050, 0x1c00, 0x3050, 0, 0, wch_ch382l },
{ 0, } /* terminate list */
};
MODULE_DEVICE_TABLE(pci, parport_pc_pci_tbl);
--
2.11.0