Re: [PATCH 3/5] USB: serial: f81232: enable remote wakeup via RX/RI pin

2018-02-08 Thread Ji-Ze Hong (Peter Hong)
Hi Johan, Johan Hovold 於 2018/2/4 上午 09:46 寫道: On Thu, Feb 01, 2018 at 11:13:01AM +0800, Ji-Ze Hong (Peter Hong) wrote: Our USB-To-Serial support RI/ RX remote wakeup by Modem, Fax or other peripherals and we had tested it by following procedure with device_set_wakeup_enable() enabled: 1

Re: [PATCH 5/5] USB: serial: f81232: fix bulk_in/out size

2018-01-31 Thread Ji-Ze Hong (Peter Hong)
Hi Johan, Johan Hovold 於 2018/1/30 下午 12:11 寫道: On Mon, Jan 22, 2018 at 03:58:47PM +0800, Ji-Ze Hong (Peter Hong) wrote: diff --git a/drivers/usb/serial/f81232.c b/drivers/usb/serial/f81232.c index a054f69446fd..f3ee537d643c 100644 --- a/drivers/usb/serial/f81232.c +++ b/drivers/usb/serial

Re: [PATCH 3/5] USB: serial: f81232: enable remote wakeup via RX/RI pin

2018-01-31 Thread Ji-Ze Hong (Peter Hong)
Hi Johan, Johan Hovold 於 2018/1/30 上午 11:57 寫道: On Mon, Jan 22, 2018 at 03:58:45PM +0800, Ji-Ze Hong (Peter Hong) wrote: The F81232 can do remote wakeup via RX/RI pin with pulse. This patch will use device_set_wakeup_enable to enable this feature. This is a policy decision that should

Re: [PATCH 2/5] USB: serial: f81232: add high baud rate support

2018-01-22 Thread Ji-Ze Hong (Peter Hong)
Hi Andy, Andy Shevchenko 於 2018/1/22 下午 10:55 寫道: On Mon, Jan 22, 2018 at 9:58 AM, Ji-Ze Hong (Peter Hong) <hpe...@gmail.com> wrote: The F81232 had 4 clocksource 1.846/18.46/14.77/24MHz and baud rates can be up to 1.5Mbits with 24MHz. F81232 Clock registers (106h) Bit1-0: Clock

Re: [PATCH 1/5] USB: serial: f81232: clear overrun flag

2018-01-22 Thread Ji-Ze Hong (Peter Hong)
Hi Oliver, Oliver Neukum 於 2018/1/22 下午 06:06 寫道: +static void f81232_lsr_worker(struct work_struct *work) +{ + struct f81232_private *priv; + struct usb_serial_port *port; + int status; + u8 tmp; + + priv = container_of(work, struct f81232_private, lsr_work); +

[PATCH 1/5] USB: serial: f81232: clear overrun flag

2018-01-22 Thread Ji-Ze Hong (Peter Hong)
when OE. Signed-off-by: Ji-Ze Hong (Peter Hong) <hpeter+linux_ker...@gmail.com> --- drivers/usb/serial/f81232.c | 20 1 file changed, 20 insertions(+) diff --git a/drivers/usb/serial/f81232.c b/drivers/usb/serial/f81232.c index 96036f87b1de..46836041c50e 100644 --- a/drive

[PATCH 3/5] USB: serial: f81232: enable remote wakeup via RX/RI pin

2018-01-22 Thread Ji-Ze Hong (Peter Hong)
The F81232 can do remote wakeup via RX/RI pin with pulse. This patch will use device_set_wakeup_enable to enable this feature. Signed-off-by: Ji-Ze Hong (Peter Hong) <hpeter+linux_ker...@gmail.com> --- drivers/usb/serial/f81232.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drive

[PATCH 5/5] USB: serial: f81232: fix bulk_in/out size

2018-01-22 Thread Ji-Ze Hong (Peter Hong)
Fix Fintek F81232 bulk_in/out size to 64/16 according to the spec. http://html.alldatasheet.com/html-pdf/406315/FINTEK/F81232/1762/8/F81232.html Signed-off-by: Ji-Ze Hong (Peter Hong) <hpeter+linux_ker...@gmail.com> --- drivers/usb/serial/f81232.c | 3 +-- 1 file changed, 1 insertion

[PATCH 2/5] USB: serial: f81232: add high baud rate support

2018-01-22 Thread Ji-Ze Hong (Peter Hong)
: 14.77MHz. Signed-off-by: Ji-Ze Hong (Peter Hong) <hpeter+linux_ker...@gmail.com> --- drivers/usb/serial/f81232.c | 105 +++- 1 file changed, 94 insertions(+), 11 deletions(-) diff --git a/drivers/usb/serial/f81232.c b/drivers/usb/serial/f81232.c index 468360

[PATCH 4/5] USB: serial: f81232: implement break control

2018-01-21 Thread Ji-Ze Hong (Peter Hong)
Implement Fintek F81232 break on/off with LCR register. It's the same with 16550A LCR register layout. Signed-off-by: Ji-Ze Hong (Peter Hong) <hpeter+linux_ker...@gmail.com> --- drivers/usb/serial/f81232.c | 17 +++-- 1 file changed, 11 insertions(+), 6 deletions(-) diff

[PATCH V3 2/6] usb: serial: f81534: add auto RTS direction support

2018-01-10 Thread Ji-Ze Hong (Peter Hong)
: Auto direction(RTS) control (RTS pin Low when TX) Bit5: Invert direction(RTS) when Bit4 enabled (RTS pin high when TX) Signed-off-by: Ji-Ze Hong (Peter Hong) <hpeter+linux_ker...@gmail.com> --- V3: 1: change some BIT() operation to GENMASK(). 2: change some dev_info() to d

[PATCH V3 3/6] usb: serial: f81534: add output pin control

2018-01-10 Thread Ji-Ze Hong (Peter Hong)
, 1, 0. Signed-off-by: Ji-Ze Hong (Peter Hong) <hpeter+linux_ker...@gmail.com> --- V3: 1: change reg_mask type from u16 to u8. 2: change space around "{" & "}". V2: 1: Fix for space between brace. 2: Remain the old pin control method.

[PATCH V3 4/6] usb: serial: f81534: refactoring calc_num_ports()

2018-01-10 Thread Ji-Ze Hong (Peter Hong)
In the original code, We'll read configuration in calc_num_ports() and read again in attach(). In fact, we can move all content from attach() to calc_num_ports() to simplify the code. Signed-off-by: Ji-Ze Hong (Peter Hong) <hpeter+linux_ker...@gmail.com> --- V3: 1: First intr

[PATCH V3 1/6] usb: serial: f81534: add high baud rate support

2018-01-10 Thread Ji-Ze Hong (Peter Hong)
(always on) Bit2-1: Clock source selector 00: 1.846MHz. 01: 18.46MHz. 10: 24MHz. 11: 14.77MHz. Signed-off-by: Ji-Ze Hong (Peter Hong) <hpeter+linux_ker...@gmail.com> --- V3: 1: Separat

[PATCH V3 5/6] usb: serial: f81534: add H/W disable port support

2018-01-10 Thread Ji-Ze Hong (Peter Hong)
with 60ms. It'll contain BREAK status in LSR. Signed-off-by: Ji-Ze Hong (Peter Hong) <hpeter+linux_ker...@gmail.com> --- V3: 1: Separate old patch into refacting and H/W disable patches. V2: 1: f81534_check_port_hw_disabled() change return type from int to bool.

[PATCH V3 6/6] usb: serial: f81534: fix tx error on some baud rate

2018-01-10 Thread Ji-Ze Hong (Peter Hong)
-by: Ji-Ze Hong (Peter Hong) <hpeter+linux_ker...@gmail.com> --- V3: 1: had not noticeable changes. V2: 1: First introduced in this series patches. drivers/usb/serial/f81534.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/usb/serial/f815

Re: [PATCH V2 1/5] usb: serial: f81534: add high baud rate support

2018-01-10 Thread Ji-Ze Hong (Peter Hong)
Hi Johan, Johan Hovold 於 2018/1/10 下午 04:49 寫道: Normally, the communication with F81534 ep0 will take less than 1 sec (even only some milliseconds), but It maybe take much long time with huge loading with UART functional. We had tested it on BurnInTest, 4 ports with 921600bps + MSR status

Re: [PATCH V2 5/5] usb: serial: f81534: fix tx error on some baud rate

2018-01-09 Thread Ji-Ze Hong (Peter Hong)
Hi Johan, Johan Hovold 於 2018/1/9 下午 07:32 寫道: On Thu, Jan 04, 2018 at 10:29:21AM +0800, Ji-Ze Hong (Peter Hong) wrote: + /* +* We'll make tx frame error when baud rate from 384~500kps. So we'll +* delay all tx data frame with 1bit. +*/ + port_priv

Re: [PATCH V2 1/5] usb: serial: f81534: add high baud rate support

2018-01-09 Thread Ji-Ze Hong (Peter Hong)
Hi Johan, Johan Hovold 於 2018/1/9 下午 07:08 寫道: On Thu, Jan 04, 2018 at 10:29:17AM +0800, Ji-Ze Hong (Peter Hong) wrote: The F81532/534 had 4 clocksource 1.846/18.46/14.77/24MHz and baud rates can be up to 1.5Mbits with 24MHz. This device may generate data overrun when baud rate setting

[PATCH V2 2/5] usb: serial: f81534: add auto RTS direction support

2018-01-03 Thread Ji-Ze Hong (Peter Hong)
: Auto direction(RTS) control (RTS pin Low when TX) Bit5: Invert direction(RTS) when Bit4 enabled (RTS pin high when TX) Signed-off-by: Ji-Ze Hong (Peter Hong) <hpeter+linux_ker...@gmail.com> --- V2: 1: Read the configure data from flash and save it to shadow clock re

[PATCH V2 5/5] usb: serial: f81534: fix tx error on some baud rate

2018-01-03 Thread Ji-Ze Hong (Peter Hong)
-by: Ji-Ze Hong (Peter Hong) <hpeter+linux_ker...@gmail.com> --- V2: 1: First introduced in this series patches. drivers/usb/serial/f81534.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/usb/serial/f81534.c b/drivers/usb/serial/f81534.c index a4666171239a..513805

[PATCH V2 1/5] usb: serial: f81534: add high baud rate support

2018-01-03 Thread Ji-Ze Hong (Peter Hong)
(always on) Bit2-1: Clock source selector 00: 1.846MHz. 01: 18.46MHz. 10: 24MHz. 11: 14.77MHz. Signed-off-by: Ji-Ze Hong (Peter Hong) <hpeter+linux_ker...@gmail.com> --- v2: 1: Add

[PATCH V2 3/5] usb: serial: f81534: add output pin control

2018-01-03 Thread Ji-Ze Hong (Peter Hong)
, 1, 0. Signed-off-by: Ji-Ze Hong (Peter Hong) <hpeter+linux_ker...@gmail.com> --- V2: 1: Fix for space between brace. 2: Remain the old pin control method. drivers/usb/serial/f81534.c | 67 - 1 file changed, 66 insertions(+), 1 de

[PATCH V2 4/5] usb: serial: f81534: add H/W disable port support

2018-01-03 Thread Ji-Ze Hong (Peter Hong)
with 60ms. It'll contain BREAK status in LSR. Signed-off-by: Ji-Ze Hong (Peter Hong) <hpeter+linux_ker...@gmail.com> --- V2: 1: f81534_check_port_hw_disabled() change return type from int to bool. 2: Add help function f81534_set_phy_port_re

Re: [PATCH V1 3/4] usb: serial: f81534: add output pin control

2018-01-01 Thread Ji-Ze Hong (Peter Hong)
Hi Johan, In this code, I'm only read/write 3 registers of 0x2ae8, 0x2a90, 0x2a80, but some register will read/write more than once. Should I change the code from port_probe() to attach() and re-write it as: 1: read the 3 register 2: change them will 12 pin desire value

Re: [PATCH V1 3/4] usb: serial: f81534: add output pin control

2017-12-21 Thread Ji-Ze Hong (Peter Hong)
Hi Johan, Johan Hovold 於 2017/12/19 上午 12:06 寫道: On Thu, Nov 16, 2017 at 03:46:08PM +0800, Ji-Ze Hong (Peter Hong) wrote: +static int f81534_set_port_output_pin(struct usb_serial_port *port) +{ + struct f81534_serial_private *serial_priv; + struct f81534_port_private *port_priv

[PATCH V1 2/4] usb: serial: f81534: add auto RTS direction support

2017-11-15 Thread Ji-Ze Hong (Peter Hong)
: Auto direction(RTS) control (RTS pin Low when TX) Bit5: Invert direction(RTS) when Bit4 enabled (RTS pin high when TX) Signed-off-by: Ji-Ze Hong (Peter Hong) <hpeter+linux_ker...@gmail.com> --- drivers/usb/serial/f81534.c | 54 +++-- 1 file chang

[PATCH V1 4/4] usb: serial: f81534: add H/W disable port support

2017-11-15 Thread Ji-Ze Hong (Peter Hong)
with 60ms. It'll contain BREAK status in LSR. Signed-off-by: Ji-Ze Hong (Peter Hong) <hpeter+linux_ker...@gmail.com> --- drivers/usb/serial/f81534.c | 74 + 1 file changed, 74 insertions(+) diff --git a/drivers/usb/serial/f81534.c b/drive

[PATCH V1 1/4] usb: serial: f81534: add high baud rate support

2017-11-15 Thread Ji-Ze Hong (Peter Hong)
. 10: 24MHz. 11: 14.77MHz. Signed-off-by: Ji-Ze Hong (Peter Hong) <hpeter+linux_ker...@gmail.com> --- drivers/usb/serial/f81534.c | 84 - 1 file changed, 68 insertions(+), 16 deletions(-) diff --git a/drivers/usb/

[PATCH V1 3/4] usb: serial: f81534: add output pin control

2017-11-15 Thread Ji-Ze Hong (Peter Hong)
Port 3: M2: 0x2a90 bit3, M1: 0x2a90 bit2, M0/SD: 0x2a90 bit1 Signed-off-by: Ji-Ze Hong (Peter Hong) <hpeter+linux_ker...@gmail.com> --- drivers/usb/serial/f81534.c | 67 - 1 file changed, 66 insertions(+), 1 deletion(-) diff

[PATCH V1 1/2] usb: serial: f81534: fix hang-up on overrun

2017-10-12 Thread Ji-Ze Hong (Peter Hong)
in this situration. So we'll disable the LSR interrupt in probe() and submit the LSR worker to clear LSR state when reported LSR error bit with bulk-in data in f81534_process_per_serial_block(). Signed-off-by: Ji-Ze Hong (Peter Hong) <hpeter+linux_ker...@gmail.com> --- drivers/usb/serial/f8

[PATCH V1 2/2] usb: serial: f81534: Implement break control

2017-10-12 Thread Ji-Ze Hong (Peter Hong)
Implement Fintek f81534 break on/off with LCR register. It's the same with 16550A LCR register layout. Signed-off-by: Ji-Ze Hong (Peter Hong) <hpeter+linux_ker...@gmail.com> --- drivers/usb/serial/f81534.c | 46 +++-- 1 file changed, 40 insertions

[PATCH V1 0/2] Implement break control for F81232/F81534

2016-12-08 Thread Ji-Ze Hong (Peter Hong)
The following 2 patches makes break control available for Fintek F81232/F81534. Ji-Ze Hong (Peter Hong) (2): usb:serial: Implement Fintek F81232 break on/off usb:serial: Implement Fintek f81534 break on/off drivers/usb/serial/f81232.c | 40 ++-- drivers

[PATCH V1 2/2] usb:serial: Implement Fintek f81534 break on/off

2016-12-08 Thread Ji-Ze Hong (Peter Hong)
Implement Fintek f81534 break on/off with LCR register It's the same with 16550A LCR register layout We'll add a shadow LCR variable to save the final LCR we had set due to the "read ep0" operations maybe slow down all the serial ports performance. Signed-off-by: Ji-Ze Hong (Peter Hon

[PATCH V1 1/2] usb:serial: Implement Fintek F81232 break on/off

2016-12-08 Thread Ji-Ze Hong (Peter Hong)
Implement Fintek F81232 break on/off with LCR register, it's the same with 16550A LCR register layout. Signed-off-by: Ji-Ze Hong (Peter Hong) <hpeter+linux_ker...@gmail.com> --- drivers/usb/serial/f81232.c | 40 ++-- 1 file changed, 34 insertions

Re: [PATCH V12 1/1] usb:serial: Add Fintek F81532/534 driver

2016-11-28 Thread Ji-Ze Hong (Peter Hong)
Hi Johan, Johan Hovold 於 2016/11/24 下午 11:04 寫道: On Mon, Nov 14, 2016 at 01:37:59PM +0800, Ji-Ze Hong (Peter Hong) wrote: This driver is for Fintek F81532/F81534 USB to Serial Ports IC. + } + + if (size_bulk_out != F81534_WRITE_BUFFER_SIZE || + size_bulk_in

[PATCH V12 1/1] usb:serial: Add Fintek F81532/534 driver

2016-11-13 Thread Ji-Ze Hong (Peter Hong)
is 1-to-4 serial ports IC 2. Support Baudrate from B50 to B115200. Signed-off-by: Ji-Ze Hong (Peter Hong) <hpeter+linux_ker...@gmail.com> --- Changelog: V12 1. Max TX change from 100 to 124 bytes. 2. Add probe() to verify endpoints & packet size. 3. Rename function names

Re: [PATCH V11 1/1] usb:serial: Add Fintek F81532/534 driver

2016-11-09 Thread Ji-Ze Hong (Peter Hong)
Hi Johan, Johan Hovold 於 2016/11/2 下午 08:37 寫道: On Fri, Oct 14, 2016 at 04:20:46PM +0800, Ji-Ze Hong (Peter Hong) wrote: Reviewed-by: Johan Hovold <jo...@kernel.org> You must never add other peoples' Reviewed-by tags unless you've explicitly been given permission to do so (e.g

[PATCH V11 1/1] usb:serial: Add Fintek F81532/534 driver

2016-10-14 Thread Ji-Ze Hong (Peter Hong)
is 1-to-4 serial ports IC 2. Support Baudrate from B50 to B115200. Reviewed-by: Johan Hovold <jo...@kernel.org> Signed-off-by: Ji-Ze Hong (Peter Hong) <hpeter+linux_ker...@gmail.com> --- Changelog: V11 1. Reduce F81534_MAX_BUS_RETRY from 2000 to 20. We are only using internal

[PATCH V10 1/1] usb:serial: Add Fintek F81532/534 driver

2016-08-31 Thread Ji-Ze Hong (Peter Hong)
is 1-to-4 serial ports IC 2. Support Baudrate from B50 to B115200. Signed-off-by: Ji-Ze Hong (Peter Hong) <hpeter+linux_ker...@gmail.com> --- Changelog: V10 1. Change the submit/kill timming for read URBs, submit when first serial port open and kill when final port close. 2.

Re: [PATCH V9 1/1] usb:serial: Add Fintek F81532/534 driver

2016-08-24 Thread Ji-Ze Hong (Peter Hong)
Hi Johan, Johan Hovold 於 2016/8/23 下午 05:50 寫道: On Tue, Aug 23, 2016 at 04:23:44PM +0800, Ji-Ze Hong (Peter Hong) wrote: Hi Johan, Johan Hovold 於 2016/8/22 下午 09:14 寫道: I'd say it's not worth trying to avoid that extra allocation, and there will be several further allocations done

Re: [PATCH V9 1/1] usb:serial: Add Fintek F81532/534 driver

2016-08-23 Thread Ji-Ze Hong (Peter Hong)
Hi Johan, Johan Hovold 於 2016/8/22 下午 09:14 寫道: +static const struct reg_value f81534_pin_control[4][3] = { + /* M0_SDM1 M2 */ + {{0x2ae8, 7}, {0x2a90, 5}, {0x2a90, 4}, }, /* port 0 pins */ + {{0x2ae8, 6}, {0x2ae8, 0}, {0x2ae8, 3}, }, /* port 1

Re: [PATCH] usb:serial: Add Fintek F81532/534 driver

2016-08-04 Thread Ji-Ze Hong (Peter Hong)
Hi Alan, One Thousand Gnomes 於 2016/7/29 下午 08:48 寫道: O +static int f81534_set_normal_register(struct usb_device *dev, u16 reg, u8 data) +{ + size_t count = F81534_USB_MAX_RETRY; + int status; + u8 *tmp; + + tmp = kmalloc(sizeof(u8), GFP_KERNEL); + if (!tmp) +

[PATCH V9 1/1] usb:serial: Add Fintek F81532/534 driver

2016-05-30 Thread Ji-Ze Hong (Peter Hong)
is 1-to-4 serial ports IC 2. Support Baudrate from B50 to B115200. Signed-off-by: Ji-Ze Hong (Peter Hong) <hpeter+linux_ker...@gmail.com> --- drivers/usb/serial/Kconfig | 10 + drivers/usb/serial/Makefile |1 + drivers/usb/serial/f81534.c | 1528 ++

[PATCH] usb:serial: Add Fintek F81532/534 driver

2016-05-30 Thread Ji-Ze Hong (Peter Hong)
is 1-to-4 serial ports IC 2. Support Baudrate from B50 to B115200. Signed-off-by: Ji-Ze Hong (Peter Hong) <hpeter+linux_ker...@gmail.com> --- Changelog: v9 1. Remove lots of code to make more generic for F81532/534. e.g., high baud rate support, RS485/422 mode switch, most of GPIO