devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/22] media: i2c: ds90ub9xx: Error handling, UB9702 improvements
@ 2025-01-24 15:17 Tomi Valkeinen
  2025-01-24 15:17 ` [PATCH v2 17/22] media: dt-bindings: ti,ds90ub960: Add ti,enable-sscg property Tomi Valkeinen
  2025-01-24 15:17 ` [PATCH v2 18/22] media: dt-bindings: ti,ds90ub960: Allow setting serializer address Tomi Valkeinen
  0 siblings, 2 replies; 5+ messages in thread
From: Tomi Valkeinen @ 2025-01-24 15:17 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: linux-media, linux-kernel, Devarsh Thakkar, Jai Luthra,
	Sakari Ailus, Tomi Valkeinen, stable, devicetree, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley

Hi,

This series has two main parts: 1) add error handling all around, and 2)
update the drivers according to latest (mostly non-public) information
from TI.

The "Update UB9702 init sequences" patch basically rewrites the init
sequence from scratch, and to make that patch easier to read, the
previous patch first removes the current init sequence. In the final
version these two patches need to be squashed together.

 Tomi

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
---
Changes in v2:
- Add new patch "media: i2c: ds90ub913: Fix returned fmt from .set_fmt()"
- Reformat the reg write in "Speed-up I2C watchdog timer"
- Add 'it' parameter to rxport for_each macros
- Move 'enable_sscg' module parameter to DT
- Change serializer 'i2c-addr' property to serializer 'reg' property
- Split ub953 registers to a header file
- Link to v1: https://lore.kernel.org/r/20250110-ub9xx-improvements-v1-0-e0b9a1f644da@ideasonboard.com

---
Jai Luthra (6):
      media: i2c: ds90ub953: Speed-up I2C watchdog timer
      media: dt-bindings: ti,ds90ub960: Add ti,enable-sscg property
      media: dt-bindings: ti,ds90ub960: Allow setting serializer address
      media: i2c: ds90ub960: Enable SSCG for UB9702
      media: i2c: ds90ub960: Configure serializer using back-channel
      media: i2c: ds90ub9xx: Set serializer temperature ramp

Tomi Valkeinen (16):
      media: i2c: ds90ub953: Fix error prints
      media: i2c: ds90ub913: Fix returned fmt from .set_fmt()
      media: i2c: ds90ub913: Align ub913_read() with other similar functions
      media: i2c: ds90ub9xx: Add err parameter to read/write funcs
      media: i2c: ds90ub960: Add error handling to multiple places
      media: i2c: ds90ub953: Add error handling to ub953_log_status()
      media: i2c: ds90ub913: Add error handling to ub913_log_status()
      media: i2c: ds90ub960: Move UB9702 registers to a separate section
      media: i2c: ds90ub960: Add UB9702 specific registers
      media: i2c: ds90ub960: Split ub960_init_tx_ports()
      media: i2c: ds90ub960: Refresh ub960_init_tx_ports_ub9702()
      media: i2c: ds90ub960: Add RX port iteration support
      media: i2c: ds90ub960: Move all RX port init code into ub960_init_rx_ports()
      media: i2c: ds90ub960: Remove old ub9702 RX port init code (SQUASH)
      media: i2c: ds90ub960: Update UB9702 init sequences
      media: i2c: ds90ub953: Move reg defines to a header file

 .../bindings/media/i2c/ti,ds90ub953.yaml           |   77 +-
 .../bindings/media/i2c/ti,ds90ub960.yaml           |   21 +-
 drivers/media/i2c/ds90ub913.c                      |   82 +-
 drivers/media/i2c/ds90ub953.c                      |  242 +--
 drivers/media/i2c/ds90ub953.h                      |  104 +
 drivers/media/i2c/ds90ub960.c                      | 2264 +++++++++++++++-----
 6 files changed, 2070 insertions(+), 720 deletions(-)
---
base-commit: c4b7779abc6633677e6edb79e2809f4f61fde157
change-id: 20250110-ub9xx-improvements-9172b44eb0bc

Best regards,
-- 
Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>


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

* [PATCH v2 17/22] media: dt-bindings: ti,ds90ub960: Add ti,enable-sscg property
  2025-01-24 15:17 [PATCH v2 00/22] media: i2c: ds90ub9xx: Error handling, UB9702 improvements Tomi Valkeinen
@ 2025-01-24 15:17 ` Tomi Valkeinen
  2025-01-27  7:37   ` Krzysztof Kozlowski
  2025-01-24 15:17 ` [PATCH v2 18/22] media: dt-bindings: ti,ds90ub960: Allow setting serializer address Tomi Valkeinen
  1 sibling, 1 reply; 5+ messages in thread
From: Tomi Valkeinen @ 2025-01-24 15:17 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: linux-media, linux-kernel, Devarsh Thakkar, Jai Luthra,
	Sakari Ailus, Tomi Valkeinen, devicetree, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley

From: Jai Luthra <jai.luthra@ideasonboard.com>

Spread-spectrum clock generation is supported by UB9702, but only
optionally required depending upon the hardware. Add a device-tree
property for enabling SSCG.

Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
---
Cc: devicetree@vger.kernel.org
Cc: Rob Herring <robh@kernel.org>
Cc: Krzysztof Kozlowski <krzk+dt@kernel.org>
Cc: Conor Dooley <conor+dt@kernel.org>
---
 Documentation/devicetree/bindings/media/i2c/ti,ds90ub960.yaml | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Documentation/devicetree/bindings/media/i2c/ti,ds90ub960.yaml b/Documentation/devicetree/bindings/media/i2c/ti,ds90ub960.yaml
index 0b71e6f911a8..970f0f36449a 100644
--- a/Documentation/devicetree/bindings/media/i2c/ti,ds90ub960.yaml
+++ b/Documentation/devicetree/bindings/media/i2c/ti,ds90ub960.yaml
@@ -43,6 +43,11 @@ properties:
     minItems: 1
     maxItems: 32
 
+  ti,enable-sscg:
+    type: boolean
+    description:
+      Enable Spread-Spectrum Clock Generator for the BC clock for all ports.
+
   links:
     type: object
     additionalProperties: false

-- 
2.43.0


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

* [PATCH v2 18/22] media: dt-bindings: ti,ds90ub960: Allow setting serializer address
  2025-01-24 15:17 [PATCH v2 00/22] media: i2c: ds90ub9xx: Error handling, UB9702 improvements Tomi Valkeinen
  2025-01-24 15:17 ` [PATCH v2 17/22] media: dt-bindings: ti,ds90ub960: Add ti,enable-sscg property Tomi Valkeinen
@ 2025-01-24 15:17 ` Tomi Valkeinen
  2025-01-27  7:45   ` Krzysztof Kozlowski
  1 sibling, 1 reply; 5+ messages in thread
From: Tomi Valkeinen @ 2025-01-24 15:17 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: linux-media, linux-kernel, Devarsh Thakkar, Jai Luthra,
	Sakari Ailus, Tomi Valkeinen, devicetree, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley

From: Jai Luthra <jai.luthra@ideasonboard.com>

The serializer's I2C address on the FPD-Link bus is usually communicated
to the deserializer once the forward-channel is established. But in some
cases it might be necessary to program the serializer (over the
back-channel) before the forward-channel is established.

This can be used e.g. to correct serializer configuration which
otherwise would prevent the FC to be enabled. To be able to communicate
to the serializer before the forward-channel is up, the deserializer
driver neds to know the default i2c address of the serializer.

Allow setting the serializer i2c address using the 'reg' property. This
is optional, and usually not needed.

Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
---
Cc: devicetree@vger.kernel.org
Cc: Rob Herring <robh@kernel.org>
Cc: Krzysztof Kozlowski <krzk+dt@kernel.org>
Cc: Conor Dooley <conor+dt@kernel.org>
---
 .../bindings/media/i2c/ti,ds90ub953.yaml           | 77 +++++++++++++---------
 .../bindings/media/i2c/ti,ds90ub960.yaml           | 16 ++++-
 2 files changed, 58 insertions(+), 35 deletions(-)

diff --git a/Documentation/devicetree/bindings/media/i2c/ti,ds90ub953.yaml b/Documentation/devicetree/bindings/media/i2c/ti,ds90ub953.yaml
index 2030366994d1..2e129bf573b7 100644
--- a/Documentation/devicetree/bindings/media/i2c/ti,ds90ub953.yaml
+++ b/Documentation/devicetree/bindings/media/i2c/ti,ds90ub953.yaml
@@ -38,6 +38,13 @@ properties:
   '#clock-cells':
     const: 0
 
+  reg:
+    maxItems: 1
+    description:
+      The strap I2C address of the serializer. Can be used by the deserializer
+      to communicate over back-channel when the forward-channel is not yet
+      active.
+
   ports:
     $ref: /schemas/graph.yaml#/properties/ports
 
@@ -81,51 +88,57 @@ examples:
   - |
     #include <dt-bindings/gpio/gpio.h>
 
-    serializer {
-      compatible = "ti,ds90ub953-q1";
+    link {
+      #address-cells = <1>;
+      #size-cells = <0>;
+
+      serializer@18 {
+        compatible = "ti,ds90ub953-q1";
+        reg = <0x18>;
 
-      gpio-controller;
-      #gpio-cells = <2>;
+        gpio-controller;
+        #gpio-cells = <2>;
 
-      #clock-cells = <0>;
+        #clock-cells = <0>;
 
-      ports {
-        #address-cells = <1>;
-        #size-cells = <0>;
+        ports {
+          #address-cells = <1>;
+          #size-cells = <0>;
 
-        port@0 {
-          reg = <0>;
-          ub953_in: endpoint {
-            clock-lanes = <0>;
-            data-lanes = <1 2 3 4>;
-            remote-endpoint = <&sensor_out>;
+          port@0 {
+            reg = <0>;
+            ub953_in: endpoint {
+              clock-lanes = <0>;
+              data-lanes = <1 2 3 4>;
+              remote-endpoint = <&sensor_out>;
+            };
           };
-        };
 
-        port@1 {
-          reg = <1>;
-          endpoint {
-            remote-endpoint = <&deser_fpd_in>;
+          port@1 {
+            reg = <1>;
+            endpoint {
+              remote-endpoint = <&deser_fpd_in>;
+            };
           };
         };
-      };
 
-      i2c {
-        #address-cells = <1>;
-        #size-cells = <0>;
+        i2c {
+          #address-cells = <1>;
+          #size-cells = <0>;
 
-        sensor@1a {
-          compatible = "sony,imx274";
-          reg = <0x1a>;
+          sensor@1a {
+            compatible = "sony,imx274";
+            reg = <0x1a>;
 
-          reset-gpios = <&serializer 0 GPIO_ACTIVE_LOW>;
+            reset-gpios = <&serializer 0 GPIO_ACTIVE_LOW>;
 
-          clocks = <&serializer>;
-          clock-names = "inck";
+            clocks = <&serializer>;
+            clock-names = "inck";
 
-          port {
-            sensor_out: endpoint {
-              remote-endpoint = <&ub953_in>;
+            port {
+              sensor_out: endpoint {
+                remote-endpoint = <&ub953_in>;
+              };
             };
           };
         };
diff --git a/Documentation/devicetree/bindings/media/i2c/ti,ds90ub960.yaml b/Documentation/devicetree/bindings/media/i2c/ti,ds90ub960.yaml
index 970f0f36449a..d9ffa369a13d 100644
--- a/Documentation/devicetree/bindings/media/i2c/ti,ds90ub960.yaml
+++ b/Documentation/devicetree/bindings/media/i2c/ti,ds90ub960.yaml
@@ -73,6 +73,12 @@ properties:
             description: The link number
             maxItems: 1
 
+          '#address-cells':
+            const: 1
+
+          '#size-cells':
+            const: 0
+
           i2c-alias:
             $ref: /schemas/types.yaml#/definitions/uint32
             description:
@@ -112,7 +118,8 @@ properties:
             maximum: 14
             description: Manual EQ level
 
-          serializer:
+        patternProperties:
+          '^serializer(@[0-9a-f]+)*$':
             type: object
             description: FPD-Link Serializer node
 
@@ -120,7 +127,6 @@ properties:
           - reg
           - i2c-alias
           - ti,rx-mode
-          - serializer
 
   ports:
     $ref: /schemas/graph.yaml#/properties/ports
@@ -314,13 +320,17 @@ examples:
           /* Link 0 has DS90UB953 serializer and IMX274 sensor */
 
           link@0 {
+            #address-cells = <1>;
+            #size-cells = <0>;
+
             reg = <0>;
             i2c-alias = <0x44>;
 
             ti,rx-mode = <3>;
 
-            serializer1: serializer {
+            serializer1: serializer@30 {
               compatible = "ti,ds90ub953-q1";
+              reg = <0x30>;
 
               gpio-controller;
               #gpio-cells = <2>;

-- 
2.43.0


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

* Re: [PATCH v2 17/22] media: dt-bindings: ti,ds90ub960: Add ti,enable-sscg property
  2025-01-24 15:17 ` [PATCH v2 17/22] media: dt-bindings: ti,ds90ub960: Add ti,enable-sscg property Tomi Valkeinen
@ 2025-01-27  7:37   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2025-01-27  7:37 UTC (permalink / raw)
  To: Tomi Valkeinen
  Cc: Mauro Carvalho Chehab, linux-media, linux-kernel, Devarsh Thakkar,
	Jai Luthra, Sakari Ailus, devicetree, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley

On Fri, Jan 24, 2025 at 05:17:54PM +0200, Tomi Valkeinen wrote:
> From: Jai Luthra <jai.luthra@ideasonboard.com>
> 
> Spread-spectrum clock generation is supported by UB9702, but only
> optionally required depending upon the hardware. Add a device-tree

What does "optionally required" mean? Either it is required or it is
optional.

> property for enabling SSCG.
> 
> Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
> ---
> Cc: devicetree@vger.kernel.org
> Cc: Rob Herring <robh@kernel.org>
> Cc: Krzysztof Kozlowski <krzk+dt@kernel.org>
> Cc: Conor Dooley <conor+dt@kernel.org>
> ---
>  Documentation/devicetree/bindings/media/i2c/ti,ds90ub960.yaml | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/media/i2c/ti,ds90ub960.yaml b/Documentation/devicetree/bindings/media/i2c/ti,ds90ub960.yaml
> index 0b71e6f911a8..970f0f36449a 100644
> --- a/Documentation/devicetree/bindings/media/i2c/ti,ds90ub960.yaml
> +++ b/Documentation/devicetree/bindings/media/i2c/ti,ds90ub960.yaml
> @@ -43,6 +43,11 @@ properties:
>      minItems: 1
>      maxItems: 32
>  
> +  ti,enable-sscg:
> +    type: boolean
> +    description:
> +      Enable Spread-Spectrum Clock Generator for the BC clock for all ports.

And the SSC values are not configurable?

I don't want three bindings for the same (see IMX8, STM32 and pull
request in dtschema), so be sure all your cases fit Dario's and Peng's
work.

Best regards,
Krzysztof


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

* Re: [PATCH v2 18/22] media: dt-bindings: ti,ds90ub960: Allow setting serializer address
  2025-01-24 15:17 ` [PATCH v2 18/22] media: dt-bindings: ti,ds90ub960: Allow setting serializer address Tomi Valkeinen
@ 2025-01-27  7:45   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2025-01-27  7:45 UTC (permalink / raw)
  To: Tomi Valkeinen
  Cc: Mauro Carvalho Chehab, linux-media, linux-kernel, Devarsh Thakkar,
	Jai Luthra, Sakari Ailus, devicetree, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley

On Fri, Jan 24, 2025 at 05:17:55PM +0200, Tomi Valkeinen wrote:
> From: Jai Luthra <jai.luthra@ideasonboard.com>
> 
> The serializer's I2C address on the FPD-Link bus is usually communicated
> to the deserializer once the forward-channel is established. But in some
> cases it might be necessary to program the serializer (over the
> back-channel) before the forward-channel is established.
> 
> This can be used e.g. to correct serializer configuration which
> otherwise would prevent the FC to be enabled. To be able to communicate
> to the serializer before the forward-channel is up, the deserializer
> driver neds to know the default i2c address of the serializer.
> 
> Allow setting the serializer i2c address using the 'reg' property. This
> is optional, and usually not needed.
> 
> Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
> ---
> Cc: devicetree@vger.kernel.org
> Cc: Rob Herring <robh@kernel.org>
> Cc: Krzysztof Kozlowski <krzk+dt@kernel.org>
> Cc: Conor Dooley <conor+dt@kernel.org>

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


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

end of thread, other threads:[~2025-01-27  7:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-24 15:17 [PATCH v2 00/22] media: i2c: ds90ub9xx: Error handling, UB9702 improvements Tomi Valkeinen
2025-01-24 15:17 ` [PATCH v2 17/22] media: dt-bindings: ti,ds90ub960: Add ti,enable-sscg property Tomi Valkeinen
2025-01-27  7:37   ` Krzysztof Kozlowski
2025-01-24 15:17 ` [PATCH v2 18/22] media: dt-bindings: ti,ds90ub960: Allow setting serializer address Tomi Valkeinen
2025-01-27  7:45   ` Krzysztof Kozlowski

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