Skip to contentSkip to conversation

dt-bindings: display: bridge: lvds-codec: Document pixel data sampling edge select

PATCH In review Marek Vasut 4 participants 18 messages Oct 17, 2021 – Dec 7, 2021

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH v5 1/2 dt-bindings: display: bridge: lvds-codec: Document pixel data sampling edge select

The OnSemi FIN3385 Parallel-to-LVDS encoder has a dedicated input line to select input pixel data sampling edge. Add DT property "pclk-sample", not the same as the one used by display timings but rather the same as used by media, to define the pixel data sampling edge.

Cc Laurent Pinchart <[email protected]>
Cc Rob Herring <[email protected]>
Cc Sam Ravnborg <[email protected]>

To: [email protected]
---
V4: New patch split from combined V3
V5: Rebase on recent linux-next

---
 .../bindings/display/bridge/lvds-codec.yaml    | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
Documentation/devicetree/bindings/display/bridge/lvds-codec.yaml +18 -0
index 1faae3e323a4..708de84ac138 100644
@@ -79,6 +79,14 @@ properties:
       - port@0
       - port@1
 
+  pclk-sample:
+    description:
+      Data sampling on rising or falling edge.
+    enum:
+      - 0  # Falling edge
+      - 1  # Rising edge
+    default: 0
+
   powerdown-gpios:
     description:
       The GPIO used to control the power down line of this device.
@@ -102,6 +110,16 @@ then:
               properties:
                 data-mapping: false
 
+if:
+  not:
+    properties:
+      compatible:
+        contains:
+          const: lvds-encoder
+then:
+  properties:
+    pclk-sample: false
+
 required:
   - compatible
   - ports
Signature · 1 line
2.33.0
#1 lore raw

PATCH v5 2/2 drm/bridge: lvds-codec: Add support for pixel data sampling edge select

The OnSemi FIN3385 Parallel-to-LVDS encoder has a dedicated input line to select input pixel data sampling edge. Add DT property "pclk-sample", not the same as the one used by display timings but rather the same as used by media, and configure bus flags based on this DT property.

Cc Laurent Pinchart <[email protected]>
Cc Rob Herring <[email protected]>
Cc Sam Ravnborg <[email protected]>

To: [email protected]
---
V2: - Limit the pixelclk-active to encoders only
- Update DT binding document
V3: - Determine whether this is encoder from connector, i.e.

      lvds_codec->connector_type == DRM_MODE_CONNECTOR_LVDS

V4: - Switch to pclk-sample. Note that the value of this is inverted,
so all the existing users of pixelclk-active using previous previous version of this patch must be reworked
V5: Rebase on recent linux-next

---
 drivers/gpu/drm/bridge/lvds-codec.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
drivers/gpu/drm/bridge/lvds-codec.c +15 -0
index f991842a161f..702ea803a743 100644
@@ -21,6 +21,7 @@ struct lvds_codec {
 	struct device *dev;
 	struct drm_bridge bridge;
 	struct drm_bridge *panel_bridge;
+	struct drm_bridge_timings timings;
 	struct regulator *vcc;
 	struct gpio_desc *powerdown_gpio;
 	u32 connector_type;
@@ -119,6 +120,7 @@ static int lvds_codec_probe(struct platform_device *pdev)
 	struct device_node *bus_node;
 	struct drm_panel *panel;
 	struct lvds_codec *lvds_codec;
+	u32 val;
 	int ret;
 
 	lvds_codec = devm_kzalloc(dev, sizeof(*lvds_codec), GFP_KERNEL);
@@ -187,12 +189,25 @@ static int lvds_codec_probe(struct platform_device *pdev)
 		}
 	}
 
+	/*
+	 * Encoder might sample data on different clock edge than the display,
+	 * for example OnSemi FIN3385 has a dedicated strapping pin to select
+	 * the sampling edge.
+	 */
+	if (lvds_codec->connector_type == DRM_MODE_CONNECTOR_LVDS &&
+	    !of_property_read_u32(dev->of_node, "pclk-sample", &val)) {
+		lvds_codec->timings.input_bus_flags = val ?
+			DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE :
+			DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE;
+	}
+
 	/*
 	 * The panel_bridge bridge is attached to the panel's of_node,
 	 * but we need a bridge attached to our of_node for our user
 	 * to look up.
 	 */
 	lvds_codec->bridge.of_node = dev->of_node;
+	lvds_codec->bridge.timings = &lvds_codec->timings;
 	drm_bridge_add(&lvds_codec->bridge);
 
 	platform_set_drvdata(pdev, lvds_codec);
Signature · 1 line
2.33.0
#2 lore raw

Re: [PATCH v5 2/2] drm/bridge: lvds-codec: Add support for pixel data sampling edge select

Hi Marek,

Quoted 4 lines · Marek Vasut

The OnSemi FIN3385 Parallel-to-LVDS encoder has a dedicated input line to select input pixel data sampling edge. Add DT property "pclk-sample", not the same as the one used by display timings but rather the same as used by media, and configure bus flags based on this DT property.

Late to the party here - sorry.

Quoted 53 lines
Cc Laurent Pinchart <[email protected]>
Cc Rob Herring <[email protected]>
Cc Sam Ravnborg <[email protected]>

To: [email protected]
---
V2: - Limit the pixelclk-active to encoders only
- Update DT binding document
V3: - Determine whether this is encoder from connector, i.e.

      lvds_codec->connector_type == DRM_MODE_CONNECTOR_LVDS

V4: - Switch to pclk-sample. Note that the value of this is inverted,
so all the existing users of pixelclk-active using previous previous version of this patch must be reworked
V5: Rebase on recent linux-next

---
 drivers/gpu/drm/bridge/lvds-codec.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
drivers/gpu/drm/bridge/lvds-codec.c +11 -0
index f991842a161f..702ea803a743 100644
@@ -21,6 +21,7 @@ struct lvds_codec {
 	struct device *dev;
 	struct drm_bridge bridge;
 	struct drm_bridge *panel_bridge;
+	struct drm_bridge_timings timings;
 	struct regulator *vcc;
 	struct gpio_desc *powerdown_gpio;
 	u32 connector_type;
@@ -119,6 +120,7 @@ static int lvds_codec_probe(struct platform_device *pdev)
 	struct device_node *bus_node;
 	struct drm_panel *panel;
 	struct lvds_codec *lvds_codec;
+	u32 val;
 	int ret;
 
 	lvds_codec = devm_kzalloc(dev, sizeof(*lvds_codec), GFP_KERNEL);
@@ -187,12 +189,25 @@ static int lvds_codec_probe(struct platform_device *pdev)
 		}
 	}
 
+	/*
+	 * Encoder might sample data on different clock edge than the display,
+	 * for example OnSemi FIN3385 has a dedicated strapping pin to select
+	 * the sampling edge.
+	 */
+	if (lvds_codec->connector_type == DRM_MODE_CONNECTOR_LVDS &&
+	    !of_property_read_u32(dev->of_node, "pclk-sample", &val)) {
+		lvds_codec->timings.input_bus_flags = val ?
+			DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE :

drivers/gpu/drm/bridge/lvds-codec.c static int lvds_codec_probe(struct platform_device *pdev) · line 210

Quoted 10 lines
drivers/gpu/drm/bridge/lvds-codec.c +4 -0
+			DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE;
+	}
+
 	/*
 	 * The panel_bridge bridge is attached to the panel's of_node,
 	 * but we need a bridge attached to our of_node for our user
 	 * to look up.
 	 */
 	lvds_codec->bridge.of_node = dev->of_node;
+	lvds_codec->bridge.timings = &lvds_codec->timings;

I do not understand how this will work. The only field that is set is timings.input_bus_flags but any user will see bridge.timings is set and will think this is all
timing info.

Maybe I just misses something obvious?

Sam

Quoted 5 lines
drivers/gpu/drm/bridge/lvds-codec.c +0 -0
 	drm_bridge_add(&lvds_codec->bridge);
 
 	platform_set_drvdata(pdev, lvds_codec);
Signature · 1 line
2.33.0
#3 lore raw

Re: [PATCH v5 2/2] drm/bridge: lvds-codec: Add support for pixel data sampling edge select

On 10/17/21 6:49 PM, Sam Ravnborg wrote:

[...]

Quoted 23 lines
Quoted 9 lines
drivers/gpu/drm/bridge/lvds-codec.c +9 -0
+	/*
+	 * Encoder might sample data on different clock edge than the display,
+	 * for example OnSemi FIN3385 has a dedicated strapping pin to select
+	 * the sampling edge.
+	 */
+	if (lvds_codec->connector_type == DRM_MODE_CONNECTOR_LVDS &&
+	    !of_property_read_u32(dev->of_node, "pclk-sample", &val)) {
+		lvds_codec->timings.input_bus_flags = val ?
+			DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE :

drivers/gpu/drm/bridge/lvds-codec.c static int lvds_codec_probe(struct platform_device *pdev) · line 210

Quoted 10 lines
drivers/gpu/drm/bridge/lvds-codec.c +4 -0
+			DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE;
+	}
+
  	/*
  	 * The panel_bridge bridge is attached to the panel's of_node,
  	 * but we need a bridge attached to our of_node for our user
  	 * to look up.
  	 */
  	lvds_codec->bridge.of_node = dev->of_node;
+	lvds_codec->bridge.timings = &lvds_codec->timings;

I do not understand how this will work. The only field that is set is timings.input_bus_flags but any user will see bridge.timings is set and will think this is all
timing info.

Quoted 1 line

Maybe I just misses something obvious?

Is there anything else in those timings that should be set ? See include/drm/drm_bridge.h around line 640

setup_time_ps/hold_time_ps/dual_link isn't supported by this driver, so it is 0 or false anyway, i.e. no change.

Reviewed-by
#4 lore raw

Re: [PATCH v5 2/2] drm/bridge: lvds-codec: Add support for pixel data sampling edge select

Hi Marek,

Quoted 27 lines · Marek Vasut

On 10/17/21 6:49 PM, Sam Ravnborg wrote:

[...]

Quoted 23 lines
Quoted 9 lines
drivers/gpu/drm/bridge/lvds-codec.c +9 -0
+	/*
+	 * Encoder might sample data on different clock edge than the display,
+	 * for example OnSemi FIN3385 has a dedicated strapping pin to select
+	 * the sampling edge.
+	 */
+	if (lvds_codec->connector_type == DRM_MODE_CONNECTOR_LVDS &&
+	    !of_property_read_u32(dev->of_node, "pclk-sample", &val)) {
+		lvds_codec->timings.input_bus_flags = val ?
+			DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE :

drivers/gpu/drm/bridge/lvds-codec.c static int lvds_codec_probe(struct platform_device *pdev) · line 210

Quoted 10 lines
drivers/gpu/drm/bridge/lvds-codec.c +4 -0
+			DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE;
+	}
+
  	/*
  	 * The panel_bridge bridge is attached to the panel's of_node,
  	 * but we need a bridge attached to our of_node for our user
  	 * to look up.
  	 */
  	lvds_codec->bridge.of_node = dev->of_node;
+	lvds_codec->bridge.timings = &lvds_codec->timings;

I do not understand how this will work. The only field that is set is timings.input_bus_flags but any user will see bridge.timings is set and will think this is all
timing info.

Quoted 7 lines
Quoted 1 line

Maybe I just misses something obvious?

Is there anything else in those timings that should be set ? See include/drm/drm_bridge.h around line 640

setup_time_ps/hold_time_ps/dual_link isn't supported by this driver, so it is 0 or false anyway, i.e. no change.

Just me being confused with display_timings. Patch looks good.

Ping me in a few days to apply it if there is no more feedback.

Sam

#5 lore raw

Re: [PATCH v5 2/2] drm/bridge: lvds-codec: Add support for pixel data sampling edge select

Quoted 35 lines · Sam Ravnborg

Hi Marek,

Quoted 32 lines · Marek Vasut

On 10/17/21 6:49 PM, Sam Ravnborg wrote:

[...]

Quoted 23 lines
Quoted 9 lines
drivers/gpu/drm/bridge/lvds-codec.c +9 -0
+	/*
+	 * Encoder might sample data on different clock edge than the display,
+	 * for example OnSemi FIN3385 has a dedicated strapping pin to select
+	 * the sampling edge.
+	 */
+	if (lvds_codec->connector_type == DRM_MODE_CONNECTOR_LVDS &&
+	    !of_property_read_u32(dev->of_node, "pclk-sample", &val)) {
+		lvds_codec->timings.input_bus_flags = val ?
+			DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE :

drivers/gpu/drm/bridge/lvds-codec.c static int lvds_codec_probe(struct platform_device *pdev) · line 210

Quoted 10 lines
drivers/gpu/drm/bridge/lvds-codec.c +4 -0
+			DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE;
+	}
+
   	/*
   	 * The panel_bridge bridge is attached to the panel's of_node,
   	 * but we need a bridge attached to our of_node for our user
   	 * to look up.
   	 */
   	lvds_codec->bridge.of_node = dev->of_node;
+	lvds_codec->bridge.timings = &lvds_codec->timings;

I do not understand how this will work. The only field that is set is timings.input_bus_flags but any user will see bridge.timings is set and will think this is all
timing info.

Quoted 1 line

Maybe I just misses something obvious?

Is there anything else in those timings that should be set ? See include/drm/drm_bridge.h around line 640

Quoted 7 lines
Quoted 2 lines

setup_time_ps/hold_time_ps/dual_link isn't supported by this driver, so it is 0 or false anyway, i.e. no change.

Just me being confused with display_timings. Patch looks good.

Ping me in a few days to apply it if there is no more feedback.

ACK

#6 lore raw

Re: [PATCH v5 2/2] drm/bridge: lvds-codec: Add support for pixel data sampling edge select

In reply to Sam Ravnborg
Quoted 1 line · Sam Ravnborg

Hi Marek,

Hi,

Quoted 33 lines · Marek Vasut
Quoted 32 lines · Sam Ravnborg

[...]

Quoted 23 lines
Quoted 9 lines
drivers/gpu/drm/bridge/lvds-codec.c +9 -0
+	/*
+	 * Encoder might sample data on different clock edge than the display,
+	 * for example OnSemi FIN3385 has a dedicated strapping pin to select
+	 * the sampling edge.
+	 */
+	if (lvds_codec->connector_type == DRM_MODE_CONNECTOR_LVDS &&
+	    !of_property_read_u32(dev->of_node, "pclk-sample", &val)) {
+		lvds_codec->timings.input_bus_flags = val ?
+			DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE :

drivers/gpu/drm/bridge/lvds-codec.c static int lvds_codec_probe(struct platform_device *pdev) · line 210

Quoted 10 lines
drivers/gpu/drm/bridge/lvds-codec.c +4 -0
+			DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE;
+	}
+
   	/*
   	 * The panel_bridge bridge is attached to the panel's of_node,
   	 * but we need a bridge attached to our of_node for our user
   	 * to look up.
   	 */
   	lvds_codec->bridge.of_node = dev->of_node;
+	lvds_codec->bridge.timings = &lvds_codec->timings;

I do not understand how this will work. The only field that is set is timings.input_bus_flags but any user will see bridge.timings is set and will think this is all
timing info.

Quoted 1 line

Maybe I just misses something obvious?

Is there anything else in those timings that should be set ? See include/drm/drm_bridge.h around line 640

Quoted 7 lines
Quoted 2 lines

setup_time_ps/hold_time_ps/dual_link isn't supported by this driver, so it is 0 or false anyway, i.e. no change.

Just me being confused with display_timings. Patch looks good.

Ping me in a few days to apply it if there is no more feedback.

Ping I guess ... Laurent ?

#7 lore raw

Re: [PATCH v5 2/2] drm/bridge: lvds-codec: Add support for pixel data sampling edge select

Quoted 43 lines · Marek Vasut
Quoted 1 line · Sam Ravnborg

Hi Marek,

Hi,

Quoted 38 lines · Marek Vasut
Quoted 36 lines · Sam Ravnborg

[...]

Quoted 21 lines
Quoted 13 lines

+    /*
+     * Encoder might sample data on different clock edge than the display,
+     * for example OnSemi FIN3385 has a dedicated strapping pin to select
+     * the sampling edge.
+     */
+    if (lvds_codec->connector_type == DRM_MODE_CONNECTOR_LVDS && +        !of_property_read_u32(dev->of_node, "pclk-sample", &val)) { +        lvds_codec->timings.input_bus_flags = val ?
+            DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE :
+            DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE;
+    }

Quoted 8 lines

+
       /*
        * The panel_bridge bridge is attached to the panel's of_node,
        * but we need a bridge attached to our of_node for our user
        * to look up.
        */
       lvds_codec->bridge.of_node = dev->of_node;
+    lvds_codec->bridge.timings = &lvds_codec->timings;

Quoted 5 lines

I do not understand how this will work. The only field that is set is timings.input_bus_flags but any user will see bridge.timings is set and will think this is all
timing info.

Maybe I just misses something obvious?

Is there anything else in those timings that should be set ? See include/drm/drm_bridge.h around line 640

setup_time_ps/hold_time_ps/dual_link isn't supported by this driver, so it is 0 or false anyway, i.e. no change.

Quoted 6 lines
Quoted 4 lines

Just me being confused with display_timings. Patch looks good.

Ping me in a few days to apply it if there is no more feedback.

Ping I guess ... Laurent ?

Ping one more time ?

#8 lore raw

Re: [PATCH v5 2/2] drm/bridge: lvds-codec: Add support for pixel data sampling edge select

Quoted 44 lines · Marek Vasut
Quoted 43 lines · Marek Vasut
Quoted 1 line · Sam Ravnborg

Hi Marek,

Hi,

Quoted 38 lines · Marek Vasut
Quoted 36 lines · Sam Ravnborg

[...]

Quoted 21 lines
Quoted 13 lines

+    /*
+     * Encoder might sample data on different clock edge than the display,
+     * for example OnSemi FIN3385 has a dedicated strapping pin to select
+     * the sampling edge.
+     */
+    if (lvds_codec->connector_type == DRM_MODE_CONNECTOR_LVDS && +        !of_property_read_u32(dev->of_node, "pclk-sample", &val)) { +        lvds_codec->timings.input_bus_flags = val ?
+            DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE :
+            DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE;
+    }

Quoted 8 lines

+
       /*
        * The panel_bridge bridge is attached to the panel's of_node,
        * but we need a bridge attached to our of_node for our user
        * to look up.
        */
       lvds_codec->bridge.of_node = dev->of_node;
+    lvds_codec->bridge.timings = &lvds_codec->timings;

Quoted 5 lines

I do not understand how this will work. The only field that is set is timings.input_bus_flags but any user will see bridge.timings is set and will think this is all
timing info.

Maybe I just misses something obvious?

Is there anything else in those timings that should be set ? See include/drm/drm_bridge.h around line 640

setup_time_ps/hold_time_ps/dual_link isn't supported by this driver, so it is 0 or false anyway, i.e. no change.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

Just me being confused with display_timings. Patch looks good.

Ping me in a few days to apply it if there is no more feedback.

Ping I guess ... Laurent ?

Ping one more time ?

Ping yet again ?

maintainer Reviewed-by on v5 1/2
#9 lore raw
In reply to Marek Vasut
Quoted 10 lines · Marek Vasut

The OnSemi FIN3385 Parallel-to-LVDS encoder has a dedicated input line to select input pixel data sampling edge. Add DT property "pclk-sample", not the same as the one used by display timings but rather the same as used by media, to define the pixel data sampling edge.

Cc Laurent Pinchart <[email protected]>
Cc Rob Herring <[email protected]>
Cc Sam Ravnborg <[email protected]>
Quoted 8 lines

To: [email protected]
---
V4: New patch split from combined V3
V5: Rebase on recent linux-next

---
 .../bindings/display/bridge/lvds-codec.yaml    | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
#10 lore raw
In reply to Marek Vasut

Hi Marek,

Thank you for the patch.

Quoted 24 lines · Marek Vasut

The OnSemi FIN3385 Parallel-to-LVDS encoder has a dedicated input line to select input pixel data sampling edge. Add DT property "pclk-sample", not the same as the one used by display timings but rather the same as used by media, to define the pixel data sampling edge.

Cc Laurent Pinchart <[email protected]>
Cc Rob Herring <[email protected]>
Cc Sam Ravnborg <[email protected]>

To: [email protected]
---
V4: New patch split from combined V3
V5: Rebase on recent linux-next

---
 .../bindings/display/bridge/lvds-codec.yaml    | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
Documentation/devicetree/bindings/display/bridge/lvds-codec.yaml +0 -0
index 1faae3e323a4..708de84ac138 100644
@@ -79,6 +79,14 @@ properties:
       - port@0

Documentation/devicetree/bindings/display/bridge/lvds-codec.yaml properties: · line 89

Quoted 10 lines
Documentation/devicetree/bindings/display/bridge/lvds-codec.yaml +8 -0
       - port@1
 
+  pclk-sample:
+    description:
+      Data sampling on rising or falling edge.
+    enum:
+      - 0  # Falling edge
+      - 1  # Rising edge
+    default: 0
+

Shouldn't this be moved to the endpoint, the same way data-mapping is defined as an endpoint property ?

Quoted 20 lines
Documentation/devicetree/bindings/display/bridge/lvds-codec.yaml +10 -0
   powerdown-gpios:
     description:
       The GPIO used to control the power down line of this device.
@@ -102,6 +110,16 @@ then:
               properties:
                 data-mapping: false
 
+if:
+  not:
+    properties:
+      compatible:
+        contains:
+          const: lvds-encoder
+then:
+  properties:
+    pclk-sample: false
+
 required:
   - compatible
   - ports
Signature · 3 lines
Regards,

Laurent Pinchart
#11 lore raw

On 10/18/21 8:08 PM, Laurent Pinchart wrote:

[...]

Quoted 8 lines
Quoted 8 lines
Documentation/devicetree/bindings/display/bridge/lvds-codec.yaml +0 -0
index 1faae3e323a4..708de84ac138 100644
@@ -79,6 +79,14 @@ properties:
        - port@0
        - port@1
 
Quoted 11 lines

Documentation/devicetree/bindings/display/bridge/lvds-codec.yaml properties: · line 89

Quoted 8 lines
Documentation/devicetree/bindings/display/bridge/lvds-codec.yaml +8 -0
+  pclk-sample:
+    description:
+      Data sampling on rising or falling edge.
+    enum:
+      - 0  # Falling edge
+      - 1  # Rising edge
+    default: 0
+

Shouldn't this be moved to the endpoint, the same way data-mapping is defined as an endpoint property ?

The strapping is a chip property, not port property, so no.

#12 lore raw

Hi Marek,

Quoted 24 lines · Marek Vasut

On 10/18/21 8:08 PM, Laurent Pinchart wrote:

[...]

Quoted 8 lines
Quoted 8 lines
Documentation/devicetree/bindings/display/bridge/lvds-codec.yaml +0 -0
index 1faae3e323a4..708de84ac138 100644
@@ -79,6 +79,14 @@ properties:
        - port@0
        - port@1
 
Quoted 11 lines

Documentation/devicetree/bindings/display/bridge/lvds-codec.yaml properties: · line 89

Quoted 8 lines
Documentation/devicetree/bindings/display/bridge/lvds-codec.yaml +8 -0
+  pclk-sample:
+    description:
+      Data sampling on rising or falling edge.
+    enum:
+      - 0  # Falling edge
+      - 1  # Rising edge
+    default: 0
+

Shouldn't this be moved to the endpoint, the same way data-mapping is defined as an endpoint property ?

Quoted 1 line

The strapping is a chip property, not port property, so no.

For this particular chip that's true. I'm still not convinced overall. For some cases it could be a per-port property, and moving it there for lvds-codec too could allow implementing helpers to parse DT properties, without much drawback for this particular use case as far as I can see. It's hard to predict the future with certainty of course, so I won't insist.

Signature · 3 lines
Regards,

Laurent Pinchart
#13 lore raw

On 10/18/21 9:57 PM, Laurent Pinchart wrote:

Hi,

Quoted 20 lines
Quoted 20 lines
Quoted 19 lines
Quoted 6 lines
Documentation/devicetree/bindings/display/bridge/lvds-codec.yaml +0 -0
index 1faae3e323a4..708de84ac138 100644
@@ -79,6 +79,14 @@ properties:
         - port@0

Documentation/devicetree/bindings/display/bridge/lvds-codec.yaml properties: · line 89

Quoted 10 lines
Documentation/devicetree/bindings/display/bridge/lvds-codec.yaml +8 -0
         - port@1
 
+  pclk-sample:
+    description:
+      Data sampling on rising or falling edge.
+    enum:
+      - 0  # Falling edge
+      - 1  # Rising edge
+    default: 0
+

Shouldn't this be moved to the endpoint, the same way data-mapping is defined as an endpoint property ?

Quoted 4 lines
Quoted 1 line

The strapping is a chip property, not port property, so no.

For this particular chip that's true. I'm still not convinced overall. For some cases it could be a per-port property

Can you be more specific about "some cases" ?

Quoted 5 lines

, and moving it there for
lvds-codec too could allow implementing helpers to parse DT properties, without much drawback for this particular use case as far as I can see. It's hard to predict the future with certainty of course, so I won't insist.

The DT bindings and the OS drivers are separate thing, we really shouldn't start bending DT bindings so that they would fit nicely with a specific OS driver model.

#14 lore raw

Hi Marek,

Quoted 24 lines · Marek Vasut

On 10/18/21 9:57 PM, Laurent Pinchart wrote:

Hi,

Quoted 20 lines
Quoted 20 lines
Quoted 19 lines
Quoted 6 lines
Documentation/devicetree/bindings/display/bridge/lvds-codec.yaml +0 -0
index 1faae3e323a4..708de84ac138 100644
@@ -79,6 +79,14 @@ properties:
         - port@0

Documentation/devicetree/bindings/display/bridge/lvds-codec.yaml properties: · line 89

Quoted 10 lines
Documentation/devicetree/bindings/display/bridge/lvds-codec.yaml +8 -0
         - port@1
 
+  pclk-sample:
+    description:
+      Data sampling on rising or falling edge.
+    enum:
+      - 0  # Falling edge
+      - 1  # Rising edge
+    default: 0
+

Shouldn't this be moved to the endpoint, the same way data-mapping is defined as an endpoint property ?

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

The strapping is a chip property, not port property, so no.

For this particular chip that's true. I'm still not convinced overall. For some cases it could be a per-port property

Can you be more specific about "some cases" ?

I'm thinking about bridges that could have multiple parallel inputs.

Quoted 9 lines
Quoted 5 lines

, and moving it there for
lvds-codec too could allow implementing helpers to parse DT properties, without much drawback for this particular use case as far as I can see. It's hard to predict the future with certainty of course, so I won't insist.

The DT bindings and the OS drivers are separate thing, we really shouldn't start bending DT bindings so that they would fit nicely with a specific OS driver model.

DT bindings are not holy beings that live in a mythical heaven way above the mere mortal drivers, they would be useless without implementations. It's not about bending them, which I regularly push against during review, but about structuring them in a way that facilitates implementations when all other things are equal.

As I said, despite wondering whether or not it would be better to move the property to the endpoint (and that was a genuine open question), I won't insist in this case.

Signature · 3 lines
Regards,

Laurent Pinchart
#15 lore raw
Quoted 1 line · Laurent Pinchart

Hi Marek,

Hi,

Quoted 20 lines
Quoted 20 lines
Quoted 20 lines
Quoted 20 lines
Quoted 19 lines
Quoted 6 lines
Documentation/devicetree/bindings/display/bridge/lvds-codec.yaml +0 -0
index 1faae3e323a4..708de84ac138 100644
@@ -79,6 +79,14 @@ properties:
          - port@0

Documentation/devicetree/bindings/display/bridge/lvds-codec.yaml properties: · line 89

Quoted 10 lines
Documentation/devicetree/bindings/display/bridge/lvds-codec.yaml +8 -0
          - port@1
 
+  pclk-sample:
+    description:
+      Data sampling on rising or falling edge.
+    enum:
+      - 0  # Falling edge
+      - 1  # Rising edge
+    default: 0
+

Shouldn't this be moved to the endpoint, the same way data-mapping is defined as an endpoint property ?

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 1 line

The strapping is a chip property, not port property, so no.

For this particular chip that's true. I'm still not convinced overall. For some cases it could be a per-port property

Can you be more specific about "some cases" ?

I'm thinking about bridges that could have multiple parallel inputs.

Can you draft an example how such a binding would look like within the confines of this lvds-codec.yaml ?

I also have to wonder how such a hypothetical device would work, would it serialize two parallel bussed into single LVDS one ?

Quoted 10 lines
Quoted 9 lines
Quoted 5 lines

, and moving it there for
lvds-codec too could allow implementing helpers to parse DT properties, without much drawback for this particular use case as far as I can see. It's hard to predict the future with certainty of course, so I won't insist.

The DT bindings and the OS drivers are separate thing, we really shouldn't start bending DT bindings so that they would fit nicely with a specific OS driver model.

Quoted 5 lines

DT bindings are not holy beings that live in a mythical heaven way above the mere mortal drivers, they would be useless without implementations. It's not about bending them, which I regularly push against during review, but about structuring them in a way that facilitates implementations when all other things are equal.

Note that the pclk-sample isn't a property of the input, but of the chip, I don't think it is a good idea to say they are equal and conflate them like so.

Quoted 3 lines

As I said, despite wondering whether or not it would be better to move the property to the endpoint (and that was a genuine open question), I won't insist in this case.

[...]

#16 lore raw
Quoted 32 lines · Marek Vasut
Quoted 1 line · Laurent Pinchart

Hi Marek,

Hi,

Quoted 27 lines
Quoted 26 lines
Quoted 20 lines
Quoted 20 lines
Quoted 19 lines
Quoted 6 lines
Documentation/devicetree/bindings/display/bridge/lvds-codec.yaml +0 -0
index 1faae3e323a4..708de84ac138 100644
@@ -79,6 +79,14 @@ properties:
          - port@0

Documentation/devicetree/bindings/display/bridge/lvds-codec.yaml properties: · line 89

Quoted 10 lines
Documentation/devicetree/bindings/display/bridge/lvds-codec.yaml +8 -0
          - port@1
 
+  pclk-sample:
+    description:
+      Data sampling on rising or falling edge.
+    enum:
+      - 0  # Falling edge
+      - 1  # Rising edge
+    default: 0
+

Shouldn't this be moved to the endpoint, the same way data-mapping is defined as an endpoint property ?

Quoted 4 lines
Quoted 1 line

The strapping is a chip property, not port property, so no.

For this particular chip that's true. I'm still not convinced overall. For some cases it could be a per-port property

Can you be more specific about "some cases" ?

Quoted 7 lines
Quoted 1 line

I'm thinking about bridges that could have multiple parallel inputs.

Can you draft an example how such a binding would look like within the confines of this lvds-codec.yaml ?

I also have to wonder how such a hypothetical device would work, would it serialize two parallel bussed into single LVDS one ?

Such a device would require custom bindings I think, as lvds-codec is limited to a single input and a single output. thine,thc63lvd1024.yaml is an example of such a device.

Quoted 16 lines
Quoted 10 lines
Quoted 9 lines
Quoted 5 lines

, and moving it there for
lvds-codec too could allow implementing helpers to parse DT properties, without much drawback for this particular use case as far as I can see. It's hard to predict the future with certainty of course, so I won't insist.

The DT bindings and the OS drivers are separate thing, we really shouldn't start bending DT bindings so that they would fit nicely with a specific OS driver model.

Quoted 5 lines

DT bindings are not holy beings that live in a mythical heaven way above the mere mortal drivers, they would be useless without implementations. It's not about bending them, which I regularly push against during review, but about structuring them in a way that facilitates implementations when all other things are equal.

Quoted 3 lines

Note that the pclk-sample isn't a property of the input, but of the chip, I don't think it is a good idea to say they are equal and conflate them like so.

With a chip that has a single input, that's always the case :-)

Anyway, I don't mind a chip-level property for this binding as we're limited to a single port. If other devices need to specify this at the port level, I'm sure we'll be able to cope with the lack of uniformity.

Quoted 5 lines
Quoted 3 lines

As I said, despite wondering whether or not it would be better to move the property to the endpoint (and that was a genuine open question), I won't insist in this case.

[...]

Signature · 3 lines
Regards,

Laurent Pinchart
#17 lore raw

On 10/27/21 1:43 AM, Laurent Pinchart wrote:

[...]

Quoted 32 lines
Quoted 32 lines
Quoted 20 lines
Quoted 20 lines
Quoted 20 lines
Quoted 20 lines
Quoted 19 lines
Quoted 6 lines
Documentation/devicetree/bindings/display/bridge/lvds-codec.yaml +0 -0
index 1faae3e323a4..708de84ac138 100644
@@ -79,6 +79,14 @@ properties:
           - port@0

Documentation/devicetree/bindings/display/bridge/lvds-codec.yaml properties: · line 89

Quoted 10 lines
Documentation/devicetree/bindings/display/bridge/lvds-codec.yaml +8 -0
           - port@1
 
+  pclk-sample:
+    description:
+      Data sampling on rising or falling edge.
+    enum:
+      - 0  # Falling edge
+      - 1  # Rising edge
+    default: 0
+

Shouldn't this be moved to the endpoint, the same way data-mapping is defined as an endpoint property ?

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 1 line

The strapping is a chip property, not port property, so no.

For this particular chip that's true. I'm still not convinced overall. For some cases it could be a per-port property

Can you be more specific about "some cases" ?

I'm thinking about bridges that could have multiple parallel inputs.

Can you draft an example how such a binding would look like within the confines of this lvds-codec.yaml ?

Quoted 6 lines
Quoted 2 lines

I also have to wonder how such a hypothetical device would work, would it serialize two parallel bussed into single LVDS one ?

Such a device would require custom bindings I think, as lvds-codec is limited to a single input and a single output. thine,thc63lvd1024.yaml is an example of such a device.

It seems THC63LVD1024 is LVDS->to->Parallel DPI, so pclk-sample does not seem applicable there either.

[...]