linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] dt-bindings: usb: ci-hdrc-usb2: add property power-active-high
@ 2019-01-15 12:31 Philipp Puschmann
  2019-01-15 12:31 ` [PATCH 2/2] usb: chipidea: imx: set power polarity Philipp Puschmann
  2019-01-16 10:51 ` [PATCH v2,1/2] dt-bindings: usb: ci-hdrc-usb2: add property power-active-high Philipp Puschmann
  0 siblings, 2 replies; 12+ messages in thread
From: Philipp Puschmann @ 2019-01-15 12:31 UTC (permalink / raw)
  To: gregkh
  Cc: robh+dt, mark.rutland, Peter.Chen, linux-usb, devicetree,
	linux-kernel, philipp.puschmann

Signed-off-by: Philipp Puschmann <philipp.puschmann@emlix.com>
---
 Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt
index adae82385dd6..8696e3eff6e7 100644
--- a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt
+++ b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt
@@ -93,6 +93,7 @@ i.mx specific properties
 - over-current-active-low: over current signal polarity is active low.
 - over-current-active-high: over current signal polarity is active high.
   It's recommended to specify the over current polarity.
+- power-active-high: power signal polarity is high active (only for imx6q/dl)
 - external-vbus-divider: enables off-chip resistor divider for Vbus
 
 Example:
-- 
2.20.1


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

* [PATCH 2/2] usb: chipidea: imx: set power polarity
  2019-01-15 12:31 [PATCH 1/2] dt-bindings: usb: ci-hdrc-usb2: add property power-active-high Philipp Puschmann
@ 2019-01-15 12:31 ` Philipp Puschmann
  2019-01-16 10:51 ` [PATCH v2,1/2] dt-bindings: usb: ci-hdrc-usb2: add property power-active-high Philipp Puschmann
  1 sibling, 0 replies; 12+ messages in thread
From: Philipp Puschmann @ 2019-01-15 12:31 UTC (permalink / raw)
  To: gregkh
  Cc: robh+dt, mark.rutland, Peter.Chen, linux-usb, devicetree,
	linux-kernel, philipp.puschmann

This patch adds support to set the power line polarity for i.MX6q/dl.

To let the USB controller control the power it may be necessary to configure
the polarity of the power line. So far the polarity was configured
by Bootloader or alternatively the power line was muxed as gpio and
driven by a regulator.

Signed-off-by: Philipp Puschmann <philipp.puschmann@emlix.com>
---
 drivers/usb/chipidea/ci_hdrc_imx.c | 3 +++
 drivers/usb/chipidea/ci_hdrc_imx.h | 1 +
 drivers/usb/chipidea/usbmisc_imx.c | 4 ++++
 3 files changed, 8 insertions(+)

diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c
index e81de9ca8729..32dc120680fa 100644
--- a/drivers/usb/chipidea/ci_hdrc_imx.c
+++ b/drivers/usb/chipidea/ci_hdrc_imx.c
@@ -152,6 +152,9 @@ static struct imx_usbmisc_data *usbmisc_get_init_data(struct device *dev)
 		dev_warn(dev, "No over current polarity defined\n");
 	}
 
+	if (of_find_property(np, "power-active-high", NULL))
+		data->pwr_pol = 1;
+
 	if (of_find_property(np, "external-vbus-divider", NULL))
 		data->evdo = 1;
 
diff --git a/drivers/usb/chipidea/ci_hdrc_imx.h b/drivers/usb/chipidea/ci_hdrc_imx.h
index 7cc53e2ce564..c842e03f8767 100644
--- a/drivers/usb/chipidea/ci_hdrc_imx.h
+++ b/drivers/usb/chipidea/ci_hdrc_imx.h
@@ -18,6 +18,7 @@ struct imx_usbmisc_data {
 	/* true if dt specifies polarity */
 	unsigned int oc_pol_configured:1;
 
+	unsigned int pwr_pol:1; /* power polarity */
 	unsigned int evdo:1; /* set external vbus divider option */
 	unsigned int ulpi:1; /* connected to an ULPI phy */
 	unsigned int hsic:1; /* HSIC controlller */
diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
index 097ffbca0bd9..13e52632aece 100644
--- a/drivers/usb/chipidea/usbmisc_imx.c
+++ b/drivers/usb/chipidea/usbmisc_imx.c
@@ -63,6 +63,7 @@
 #define MX6_BM_NON_BURST_SETTING	BIT(1)
 #define MX6_BM_OVER_CUR_DIS		BIT(7)
 #define MX6_BM_OVER_CUR_POLARITY	BIT(8)
+#define MX6_BM_PWR_POLARITY		BIT(9)
 #define MX6_BM_WAKEUP_ENABLE		BIT(10)
 #define MX6_BM_UTMI_ON_CLOCK		BIT(13)
 #define MX6_BM_ID_WAKEUP		BIT(16)
@@ -383,6 +384,9 @@ static int usbmisc_imx6q_init(struct imx_usbmisc_data *data)
 		else if (data->oc_pol_configured)
 			reg &= ~MX6_BM_OVER_CUR_POLARITY;
 	}
+	/* If the polarity is not set keep it as setup by the bootlader */
+	if (data->pwr_polarity == 1)
+		reg |= MX6_BM_PWR_POLARITY;
 	writel(reg, usbmisc->base + data->index * 4);
 
 	/* SoC non-burst setting */
-- 
2.20.1


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

* [PATCH v2,1/2] dt-bindings: usb: ci-hdrc-usb2: add property power-active-high
  2019-01-15 12:31 [PATCH 1/2] dt-bindings: usb: ci-hdrc-usb2: add property power-active-high Philipp Puschmann
  2019-01-15 12:31 ` [PATCH 2/2] usb: chipidea: imx: set power polarity Philipp Puschmann
@ 2019-01-16 10:51 ` Philipp Puschmann
  2019-01-16 10:51   ` [PATCH v2,2/2] usb: chipidea: imx: set power polarity Philipp Puschmann
  1 sibling, 1 reply; 12+ messages in thread
From: Philipp Puschmann @ 2019-01-16 10:51 UTC (permalink / raw)
  To: gregkh
  Cc: robh+dt, mark.rutland, Peter.Chen, linux-usb, devicetree,
	linux-kernel, philipp.puschmann

Signed-off-by: Philipp Puschmann <philipp.puschmann@emlix.com>

---

V2: unchanged ...

---
 Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt
index adae82385dd6..8696e3eff6e7 100644
--- a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt
+++ b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt
@@ -93,6 +93,7 @@ i.mx specific properties
 - over-current-active-low: over current signal polarity is active low.
 - over-current-active-high: over current signal polarity is active high.
   It's recommended to specify the over current polarity.
+- power-active-high: power signal polarity is high active (only for imx6q/dl)
 - external-vbus-divider: enables off-chip resistor divider for Vbus
 
 Example:
-- 
2.20.1


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

* [PATCH v2,2/2] usb: chipidea: imx: set power polarity
  2019-01-16 10:51 ` [PATCH v2,1/2] dt-bindings: usb: ci-hdrc-usb2: add property power-active-high Philipp Puschmann
@ 2019-01-16 10:51   ` Philipp Puschmann
  2019-01-16 11:11     ` [PATCH v3 1/2] dt-bindings: usb: ci-hdrc-usb2: add property power-active-high Philipp Puschmann
  2019-01-16 16:32     ` [PATCH v2,2/2] usb: chipidea: imx: set power polarity Sergei Shtylyov
  0 siblings, 2 replies; 12+ messages in thread
From: Philipp Puschmann @ 2019-01-16 10:51 UTC (permalink / raw)
  To: gregkh
  Cc: robh+dt, mark.rutland, Peter.Chen, linux-usb, devicetree,
	linux-kernel, philipp.puschmann

This patch adds support to set the power line polarity for i.MX6q/dl.

To let the USB controller control the power it may be necessary to configure
the polarity of the power line. So far the polarity was configured
by Bootloader or alternatively the power line was muxed as gpio and
driven by a regulator.

Signed-off-by: Philipp Puschmann <philipp.puschmann@emlix.com>
---

V2: fixed wrong variable name ...

---
 drivers/usb/chipidea/ci_hdrc_imx.c | 3 +++
 drivers/usb/chipidea/ci_hdrc_imx.h | 1 +
 drivers/usb/chipidea/usbmisc_imx.c | 4 ++++
 3 files changed, 8 insertions(+)

diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c
index e81de9ca8729..32dc120680fa 100644
--- a/drivers/usb/chipidea/ci_hdrc_imx.c
+++ b/drivers/usb/chipidea/ci_hdrc_imx.c
@@ -152,6 +152,9 @@ static struct imx_usbmisc_data *usbmisc_get_init_data(struct device *dev)
 		dev_warn(dev, "No over current polarity defined\n");
 	}
 
+	if (of_find_property(np, "power-active-high", NULL))
+		data->pwr_pol = 1;
+
 	if (of_find_property(np, "external-vbus-divider", NULL))
 		data->evdo = 1;
 
diff --git a/drivers/usb/chipidea/ci_hdrc_imx.h b/drivers/usb/chipidea/ci_hdrc_imx.h
index 7cc53e2ce564..c842e03f8767 100644
--- a/drivers/usb/chipidea/ci_hdrc_imx.h
+++ b/drivers/usb/chipidea/ci_hdrc_imx.h
@@ -18,6 +18,7 @@ struct imx_usbmisc_data {
 	/* true if dt specifies polarity */
 	unsigned int oc_pol_configured:1;
 
+	unsigned int pwr_pol:1; /* power polarity */
 	unsigned int evdo:1; /* set external vbus divider option */
 	unsigned int ulpi:1; /* connected to an ULPI phy */
 	unsigned int hsic:1; /* HSIC controlller */
diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
index 097ffbca0bd9..64a7c7ff4b35 100644
--- a/drivers/usb/chipidea/usbmisc_imx.c
+++ b/drivers/usb/chipidea/usbmisc_imx.c
@@ -63,6 +63,7 @@
 #define MX6_BM_NON_BURST_SETTING	BIT(1)
 #define MX6_BM_OVER_CUR_DIS		BIT(7)
 #define MX6_BM_OVER_CUR_POLARITY	BIT(8)
+#define MX6_BM_PWR_POLARITY		BIT(9)
 #define MX6_BM_WAKEUP_ENABLE		BIT(10)
 #define MX6_BM_UTMI_ON_CLOCK		BIT(13)
 #define MX6_BM_ID_WAKEUP		BIT(16)
@@ -383,6 +384,9 @@ static int usbmisc_imx6q_init(struct imx_usbmisc_data *data)
 		else if (data->oc_pol_configured)
 			reg &= ~MX6_BM_OVER_CUR_POLARITY;
 	}
+	/* If the polarity is not set keep it as setup by the bootlader */
+	if (data->pwr_pol == 1)
+		reg |= MX6_BM_PWR_POLARITY;
 	writel(reg, usbmisc->base + data->index * 4);
 
 	/* SoC non-burst setting */
-- 
2.20.1


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

* [PATCH v3 1/2] dt-bindings: usb: ci-hdrc-usb2: add property power-active-high
  2019-01-16 10:51   ` [PATCH v2,2/2] usb: chipidea: imx: set power polarity Philipp Puschmann
@ 2019-01-16 11:11     ` Philipp Puschmann
  2019-01-16 11:11       ` [PATCH v3 2/2] usb: chipidea: imx: set power polarity Philipp Puschmann
                         ` (2 more replies)
  2019-01-16 16:32     ` [PATCH v2,2/2] usb: chipidea: imx: set power polarity Sergei Shtylyov
  1 sibling, 3 replies; 12+ messages in thread
From: Philipp Puschmann @ 2019-01-16 11:11 UTC (permalink / raw)
  To: gregkh
  Cc: robh+dt, mark.rutland, Peter.Chen, linux-usb, devicetree,
	linux-kernel, Philipp Puschmann

The i.MX6q/dl USB controller may drive the usb power line directly, but the
polarity depends on the board. Reset state of the polarity is low-active so
add this property to allow it to be high-active.

Signed-off-by: Philipp Puschmann <philipp.puschmann@emlix.com>
---
Changes in v3: add description
---
 Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt
index adae82385dd6..8696e3eff6e7 100644
--- a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt
+++ b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt
@@ -93,6 +93,7 @@ i.mx specific properties
 - over-current-active-low: over current signal polarity is active low.
 - over-current-active-high: over current signal polarity is active high.
   It's recommended to specify the over current polarity.
+- power-active-high: power signal polarity is high active (only for imx6q/dl)
 - external-vbus-divider: enables off-chip resistor divider for Vbus
 
 Example:
-- 
2.20.1


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

* [PATCH v3 2/2] usb: chipidea: imx: set power polarity
  2019-01-16 11:11     ` [PATCH v3 1/2] dt-bindings: usb: ci-hdrc-usb2: add property power-active-high Philipp Puschmann
@ 2019-01-16 11:11       ` Philipp Puschmann
  2019-01-16 19:51       ` [PATCH v3 1/2] dt-bindings: usb: ci-hdrc-usb2: add property power-active-high Rob Herring
  2019-01-17  7:01       ` Peter Chen
  2 siblings, 0 replies; 12+ messages in thread
From: Philipp Puschmann @ 2019-01-16 11:11 UTC (permalink / raw)
  To: gregkh
  Cc: robh+dt, mark.rutland, Peter.Chen, linux-usb, devicetree,
	linux-kernel, Philipp Puschmann

This patch adds support to set the power line polarity for i.MX6q/dl.

To let the USB controller control the power it may be necessary to configure
the polarity of the power line. So far the polarity was configured
by Bootloader or alternatively the power line was muxed as gpio and
driven by a regulator.

Signed-off-by: Philipp Puschmann <philipp.puschmann@emlix.com>
---
Changes in v2: fixed usage of wrong variable name
Changes in v3: no changes
---
 drivers/usb/chipidea/ci_hdrc_imx.c | 3 +++
 drivers/usb/chipidea/ci_hdrc_imx.h | 1 +
 drivers/usb/chipidea/usbmisc_imx.c | 4 ++++
 3 files changed, 8 insertions(+)

diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c
index e81de9ca8729..32dc120680fa 100644
--- a/drivers/usb/chipidea/ci_hdrc_imx.c
+++ b/drivers/usb/chipidea/ci_hdrc_imx.c
@@ -152,6 +152,9 @@ static struct imx_usbmisc_data *usbmisc_get_init_data(struct device *dev)
 		dev_warn(dev, "No over current polarity defined\n");
 	}
 
+	if (of_find_property(np, "power-active-high", NULL))
+		data->pwr_pol = 1;
+
 	if (of_find_property(np, "external-vbus-divider", NULL))
 		data->evdo = 1;
 
diff --git a/drivers/usb/chipidea/ci_hdrc_imx.h b/drivers/usb/chipidea/ci_hdrc_imx.h
index 7cc53e2ce564..c842e03f8767 100644
--- a/drivers/usb/chipidea/ci_hdrc_imx.h
+++ b/drivers/usb/chipidea/ci_hdrc_imx.h
@@ -18,6 +18,7 @@ struct imx_usbmisc_data {
 	/* true if dt specifies polarity */
 	unsigned int oc_pol_configured:1;
 
+	unsigned int pwr_pol:1; /* power polarity */
 	unsigned int evdo:1; /* set external vbus divider option */
 	unsigned int ulpi:1; /* connected to an ULPI phy */
 	unsigned int hsic:1; /* HSIC controlller */
diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
index 097ffbca0bd9..64a7c7ff4b35 100644
--- a/drivers/usb/chipidea/usbmisc_imx.c
+++ b/drivers/usb/chipidea/usbmisc_imx.c
@@ -63,6 +63,7 @@
 #define MX6_BM_NON_BURST_SETTING	BIT(1)
 #define MX6_BM_OVER_CUR_DIS		BIT(7)
 #define MX6_BM_OVER_CUR_POLARITY	BIT(8)
+#define MX6_BM_PWR_POLARITY		BIT(9)
 #define MX6_BM_WAKEUP_ENABLE		BIT(10)
 #define MX6_BM_UTMI_ON_CLOCK		BIT(13)
 #define MX6_BM_ID_WAKEUP		BIT(16)
@@ -383,6 +384,9 @@ static int usbmisc_imx6q_init(struct imx_usbmisc_data *data)
 		else if (data->oc_pol_configured)
 			reg &= ~MX6_BM_OVER_CUR_POLARITY;
 	}
+	/* If the polarity is not set keep it as setup by the bootlader */
+	if (data->pwr_pol == 1)
+		reg |= MX6_BM_PWR_POLARITY;
 	writel(reg, usbmisc->base + data->index * 4);
 
 	/* SoC non-burst setting */
-- 
2.20.1


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

* Re: [PATCH v2,2/2] usb: chipidea: imx: set power polarity
  2019-01-16 10:51   ` [PATCH v2,2/2] usb: chipidea: imx: set power polarity Philipp Puschmann
  2019-01-16 11:11     ` [PATCH v3 1/2] dt-bindings: usb: ci-hdrc-usb2: add property power-active-high Philipp Puschmann
@ 2019-01-16 16:32     ` Sergei Shtylyov
  2019-01-21 17:57       ` Philipp Puschmann
  1 sibling, 1 reply; 12+ messages in thread
From: Sergei Shtylyov @ 2019-01-16 16:32 UTC (permalink / raw)
  To: Philipp Puschmann, gregkh
  Cc: robh+dt, mark.rutland, Peter.Chen, linux-usb, devicetree, linux-kernel

Hello!

On 01/16/2019 01:51 PM, Philipp Puschmann wrote:

> This patch adds support to set the power line polarity for i.MX6q/dl.
> 
> To let the USB controller control the power it may be necessary to configure
> the polarity of the power line. So far the polarity was configured
> by Bootloader or alternatively the power line was muxed as gpio and
> driven by a regulator.
> 
> Signed-off-by: Philipp Puschmann <philipp.puschmann@emlix.com>
> ---
> 
> V2: fixed wrong variable name ...
> 
> ---
>  drivers/usb/chipidea/ci_hdrc_imx.c | 3 +++
>  drivers/usb/chipidea/ci_hdrc_imx.h | 1 +
>  drivers/usb/chipidea/usbmisc_imx.c | 4 ++++
>  3 files changed, 8 insertions(+)
> 
> diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c
> index e81de9ca8729..32dc120680fa 100644
> --- a/drivers/usb/chipidea/ci_hdrc_imx.c
> +++ b/drivers/usb/chipidea/ci_hdrc_imx.c
> @@ -152,6 +152,9 @@ static struct imx_usbmisc_data *usbmisc_get_init_data(struct device *dev)
>  		dev_warn(dev, "No over current polarity defined\n");
>  	}
>  
> +	if (of_find_property(np, "power-active-high", NULL))

   How about of_property_read_bool()?

> +		data->pwr_pol = 1;
> +
>  	if (of_find_property(np, "external-vbus-divider", NULL))
>  		data->evdo = 1;
>  
[...]

MBR, Sergei

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

* Re: [PATCH v3 1/2] dt-bindings: usb: ci-hdrc-usb2: add property power-active-high
  2019-01-16 11:11     ` [PATCH v3 1/2] dt-bindings: usb: ci-hdrc-usb2: add property power-active-high Philipp Puschmann
  2019-01-16 11:11       ` [PATCH v3 2/2] usb: chipidea: imx: set power polarity Philipp Puschmann
@ 2019-01-16 19:51       ` Rob Herring
  2019-01-17  7:01       ` Peter Chen
  2 siblings, 0 replies; 12+ messages in thread
From: Rob Herring @ 2019-01-16 19:51 UTC (permalink / raw)
  To: Philipp Puschmann
  Cc: gregkh, robh+dt, mark.rutland, Peter.Chen, linux-usb, devicetree,
	linux-kernel, Philipp Puschmann

On Wed, 16 Jan 2019 12:11:32 +0100, Philipp Puschmann wrote:
> The i.MX6q/dl USB controller may drive the usb power line directly, but the
> polarity depends on the board. Reset state of the polarity is low-active so
> add this property to allow it to be high-active.
> 
> Signed-off-by: Philipp Puschmann <philipp.puschmann@emlix.com>
> ---
> Changes in v3: add description
> ---
>  Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt | 1 +
>  1 file changed, 1 insertion(+)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

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

* RE: [PATCH v3 1/2] dt-bindings: usb: ci-hdrc-usb2: add property power-active-high
  2019-01-16 11:11     ` [PATCH v3 1/2] dt-bindings: usb: ci-hdrc-usb2: add property power-active-high Philipp Puschmann
  2019-01-16 11:11       ` [PATCH v3 2/2] usb: chipidea: imx: set power polarity Philipp Puschmann
  2019-01-16 19:51       ` [PATCH v3 1/2] dt-bindings: usb: ci-hdrc-usb2: add property power-active-high Rob Herring
@ 2019-01-17  7:01       ` Peter Chen
  2019-01-21 18:00         ` Philipp Puschmann
  2 siblings, 1 reply; 12+ messages in thread
From: Peter Chen @ 2019-01-17  7:01 UTC (permalink / raw)
  To: Philipp Puschmann, gregkh
  Cc: robh+dt, mark.rutland, linux-usb, devicetree, linux-kernel

 
> 
> The i.MX6q/dl USB controller may drive the usb power line directly, but the polarity
> depends on the board. Reset state of the polarity is low-active so add this property
> to allow it to be high-active.
> 

As far as I know, most of i.mx USB controllers (except imx28/23, but they don't have non-core registers)
work like this, and most of them are low active for PP default. Would you just use "i.mx" at
both your code and your comment?

Peter

> Signed-off-by: Philipp Puschmann <philipp.puschmann@emlix.com>
> ---
> Changes in v3: add description
> ---
>  Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt
> b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt
> index adae82385dd6..8696e3eff6e7 100644
> --- a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt
> +++ b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt
> @@ -93,6 +93,7 @@ i.mx specific properties
>  - over-current-active-low: over current signal polarity is active low.
>  - over-current-active-high: over current signal polarity is active high.
>    It's recommended to specify the over current polarity.
> +- power-active-high: power signal polarity is high active (only for
> +imx6q/dl)
>  - external-vbus-divider: enables off-chip resistor divider for Vbus
> 
>  Example:
> --
> 2.20.1


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

* Re: [PATCH v2,2/2] usb: chipidea: imx: set power polarity
  2019-01-16 16:32     ` [PATCH v2,2/2] usb: chipidea: imx: set power polarity Sergei Shtylyov
@ 2019-01-21 17:57       ` Philipp Puschmann
  0 siblings, 0 replies; 12+ messages in thread
From: Philipp Puschmann @ 2019-01-21 17:57 UTC (permalink / raw)
  To: Sergei Shtylyov, Philipp Puschmann, gregkh
  Cc: robh+dt, mark.rutland, Peter.Chen, linux-usb, devicetree, linux-kernel

Hi!

Am 16.01.19 um 17:32 schrieb Sergei Shtylyov:
> Hello!
> 
> On 01/16/2019 01:51 PM, Philipp Puschmann wrote:
> 
>> This patch adds support to set the power line polarity for i.MX6q/dl.
>>
>> To let the USB controller control the power it may be necessary to configure
>> the polarity of the power line. So far the polarity was configured
>> by Bootloader or alternatively the power line was muxed as gpio and
>> driven by a regulator.
>>
>> Signed-off-by: Philipp Puschmann <philipp.puschmann@emlix.com>
>> ---
>>
>> V2: fixed wrong variable name ...
>>
>> ---
>>  drivers/usb/chipidea/ci_hdrc_imx.c | 3 +++
>>  drivers/usb/chipidea/ci_hdrc_imx.h | 1 +
>>  drivers/usb/chipidea/usbmisc_imx.c | 4 ++++
>>  3 files changed, 8 insertions(+)
>>
>> diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c
>> index e81de9ca8729..32dc120680fa 100644
>> --- a/drivers/usb/chipidea/ci_hdrc_imx.c
>> +++ b/drivers/usb/chipidea/ci_hdrc_imx.c
>> @@ -152,6 +152,9 @@ static struct imx_usbmisc_data *usbmisc_get_init_data(struct device *dev)
>>  		dev_warn(dev, "No over current polarity defined\n");
>>  	}
>>  
>> +	if (of_find_property(np, "power-active-high", NULL))
> 
>    How about of_property_read_bool()?

Good idea. I will send a patch v4 in next days.
> 
>> +		data->pwr_pol = 1;
>> +
>>  	if (of_find_property(np, "external-vbus-divider", NULL))
>>  		data->evdo = 1;
>>  
> [...]
> 
> MBR, Sergei
> 

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

* Re: [PATCH v3 1/2] dt-bindings: usb: ci-hdrc-usb2: add property power-active-high
  2019-01-17  7:01       ` Peter Chen
@ 2019-01-21 18:00         ` Philipp Puschmann
  2019-01-22  7:50           ` Peter Chen
  0 siblings, 1 reply; 12+ messages in thread
From: Philipp Puschmann @ 2019-01-21 18:00 UTC (permalink / raw)
  To: Peter Chen, Philipp Puschmann, gregkh
  Cc: robh+dt, mark.rutland, linux-usb, devicetree, linux-kernel

Hi Peter,

Am 17.01.19 um 08:01 schrieb Peter Chen:
>  
>>
>> The i.MX6q/dl USB controller may drive the usb power line directly, but the polarity
>> depends on the board. Reset state of the polarity is low-active so add this property
>> to allow it to be high-active.
>>
> 
> As far as I know, most of i.mx USB controllers (except imx28/23, but they don't have non-core registers)
> work like this, and most of them are low active for PP default. Would you just use "i.mx" at
> both your code and your comment?

Am i right that i have to add my code block to (nearly) all other version specific init functions then?
Will do so in next days and then send a v4 of this patch.
> 
> Peter
> 
>> Signed-off-by: Philipp Puschmann <philipp.puschmann@emlix.com>
>> ---
>> Changes in v3: add description
>> ---
>>  Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt
>> b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt
>> index adae82385dd6..8696e3eff6e7 100644
>> --- a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt
>> +++ b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt
>> @@ -93,6 +93,7 @@ i.mx specific properties
>>  - over-current-active-low: over current signal polarity is active low.
>>  - over-current-active-high: over current signal polarity is active high.
>>    It's recommended to specify the over current polarity.
>> +- power-active-high: power signal polarity is high active (only for
>> +imx6q/dl)
>>  - external-vbus-divider: enables off-chip resistor divider for Vbus
>>
>>  Example:
>> --
>> 2.20.1
> 

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

* RE: [PATCH v3 1/2] dt-bindings: usb: ci-hdrc-usb2: add property power-active-high
  2019-01-21 18:00         ` Philipp Puschmann
@ 2019-01-22  7:50           ` Peter Chen
  0 siblings, 0 replies; 12+ messages in thread
From: Peter Chen @ 2019-01-22  7:50 UTC (permalink / raw)
  To: Philipp Puschmann, Philipp Puschmann, gregkh
  Cc: robh+dt, mark.rutland, linux-usb, devicetree, linux-kernel

 
> Am 17.01.19 um 08:01 schrieb Peter Chen:
> >
> >>
> >> The i.MX6q/dl USB controller may drive the usb power line directly,
> >> but the polarity depends on the board. Reset state of the polarity is
> >> low-active so add this property to allow it to be high-active.
> >>
> >
> > As far as I know, most of i.mx USB controllers (except imx28/23, but
> > they don't have non-core registers) work like this, and most of them
> > are low active for PP default. Would you just use "i.mx" at both your code and
> your comment?
> 
> Am i right that i have to add my code block to (nearly) all other version specific init
> functions then?

Besides your current patch, only usbmisc_imx7d_init is needed to add the same content.

Peter

> Will do so in next days and then send a v4 of this patch.
> >
> > Peter
> >
> >> Signed-off-by: Philipp Puschmann <philipp.puschmann@emlix.com>
> >> ---
> >> Changes in v3: add description
> >> ---
> >>  Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt | 1 +
> >>  1 file changed, 1 insertion(+)
> >>
> >> diff --git a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt
> >> b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt
> >> index adae82385dd6..8696e3eff6e7 100644
> >> --- a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt
> >> +++ b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt
> >> @@ -93,6 +93,7 @@ i.mx specific properties
> >>  - over-current-active-low: over current signal polarity is active low.
> >>  - over-current-active-high: over current signal polarity is active high.
> >>    It's recommended to specify the over current polarity.
> >> +- power-active-high: power signal polarity is high active (only for
> >> +imx6q/dl)
> >>  - external-vbus-divider: enables off-chip resistor divider for Vbus
> >>
> >>  Example:
> >> --
> >> 2.20.1
> >

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

end of thread, other threads:[~2019-01-22  7:50 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-15 12:31 [PATCH 1/2] dt-bindings: usb: ci-hdrc-usb2: add property power-active-high Philipp Puschmann
2019-01-15 12:31 ` [PATCH 2/2] usb: chipidea: imx: set power polarity Philipp Puschmann
2019-01-16 10:51 ` [PATCH v2,1/2] dt-bindings: usb: ci-hdrc-usb2: add property power-active-high Philipp Puschmann
2019-01-16 10:51   ` [PATCH v2,2/2] usb: chipidea: imx: set power polarity Philipp Puschmann
2019-01-16 11:11     ` [PATCH v3 1/2] dt-bindings: usb: ci-hdrc-usb2: add property power-active-high Philipp Puschmann
2019-01-16 11:11       ` [PATCH v3 2/2] usb: chipidea: imx: set power polarity Philipp Puschmann
2019-01-16 19:51       ` [PATCH v3 1/2] dt-bindings: usb: ci-hdrc-usb2: add property power-active-high Rob Herring
2019-01-17  7:01       ` Peter Chen
2019-01-21 18:00         ` Philipp Puschmann
2019-01-22  7:50           ` Peter Chen
2019-01-16 16:32     ` [PATCH v2,2/2] usb: chipidea: imx: set power polarity Sergei Shtylyov
2019-01-21 17:57       ` Philipp Puschmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).