Re: PL2303 Linux driver (adding new chip version PID and GPIO)

2017-07-17 Thread Johan Hovold
On Fri, Jul 14, 2017 at 10:32:49AM +, Chu.Mike [朱堅宜] wrote:

> 保密警語: 
> 本電子郵件內容及其附加檔案均視為機密資料,受保密合約保護或依法不得洩漏。其內容僅供指定收件人按限定範圍或特殊目的合法使用,未經授權者收到此信息均無權閱讀、使用、複製、洩漏或散佈。若您並非本郵件之指定收件人,請即刻回覆郵件並永久刪除此郵件及其附件和銷毀所有複印文件。電子郵件的傳輸可能遭攔截、損毀、遺失、破壞、遲到或不完整、或包含病毒,無法保證其安全或無誤。寄件人不承擔因本電子郵件的錯誤或遺漏所產生的任何損害賠償責任。
>  Confidentiality Notice: This e-mail message together with any attachments 
> thereto (if any) is confidential, protected under an enforceable 
> non-disclosure agreement, intended only for the use of the named recipient(s) 
> above and may contain information that is privileged, belonging to 
> professional work products or exempt from disclosure under applicable laws. 
> Any unauthorized review, use, copying, disclosure, or distribution of any 
> information contained in or attached to this transmission is strictly 
> prohibited and may be against the laws. If you have received this message in 
> error, or are not the intended recipient(s), please immediately notify the 
> sender by e-mail and delete this e-mail message, all copies, and any attached 
> documentation from your computer. E-mail transmission cannot be guaranteed to 
> be secure or error-free as information could be intercepted, corrupted, lost, 
> destroyed, arrive late or incomplete, or contain viruses. The sender 
> therefore does not accept liability for any damage caused by any errors or 
> omissions in the contents of this email.

Oh, and make sure to not include any mail footers like this one, or we
really won't be able to help out at all.

Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: PL2303 Linux driver (adding new chip version PID and GPIO)

2017-07-17 Thread Johan Hovold
On Fri, Jul 14, 2017 at 12:47:29PM +0200, Greg Kroah-Hartman wrote:
> On Fri, Jul 14, 2017 at 10:32:49AM +, Chu.Mike [朱堅宜] wrote:
> > Hi Greg,
> > 
> > This patch is for adding our new chip PL2303TB (UART, 12 GPIO, PWN)
> > PID is 2304 and GPIO function codes. Attached is datasheet. Can you
> > help us?
> 
> Adding a new device is is simple, but adding custom ioctls for gpio
> control is not ok.  That needs to tie into the gpio subsystem instead.
> I think work is ongoing with some other drivers to do this, so you
> should have some examples on the mailing list to look at.
> 
> Johan would have more details about this, Johan?

Yes, you can take a look at the cp210x driver which recently gained gpio
support for an example:

 cf5276ce7867 ("USB: serial: cp210x: Adding GPIO support for
CP2105")

Basically you should register one (or more) gpio chips when probing the
device while taking the current pin settings into account (e.g. don't
registers gpios for pins that are currently being used for uart
functions).

Also make sure to split this up in logical changes; for example, add
support for your new device first (e.g. vid/pid entry + whatever changes
are required to talk to the new chip), and then add gpio support on top
of that.

And just let us know if you have any further questions regarding any of
this.

Thanks,
Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: PL2303 Linux driver (adding new chip version PID and GPIO)

2017-07-14 Thread 'g...@kroah.com'
On Fri, Jul 14, 2017 at 10:32:49AM +, Chu.Mike [朱堅宜] wrote:
> Hi Greg,
> 
> This patch is for adding our new chip PL2303TB (UART, 12 GPIO, PWN)
> PID is 2304 and GPIO function codes. Attached is datasheet. Can you
> help us?

Adding a new device is is simple, but adding custom ioctls for gpio
control is not ok.  That needs to tie into the gpio subsystem instead.
I think work is ongoing with some other drivers to do this, so you
should have some examples on the mailing list to look at.

Johan would have more details about this, Johan?

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: PL2303 Linux driver (adding new chip version PID and GPIO)

2017-07-14 Thread 'g...@kroah.com'
On Fri, Jul 14, 2017 at 05:10:57AM +, Yeh.Charles[葉榮鑫] wrote:
> Hi Greg,
>The attached file" pl2303c_patch.zip & pl2303h_patch.zip" are patch file 
> for PL2303.c & PL2303.h.
>Can you help to include it to the next kernel release?

Hm, I started to edit this to make it fit the proper coding style rules
(hint, please always run scripts/checkpatch.pl on your patches so no one
else has to), but then I realized you were adding a bunch of custom
ioctls to the driver for no real apparent reason.

So, what is this patch for?  What is the description of what you are
trying to do, and why?  (hint, I think I know, but I need a discription
from you).

Also, can you just make the patch and send it yourself in the correct
format, as the file Documentation/SubmittingPatches says to?  I know I
have helped out in the past for "simple" things like new ids, but for
real changes, you all should be able to do it yourself.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: PL2303 Linux driver (adding new chip version PID and GPIO)

2015-06-25 Thread 'g...@kroah.com'
On Fri, Jun 26, 2015 at 01:43:00AM +, Chu.Mike [朱堅宜] wrote:
> Hi Greg,
> 
> We have a new PL2303 chip version (called PL2303TB) with 12 GPIO function.
> http://www.prolific.com.tw/US/ShowProduct.aspx?p_id=235&pcid=41
> 
> I attached here the Linux driver and GPIO sample code. Can you help to 
> include it to the next kernel release?

Like I said last time, you need to provide this in patch format, as
described in the file Documentation/SubmittingPatches in the Linux
kernel source tree.  I can not take changes any other way.

Please fix it up that way and resend and we will be glad to review it.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html