All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: "Ji-Ze Hong \(Peter Hong\)" <hpeter@gmail.com>
Cc: johan@kernel.org, gregkh@linuxfoundation.org,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	peter_hong@fintek.com.tw,
	"Ji-Ze Hong \(Peter Hong\)" <hpeter+linux_kernel@gmail.com>
Subject: [V2,3/5] usb: serial: f81534: add output pin control
Date: Tue, 9 Jan 2018 12:19:14 +0100	[thread overview]
Message-ID: <20180109111914.GP11344@localhost> (raw)

On Thu, Jan 04, 2018 at 10:29:19AM +0800, Ji-Ze Hong (Peter Hong) wrote:
> The F81532/534 had 3 output pin (M0/SD, M1, M2) with open-drain mode to
> control transceiver. We'll read it from internal Flash with address
> 0x2f05~0x2f08 for 4 ports. The value is range from 0 to 7. The M0/SD is
> MSB of this value. For a examples, If read value is 6, we'll write M0/SD,
> M1, M2 as 1, 1, 0.
> 
> Signed-off-by: Ji-Ze Hong (Peter Hong) <hpeter+linux_kernel@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 deletion(-)
> 
> diff --git a/drivers/usb/serial/f81534.c b/drivers/usb/serial/f81534.c
> index 8a778bc1d492..7f175f39a171 100644
> --- a/drivers/usb/serial/f81534.c
> +++ b/drivers/usb/serial/f81534.c
> @@ -52,6 +52,7 @@
>  #define F81534_CUSTOM_NO_CUSTOM_DATA	0xff
>  #define F81534_CUSTOM_VALID_TOKEN	0xf0
>  #define F81534_CONF_OFFSET		1
> +#define F81534_CONF_GPIO_OFFSET		4
>  
>  #define F81534_MAX_DATA_BLOCK		64
>  #define F81534_MAX_BUS_RETRY		20
> @@ -164,6 +165,23 @@ struct f81534_port_private {
>  	u8 phy_num;
>  };
>  
> +struct f81534_pin_data {
> +	const u16 reg_addr;
> +	const u16 reg_mask;

I asked in my previous review comments whether this mask should really
be u8?

> +};
> +
> +struct f81534_port_out_pin {
> +	struct f81534_pin_data pin[3];
> +};
> +
> +/* Pin output value for M2/M1/M0(SD) */
> +static const struct f81534_port_out_pin f81534_port_out_pins[] = {
> +	 { { {0x2ae8, BIT(7)}, {0x2a90, BIT(5)}, {0x2a90, BIT(4) } } },
> +	 { { {0x2ae8, BIT(6)}, {0x2ae8, BIT(0)}, {0x2ae8, BIT(3) } } },
> +	 { { {0x2a90, BIT(0)}, {0x2ae8, BIT(2)}, {0x2a80, BIT(6) } } },
> +	 { { {0x2a90, BIT(3)}, {0x2a90, BIT(2)}, {0x2a90, BIT(1) } } },

Nit picking, but you still don't use space consistently around { and }
above.

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

WARNING: multiple messages have this Message-ID (diff)
From: Johan Hovold <johan@kernel.org>
To: "Ji-Ze Hong (Peter Hong)" <hpeter@gmail.com>
Cc: johan@kernel.org, gregkh@linuxfoundation.org,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	peter_hong@fintek.com.tw,
	"Ji-Ze Hong (Peter Hong)" <hpeter+linux_kernel@gmail.com>
Subject: Re: [PATCH V2 3/5] usb: serial: f81534: add output pin control
Date: Tue, 9 Jan 2018 12:19:14 +0100	[thread overview]
Message-ID: <20180109111914.GP11344@localhost> (raw)
In-Reply-To: <1515032961-29131-3-git-send-email-hpeter+linux_kernel@gmail.com>

On Thu, Jan 04, 2018 at 10:29:19AM +0800, Ji-Ze Hong (Peter Hong) wrote:
> The F81532/534 had 3 output pin (M0/SD, M1, M2) with open-drain mode to
> control transceiver. We'll read it from internal Flash with address
> 0x2f05~0x2f08 for 4 ports. The value is range from 0 to 7. The M0/SD is
> MSB of this value. For a examples, If read value is 6, we'll write M0/SD,
> M1, M2 as 1, 1, 0.
> 
> Signed-off-by: Ji-Ze Hong (Peter Hong) <hpeter+linux_kernel@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 deletion(-)
> 
> diff --git a/drivers/usb/serial/f81534.c b/drivers/usb/serial/f81534.c
> index 8a778bc1d492..7f175f39a171 100644
> --- a/drivers/usb/serial/f81534.c
> +++ b/drivers/usb/serial/f81534.c
> @@ -52,6 +52,7 @@
>  #define F81534_CUSTOM_NO_CUSTOM_DATA	0xff
>  #define F81534_CUSTOM_VALID_TOKEN	0xf0
>  #define F81534_CONF_OFFSET		1
> +#define F81534_CONF_GPIO_OFFSET		4
>  
>  #define F81534_MAX_DATA_BLOCK		64
>  #define F81534_MAX_BUS_RETRY		20
> @@ -164,6 +165,23 @@ struct f81534_port_private {
>  	u8 phy_num;
>  };
>  
> +struct f81534_pin_data {
> +	const u16 reg_addr;
> +	const u16 reg_mask;

I asked in my previous review comments whether this mask should really
be u8?

> +};
> +
> +struct f81534_port_out_pin {
> +	struct f81534_pin_data pin[3];
> +};
> +
> +/* Pin output value for M2/M1/M0(SD) */
> +static const struct f81534_port_out_pin f81534_port_out_pins[] = {
> +	 { { {0x2ae8, BIT(7)}, {0x2a90, BIT(5)}, {0x2a90, BIT(4) } } },
> +	 { { {0x2ae8, BIT(6)}, {0x2ae8, BIT(0)}, {0x2ae8, BIT(3) } } },
> +	 { { {0x2a90, BIT(0)}, {0x2ae8, BIT(2)}, {0x2a80, BIT(6) } } },
> +	 { { {0x2a90, BIT(3)}, {0x2a90, BIT(2)}, {0x2a90, BIT(1) } } },

Nit picking, but you still don't use space consistently around { and }
above.

Johan

             reply	other threads:[~2018-01-09 11:19 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-09 11:19 Johan Hovold [this message]
2018-01-09 11:19 ` [PATCH V2 3/5] usb: serial: f81534: add output pin control Johan Hovold
  -- strict thread matches above, loose matches on Subject: below --
2018-01-10  9:27 [V2,1/5] usb: serial: f81534: add high baud rate support Johan Hovold
2018-01-10  9:27 ` [PATCH V2 1/5] " Johan Hovold
2018-01-10  9:16 [V2,1/5] " Ji-Ze Hong (Peter Hong)
2018-01-10  9:16 ` [PATCH V2 1/5] " Ji-Ze Hong (Peter Hong)
2018-01-10  8:50 [V2,5/5] usb: serial: f81534: fix tx error on some baud rate Johan Hovold
2018-01-10  8:50 ` [PATCH V2 5/5] " Johan Hovold
2018-01-10  8:49 [V2,1/5] usb: serial: f81534: add high baud rate support Johan Hovold
2018-01-10  8:49 ` [PATCH V2 1/5] " Johan Hovold
2018-01-10  5:42 [V2,5/5] usb: serial: f81534: fix tx error on some baud rate Ji-Ze Hong (Peter Hong)
2018-01-10  5:42 ` [PATCH V2 5/5] " Ji-Ze Hong (Peter Hong)
2018-01-10  5:30 [V2,1/5] usb: serial: f81534: add high baud rate support Ji-Ze Hong (Peter Hong)
2018-01-10  5:30 ` [PATCH V2 1/5] " Ji-Ze Hong (Peter Hong)
2018-01-09 11:32 [V2,5/5] usb: serial: f81534: fix tx error on some baud rate Johan Hovold
2018-01-09 11:32 ` [PATCH V2 5/5] " Johan Hovold
2018-01-09 11:29 [V2,4/5] usb: serial: f81534: add H/W disable port support Johan Hovold
2018-01-09 11:29 ` [PATCH V2 4/5] " Johan Hovold
2018-01-09 11:14 [V2,2/5] usb: serial: f81534: add auto RTS direction support Johan Hovold
2018-01-09 11:14 ` [PATCH V2 2/5] " Johan Hovold
2018-01-09 11:08 [V2,1/5] usb: serial: f81534: add high baud rate support Johan Hovold
2018-01-09 11:08 ` [PATCH V2 1/5] " Johan Hovold
2018-01-04  2:29 [V2,5/5] usb: serial: f81534: fix tx error on some baud rate Ji-Ze Hong (Peter Hong)
2018-01-04  2:29 ` [PATCH V2 5/5] " Ji-Ze Hong (Peter Hong)
2018-01-04  2:29 [V2,4/5] usb: serial: f81534: add H/W disable port support Ji-Ze Hong (Peter Hong)
2018-01-04  2:29 ` [PATCH V2 4/5] " Ji-Ze Hong (Peter Hong)
2018-01-04  2:29 [V2,3/5] usb: serial: f81534: add output pin control Ji-Ze Hong (Peter Hong)
2018-01-04  2:29 ` [PATCH V2 3/5] " Ji-Ze Hong (Peter Hong)
2018-01-04  2:29 [V2,2/5] usb: serial: f81534: add auto RTS direction support Ji-Ze Hong (Peter Hong)
2018-01-04  2:29 ` [PATCH V2 2/5] " Ji-Ze Hong (Peter Hong)
2018-01-04  2:29 [V2,1/5] usb: serial: f81534: add high baud rate support Ji-Ze Hong (Peter Hong)
2018-01-04  2:29 ` [PATCH V2 1/5] " Ji-Ze Hong (Peter Hong)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180109111914.GP11344@localhost \
    --to=johan@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hpeter+linux_kernel@gmail.com \
    --cc=hpeter@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=peter_hong@fintek.com.tw \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.