linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dt-bindings: phy: qcom-qusb2: Fix defaults
@ 2020-04-23 18:10 Douglas Anderson
  2020-04-24  0:45 ` Matthias Kaehlcke
  2020-04-24 22:52 ` Rob Herring
  0 siblings, 2 replies; 3+ messages in thread
From: Douglas Anderson @ 2020-04-23 18:10 UTC (permalink / raw)
  To: Kishon Vijay Abraham I
  Cc: Sandeep Maheswaram, mka, Manu Gautam, linux-arm-msm,
	Douglas Anderson, Andy Gross, Bjorn Andersson, Rob Herring,
	Stephen Boyd, devicetree, linux-kernel

The defaults listed in the bindings don't match what the code is
actually doing.  Presumably existing users care more about keeping
existing behavior the same, so change the bindings to match the code
in Linux.

The "qcom,preemphasis-level" default has been wrong for quite a long
time (May 2018).  The other two were recently added.

As some evidence that these values are wrong, this is from the Linux
driver:
- qcom,preemphasis-level: sets "PORT_TUNE1", lower 2 bits.  Driver
  programs PORT_TUNE1 to 0x30 by default and (0x30 & 0x3) = 0.
- qcom,bias-ctrl-value: sets "PLL_BIAS_CONTROL_2", lower 6 bits.
  Driver programs PLL_BIAS_CONTROL_2 to 0x20 by default and (0x20 &
  0x3f) = 0x20 = 32.
- qcom,hsdisc-trim-value: sets "PORT_TUNE2", lower 2 bits.  Driver
  programs PORT_TUNE2 to 0x29 by default and (0x29 & 0x3) = 1.

Fixes: 1e6f134eb67a ("dt-bindings: phy: qcom-qusb2: Add support for overriding Phy tuning parameters")
Fixes: a8b70ccf10e3 ("dt-bindings: phy-qcom-usb2: Add support to override tuning values")
Signed-off-by: Douglas Anderson <dianders@chromium.org>
---

 Documentation/devicetree/bindings/phy/qcom,qusb2-phy.yaml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/phy/qcom,qusb2-phy.yaml b/Documentation/devicetree/bindings/phy/qcom,qusb2-phy.yaml
index 144ae29e7141..f8bd28ff31c1 100644
--- a/Documentation/devicetree/bindings/phy/qcom,qusb2-phy.yaml
+++ b/Documentation/devicetree/bindings/phy/qcom,qusb2-phy.yaml
@@ -97,7 +97,7 @@ then:
         - $ref: /schemas/types.yaml#/definitions/uint32
         - minimum: 0
           maximum: 63
-          default: 0
+          default: 32
 
     qcom,charge-ctrl-value:
      description:
@@ -130,7 +130,7 @@ then:
         - $ref: /schemas/types.yaml#/definitions/uint32
         - minimum: 0
           maximum: 3
-          default: 2
+          default: 0
 
     qcom,preemphasis-width:
       description:
@@ -152,7 +152,7 @@ then:
         - $ref: /schemas/types.yaml#/definitions/uint32
         - minimum: 0
           maximum: 3
-          default: 0
+          default: 1
 
 required:
   - compatible
-- 
2.26.1.301.g55bc3eb7cb9-goog


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

* Re: [PATCH] dt-bindings: phy: qcom-qusb2: Fix defaults
  2020-04-23 18:10 [PATCH] dt-bindings: phy: qcom-qusb2: Fix defaults Douglas Anderson
@ 2020-04-24  0:45 ` Matthias Kaehlcke
  2020-04-24 22:52 ` Rob Herring
  1 sibling, 0 replies; 3+ messages in thread
From: Matthias Kaehlcke @ 2020-04-24  0:45 UTC (permalink / raw)
  To: Douglas Anderson
  Cc: Kishon Vijay Abraham I, Sandeep Maheswaram, Manu Gautam,
	linux-arm-msm, Andy Gross, Bjorn Andersson, Rob Herring,
	Stephen Boyd, devicetree, linux-kernel

On Thu, Apr 23, 2020 at 11:10:27AM -0700, Douglas Anderson wrote:
> The defaults listed in the bindings don't match what the code is
> actually doing.  Presumably existing users care more about keeping
> existing behavior the same, so change the bindings to match the code
> in Linux.
> 
> The "qcom,preemphasis-level" default has been wrong for quite a long
> time (May 2018).  The other two were recently added.
> 
> As some evidence that these values are wrong, this is from the Linux
> driver:
> - qcom,preemphasis-level: sets "PORT_TUNE1", lower 2 bits.  Driver
>   programs PORT_TUNE1 to 0x30 by default and (0x30 & 0x3) = 0.
> - qcom,bias-ctrl-value: sets "PLL_BIAS_CONTROL_2", lower 6 bits.
>   Driver programs PLL_BIAS_CONTROL_2 to 0x20 by default and (0x20 &
>   0x3f) = 0x20 = 32.
> - qcom,hsdisc-trim-value: sets "PORT_TUNE2", lower 2 bits.  Driver
>   programs PORT_TUNE2 to 0x29 by default and (0x29 & 0x3) = 1.
> 
> Fixes: 1e6f134eb67a ("dt-bindings: phy: qcom-qusb2: Add support for overriding Phy tuning parameters")
> Fixes: a8b70ccf10e3 ("dt-bindings: phy-qcom-usb2: Add support to override tuning values")
> Signed-off-by: Douglas Anderson <dianders@chromium.org>
> ---
> 
>  Documentation/devicetree/bindings/phy/qcom,qusb2-phy.yaml | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/phy/qcom,qusb2-phy.yaml b/Documentation/devicetree/bindings/phy/qcom,qusb2-phy.yaml
> index 144ae29e7141..f8bd28ff31c1 100644
> --- a/Documentation/devicetree/bindings/phy/qcom,qusb2-phy.yaml
> +++ b/Documentation/devicetree/bindings/phy/qcom,qusb2-phy.yaml
> @@ -97,7 +97,7 @@ then:
>          - $ref: /schemas/types.yaml#/definitions/uint32
>          - minimum: 0
>            maximum: 63
> -          default: 0
> +          default: 32
>  
>      qcom,charge-ctrl-value:
>       description:
> @@ -130,7 +130,7 @@ then:
>          - $ref: /schemas/types.yaml#/definitions/uint32
>          - minimum: 0
>            maximum: 3
> -          default: 2
> +          default: 0
>  
>      qcom,preemphasis-width:
>        description:
> @@ -152,7 +152,7 @@ then:
>          - $ref: /schemas/types.yaml#/definitions/uint32
>          - minimum: 0
>            maximum: 3
> -          default: 0
> +          default: 1
>  
>  required:
>    - compatible
> -- 
> 2.26.1.301.g55bc3eb7cb9-goog

Reviewed-by: Matthias Kaehlcke <mka@chromium.org>

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

* Re: [PATCH] dt-bindings: phy: qcom-qusb2: Fix defaults
  2020-04-23 18:10 [PATCH] dt-bindings: phy: qcom-qusb2: Fix defaults Douglas Anderson
  2020-04-24  0:45 ` Matthias Kaehlcke
@ 2020-04-24 22:52 ` Rob Herring
  1 sibling, 0 replies; 3+ messages in thread
From: Rob Herring @ 2020-04-24 22:52 UTC (permalink / raw)
  To: Douglas Anderson
  Cc: Kishon Vijay Abraham I, Sandeep Maheswaram, mka, Manu Gautam,
	linux-arm-msm, Douglas Anderson, Andy Gross, Bjorn Andersson,
	Stephen Boyd, devicetree, linux-kernel

On Thu, 23 Apr 2020 11:10:27 -0700, Douglas Anderson wrote:
> The defaults listed in the bindings don't match what the code is
> actually doing.  Presumably existing users care more about keeping
> existing behavior the same, so change the bindings to match the code
> in Linux.
> 
> The "qcom,preemphasis-level" default has been wrong for quite a long
> time (May 2018).  The other two were recently added.
> 
> As some evidence that these values are wrong, this is from the Linux
> driver:
> - qcom,preemphasis-level: sets "PORT_TUNE1", lower 2 bits.  Driver
>   programs PORT_TUNE1 to 0x30 by default and (0x30 & 0x3) = 0.
> - qcom,bias-ctrl-value: sets "PLL_BIAS_CONTROL_2", lower 6 bits.
>   Driver programs PLL_BIAS_CONTROL_2 to 0x20 by default and (0x20 &
>   0x3f) = 0x20 = 32.
> - qcom,hsdisc-trim-value: sets "PORT_TUNE2", lower 2 bits.  Driver
>   programs PORT_TUNE2 to 0x29 by default and (0x29 & 0x3) = 1.
> 
> Fixes: 1e6f134eb67a ("dt-bindings: phy: qcom-qusb2: Add support for overriding Phy tuning parameters")
> Fixes: a8b70ccf10e3 ("dt-bindings: phy-qcom-usb2: Add support to override tuning values")
> Signed-off-by: Douglas Anderson <dianders@chromium.org>
> ---
> 
>  Documentation/devicetree/bindings/phy/qcom,qusb2-phy.yaml | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 

Applied, thanks.

Rob

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

end of thread, other threads:[~2020-04-24 22:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-23 18:10 [PATCH] dt-bindings: phy: qcom-qusb2: Fix defaults Douglas Anderson
2020-04-24  0:45 ` Matthias Kaehlcke
2020-04-24 22:52 ` Rob Herring

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