All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] parport_serial: Add support for WCH CH382L PCI-E single parallel port card.
@ 2017-06-17 13:02 Sudip Mukherjee
  2017-06-17 13:45 ` Andy Shevchenko
  0 siblings, 1 reply; 10+ messages in thread
From: Sudip Mukherjee @ 2017-06-17 13:02 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, Alexander Gerasiov, Sudip Mukherjee

From: Alexander Gerasiov <gq@redlab-i.ru>

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 <gq@redlab-i.ru>
Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
---
 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

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] parport_serial: Add support for WCH CH382L PCI-E single parallel port card.
  2017-06-17 13:02 [PATCH] parport_serial: Add support for WCH CH382L PCI-E single parallel port card Sudip Mukherjee
@ 2017-06-17 13:45 ` Andy Shevchenko
  2017-06-18 18:37   ` Alexander Gerasiov
  0 siblings, 1 reply; 10+ messages in thread
From: Andy Shevchenko @ 2017-06-17 13:45 UTC (permalink / raw)
  To: Sudip Mukherjee; +Cc: Greg Kroah-Hartman, linux-kernel, Alexander Gerasiov

On Sat, Jun 17, 2017 at 4:02 PM, Sudip Mukherjee
<sudipm.mukherjee@gmail.com> wrote:
> From: Alexander Gerasiov <gq@redlab-i.ru>
>
> 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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] parport_serial: Add support for WCH CH382L PCI-E single parallel port card.
  2017-06-17 13:45 ` Andy Shevchenko
@ 2017-06-18 18:37   ` Alexander Gerasiov
  2017-06-18 21:06     ` Sudip Mukherjee
  0 siblings, 1 reply; 10+ messages in thread
From: Alexander Gerasiov @ 2017-06-18 18:37 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: Sudip Mukherjee, Greg Kroah-Hartman, linux-kernel

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 <andy.shevchenko@gmail.com> wrote:

> On Sat, Jun 17, 2017 at 4:02 PM, Sudip Mukherjee
> <sudipm.mukherjee@gmail.com> wrote:
> > From: Alexander Gerasiov <gq@redlab-i.ru>
> >
> > 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: gq@cs.msu.su  Homepage: http://gerasiov.net  Skype: gerasiov
 PGP fingerprint: 04B5 9D90 DF7C C2AB CD49  BAEA CA87 E9E8 2AAC 33F1

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] parport_serial: Add support for WCH CH382L PCI-E single parallel port card.
  2017-06-18 18:37   ` Alexander Gerasiov
@ 2017-06-18 21:06     ` Sudip Mukherjee
  2017-06-19 18:37       ` Alan Cox
  2017-07-05 20:02       ` [PATCH] parport_pc: " Alexander Gerasiov
  0 siblings, 2 replies; 10+ messages in thread
From: Sudip Mukherjee @ 2017-06-18 21:06 UTC (permalink / raw)
  To: Alexander Gerasiov; +Cc: Andy Shevchenko, Greg Kroah-Hartman, linux-kernel

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] parport_serial: Add support for WCH CH382L PCI-E single parallel port card.
  2017-06-18 21:06     ` Sudip Mukherjee
@ 2017-06-19 18:37       ` Alan Cox
  2017-07-05 11:07         ` Alexander Gerasiov
  2017-07-05 20:02       ` [PATCH] parport_pc: " Alexander Gerasiov
  1 sibling, 1 reply; 10+ messages in thread
From: Alan Cox @ 2017-06-19 18:37 UTC (permalink / raw)
  To: Sudip Mukherjee
  Cc: Alexander Gerasiov, Andy Shevchenko, Greg Kroah-Hartman, linux-kernel

On Sun, 18 Jun 2017 22:06:59 +0100
Sudip Mukherjee <sudipm.mukherjee@gmail.com> 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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] parport_serial: Add support for WCH CH382L PCI-E single parallel port card.
  2017-06-19 18:37       ` Alan Cox
@ 2017-07-05 11:07         ` Alexander Gerasiov
  0 siblings, 0 replies; 10+ messages in thread
From: Alexander Gerasiov @ 2017-07-05 11:07 UTC (permalink / raw)
  To: Alan Cox
  Cc: Sudip Mukherjee, Andy Shevchenko, Greg Kroah-Hartman, linux-kernel

Hello Alan,

On Mon, 19 Jun 2017 19:37:34 +0100
Alan Cox <gnomes@lxorguk.ukuu.org.uk> wrote:

> On Sun, 18 Jun 2017 22:06:59 +0100
> Sudip Mukherjee <sudipm.mukherjee@gmail.com> 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: gq@cs.msu.su  Homepage: http://gerasiov.net  Skype: gerasiov
 PGP fingerprint: 04B5 9D90 DF7C C2AB CD49  BAEA CA87 E9E8 2AAC 33F1

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH] parport_pc: Add support for WCH CH382L PCI-E single parallel port card.
  2017-06-18 21:06     ` Sudip Mukherjee
  2017-06-19 18:37       ` Alan Cox
@ 2017-07-05 20:02       ` Alexander Gerasiov
  2017-07-05 21:28         ` Andy Shevchenko
  1 sibling, 1 reply; 10+ messages in thread
From: Alexander Gerasiov @ 2017-07-05 20:02 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, Sudip Mukherjee, Andy Shevchenko, Alan Cox,
	Alexander Gerasiov

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 <gq@redlab-i.ru>
---
 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

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] parport_pc: Add support for WCH CH382L PCI-E single parallel port card.
  2017-07-05 20:02       ` [PATCH] parport_pc: " Alexander Gerasiov
@ 2017-07-05 21:28         ` Andy Shevchenko
  2018-02-03 23:37           ` Alexander Gerasiov
  0 siblings, 1 reply; 10+ messages in thread
From: Andy Shevchenko @ 2017-07-05 21:28 UTC (permalink / raw)
  To: Alexander Gerasiov
  Cc: linux-kernel, Greg Kroah-Hartman, Sudip Mukherjee, Alan Cox

On Wed, Jul 5, 2017 at 11:02 PM, Alexander Gerasiov <gq@redlab-i.ru> 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 <gq@redlab-i.ru>
> ---
>  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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH] parport_pc: Add support for WCH CH382L PCI-E single parallel port card.
  2017-07-05 21:28         ` Andy Shevchenko
@ 2018-02-03 23:37           ` Alexander Gerasiov
  2018-02-03 23:50             ` Alexander Gerasiov
  0 siblings, 1 reply; 10+ messages in thread
From: Alexander Gerasiov @ 2018-02-03 23:37 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, Sudip Mukherjee, Andy Shevchenko, Alan Cox,
	Alexander Gerasiov

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 <gq@redlab-i.ru>
---
 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

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH] parport_pc: Add support for WCH CH382L PCI-E single parallel port card.
  2018-02-03 23:37           ` Alexander Gerasiov
@ 2018-02-03 23:50             ` Alexander Gerasiov
  0 siblings, 0 replies; 10+ messages in thread
From: Alexander Gerasiov @ 2018-02-03 23:50 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, Sudip Mukherjee, Andy Shevchenko, Alan Cox,
	Alexander Gerasiov

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 <gq@redlab-i.ru>
---
 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

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-02-03 23:50 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-17 13:02 [PATCH] parport_serial: Add support for WCH CH382L PCI-E single parallel port card Sudip Mukherjee
2017-06-17 13:45 ` Andy Shevchenko
2017-06-18 18:37   ` Alexander Gerasiov
2017-06-18 21:06     ` Sudip Mukherjee
2017-06-19 18:37       ` Alan Cox
2017-07-05 11:07         ` Alexander Gerasiov
2017-07-05 20:02       ` [PATCH] parport_pc: " Alexander Gerasiov
2017-07-05 21:28         ` Andy Shevchenko
2018-02-03 23:37           ` Alexander Gerasiov
2018-02-03 23:50             ` Alexander Gerasiov

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.