devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] phy: rockchip-inno-usb2: document improvements and allow to force B-device valid session bit.
@ 2018-08-15  9:59 Enric Balletbo i Serra
  2018-08-15  9:59 ` [PATCH 2/4] dt-bindings: phy-rockchip-inno-usb2: add documentation for extcon and utmi-avalid properties Enric Balletbo i Serra
  2018-08-15  9:59 ` [PATCH 4/4] dt-bindings: phy-rockchip-inno-usb2: add new rockchip,force-bvalid property Enric Balletbo i Serra
  0 siblings, 2 replies; 12+ messages in thread
From: Enric Balletbo i Serra @ 2018-08-15  9:59 UTC (permalink / raw)
  To: linux-kernel
  Cc: amstan, groeck, kieran.bingham, kernel, bleung, heiko, devicetree,
	Frank Wang, linux-rockchip, Rob Herring, Kishon Vijay Abraham I,
	Mark Rutland, linux-arm-kernel

Hi all,

The main purpose of this patchset is have the Type-C port on the Samsung
Chromebook Plus work as a device or in OTG mode. While doing it I spent
some time to fix some documentation issues. So, the first and the second
patch are not really related to the topic and can be picked
independently of the future discussion generated by the third and the
fourth patch (these two patches are the ones that makes the type-c port
work as device)

The patchset was tested on a Samsung Chromebook Plus by configuring one
port to work as device, configure a cdc ethernet gadget and communicate
via ethernet gadget my workstation with the chromebook through a usb-a
to type-c cable.

Best regards,
 Enric


Enric Balletbo i Serra (4):
  phy: rockchip-inno-usb2: fix misspelling and kernel-doc documentation.
  dt-bindings: phy-rockchip-inno-usb2: add documentation for extcon and
    utmi-avalid properties.
  phy: rockchip-inno-usb2: allow to force the B-Device Session Valid
    bit.
  dt-bindings: phy-rockchip-inno-usb2: add new rockchip,force-bvalid
    property.

 .../bindings/phy/phy-rockchip-inno-usb2.txt   |  8 +++
 drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 70 ++++++++++++++-----
 2 files changed, 62 insertions(+), 16 deletions(-)

-- 
2.18.0

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

* [PATCH 2/4] dt-bindings: phy-rockchip-inno-usb2: add documentation for extcon and utmi-avalid properties.
  2018-08-15  9:59 [PATCH 0/4] phy: rockchip-inno-usb2: document improvements and allow to force B-device valid session bit Enric Balletbo i Serra
@ 2018-08-15  9:59 ` Enric Balletbo i Serra
  2018-08-15 10:29   ` Heiko Stuebner
  2018-08-15 22:21   ` Rob Herring
  2018-08-15  9:59 ` [PATCH 4/4] dt-bindings: phy-rockchip-inno-usb2: add new rockchip,force-bvalid property Enric Balletbo i Serra
  1 sibling, 2 replies; 12+ messages in thread
From: Enric Balletbo i Serra @ 2018-08-15  9:59 UTC (permalink / raw)
  To: linux-kernel
  Cc: amstan, groeck, kieran.bingham, kernel, bleung, heiko, devicetree,
	Frank Wang, linux-rockchip, Rob Herring, Kishon Vijay Abraham I,
	Mark Rutland, linux-arm-kernel

Commit 98898f3bc83c8 ("phy: rockchip-inno-usb2: support otg-port for
rk3399") introduces two new properties. The extcon property is used to
detect the cable-state, and the rockchip,utmi-avalid is used to indicate
which register should be used to detect the vbus state.

Document these properties in the documentation binding.

Fixes: 98898f3bc83c8 ("phy: rockchip-inno-usb2: support otg-port for rk3399")
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
---

 .../devicetree/bindings/phy/phy-rockchip-inno-usb2.txt         | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.txt b/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.txt
index 074a7b3b0425..2d4808d3920b 100644
--- a/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.txt
+++ b/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.txt
@@ -23,6 +23,7 @@ Optional properties:
 		 register files". When set driver will request its
 		 phandle as one companion-grf for some special SoCs
 		 (e.g RV1108).
+ - extcon : phandle to the extcon device for the otg phy.
 
 Required nodes : a sub-node is required for each port the phy provides.
 		 The sub-node name is used to identify host or otg port,
@@ -45,6 +46,8 @@ Required properties (port (child) node):
 Optional properties:
  - phy-supply : phandle to a regulator that provides power to VBUS.
 		See ./phy-bindings.txt for details.
+ - rockchip,utmi-avalid : boolean, use the avalid register to get vbus status.
+			  Otherwise, use the bvalid register.
 
 Example:
 
-- 
2.18.0

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

* [PATCH 4/4] dt-bindings: phy-rockchip-inno-usb2: add new rockchip,force-bvalid property.
  2018-08-15  9:59 [PATCH 0/4] phy: rockchip-inno-usb2: document improvements and allow to force B-device valid session bit Enric Balletbo i Serra
  2018-08-15  9:59 ` [PATCH 2/4] dt-bindings: phy-rockchip-inno-usb2: add documentation for extcon and utmi-avalid properties Enric Balletbo i Serra
@ 2018-08-15  9:59 ` Enric Balletbo i Serra
  2018-08-15 10:34   ` Heiko Stuebner
  2018-08-15 22:26   ` Rob Herring
  1 sibling, 2 replies; 12+ messages in thread
From: Enric Balletbo i Serra @ 2018-08-15  9:59 UTC (permalink / raw)
  To: linux-kernel
  Cc: amstan, groeck, kieran.bingham, kernel, bleung, heiko, devicetree,
	Frank Wang, linux-rockchip, Rob Herring, Kishon Vijay Abraham I,
	Mark Rutland, linux-arm-kernel

This property is used when the otg-id pin is not connected. When this
property is set it forces to set the B-Device Session Valid bit when the
port works as device and clears that bit when the port works as host.

Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
---

 .../devicetree/bindings/phy/phy-rockchip-inno-usb2.txt       | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.txt b/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.txt
index 2d4808d3920b..55761f466c41 100644
--- a/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.txt
+++ b/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.txt
@@ -48,6 +48,11 @@ Optional properties:
 		See ./phy-bindings.txt for details.
  - rockchip,utmi-avalid : boolean, use the avalid register to get vbus status.
 			  Otherwise, use the bvalid register.
+ - rockchip,force-bvalid : boolean, set this to force the B-Device Session
+			  Valid bit when the usb port is in device mode. This
+			  is used when the otg-id pin is not connected.
+			  Only supported in case of compatible being:
+			  * "rockchip,rk3399-usb2phy"
 
 Example:
 
-- 
2.18.0

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

* Re: [PATCH 2/4] dt-bindings: phy-rockchip-inno-usb2: add documentation for extcon and utmi-avalid properties.
  2018-08-15  9:59 ` [PATCH 2/4] dt-bindings: phy-rockchip-inno-usb2: add documentation for extcon and utmi-avalid properties Enric Balletbo i Serra
@ 2018-08-15 10:29   ` Heiko Stuebner
  2018-08-15 11:08     ` Enric Balletbo i Serra
  2018-08-15 22:21   ` Rob Herring
  1 sibling, 1 reply; 12+ messages in thread
From: Heiko Stuebner @ 2018-08-15 10:29 UTC (permalink / raw)
  To: Enric Balletbo i Serra
  Cc: linux-kernel, amstan, groeck, kieran.bingham, kernel, bleung,
	devicetree, Frank Wang, linux-rockchip, Rob Herring,
	Kishon Vijay Abraham I, Mark Rutland, linux-arm-kernel

Hi Enric,

Am Mittwoch, 15. August 2018, 11:59:32 CEST schrieb Enric Balletbo i Serra:
> Commit 98898f3bc83c8 ("phy: rockchip-inno-usb2: support otg-port for
> rk3399") introduces two new properties. The extcon property is used to
> detect the cable-state, and the rockchip,utmi-avalid is used to indicate
> which register should be used to detect the vbus state.
> 
> Document these properties in the documentation binding.
> 
> Fixes: 98898f3bc83c8 ("phy: rockchip-inno-usb2: support otg-port for rk3399")
> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> ---
> 
>  .../devicetree/bindings/phy/phy-rockchip-inno-usb2.txt         | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.txt b/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.txt
> index 074a7b3b0425..2d4808d3920b 100644
> --- a/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.txt
> +++ b/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.txt
> @@ -23,6 +23,7 @@ Optional properties:
>  		 register files". When set driver will request its
>  		 phandle as one companion-grf for some special SoCs
>  		 (e.g RV1108).
> + - extcon : phandle to the extcon device for the otg phy.

That should probably mention that this is the extcon providing the cable-state?


>  Required nodes : a sub-node is required for each port the phy provides.
>  		 The sub-node name is used to identify host or otg port,
> @@ -45,6 +46,8 @@ Required properties (port (child) node):
>  Optional properties:
>   - phy-supply : phandle to a regulator that provides power to VBUS.
>  		See ./phy-bindings.txt for details.
> + - rockchip,utmi-avalid : boolean, use the avalid register to get vbus status.
> +			  Otherwise, use the bvalid register.

Not having looked to deeply into the usb2 phy, this might raise questions
on why this is a hardware-description? Is this needed when something is not
connected on the board?


Heiko

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

* Re: [PATCH 4/4] dt-bindings: phy-rockchip-inno-usb2: add new rockchip,force-bvalid property.
  2018-08-15  9:59 ` [PATCH 4/4] dt-bindings: phy-rockchip-inno-usb2: add new rockchip,force-bvalid property Enric Balletbo i Serra
@ 2018-08-15 10:34   ` Heiko Stuebner
  2018-08-15 22:26   ` Rob Herring
  1 sibling, 0 replies; 12+ messages in thread
From: Heiko Stuebner @ 2018-08-15 10:34 UTC (permalink / raw)
  To: Enric Balletbo i Serra
  Cc: linux-kernel, amstan, groeck, kieran.bingham, kernel, bleung,
	devicetree, Frank Wang, linux-rockchip, Rob Herring,
	Kishon Vijay Abraham I, Mark Rutland, linux-arm-kernel

Am Mittwoch, 15. August 2018, 11:59:34 CEST schrieb Enric Balletbo i Serra:
> This property is used when the otg-id pin is not connected. When this
> property is set it forces to set the B-Device Session Valid bit when the
> port works as device and clears that bit when the port works as host.
> 
> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> ---
> 
>  .../devicetree/bindings/phy/phy-rockchip-inno-usb2.txt       | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.txt b/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.txt
> index 2d4808d3920b..55761f466c41 100644
> --- a/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.txt
> +++ b/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.txt
> @@ -48,6 +48,11 @@ Optional properties:
>  		See ./phy-bindings.txt for details.
>   - rockchip,utmi-avalid : boolean, use the avalid register to get vbus status.
>  			  Otherwise, use the bvalid register.
> + - rockchip,force-bvalid : boolean, set this to force the B-Device Session
> +			  Valid bit when the usb port is in device mode. This
> +			  is used when the otg-id pin is not connected.
> +			  Only supported in case of compatible being:
> +			  * "rockchip,rk3399-usb2phy"

I guess you could drop that rk3399 mention instead make the
driver complain? Trying to keep that list up to date will get hard
and I guess the other socs may very well hide that setting somewhere
in their undocumented phy registers as well.

I guess a bit of alphabetical ordering might also be nice,
rockchip,force-bvalid above rockchip,utmi-avalid
Makes it easier to read ;-)

Heiko

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

* Re: [PATCH 2/4] dt-bindings: phy-rockchip-inno-usb2: add documentation for extcon and utmi-avalid properties.
  2018-08-15 10:29   ` Heiko Stuebner
@ 2018-08-15 11:08     ` Enric Balletbo i Serra
  2018-08-15 11:22       ` Heiko Stuebner
  0 siblings, 1 reply; 12+ messages in thread
From: Enric Balletbo i Serra @ 2018-08-15 11:08 UTC (permalink / raw)
  To: Heiko Stuebner
  Cc: linux-kernel, amstan, groeck, kieran.bingham, kernel, bleung,
	devicetree, Frank Wang, linux-rockchip, Rob Herring,
	Kishon Vijay Abraham I, Mark Rutland, linux-arm-kernel

Hi Heiko,

On 15/08/18 12:29, Heiko Stuebner wrote:
> Hi Enric,
> 
> Am Mittwoch, 15. August 2018, 11:59:32 CEST schrieb Enric Balletbo i Serra:
>> Commit 98898f3bc83c8 ("phy: rockchip-inno-usb2: support otg-port for
>> rk3399") introduces two new properties. The extcon property is used to
>> detect the cable-state, and the rockchip,utmi-avalid is used to indicate
>> which register should be used to detect the vbus state.
>>
>> Document these properties in the documentation binding.
>>
>> Fixes: 98898f3bc83c8 ("phy: rockchip-inno-usb2: support otg-port for rk3399")
>> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
>> ---
>>
>>  .../devicetree/bindings/phy/phy-rockchip-inno-usb2.txt         | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.txt b/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.txt
>> index 074a7b3b0425..2d4808d3920b 100644
>> --- a/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.txt
>> +++ b/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.txt
>> @@ -23,6 +23,7 @@ Optional properties:
>>  		 register files". When set driver will request its
>>  		 phandle as one companion-grf for some special SoCs
>>  		 (e.g RV1108).
>> + - extcon : phandle to the extcon device for the otg phy.
> 
> That should probably mention that this is the extcon providing the cable-state?

ack.

> 
> 
>>  Required nodes : a sub-node is required for each port the phy provides.
>>  		 The sub-node name is used to identify host or otg port,
>> @@ -45,6 +46,8 @@ Required properties (port (child) node):
>>  Optional properties:
>>   - phy-supply : phandle to a regulator that provides power to VBUS.
>>  		See ./phy-bindings.txt for details.
>> + - rockchip,utmi-avalid : boolean, use the avalid register to get vbus status.
>> +			  Otherwise, use the bvalid register.
> 
> Not having looked to deeply into the usb2 phy, this might raise questions
> on why this is a hardware-description? Is this needed when something is not
> connected on the board?

I asked myself the same question and even I thought in just remove that code.

After some investigation, though, I saw that the UTMI+ specification [1] has two
signals similar to ID signal (page 11), the AValid signal is used to indicate if
the session for an A-peripheral is valid and the BValid signal that is used to
indicate if the session for a B-peripheral is valid. I suppose that use of one
or the other matters in some cases, but AFAICT this is not used and I didn't see
any binding using it.

Maybe someone else can give us more clues on the importance or not of this property?

[1] https://www.nxp.com/docs/en/brochure/UTMI-PLUS-SPECIFICATION.pdf

Enric

> 
> 
> Heiko
> 
> 

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

* Re: [PATCH 2/4] dt-bindings: phy-rockchip-inno-usb2: add documentation for extcon and utmi-avalid properties.
  2018-08-15 11:08     ` Enric Balletbo i Serra
@ 2018-08-15 11:22       ` Heiko Stuebner
  0 siblings, 0 replies; 12+ messages in thread
From: Heiko Stuebner @ 2018-08-15 11:22 UTC (permalink / raw)
  To: Enric Balletbo i Serra
  Cc: linux-kernel, amstan, groeck, kieran.bingham, kernel, bleung,
	devicetree, Frank Wang, linux-rockchip, Rob Herring,
	Kishon Vijay Abraham I, Mark Rutland, linux-arm-kernel

Hi Enric,

Am Mittwoch, 15. August 2018, 13:08:00 CEST schrieb Enric Balletbo i Serra:
> On 15/08/18 12:29, Heiko Stuebner wrote:
> > Am Mittwoch, 15. August 2018, 11:59:32 CEST schrieb Enric Balletbo i Serra:
> >> Commit 98898f3bc83c8 ("phy: rockchip-inno-usb2: support otg-port for
> >> rk3399") introduces two new properties. The extcon property is used to
> >> detect the cable-state, and the rockchip,utmi-avalid is used to indicate
> >> which register should be used to detect the vbus state.
> >>
> >> Document these properties in the documentation binding.
> >>
> >> Fixes: 98898f3bc83c8 ("phy: rockchip-inno-usb2: support otg-port for rk3399")
> >> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>

[...]

> >> @@ -45,6 +46,8 @@ Required properties (port (child) node):
> >>  Optional properties:
> >>   - phy-supply : phandle to a regulator that provides power to VBUS.
> >>  		See ./phy-bindings.txt for details.
> >> + - rockchip,utmi-avalid : boolean, use the avalid register to get vbus status.
> >> +			  Otherwise, use the bvalid register.
> > 
> > Not having looked to deeply into the usb2 phy, this might raise questions
> > on why this is a hardware-description? Is this needed when something is not
> > connected on the board?
> 
> I asked myself the same question and even I thought in just remove that code.
> 
> After some investigation, though, I saw that the UTMI+ specification [1] has two
> signals similar to ID signal (page 11), the AValid signal is used to indicate if
> the session for an A-peripheral is valid and the BValid signal that is used to
> indicate if the session for a B-peripheral is valid. I suppose that use of one
> or the other matters in some cases, but AFAICT this is not used and I didn't see
> any binding using it.
> 
> Maybe someone else can give us more clues on the importance or not of this property?

so I've looked in mainline, chromeos-4.4 and the Rockchip vendor-kernel
and the only board using that property at all is the rk3399-evb-rev1
and -rev2 in the vendor kernel.

The existence of a further -rev3 (which also looks way better cared for
compared rev1+2) indicates that the older ones are probably some sort
of preproduction models, where some wiring (on the soc or board) may
have gone wrong.

So while I would keep all the avalid settings in the driver, we could just
drop reading that property quietly - as Rob wrote some days ago
"it's only an incompatible change if someone notices" [0] and from the
above it doesn't look like it ;-) .

Heiko

[0] https://www.spinics.net/lists/devicetree/msg243978.html

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

* Re: [PATCH 2/4] dt-bindings: phy-rockchip-inno-usb2: add documentation for extcon and utmi-avalid properties.
  2018-08-15  9:59 ` [PATCH 2/4] dt-bindings: phy-rockchip-inno-usb2: add documentation for extcon and utmi-avalid properties Enric Balletbo i Serra
  2018-08-15 10:29   ` Heiko Stuebner
@ 2018-08-15 22:21   ` Rob Herring
  2018-08-16  8:38     ` Enric Balletbo i Serra
  1 sibling, 1 reply; 12+ messages in thread
From: Rob Herring @ 2018-08-15 22:21 UTC (permalink / raw)
  To: Enric Balletbo i Serra
  Cc: linux-kernel, amstan, groeck, kieran.bingham, kernel, bleung,
	heiko, devicetree, Frank Wang, linux-rockchip,
	Kishon Vijay Abraham I, Mark Rutland, linux-arm-kernel

On Wed, Aug 15, 2018 at 11:59:32AM +0200, Enric Balletbo i Serra wrote:
> Commit 98898f3bc83c8 ("phy: rockchip-inno-usb2: support otg-port for
> rk3399") introduces two new properties. The extcon property is used to
> detect the cable-state, and the rockchip,utmi-avalid is used to indicate
> which register should be used to detect the vbus state.
> 
> Document these properties in the documentation binding.
> 
> Fixes: 98898f3bc83c8 ("phy: rockchip-inno-usb2: support otg-port for rk3399")
> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> ---
> 
>  .../devicetree/bindings/phy/phy-rockchip-inno-usb2.txt         | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.txt b/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.txt
> index 074a7b3b0425..2d4808d3920b 100644
> --- a/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.txt
> +++ b/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.txt
> @@ -23,6 +23,7 @@ Optional properties:
>  		 register files". When set driver will request its
>  		 phandle as one companion-grf for some special SoCs
>  		 (e.g RV1108).
> + - extcon : phandle to the extcon device for the otg phy.

extcon is not a good binding. The usb connector binding should be used 
instead for new users.

Rob

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

* Re: [PATCH 4/4] dt-bindings: phy-rockchip-inno-usb2: add new rockchip,force-bvalid property.
  2018-08-15  9:59 ` [PATCH 4/4] dt-bindings: phy-rockchip-inno-usb2: add new rockchip,force-bvalid property Enric Balletbo i Serra
  2018-08-15 10:34   ` Heiko Stuebner
@ 2018-08-15 22:26   ` Rob Herring
  2019-01-10  9:06     ` Enric Balletbo Serra
  1 sibling, 1 reply; 12+ messages in thread
From: Rob Herring @ 2018-08-15 22:26 UTC (permalink / raw)
  To: Enric Balletbo i Serra
  Cc: linux-kernel, amstan, groeck, kieran.bingham, kernel, bleung,
	heiko, devicetree, Frank Wang, linux-rockchip,
	Kishon Vijay Abraham I, Mark Rutland, linux-arm-kernel

On Wed, Aug 15, 2018 at 11:59:34AM +0200, Enric Balletbo i Serra wrote:
> This property is used when the otg-id pin is not connected. When this
> property is set it forces to set the B-Device Session Valid bit when the
> port works as device and clears that bit when the port works as host.
> 
> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> ---
> 
>  .../devicetree/bindings/phy/phy-rockchip-inno-usb2.txt       | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.txt b/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.txt
> index 2d4808d3920b..55761f466c41 100644
> --- a/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.txt
> +++ b/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.txt
> @@ -48,6 +48,11 @@ Optional properties:
>  		See ./phy-bindings.txt for details.
>   - rockchip,utmi-avalid : boolean, use the avalid register to get vbus status.
>  			  Otherwise, use the bvalid register.
> + - rockchip,force-bvalid : boolean, set this to force the B-Device Session
> +			  Valid bit when the usb port is in device mode. This
> +			  is used when the otg-id pin is not connected.
> +			  Only supported in case of compatible being:
> +			  * "rockchip,rk3399-usb2phy"

Shouldn't you describe the property of the h/w that ID pin is not 
connected, rather than what you do with that information.

Is the pin not connected because it's a connector without ID pin? If so, 
that should be a property of the connector (or inferred from the 
connector compatible string).

Rob

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

* Re: [PATCH 2/4] dt-bindings: phy-rockchip-inno-usb2: add documentation for extcon and utmi-avalid properties.
  2018-08-15 22:21   ` Rob Herring
@ 2018-08-16  8:38     ` Enric Balletbo i Serra
  0 siblings, 0 replies; 12+ messages in thread
From: Enric Balletbo i Serra @ 2018-08-16  8:38 UTC (permalink / raw)
  To: Rob Herring
  Cc: linux-kernel, amstan, groeck, kieran.bingham, kernel, bleung,
	heiko, devicetree, Frank Wang, linux-rockchip,
	Kishon Vijay Abraham I, Mark Rutland, linux-arm-kernel

Hi Rob,

On 16/08/18 00:21, Rob Herring wrote:
> On Wed, Aug 15, 2018 at 11:59:32AM +0200, Enric Balletbo i Serra wrote:
>> Commit 98898f3bc83c8 ("phy: rockchip-inno-usb2: support otg-port for
>> rk3399") introduces two new properties. The extcon property is used to
>> detect the cable-state, and the rockchip,utmi-avalid is used to indicate
>> which register should be used to detect the vbus state.
>>
>> Document these properties in the documentation binding.
>>
>> Fixes: 98898f3bc83c8 ("phy: rockchip-inno-usb2: support otg-port for rk3399")
>> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
>> ---
>>
>>  .../devicetree/bindings/phy/phy-rockchip-inno-usb2.txt         | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.txt b/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.txt
>> index 074a7b3b0425..2d4808d3920b 100644
>> --- a/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.txt
>> +++ b/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.txt
>> @@ -23,6 +23,7 @@ Optional properties:
>>  		 register files". When set driver will request its
>>  		 phandle as one companion-grf for some special SoCs
>>  		 (e.g RV1108).
>> + - extcon : phandle to the extcon device for the otg phy.
> 
> extcon is not a good binding. The usb connector binding should be used 
> instead for new users.
> 

Ok, although the extcon thing is implemented in the driver, so I was trying to
just describe how is implemented now, looks like nobody is using it apart from
me (patches not upstreamed yet). I suppose switch to the usb connector binding
will imply some driver modifications. I will take a look.

Thanks,
 Enric

> Rob
> 

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

* Re: [PATCH 4/4] dt-bindings: phy-rockchip-inno-usb2: add new rockchip,force-bvalid property.
  2018-08-15 22:26   ` Rob Herring
@ 2019-01-10  9:06     ` Enric Balletbo Serra
  2019-01-10 12:31       ` Heiko Stuebner
  0 siblings, 1 reply; 12+ messages in thread
From: Enric Balletbo Serra @ 2019-01-10  9:06 UTC (permalink / raw)
  To: Rob Herring
  Cc: Enric Balletbo i Serra, Mark Rutland, devicetree@vger.kernel.org,
	Alexandru Stan, Guenter Roeck, Kishon Vijay Abraham I, Frank Wang,
	kieran.bingham, linux-kernel, open list:ARM/Rockchip SoC...,
	kernel, Benson Leung, Linux ARM, Heiko Stübner

Hi Rob,

Missatge de Rob Herring <robh@kernel.org> del dia dj., 16 d’ag. 2018 a les 0:26:
>
> On Wed, Aug 15, 2018 at 11:59:34AM +0200, Enric Balletbo i Serra wrote:
> > This property is used when the otg-id pin is not connected. When this
> > property is set it forces to set the B-Device Session Valid bit when the
> > port works as device and clears that bit when the port works as host.
> >
> > Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> > ---
> >
> >  .../devicetree/bindings/phy/phy-rockchip-inno-usb2.txt       | 5 +++++
> >  1 file changed, 5 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.txt b/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.txt
> > index 2d4808d3920b..55761f466c41 100644
> > --- a/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.txt
> > +++ b/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.txt
> > @@ -48,6 +48,11 @@ Optional properties:
> >               See ./phy-bindings.txt for details.
> >   - rockchip,utmi-avalid : boolean, use the avalid register to get vbus status.
> >                         Otherwise, use the bvalid register.
> > + - rockchip,force-bvalid : boolean, set this to force the B-Device Session
> > +                       Valid bit when the usb port is in device mode. This
> > +                       is used when the otg-id pin is not connected.
> > +                       Only supported in case of compatible being:
> > +                       * "rockchip,rk3399-usb2phy"
>
> Shouldn't you describe the property of the h/w that ID pin is not
> connected, rather than what you do with that information.
>

What about "rockchip, otg-id-not-connected"?

> Is the pin not connected because it's a connector without ID pin? If so,
> that should be a property of the connector (or inferred from the
> connector compatible string).
>

No, it's not the connector. it is not wired on the phy and the cable
detection is done via an extcon.

Thanks,
 Enric

> Rob
>
> _______________________________________________
> Linux-rockchip mailing list
> Linux-rockchip@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* Re: [PATCH 4/4] dt-bindings: phy-rockchip-inno-usb2: add new rockchip,force-bvalid property.
  2019-01-10  9:06     ` Enric Balletbo Serra
@ 2019-01-10 12:31       ` Heiko Stuebner
  0 siblings, 0 replies; 12+ messages in thread
From: Heiko Stuebner @ 2019-01-10 12:31 UTC (permalink / raw)
  To: Enric Balletbo Serra
  Cc: Rob Herring, Enric Balletbo i Serra, Mark Rutland,
	devicetree@vger.kernel.org, Alexandru Stan, Guenter Roeck,
	Kishon Vijay Abraham I, Frank Wang, kieran.bingham, linux-kernel,
	open list:ARM/Rockchip SoC..., kernel, Benson Leung, Linux ARM

Hi Enric,
Am Donnerstag, 10. Januar 2019, 10:06:38 CET schrieb Enric Balletbo Serra:
> Missatge de Rob Herring <robh@kernel.org> del dia dj., 16 d’ag. 2018 a les 0:26:
> >
> > On Wed, Aug 15, 2018 at 11:59:34AM +0200, Enric Balletbo i Serra wrote:
> > > This property is used when the otg-id pin is not connected. When this
> > > property is set it forces to set the B-Device Session Valid bit when the
> > > port works as device and clears that bit when the port works as host.
> > >
> > > Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> > > ---
> > >
> > >  .../devicetree/bindings/phy/phy-rockchip-inno-usb2.txt       | 5 +++++
> > >  1 file changed, 5 insertions(+)
> > >
> > > diff --git a/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.txt b/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.txt
> > > index 2d4808d3920b..55761f466c41 100644
> > > --- a/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.txt
> > > +++ b/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.txt
> > > @@ -48,6 +48,11 @@ Optional properties:
> > >               See ./phy-bindings.txt for details.
> > >   - rockchip,utmi-avalid : boolean, use the avalid register to get vbus status.
> > >                         Otherwise, use the bvalid register.
> > > + - rockchip,force-bvalid : boolean, set this to force the B-Device Session
> > > +                       Valid bit when the usb port is in device mode. This
> > > +                       is used when the otg-id pin is not connected.
> > > +                       Only supported in case of compatible being:
> > > +                       * "rockchip,rk3399-usb2phy"
> >
> > Shouldn't you describe the property of the h/w that ID pin is not
> > connected, rather than what you do with that information.
> >
> 
> What about "rockchip, otg-id-not-connected"?

just pointing back to our discussion in patch3 about simply assuming
id-not-connected in the case of the extcon missing

I still think that might be the cleaner variant? But I guess you're
probably already looking into doing that as so far you only resend the
cleanup patches :-) .


Heiko

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

end of thread, other threads:[~2019-01-10 12:31 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-15  9:59 [PATCH 0/4] phy: rockchip-inno-usb2: document improvements and allow to force B-device valid session bit Enric Balletbo i Serra
2018-08-15  9:59 ` [PATCH 2/4] dt-bindings: phy-rockchip-inno-usb2: add documentation for extcon and utmi-avalid properties Enric Balletbo i Serra
2018-08-15 10:29   ` Heiko Stuebner
2018-08-15 11:08     ` Enric Balletbo i Serra
2018-08-15 11:22       ` Heiko Stuebner
2018-08-15 22:21   ` Rob Herring
2018-08-16  8:38     ` Enric Balletbo i Serra
2018-08-15  9:59 ` [PATCH 4/4] dt-bindings: phy-rockchip-inno-usb2: add new rockchip,force-bvalid property Enric Balletbo i Serra
2018-08-15 10:34   ` Heiko Stuebner
2018-08-15 22:26   ` Rob Herring
2019-01-10  9:06     ` Enric Balletbo Serra
2019-01-10 12:31       ` Heiko Stuebner

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).