mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/3] usb: misc: usb3503: Fix up usb3503 driver
@ 2013-06-01  1:34 Julius Werner
  2013-06-01  1:34 ` [PATCH 1/3] usb: misc: usb3503: Fix up whitespace Julius Werner
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Julius Werner @ 2013-06-01  1:34 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Dongjin Kim, Fengguang Wu, Wei Yongjun, linux-usb, linux-kernel,
	Simon Glass, Doug Anderson, Olof Johansson, Vivek Gautam,
	Julius Werner

This patch set contains a few minor changes to the recently added SMSC
USB3503 driver. It addresses issues that seem to be either left-over
stopgaps from an early development stage or board-specific hacks,
changing them to defaults that should be most sane and useable for all
platforms that contain this chip.

Julius Werner (3):
  usb: misc: usb3503: Fix up whitespace
  usb: misc: usb3503: Remove hardcoded disabling of ports 2 and 3
  usb: misc: usb3503: Remove 100ms sleep on reset, conform to data
    sheet

 drivers/usb/misc/usb3503.c | 16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)

-- 
1.7.12.4


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

* [PATCH 1/3] usb: misc: usb3503: Fix up whitespace
  2013-06-01  1:34 [PATCH 0/3] usb: misc: usb3503: Fix up usb3503 driver Julius Werner
@ 2013-06-01  1:34 ` Julius Werner
  2013-06-01  3:08   ` Dongjin Kim
  2013-06-01  1:34 ` [PATCH 2/3] usb: misc: usb3503: Remove hardcoded disabling of ports 2 and 3 Julius Werner
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: Julius Werner @ 2013-06-01  1:34 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Dongjin Kim, Fengguang Wu, Wei Yongjun, linux-usb, linux-kernel,
	Simon Glass, Doug Anderson, Olof Johansson, Vivek Gautam,
	Julius Werner

Remove an erroneous tab that should be a space.

Signed-off-by: Julius Werner <jwerner@chromium.org>
---
 drivers/usb/misc/usb3503.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/misc/usb3503.c b/drivers/usb/misc/usb3503.c
index d3a1cce..73aeb87 100644
--- a/drivers/usb/misc/usb3503.c
+++ b/drivers/usb/misc/usb3503.c
@@ -208,7 +208,7 @@ static int usb3503_probe(struct i2c_client *i2c, const struct i2c_device_id *id)
 		hub->gpio_connect = of_get_named_gpio(np, "intn-gpios", 0);
 		if (hub->gpio_connect == -EPROBE_DEFER)
 			return -EPROBE_DEFER;
-		hub->gpio_reset	= of_get_named_gpio(np, "reset-gpios", 0);
+		hub->gpio_reset = of_get_named_gpio(np, "reset-gpios", 0);
 		if (hub->gpio_reset == -EPROBE_DEFER)
 			return -EPROBE_DEFER;
 		of_property_read_u32(np, "initial-mode", &mode);
-- 
1.7.12.4


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

* [PATCH 2/3] usb: misc: usb3503: Remove hardcoded disabling of ports 2 and 3
  2013-06-01  1:34 [PATCH 0/3] usb: misc: usb3503: Fix up usb3503 driver Julius Werner
  2013-06-01  1:34 ` [PATCH 1/3] usb: misc: usb3503: Fix up whitespace Julius Werner
@ 2013-06-01  1:34 ` Julius Werner
  2013-06-01  3:01   ` Dongjin Kim
  2013-06-01  1:34 ` [PATCH 3/3] usb: misc: usb3503: Remove 100ms sleep on reset, conform to data sheet Julius Werner
  2013-06-01  2:55 ` [PATCH 0/3] usb: misc: usb3503: Fix up usb3503 driver Olof Johansson
  3 siblings, 1 reply; 8+ messages in thread
From: Julius Werner @ 2013-06-01  1:34 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Dongjin Kim, Fengguang Wu, Wei Yongjun, linux-usb, linux-kernel,
	Simon Glass, Doug Anderson, Olof Johansson, Vivek Gautam,
	Julius Werner

The usb3503 driver currently disables port 2 and 3 without explaination.
It doesn't make sense to do this in a mainline Linux driver that should
support all platforms which use this chip. If specific use cases really
require ports to be disabled, this should either be done through local
patches or a configurable mechanism (such as a device tree property).
Until then, let's keep all ports enabled.

Signed-off-by: Julius Werner <jwerner@chromium.org>
---
 drivers/usb/misc/usb3503.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/drivers/usb/misc/usb3503.c b/drivers/usb/misc/usb3503.c
index 73aeb87..a647a2e 100644
--- a/drivers/usb/misc/usb3503.c
+++ b/drivers/usb/misc/usb3503.c
@@ -134,14 +134,6 @@ static int usb3503_switch_mode(struct usb3503 *hub, enum usb3503_mode mode)
 			goto err_hubmode;
 		}
 
-		/* PDS : Port2,3 Disable For Self Powered Operation */
-		err = usb3503_set_bits(i2c, USB3503_PDS,
-				(USB3503_PORT2 | USB3503_PORT3));
-		if (err < 0) {
-			dev_err(&i2c->dev, "PDS failed (%d)\n", err);
-			goto err_hubmode;
-		}
-
 		/* CFG1 : SELF_BUS_PWR -> Self-Powerd operation */
 		err = usb3503_set_bits(i2c, USB3503_CFG1, USB3503_SELF_BUS_PWR);
 		if (err < 0) {
-- 
1.7.12.4


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

* [PATCH 3/3] usb: misc: usb3503: Remove 100ms sleep on reset, conform to data sheet
  2013-06-01  1:34 [PATCH 0/3] usb: misc: usb3503: Fix up usb3503 driver Julius Werner
  2013-06-01  1:34 ` [PATCH 1/3] usb: misc: usb3503: Fix up whitespace Julius Werner
  2013-06-01  1:34 ` [PATCH 2/3] usb: misc: usb3503: Remove hardcoded disabling of ports 2 and 3 Julius Werner
@ 2013-06-01  1:34 ` Julius Werner
  2013-06-01  3:08   ` Dongjin Kim
  2013-06-01  2:55 ` [PATCH 0/3] usb: misc: usb3503: Fix up usb3503 driver Olof Johansson
  3 siblings, 1 reply; 8+ messages in thread
From: Julius Werner @ 2013-06-01  1:34 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Dongjin Kim, Fengguang Wu, Wei Yongjun, linux-usb, linux-kernel,
	Simon Glass, Doug Anderson, Olof Johansson, Vivek Gautam,
	Julius Werner

The usb3503 driver sleeps a flat 100ms when resetting the chip, with a
comment about waiting for the reference clock. This seems to be a
board-specific detail that should not hold up boot across all platforms.
This patch reduces the sleep to the 4ms initialization delay that the
chip itself actually requires (as per its data sheet). If certain boards
require more time to set up the reference clock, they should change this
through local patches or add a proper, configurable synchronization
mechanism.

Signed-off-by: Julius Werner <jwerner@chromium.org>
---
 drivers/usb/misc/usb3503.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/misc/usb3503.c b/drivers/usb/misc/usb3503.c
index a647a2e..a1d509f 100644
--- a/drivers/usb/misc/usb3503.c
+++ b/drivers/usb/misc/usb3503.c
@@ -107,11 +107,9 @@ static int usb3503_reset(int gpio_reset, int state)
 	if (gpio_is_valid(gpio_reset))
 		gpio_set_value(gpio_reset, state);
 
-	/* Wait RefClk when RESET_N is released, otherwise Hub will
-	 * not transition to Hub Communication Stage.
-	 */
+	/* Wait T_HUBINIT == 4ms for hub logic to stabilize */
 	if (state)
-		msleep(100);
+		usleep_range(4000, 10000);
 
 	return 0;
 }
-- 
1.7.12.4


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

* Re: [PATCH 0/3] usb: misc: usb3503: Fix up usb3503 driver
  2013-06-01  1:34 [PATCH 0/3] usb: misc: usb3503: Fix up usb3503 driver Julius Werner
                   ` (2 preceding siblings ...)
  2013-06-01  1:34 ` [PATCH 3/3] usb: misc: usb3503: Remove 100ms sleep on reset, conform to data sheet Julius Werner
@ 2013-06-01  2:55 ` Olof Johansson
  3 siblings, 0 replies; 8+ messages in thread
From: Olof Johansson @ 2013-06-01  2:55 UTC (permalink / raw)
  To: Julius Werner
  Cc: Greg Kroah-Hartman, Dongjin Kim, Fengguang Wu, Wei Yongjun,
	linux-usb, linux-kernel, Simon Glass, Doug Anderson,
	Vivek Gautam

2013/5/31 Julius Werner <jwerner@chromium.org>:
> This patch set contains a few minor changes to the recently added SMSC
> USB3503 driver. It addresses issues that seem to be either left-over
> stopgaps from an early development stage or board-specific hacks,
> changing them to defaults that should be most sane and useable for all
> platforms that contain this chip.
>
> Julius Werner (3):
>   usb: misc: usb3503: Fix up whitespace
>   usb: misc: usb3503: Remove hardcoded disabling of ports 2 and 3
>   usb: misc: usb3503: Remove 100ms sleep on reset, conform to data
>     sheet
>
>  drivers/usb/misc/usb3503.c | 16 +++-------------
>  1 file changed, 3 insertions(+), 13 deletions(-)

Series:

Acked-by: Olof Johansson <olof@lixom.net>


-Olof

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

* Re: [PATCH 2/3] usb: misc: usb3503: Remove hardcoded disabling of ports 2 and 3
  2013-06-01  1:34 ` [PATCH 2/3] usb: misc: usb3503: Remove hardcoded disabling of ports 2 and 3 Julius Werner
@ 2013-06-01  3:01   ` Dongjin Kim
  0 siblings, 0 replies; 8+ messages in thread
From: Dongjin Kim @ 2013-06-01  3:01 UTC (permalink / raw)
  To: Julius Werner
  Cc: Greg Kroah-Hartman, Fengguang Wu, Wei Yongjun, linux-usb,
	linux-kernel, Simon Glass, Doug Anderson, Olof Johansson,
	Vivek Gautam

Hi,

I have sent two patches for the same issue, these two are merged into
Greg's tree. Please review the patches.

[1] https://patchwork.kernel.org/patch/2599021
[2] https://patchwork.kernel.org/patch/2599031

Many thanks,
Dongjin.

On Sat, Jun 1, 2013 at 10:34 AM, Julius Werner <jwerner@chromium.org> wrote:
> The usb3503 driver currently disables port 2 and 3 without explaination.
> It doesn't make sense to do this in a mainline Linux driver that should
> support all platforms which use this chip. If specific use cases really
> require ports to be disabled, this should either be done through local
> patches or a configurable mechanism (such as a device tree property).
> Until then, let's keep all ports enabled.
>
> Signed-off-by: Julius Werner <jwerner@chromium.org>
> ---
>  drivers/usb/misc/usb3503.c | 8 --------
>  1 file changed, 8 deletions(-)
>
> diff --git a/drivers/usb/misc/usb3503.c b/drivers/usb/misc/usb3503.c
> index 73aeb87..a647a2e 100644
> --- a/drivers/usb/misc/usb3503.c
> +++ b/drivers/usb/misc/usb3503.c
> @@ -134,14 +134,6 @@ static int usb3503_switch_mode(struct usb3503 *hub, enum usb3503_mode mode)
>                         goto err_hubmode;
>                 }
>
> -               /* PDS : Port2,3 Disable For Self Powered Operation */
> -               err = usb3503_set_bits(i2c, USB3503_PDS,
> -                               (USB3503_PORT2 | USB3503_PORT3));
> -               if (err < 0) {
> -                       dev_err(&i2c->dev, "PDS failed (%d)\n", err);
> -                       goto err_hubmode;
> -               }
> -
>                 /* CFG1 : SELF_BUS_PWR -> Self-Powerd operation */
>                 err = usb3503_set_bits(i2c, USB3503_CFG1, USB3503_SELF_BUS_PWR);
>                 if (err < 0) {
> --
> 1.7.12.4
>

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

* Re: [PATCH 1/3] usb: misc: usb3503: Fix up whitespace
  2013-06-01  1:34 ` [PATCH 1/3] usb: misc: usb3503: Fix up whitespace Julius Werner
@ 2013-06-01  3:08   ` Dongjin Kim
  0 siblings, 0 replies; 8+ messages in thread
From: Dongjin Kim @ 2013-06-01  3:08 UTC (permalink / raw)
  To: Julius Werner
  Cc: Greg Kroah-Hartman, Fengguang Wu, Wei Yongjun, linux-usb,
	linux-kernel, Simon Glass, Doug Anderson, Olof Johansson,
	Vivek Gautam

Signed-off-by: Dongjin Kim <tobetter@gmail.com>

On Sat, Jun 1, 2013 at 10:34 AM, Julius Werner <jwerner@chromium.org> wrote:
> Remove an erroneous tab that should be a space.
>
> Signed-off-by: Julius Werner <jwerner@chromium.org>
> ---
>  drivers/usb/misc/usb3503.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/misc/usb3503.c b/drivers/usb/misc/usb3503.c
> index d3a1cce..73aeb87 100644
> --- a/drivers/usb/misc/usb3503.c
> +++ b/drivers/usb/misc/usb3503.c
> @@ -208,7 +208,7 @@ static int usb3503_probe(struct i2c_client *i2c, const struct i2c_device_id *id)
>                 hub->gpio_connect = of_get_named_gpio(np, "intn-gpios", 0);
>                 if (hub->gpio_connect == -EPROBE_DEFER)
>                         return -EPROBE_DEFER;
> -               hub->gpio_reset = of_get_named_gpio(np, "reset-gpios", 0);
> +               hub->gpio_reset = of_get_named_gpio(np, "reset-gpios", 0);
>                 if (hub->gpio_reset == -EPROBE_DEFER)
>                         return -EPROBE_DEFER;
>                 of_property_read_u32(np, "initial-mode", &mode);
> --
> 1.7.12.4
>

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

* Re: [PATCH 3/3] usb: misc: usb3503: Remove 100ms sleep on reset, conform to data sheet
  2013-06-01  1:34 ` [PATCH 3/3] usb: misc: usb3503: Remove 100ms sleep on reset, conform to data sheet Julius Werner
@ 2013-06-01  3:08   ` Dongjin Kim
  0 siblings, 0 replies; 8+ messages in thread
From: Dongjin Kim @ 2013-06-01  3:08 UTC (permalink / raw)
  To: Julius Werner
  Cc: Greg Kroah-Hartman, Fengguang Wu, Wei Yongjun, linux-usb,
	linux-kernel, Simon Glass, Doug Anderson, Olof Johansson,
	Vivek Gautam

Signed-off-by: Dongjin Kim <tobetter@gmail.com>

On Sat, Jun 1, 2013 at 10:34 AM, Julius Werner <jwerner@chromium.org> wrote:
> The usb3503 driver sleeps a flat 100ms when resetting the chip, with a
> comment about waiting for the reference clock. This seems to be a
> board-specific detail that should not hold up boot across all platforms.
> This patch reduces the sleep to the 4ms initialization delay that the
> chip itself actually requires (as per its data sheet). If certain boards
> require more time to set up the reference clock, they should change this
> through local patches or add a proper, configurable synchronization
> mechanism.
>
> Signed-off-by: Julius Werner <jwerner@chromium.org>
> ---
>  drivers/usb/misc/usb3503.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/usb/misc/usb3503.c b/drivers/usb/misc/usb3503.c
> index a647a2e..a1d509f 100644
> --- a/drivers/usb/misc/usb3503.c
> +++ b/drivers/usb/misc/usb3503.c
> @@ -107,11 +107,9 @@ static int usb3503_reset(int gpio_reset, int state)
>         if (gpio_is_valid(gpio_reset))
>                 gpio_set_value(gpio_reset, state);
>
> -       /* Wait RefClk when RESET_N is released, otherwise Hub will
> -        * not transition to Hub Communication Stage.
> -        */
> +       /* Wait T_HUBINIT == 4ms for hub logic to stabilize */
>         if (state)
> -               msleep(100);
> +               usleep_range(4000, 10000);
>
>         return 0;
>  }
> --
> 1.7.12.4
>

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

end of thread, other threads:[~2013-06-01  3:12 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-01  1:34 [PATCH 0/3] usb: misc: usb3503: Fix up usb3503 driver Julius Werner
2013-06-01  1:34 ` [PATCH 1/3] usb: misc: usb3503: Fix up whitespace Julius Werner
2013-06-01  3:08   ` Dongjin Kim
2013-06-01  1:34 ` [PATCH 2/3] usb: misc: usb3503: Remove hardcoded disabling of ports 2 and 3 Julius Werner
2013-06-01  3:01   ` Dongjin Kim
2013-06-01  1:34 ` [PATCH 3/3] usb: misc: usb3503: Remove 100ms sleep on reset, conform to data sheet Julius Werner
2013-06-01  3:08   ` Dongjin Kim
2013-06-01  2:55 ` [PATCH 0/3] usb: misc: usb3503: Fix up usb3503 driver Olof Johansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®