Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1668248 > unrolled thread

[PATCH] parport_serial: Add support for WCH CH382L PCI-E single parallel port card.

Started bySudip Mukherjee <sudipm.mukherjee@gmail.com>
First post2017-06-17 15:10 +0200
Last post2017-06-19 21:10 +0200
Articles 5 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] parport_serial: Add support for WCH CH382L PCI-E single parallel port card. Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2017-06-17 15:10 +0200
    Re: [PATCH] parport_serial: Add support for WCH CH382L PCI-E single  parallel port card. Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-06-17 15:50 +0200
      Re: [PATCH] parport_serial: Add support for WCH CH382L PCI-E single  parallel port card. Alexander Gerasiov <gq@redlab-i.ru> - 2017-06-18 20:50 +0200
        Re: [PATCH] parport_serial: Add support for WCH CH382L PCI-E single  parallel port card. Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2017-06-18 23:10 +0200
          Re: [PATCH] parport_serial: Add support for WCH CH382L PCI-E single  parallel port card. Alan Cox <gnomes@lxorguk.ukuu.org.uk> - 2017-06-19 21:10 +0200

#1668248 — [PATCH] parport_serial: Add support for WCH CH382L PCI-E single parallel port card.

FromSudip Mukherjee <sudipm.mukherjee@gmail.com>
Date2017-06-17 15:10 +0200
Subject[PATCH] parport_serial: Add support for WCH CH382L PCI-E single parallel port card.
Message-ID<tTlEd-7zn-3@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1668253 — Re: [PATCH] parport_serial: Add support for WCH CH382L PCI-E single parallel port card.

FromAndy Shevchenko <andy.shevchenko@gmail.com>
Date2017-06-17 15:50 +0200
SubjectRe: [PATCH] parport_serial: Add support for WCH CH382L PCI-E single parallel port card.
Message-ID<tTmgW-7Qw-3@gated-at.bofh.it>
In reply to#1668248
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

[toc] | [prev] | [next] | [standalone]


#1668646 — Re: [PATCH] parport_serial: Add support for WCH CH382L PCI-E single parallel port card.

FromAlexander Gerasiov <gq@redlab-i.ru>
Date2017-06-18 20:50 +0200
SubjectRe: [PATCH] parport_serial: Add support for WCH CH382L PCI-E single parallel port card.
Message-ID<tTNqO-j7-19@gated-at.bofh.it>
In reply to#1668253
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

[toc] | [prev] | [next] | [standalone]


#1668657 — Re: [PATCH] parport_serial: Add support for WCH CH382L PCI-E single parallel port card.

FromSudip Mukherjee <sudipm.mukherjee@gmail.com>
Date2017-06-18 23:10 +0200
SubjectRe: [PATCH] parport_serial: Add support for WCH CH382L PCI-E single parallel port card.
Message-ID<tTPCi-1QZ-41@gated-at.bofh.it>
In reply to#1668646
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

[toc] | [prev] | [next] | [standalone]


#1669739 — Re: [PATCH] parport_serial: Add support for WCH CH382L PCI-E single parallel port card.

FromAlan Cox <gnomes@lxorguk.ukuu.org.uk>
Date2017-06-19 21:10 +0200
SubjectRe: [PATCH] parport_serial: Add support for WCH CH382L PCI-E single parallel port card.
Message-ID<tUadK-6Iy-61@gated-at.bofh.it>
In reply to#1668657
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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web