Skip to contentSkip to conversation

LVDS Controller Support for SAM9X7 SoC

PATCH Superseded Dharma Balasubiramani 6 participants 15 messages Jan 22, 2024 – Feb 3, 2024

Subsystems (5)

v1 of 8 Superseded Latest is v8 →

lore
Share & tools
lore

Dharma Balasubiramani

author maintainer
#0 lore raw

cover LVDS Controller Support for SAM9X7 SoC

This patch series introduces LVDS controller support for the SAM9X7 SoC. The LVDS controller is designed to work with Microchip's sam9x7 series System-on-Chip (SoC) devices, providing Low Voltage Differential Signaling capabilities.

Dharma Balasubiramani (3):
dt-bindings: display: bridge: add sam9x7-lvds compatible drm/bridge: add lvds controller support for sam9x7
MAINTAINERS: add SAM9X7 SoC's LVDS controller

 .../display/bridge/microchip,sam9x7-lvds.yaml |  59 +++++
 MAINTAINERS                                   |   8 +
 drivers/gpu/drm/bridge/Kconfig                |   7 +
 drivers/gpu/drm/bridge/Makefile               |   1 +
 drivers/gpu/drm/bridge/microchip-lvds.c       | 250 ++++++++++++++++++
 5 files changed, 325 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml
 create mode 100644 drivers/gpu/drm/bridge/microchip-lvds.c
Signature · 1 line
2.25.1
author maintainer
#1 lore raw

PATCH 1/3 dt-bindings: display: bridge: add sam9x7-lvds compatible

Add the 'sam9x7-lvds' compatible binding, which describes the Low Voltage Differential Signaling (LVDS) Controller found on Microchip's sam9x7 series System-on-Chip (SoC) devices. This binding will be used to define the properties and configuration for the LVDS Controller in DT.

---
 .../display/bridge/microchip,sam9x7-lvds.yaml | 59 +++++++++++++++++++
 1 file changed, 59 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml
Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml new file +59 -0
new file mode 100644
index 000000000000..8c2c5b858c85
@@ -0,0 +1,59 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/bridge/microchip,sam9x7-lvds.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Microchip SAM9X7 LVDS Controller
+
+maintainers:
+  - Dharma Balasubiramani <[email protected]>
+
+description: |
+  The Low Voltage Differential Signaling Controller (LVDSC) manages data
+  format conversion from the LCD Controller internal DPI bus to OpenLDI
+  LVDS output signals. LVDSC functions include bit mapping, balanced mode
+  management, and serializer.
+
+properties:
+  compatible:
+    const: microchip,sam9x7-lvds
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    items:
+      - description: Peripheral Bus Clock
+
+  clock-names:
+    items:
+      - const: pclk
+      - const: gclk
+    minItems: 1
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+  - clock-names
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/at91.h>
+    #include <dt-bindings/dma/at91.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    lvds-controller@f8060000 {
+      compatible = "microchip,sam9x7-lvds";
+      reg = <0xf8060000 0x100>;
+      interrupts = <56 IRQ_TYPE_LEVEL_HIGH 0>;
+      clocks = <&pmc PMC_TYPE_PERIPHERAL 56>;
+      clock-names = "pclk";
+    };
Signature · 1 line
2.25.1
author maintainer
#10 lore raw

PATCH 2/3 drm/bridge: add lvds controller support for sam9x7

In reply to Dharma Balasubiramani

Add a new LVDS controller driver for sam9x7 which does the following:
- Prepares and enables the LVDS Peripheral clock
- Defines its connector type as DRM_MODE_CONNECTOR_LVDS and adds itself to the global bridge list.
- Identifies its output endpoint as panel and adds it to the encoder display pipeline
- Enables the LVDS serializer

---
 drivers/gpu/drm/bridge/Kconfig          |   7 +
 drivers/gpu/drm/bridge/Makefile         |   1 +
 drivers/gpu/drm/bridge/microchip-lvds.c | 250 ++++++++++++++++++++++++
 3 files changed, 258 insertions(+)
 create mode 100644 drivers/gpu/drm/bridge/microchip-lvds.c
drivers/gpu/drm/bridge/Kconfig +7 -0
index 3e6a4e2044c0..200afb36e421 100644
@@ -173,6 +173,13 @@ config DRM_MEGACHIPS_STDPXXXX_GE_B850V3_FW
 	  to DP++. This is used with the i.MX6 imx-ldb
 	  driver. You are likely to say N here.
 
+config DRM_MICROCHIP_LVDS_SERIALIZER
+	tristate "Microchip LVDS serailzer support"
+	depends on OF
+	depends on DRM_ATMEL_HLCDC
+	help
+	  Support for Microchip's LVDS serializer.
+
 config DRM_NWL_MIPI_DSI
 	tristate "Northwest Logic MIPI DSI Host controller"
 	depends on DRM
drivers/gpu/drm/bridge/Makefile +1 -0
index 2b892b7ed59e..e3804e93d324 100644
@@ -11,6 +11,7 @@ obj-$(CONFIG_DRM_LONTIUM_LT9611) += lontium-lt9611.o
 obj-$(CONFIG_DRM_LONTIUM_LT9611UXC) += lontium-lt9611uxc.o
 obj-$(CONFIG_DRM_LVDS_CODEC) += lvds-codec.o
 obj-$(CONFIG_DRM_MEGACHIPS_STDPXXXX_GE_B850V3_FW) += megachips-stdpxxxx-ge-b850v3-fw.o
+obj-$(CONFIG_DRM_MICROCHIP_LVDS_SERIALIZER) += microchip-lvds.o
 obj-$(CONFIG_DRM_NXP_PTN3460) += nxp-ptn3460.o
 obj-$(CONFIG_DRM_PARADE_PS8622) += parade-ps8622.o
 obj-$(CONFIG_DRM_PARADE_PS8640) += parade-ps8640.o
drivers/gpu/drm/bridge/microchip-lvds.c new file +250 -0

250 lines not on this page · raw message

Signature · 1 line
2.25.1
author maintainer
#14 lore raw

PATCH 3/3 MAINTAINERS: add SAM9X7 SoC's LVDS controller

In reply to Dharma Balasubiramani

Add the newly added LVDS controller for the SAM9X7 SoC to the existing MAINTAINERS entry.

---
 MAINTAINERS | 8 ++++++++
 1 file changed, 8 insertions(+)
MAINTAINERS +8 -0
index a7c4cf8201e0..24a266d20df6 100644
@@ -14230,6 +14230,14 @@ S:	Supported
 F:	Documentation/devicetree/bindings/power/reset/atmel,sama5d2-shdwc.yaml
 F:	drivers/power/reset/at91-sama5d2_shdwc.c
 
+MICROCHIP SAM9x7-COMPATIBLE LVDS CONTROLLER
+M:	Manikandan Muralidharan <[email protected]>
+M:	Dharma Balasubiramani <[email protected]>
+L:	[email protected]
+S:	Supported
+F:	Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml
+F:	drivers/gpu/drm/bridge/microchip-lvds.c
+
 MICROCHIP SOC DRIVERS
 M:	Conor Dooley <[email protected]>
 S:	Supported
Signature · 1 line
2.25.1
#11 lore raw

Re: [PATCH 2/3] drm/bridge: add lvds controller support for sam9x7

In reply to Dharma Balasubiramani
Quoted 11 lines · Dharma Balasubiramani

Add a new LVDS controller driver for sam9x7 which does the following:
- Prepares and enables the LVDS Peripheral clock
- Defines its connector type as DRM_MODE_CONNECTOR_LVDS and adds itself to the global bridge list.
- Identifies its output endpoint as panel and adds it to the encoder display pipeline
- Enables the LVDS serializer

---

...

Quoted 10 lines
drivers/gpu/drm/bridge/microchip-lvds.c new file +10 -0
+
+static int mchp_lvds_probe(struct platform_device *pdev)
+{
+	struct device *dev = &pdev->dev;
+	struct mchp_lvds *lvds;
+	struct resource *res;
+	struct device_node *port;
+	int ret;
+
+	if (!dev->of_node)

drivers/gpu/drm/bridge/microchip-lvds.c line 171

Quoted 10 lines
drivers/gpu/drm/bridge/microchip-lvds.c new file +10 -0
+		return -ENODEV;
+
+	lvds = devm_kzalloc(&pdev->dev, sizeof(*lvds), GFP_KERNEL);
+	if (!lvds)
+		return -ENOMEM;
+
+	lvds->dev = dev;
+
+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	lvds->regs = devm_ioremap_resource(lvds->dev, res);

Why not combining these two?

drivers/gpu/drm/bridge/microchip-lvds.c line 177

Quoted 6 lines
drivers/gpu/drm/bridge/microchip-lvds.c new file +6 -0
+	if (IS_ERR(lvds->regs))
+		return PTR_ERR(lvds->regs);
+
+	lvds->pclk = devm_clk_get(lvds->dev, "pclk");
+	if (IS_ERR(lvds->pclk)) {
+		DRM_DEV_ERROR(lvds->dev, "could not get pclk_lvds\n");

Handle properly deferred probe. What's DRM wrapper over dev_err_probe()?

Quoted 12 lines
drivers/gpu/drm/bridge/microchip-lvds.c new file +12 -0
+		return PTR_ERR(lvds->pclk);
+	}
+
+	ret = clk_prepare(lvds->pclk);
+	if (ret < 0) {
+		DRM_DEV_ERROR(lvds->dev, "failed to prepare pclk_lvds\n");
+		return ret;
+	}
+
+	port = of_graph_get_remote_node(dev->of_node, 1, 0);
+	if (!port) {
+		DRM_DEV_ERROR(dev,

drivers/gpu/drm/bridge/microchip-lvds.c line 199

Quoted 10 lines
drivers/gpu/drm/bridge/microchip-lvds.c new file +10 -0
+			      "can't find port point, please init lvds panel port!\n");
+		return -EINVAL;
+	}
+
+	lvds->panel = of_drm_find_panel(port);
+	of_node_put(port);
+
+	if (IS_ERR(lvds->panel)) {
+		DRM_DEV_ERROR(dev, "failed to find panel node\n");
+		return -EPROBE_DEFER;

OK, that's for sure wrong. Don't print anything on deferred probe.

Quoted 41 lines
drivers/gpu/drm/bridge/microchip-lvds.c new file +41 -0
+	}
+
+	lvds->panel_bridge = devm_drm_panel_bridge_add(dev, lvds->panel);
+
+	if (IS_ERR(lvds->panel_bridge))
+		return PTR_ERR(lvds->panel_bridge);
+
+	lvds->bridge.of_node = dev->of_node;
+	lvds->bridge.type = DRM_MODE_CONNECTOR_LVDS;
+	lvds->bridge.funcs = &mchp_lvds_bridge_funcs;
+
+	dev_set_drvdata(dev, lvds);
+	pm_runtime_enable(dev);
+
+	drm_bridge_add(&lvds->bridge);
+
+	return 0;
+}
+
+static int mchp_lvds_remove(struct platform_device *pdev)
+{
+	struct mchp_lvds *lvds = platform_get_drvdata(pdev);
+
+	pm_runtime_disable(&pdev->dev);
+	clk_unprepare(lvds->pclk);
+
+	return 0;
+}
+
+static const struct of_device_id mchp_lvds_dt_ids[] = {
+	{
+		.compatible = "microchip,sam9x7-lvds",
+	},
+	{},
+};
+
+struct platform_driver mchp_lvds_driver = {
+	.probe = mchp_lvds_probe,
+	.remove = mchp_lvds_remove,
+	.driver = {
+		   .name = "microchip-lvds",

drivers/gpu/drm/bridge/microchip-lvds.c line 250

Quoted 10 lines
drivers/gpu/drm/bridge/microchip-lvds.c new file +10 -0
+		   .of_match_table = mchp_lvds_dt_ids,
+	},
+};
+module_platform_driver(mchp_lvds_driver);
+
+MODULE_AUTHOR("Manikandan Muralidharan <[email protected]>");
+MODULE_AUTHOR("Dharma Balasubiramani <[email protected]>");
+MODULE_DESCRIPTION("Low Voltage Differential Signaling Controller Driver");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:microchip-lvds");

You should not need MODULE_ALIAS() in normal cases. If you need it, usually it means your device ID table is wrong (e.g. misses either entries or MODULE_DEVICE_TABLE()). MODULE_ALIAS() is not a substitute for incomplete ID table.

Best regards,
Krzysztof

#2 lore raw

Re: [PATCH 1/3] dt-bindings: display: bridge: add sam9x7-lvds compatible

In reply to Dharma Balasubiramani
Quoted 17 lines · Dharma Balasubiramani

Add the 'sam9x7-lvds' compatible binding, which describes the Low Voltage Differential Signaling (LVDS) Controller found on Microchip's sam9x7 series System-on-Chip (SoC) devices. This binding will be used to define the properties and configuration for the LVDS Controller in DT.

---
 .../display/bridge/microchip,sam9x7-lvds.yaml | 59 +++++++++++++++++++
 1 file changed, 59 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml
Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml new file +0 -0
new file mode 100644
index 000000000000..8c2c5b858c85

Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml line 7

Quoted 7 lines
Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml new file +7 -0
@@ -0,0 +1,59 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/bridge/microchip,sam9x7-lvds.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Microchip SAM9X7 LVDS Controller

What is the "X"?

Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml line 12

Quoted 5 lines
Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml new file +5 -0
+
+maintainers:
+  - Dharma Balasubiramani <[email protected]>
+
+description: |

Do not need '|' unless you need to preserve formatting.

Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml line 20

Quoted 8 lines
Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml new file +8 -0
+  The Low Voltage Differential Signaling Controller (LVDSC) manages data
+  format conversion from the LCD Controller internal DPI bus to OpenLDI
+  LVDS output signals. LVDSC functions include bit mapping, balanced mode
+  management, and serializer.
+
+properties:
+  compatible:
+    const: microchip,sam9x7-lvds

What is "x"? Wildcard? Then no, don't use it and instead use proper SoC version number.

Quoted 6 lines
Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml new file +6 -0
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1

Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml line 36

Quoted 10 lines
Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml new file +10 -0
+
+  clocks:
+    items:
+      - description: Peripheral Bus Clock
+
+  clock-names:
+    items:
+      - const: pclk
+      - const: gclk
+    minItems: 1

No, you just said you have one clock.

Quoted 5 lines
Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml new file +5 -0
+
+required:
+  - compatible
+  - reg
+  - interrupts

Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml line 51

Quoted 10 lines
Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml new file +10 -0
+  - clocks
+  - clock-names
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/at91.h>
+    #include <dt-bindings/dma/at91.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>

This header is not used. Include only used ones (and missing interrupt).

Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml line 56

Quoted 5 lines
Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml new file +5 -0
+
+    lvds-controller@f8060000 {
+      compatible = "microchip,sam9x7-lvds";
+      reg = <0xf8060000 0x100>;
+      interrupts = <56 IRQ_TYPE_LEVEL_HIGH 0>;

What is "0"?

Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml line 59

Quoted 3 lines
Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml new file +3 -0
+      clocks = <&pmc PMC_TYPE_PERIPHERAL 56>;
+      clock-names = "pclk";
+    };

Best regards,
Krzysztof

#3 lore raw

Re: [PATCH 1/3] dt-bindings: display: bridge: add sam9x7-lvds compatible

Quoted 36 lines · Krzysztof Kozlowski
Quoted 17 lines · Dharma Balasubiramani

Add the 'sam9x7-lvds' compatible binding, which describes the Low Voltage Differential Signaling (LVDS) Controller found on Microchip's sam9x7 series System-on-Chip (SoC) devices. This binding will be used to define the properties and configuration for the LVDS Controller in DT.

---
 .../display/bridge/microchip,sam9x7-lvds.yaml | 59 +++++++++++++++++++
 1 file changed, 59 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml
Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml new file +0 -0
new file mode 100644
index 000000000000..8c2c5b858c85

Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml line 7

Quoted 7 lines
Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml new file +7 -0
@@ -0,0 +1,59 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/bridge/microchip,sam9x7-lvds.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Microchip SAM9X7 LVDS Controller

What is the "X"?

Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml line 12

Quoted 5 lines
Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml new file +5 -0
+
+maintainers:
+  - Dharma Balasubiramani <[email protected]>
+
+description: |

Do not need '|' unless you need to preserve formatting.

Quoted 11 lines

Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml line 20

Quoted 8 lines
Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml new file +8 -0
+  The Low Voltage Differential Signaling Controller (LVDSC) manages data
+  format conversion from the LCD Controller internal DPI bus to OpenLDI
+  LVDS output signals. LVDSC functions include bit mapping, balanced mode
+  management, and serializer.
+
+properties:
+  compatible:
+    const: microchip,sam9x7-lvds

What is "x"? Wildcard? Then no, don't use it and instead use proper SoC version number.

These SoCs actually do have an x in their name. However, and I do always get confused here, the sam9x7 is a series of SoCs (the cover letter does say this) rather than a specific device.
I think the series current consists of a sam9x70 sam9x72 and a sam9x75. The devices are largely similar, but I am not sure if the sam9x70 supports LVDS at all. Having a compatible for the series does not seem correct to me.

Cheers,
Conor.

author maintainer
#9 lore raw

Re: [PATCH 1/3] dt-bindings: display: bridge: add sam9x7-lvds compatible

In reply to Krzysztof Kozlowski

Hi Krzysztof,

Quoted 14 lines · Krzysztof Kozlowski

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

Quoted 11 lines · Dharma Balasubiramani

Add the 'sam9x7-lvds' compatible binding, which describes the Low Voltage Differential Signaling (LVDS) Controller found on Microchip's sam9x7 series System-on-Chip (SoC) devices. This binding will be used to define the properties and configuration for the LVDS Controller in DT.

---
  .../display/bridge/microchip,sam9x7-lvds.yaml | 59 +++++++++++++++++++
  1 file changed, 59 insertions(+)

create mode 100644 Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml

Quoted 15 lines

Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml line 7

Quoted 13 lines
Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml new file +7 -0
new file mode 100644
index 000000000000..8c2c5b858c85
@@ -0,0 +1,59 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/bridge/microchip,sam9x7-lvds.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Microchip SAM9X7 LVDS Controller

What is the "X

Answered below

Quoted 8 lines

Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml line 12

Quoted 6 lines
Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml new file +5 -0
+
+maintainers:
+  - Dharma Balasubiramani <[email protected]>
+
+description: |

Do not need '|' unless you need to preserve formatting.

Sure, I will drop it.

Quoted 12 lines

Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml line 20

Quoted 9 lines
Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml new file +8 -0
+  The Low Voltage Differential Signaling Controller (LVDSC) manages data
+  format conversion from the LCD Controller internal DPI bus to OpenLDI
+  LVDS output signals. LVDSC functions include bit mapping, balanced mode
+  management, and serializer.
+
+properties:
+  compatible:
+    const: microchip,sam9x7-lvds

What is "x"? Wildcard? Then no, don't use it and instead use proper SoC version number.

The term 'X' doesn't serve as a wildcard; rather, it directly represents the name of the SoC series, I should use sam9x75,sam9x72 instead of sam9x7.

Quoted 11 lines
Quoted 11 lines
Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml new file +10 -0
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    items:
+      - description: Peripheral Bus Clock
Quoted 8 lines

Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml line 36

Quoted 6 lines
Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml new file +6 -0
+
+  clock-names:
+    items:
+      - const: pclk
+      - const: gclk
+    minItems: 1

No, you just said you have one clock.

Certainly, I need to exclude the gclk. Thanks.

Quoted 19 lines
Quoted 6 lines
Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml new file +5 -0
+
+required:
+  - compatible
+  - reg
+  - interrupts

Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml line 51

Quoted 10 lines
Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml new file +10 -0
+  - clocks
+  - clock-names
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/at91.h>
+    #include <dt-bindings/dma/at91.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>

This header is not used. Include only used ones (and missing interrupt).

Quoted 7 lines

Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml line 56

Quoted 5 lines
Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml new file +5 -0
+
+    lvds-controller@f8060000 {
+      compatible = "microchip,sam9x7-lvds";
+      reg = <0xf8060000 0x100>;
+      interrupts = <56 IRQ_TYPE_LEVEL_HIGH 0>;

What is "0"?

Please refer "Documentation/devicetree/bindings/interrupt-controller/atmel,aic.txt" The third cell is used to specify the irq priority from 0 (lowest) to 7(highest).

Signature · 2 lines
With Best Regards,
Dharma B.
Quoted 8 lines

Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml line 59

Quoted 4 lines
Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml new file +3 -0
+      clocks = <&pmc PMC_TYPE_PERIPHERAL 56>;
+      clock-names = "pclk";
+    };

Best regards,
Krzysztof

author maintainer
#4 lore raw

Re: [PATCH 1/3] dt-bindings: display: bridge: add sam9x7-lvds compatible

In reply to Conor Dooley

Hi Conor,

Quoted 45 lines · Conor Dooley
Quoted 34 lines · Krzysztof Kozlowski
Quoted 17 lines · Dharma Balasubiramani

Add the 'sam9x7-lvds' compatible binding, which describes the Low Voltage Differential Signaling (LVDS) Controller found on Microchip's sam9x7 series System-on-Chip (SoC) devices. This binding will be used to define the properties and configuration for the LVDS Controller in DT.

---
  .../display/bridge/microchip,sam9x7-lvds.yaml | 59 +++++++++++++++++++
  1 file changed, 59 insertions(+)

create mode 100644 Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml

Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml new file +0 -0
new file mode 100644
index 000000000000..8c2c5b858c85

Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml line 7

Quoted 7 lines
Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml new file +7 -0
@@ -0,0 +1,59 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id:http://devicetree.org/schemas/display/bridge/microchip,sam9x7-lvds.yaml#
+$schema:http://devicetree.org/meta-schemas/core.yaml#
+
+title: Microchip SAM9X7 LVDS Controller

What is the "X"?

Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml line 12

Quoted 5 lines
Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml new file +5 -0
+
+maintainers:
+  - Dharma Balasubiramani<[email protected]>
+
+description: |

Do not need '|' unless you need to preserve formatting.

Quoted 10 lines

Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml line 20

Quoted 8 lines
Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml new file +8 -0
+  The Low Voltage Differential Signaling Controller (LVDSC) manages data
+  format conversion from the LCD Controller internal DPI bus to OpenLDI
+  LVDS output signals. LVDSC functions include bit mapping, balanced mode
+  management, and serializer.
+
+properties:
+  compatible:
+    const: microchip,sam9x7-lvds

What is "x"? Wildcard? Then no, don't use it and instead use proper SoC version number.

Quoted 7 lines

These SoCs actually do have an x in their name. However, and I do always get confused here, the sam9x7 is a series of SoCs (the cover letter does say this) rather than a specific device.
I think the series current consists of a sam9x70 sam9x72 and a sam9x75. The devices are largely similar, but I am not sure if the sam9x70 supports LVDS at all. Having a compatible for the series does not seem correct to me.

Yes, you are correct. Only sam9x72 and sam9x75 have LVDS support, while sam9x70 does not. I will revise the compatibility to include both sam9x72 and sam9x75, as outlined below:

properties:
compatible:
enum:
- microchip,sam9x72-lvds
- microchip,sam9x75-lvds

Additionally, I will update the driver accordingly. Thank you.

Signature · 2 lines
With Best Regards,
Dharma B.
Quoted 3 lines

Cheers,
Conor.

author maintainer
#12 lore raw

Re: [PATCH 2/3] drm/bridge: add lvds controller support for sam9x7

In reply to Krzysztof Kozlowski

Hi Krzysztof,

Quoted 31 lines · Krzysztof Kozlowski

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

Quoted 11 lines · Dharma Balasubiramani

Add a new LVDS controller driver for sam9x7 which does the following:
- Prepares and enables the LVDS Peripheral clock
- Defines its connector type as DRM_MODE_CONNECTOR_LVDS and adds itself to the global bridge list.
- Identifies its output endpoint as panel and adds it to the encoder display pipeline
- Enables the LVDS serializer

---

...

Quoted 14 lines
drivers/gpu/drm/bridge/microchip-lvds.c new file +14 -0
+
+static int mchp_lvds_probe(struct platform_device *pdev)
+{
+     struct device *dev = &pdev->dev;
+     struct mchp_lvds *lvds;
+     struct resource *res;
+     struct device_node *port;
+     int ret;
+
+     if (!dev->of_node)
+             return -ENODEV;
+
+     lvds = devm_kzalloc(&pdev->dev, sizeof(*lvds), GFP_KERNEL);
+     if (!lvds)
Quoted 8 lines

drivers/gpu/drm/bridge/microchip-lvds.c line 171

Quoted 6 lines
drivers/gpu/drm/bridge/microchip-lvds.c new file +6 -0
+             return -ENOMEM;
+
+     lvds->dev = dev;
+
+     res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+     lvds->regs = devm_ioremap_resource(lvds->dev, res);

Why not combining these two?

It seems reasonable to combine these two lines since the resource variable (res) is only used at this point. I'll proceed with consolidating these lines for simplicity.

Quoted 9 lines

drivers/gpu/drm/bridge/microchip-lvds.c line 177

Quoted 7 lines
drivers/gpu/drm/bridge/microchip-lvds.c new file +6 -0
+     if (IS_ERR(lvds->regs))
+             return PTR_ERR(lvds->regs);
+
+     lvds->pclk = devm_clk_get(lvds->dev, "pclk");
+     if (IS_ERR(lvds->pclk)) {
+             DRM_DEV_ERROR(lvds->dev, "could not get pclk_lvds\n");

Handle properly deferred probe. What's DRM wrapper over dev_err_probe()?

Sure, I will use dev_err_probe()

return dev_err_probe(lvds->dev, PTR_ERR(lvds->pclk), "could not get pclk_lvds\n");

Quoted 17 lines
Quoted 17 lines
drivers/gpu/drm/bridge/microchip-lvds.c new file +16 -0
+             return PTR_ERR(lvds->pclk);
+     }
+
+     ret = clk_prepare(lvds->pclk);
+     if (ret < 0) {
+             DRM_DEV_ERROR(lvds->dev, "failed to prepare pclk_lvds\n");
+             return ret;
+     }
+
+     port = of_graph_get_remote_node(dev->of_node, 1, 0);
+     if (!port) {
+             DRM_DEV_ERROR(dev,
+                           "can't find port point, please init lvds panel port!\n");
+             return -EINVAL;
+     }
+
Quoted 8 lines

drivers/gpu/drm/bridge/microchip-lvds.c line 199

Quoted 6 lines
drivers/gpu/drm/bridge/microchip-lvds.c new file +6 -0
+     lvds->panel = of_drm_find_panel(port);
+     of_node_put(port);
+
+     if (IS_ERR(lvds->panel)) {
+             DRM_DEV_ERROR(dev, "failed to find panel node\n");
+             return -EPROBE_DEFER;

OK, that's for sure wrong. Don't print anything on deferred probe.

Sure, I will drop the print here.

Quoted 49 lines
Quoted 49 lines
drivers/gpu/drm/bridge/microchip-lvds.c new file +48 -0
+     }
+
+     lvds->panel_bridge = devm_drm_panel_bridge_add(dev, lvds->panel);
+
+     if (IS_ERR(lvds->panel_bridge))
+             return PTR_ERR(lvds->panel_bridge);
+
+     lvds->bridge.of_node = dev->of_node;
+     lvds->bridge.type = DRM_MODE_CONNECTOR_LVDS;
+     lvds->bridge.funcs = &mchp_lvds_bridge_funcs;
+
+     dev_set_drvdata(dev, lvds);
+     pm_runtime_enable(dev);
+
+     drm_bridge_add(&lvds->bridge);
+
+     return 0;
+}
+
+static int mchp_lvds_remove(struct platform_device *pdev)
+{
+     struct mchp_lvds *lvds = platform_get_drvdata(pdev);
+
+     pm_runtime_disable(&pdev->dev);
+     clk_unprepare(lvds->pclk);
+
+     return 0;
+}
+
+static const struct of_device_id mchp_lvds_dt_ids[] = {
+     {
+             .compatible = "microchip,sam9x7-lvds",
+     },
+     {},
+};
+
+struct platform_driver mchp_lvds_driver = {
+     .probe = mchp_lvds_probe,
+     .remove = mchp_lvds_remove,
+     .driver = {
+                .name = "microchip-lvds",
+                .of_match_table = mchp_lvds_dt_ids,
+     },
+};
+module_platform_driver(mchp_lvds_driver);
+
+MODULE_AUTHOR("Manikandan Muralidharan <[email protected]>");
+MODULE_AUTHOR("Dharma Balasubiramani <[email protected]>");
Quoted 8 lines

drivers/gpu/drm/bridge/microchip-lvds.c line 250

Quoted 3 lines
drivers/gpu/drm/bridge/microchip-lvds.c new file +3 -0
+MODULE_DESCRIPTION("Low Voltage Differential Signaling Controller Driver");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:microchip-lvds");

You should not need MODULE_ALIAS() in normal cases. If you need it, usually it means your device ID table is wrong (e.g. misses either entries or MODULE_DEVICE_TABLE()). MODULE_ALIAS() is not a substitute for incomplete ID table.

Okay, I will remove the MODULE_ALIAS and update the mchp_lvds_dt_ids[] as below along with MODULE_DEVICE_TABLE()

static const struct of_device_id mchp_lvds_dt_ids[] = {
         {
                 .compatible = "microchip,sam9x72-lvds",
         },
         {
                 .compatible = "microchip,sam9x75-lvds",
         },
         {},
};

MODULE_DEVICE_TABLE(of, mchp_lvds_dt_ids);

Signature · 2 lines
Thanks,
Dharma B.
Quoted 5 lines

Best regards,
Krzysztof

maintainer
#5 lore raw

Re: [PATCH 1/3] dt-bindings: display: bridge: add sam9x7-lvds compatible

In reply to [email protected]
Quoted 59 lines · On Tue, Jan 23, 2024 at 03:39:13AM +0000, [email protected] wrote:

Hi Conor,

Quoted 45 lines · Conor Dooley
Quoted 34 lines · Krzysztof Kozlowski
Quoted 17 lines · Dharma Balasubiramani

Add the 'sam9x7-lvds' compatible binding, which describes the Low Voltage Differential Signaling (LVDS) Controller found on Microchip's sam9x7 series System-on-Chip (SoC) devices. This binding will be used to define the properties and configuration for the LVDS Controller in DT.

---
  .../display/bridge/microchip,sam9x7-lvds.yaml | 59 +++++++++++++++++++
  1 file changed, 59 insertions(+)

create mode 100644 Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml

Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml new file +0 -0
new file mode 100644
index 000000000000..8c2c5b858c85

Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml line 7

Quoted 7 lines
Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml new file +7 -0
@@ -0,0 +1,59 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id:http://devicetree.org/schemas/display/bridge/microchip,sam9x7-lvds.yaml#
+$schema:http://devicetree.org/meta-schemas/core.yaml#
+
+title: Microchip SAM9X7 LVDS Controller

What is the "X"?

Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml line 12

Quoted 5 lines
Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml new file +5 -0
+
+maintainers:
+  - Dharma Balasubiramani<[email protected]>
+
+description: |

Do not need '|' unless you need to preserve formatting.

Quoted 10 lines

Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml line 20

Quoted 8 lines
Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml new file +8 -0
+  The Low Voltage Differential Signaling Controller (LVDSC) manages data
+  format conversion from the LCD Controller internal DPI bus to OpenLDI
+  LVDS output signals. LVDSC functions include bit mapping, balanced mode
+  management, and serializer.
+
+properties:
+  compatible:
+    const: microchip,sam9x7-lvds

What is "x"? Wildcard? Then no, don't use it and instead use proper SoC version number.

Quoted 7 lines

These SoCs actually do have an x in their name. However, and I do always get confused here, the sam9x7 is a series of SoCs (the cover letter does say this) rather than a specific device.
I think the series current consists of a sam9x70 sam9x72 and a sam9x75. The devices are largely similar, but I am not sure if the sam9x70 supports LVDS at all. Having a compatible for the series does not seem correct to me.

Yes, you are correct. Only sam9x72 and sam9x75 have LVDS support, while sam9x70 does not. I will revise the compatibility to include both sam9x72 and sam9x75, as outlined below:

Quoted 5 lines

properties:
compatible:
enum:
- microchip,sam9x72-lvds
- microchip,sam9x75-lvds

I would presume these 2 are the same, but the above implies they aren't. I think what you had is fine assuming these are all fundamentally the same part with just packaging or fused off h/w differences.

Rob

author maintainer
#6 lore raw

Re: [PATCH 1/3] dt-bindings: display: bridge: add sam9x7-lvds compatible

Quoted 68 lines · Rob Herring

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

Quoted 59 lines · On Tue, Jan 23, 2024 at 03:39:13AM +0000, [email protected] wrote:

Hi Conor,

Quoted 45 lines · Conor Dooley
Quoted 34 lines · Krzysztof Kozlowski
Quoted 17 lines · Dharma Balasubiramani

Add the 'sam9x7-lvds' compatible binding, which describes the Low Voltage Differential Signaling (LVDS) Controller found on Microchip's sam9x7 series System-on-Chip (SoC) devices. This binding will be used to define the properties and configuration for the LVDS Controller in DT.

---
   .../display/bridge/microchip,sam9x7-lvds.yaml | 59 +++++++++++++++++++
   1 file changed, 59 insertions(+)

create mode 100644 Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml

Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml new file +0 -0
new file mode 100644
index 000000000000..8c2c5b858c85

Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml line 7

Quoted 7 lines
Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml new file +7 -0
@@ -0,0 +1,59 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id:http://devicetree.org/schemas/display/bridge/microchip,sam9x7-lvds.yaml#
+$schema:http://devicetree.org/meta-schemas/core.yaml#
+
+title: Microchip SAM9X7 LVDS Controller

What is the "X"?

Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml line 12

Quoted 5 lines
Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml new file +5 -0
+
+maintainers:
+  - Dharma Balasubiramani<[email protected]>
+
+description: |

Do not need '|' unless you need to preserve formatting.

Quoted 10 lines

Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml line 20

Quoted 8 lines
Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml new file +8 -0
+  The Low Voltage Differential Signaling Controller (LVDSC) manages data
+  format conversion from the LCD Controller internal DPI bus to OpenLDI
+  LVDS output signals. LVDSC functions include bit mapping, balanced mode
+  management, and serializer.
+
+properties:
+  compatible:
+    const: microchip,sam9x7-lvds

What is "x"? Wildcard? Then no, don't use it and instead use proper SoC version number.

Quoted 7 lines

These SoCs actually do have an x in their name. However, and I do always get confused here, the sam9x7 is a series of SoCs (the cover letter does say this) rather than a specific device.
I think the series current consists of a sam9x70 sam9x72 and a sam9x75. The devices are largely similar, but I am not sure if the sam9x70 supports LVDS at all. Having a compatible for the series does not seem correct to me.

Yes, you are correct. Only sam9x72 and sam9x75 have LVDS support, while sam9x70 does not. I will revise the compatibility to include both sam9x72 and sam9x75, as outlined below:

Quoted 5 lines

properties:
compatible:
enum:
- microchip,sam9x72-lvds
- microchip,sam9x75-lvds

Quoted 4 lines

I would presume these 2 are the same, but the above implies they aren't. I think what you had is fine assuming these are all fundamentally the same part with just packaging or fused off h/w differences.

Yes, so is it okay to have compatible for a series? Shall I go ahead with "
compatible:
const: microchip,sam9x7-lvds
"
itself?

Signature · 2 lines
Thanks,
Dharma B.
Quoted 2 lines

Rob

#7 lore raw

Re: [PATCH 1/3] dt-bindings: display: bridge: add sam9x7-lvds compatible

Quoted 74 lines · On 01/02/2024 05:10, [email protected] wrote:
Quoted 68 lines · Rob Herring

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

Quoted 59 lines · On Tue, Jan 23, 2024 at 03:39:13AM +0000, [email protected] wrote:

Hi Conor,

Quoted 45 lines · Conor Dooley
Quoted 34 lines · Krzysztof Kozlowski
Quoted 17 lines · Dharma Balasubiramani

Add the 'sam9x7-lvds' compatible binding, which describes the Low Voltage Differential Signaling (LVDS) Controller found on Microchip's sam9x7 series System-on-Chip (SoC) devices. This binding will be used to define the properties and configuration for the LVDS Controller in DT.

---
   .../display/bridge/microchip,sam9x7-lvds.yaml | 59 +++++++++++++++++++
   1 file changed, 59 insertions(+)

create mode 100644 Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml

Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml new file +0 -0
new file mode 100644
index 000000000000..8c2c5b858c85

Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml line 7

Quoted 7 lines
Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml new file +7 -0
@@ -0,0 +1,59 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id:http://devicetree.org/schemas/display/bridge/microchip,sam9x7-lvds.yaml#
+$schema:http://devicetree.org/meta-schemas/core.yaml#
+
+title: Microchip SAM9X7 LVDS Controller

What is the "X"?

Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml line 12

Quoted 5 lines
Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml new file +5 -0
+
+maintainers:
+  - Dharma Balasubiramani<[email protected]>
+
+description: |

Do not need '|' unless you need to preserve formatting.

Quoted 10 lines

Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml line 20

Quoted 8 lines
Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml new file +8 -0
+  The Low Voltage Differential Signaling Controller (LVDSC) manages data
+  format conversion from the LCD Controller internal DPI bus to OpenLDI
+  LVDS output signals. LVDSC functions include bit mapping, balanced mode
+  management, and serializer.
+
+properties:
+  compatible:
+    const: microchip,sam9x7-lvds

What is "x"? Wildcard? Then no, don't use it and instead use proper SoC version number.

Quoted 7 lines

These SoCs actually do have an x in their name. However, and I do always get confused here, the sam9x7 is a series of SoCs (the cover letter does say this) rather than a specific device.
I think the series current consists of a sam9x70 sam9x72 and a sam9x75. The devices are largely similar, but I am not sure if the sam9x70 supports LVDS at all. Having a compatible for the series does not seem correct to me.

Yes, you are correct. Only sam9x72 and sam9x75 have LVDS support, while sam9x70 does not. I will revise the compatibility to include both sam9x72 and sam9x75, as outlined below:

Quoted 5 lines

properties:
compatible:
enum:
- microchip,sam9x72-lvds
- microchip,sam9x75-lvds

Quoted 4 lines

I would presume these 2 are the same, but the above implies they aren't. I think what you had is fine assuming these are all fundamentally the same part with just packaging or fused off h/w differences.

Quoted 4 lines

Yes, so is it okay to have compatible for a series? Shall I go ahead with "
compatible:
const: microchip,sam9x7-lvds

You said 9x70, which would match such 9x7 "series", is different, so I still think series should not be used. I don't know much about Microchip naming scheme, so this x is always confusing. However if these are the same, maybe just use sam9x72?

Best regards,
Krzysztof

author maintainer
#8 lore raw

Re: [PATCH 1/3] dt-bindings: display: bridge: add sam9x7-lvds compatible

Quoted 82 lines · Krzysztof Kozlowski

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

Quoted 74 lines · On 01/02/2024 05:10, [email protected] wrote:
Quoted 68 lines · Rob Herring

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

Quoted 59 lines · On Tue, Jan 23, 2024 at 03:39:13AM +0000, [email protected] wrote:

Hi Conor,

Quoted 45 lines · Conor Dooley
Quoted 34 lines · Krzysztof Kozlowski
Quoted 17 lines · Dharma Balasubiramani

Add the 'sam9x7-lvds' compatible binding, which describes the Low Voltage Differential Signaling (LVDS) Controller found on Microchip's sam9x7 series System-on-Chip (SoC) devices. This binding will be used to define the properties and configuration for the LVDS Controller in DT.

---
    .../display/bridge/microchip,sam9x7-lvds.yaml | 59 +++++++++++++++++++
    1 file changed, 59 insertions(+)

create mode 100644 Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml

Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml new file +0 -0
new file mode 100644
index 000000000000..8c2c5b858c85

Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml line 7

Quoted 7 lines
Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml new file +7 -0
@@ -0,0 +1,59 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id:http://devicetree.org/schemas/display/bridge/microchip,sam9x7-lvds.yaml#
+$schema:http://devicetree.org/meta-schemas/core.yaml#
+
+title: Microchip SAM9X7 LVDS Controller

What is the "X"?

Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml line 12

Quoted 5 lines
Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml new file +5 -0
+
+maintainers:
+  - Dharma Balasubiramani<[email protected]>
+
+description: |

Do not need '|' unless you need to preserve formatting.

Quoted 10 lines

Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml line 20

Quoted 8 lines
Documentation/devicetree/bindings/display/bridge/microchip,sam9x7-lvds.yaml new file +8 -0
+  The Low Voltage Differential Signaling Controller (LVDSC) manages data
+  format conversion from the LCD Controller internal DPI bus to OpenLDI
+  LVDS output signals. LVDSC functions include bit mapping, balanced mode
+  management, and serializer.
+
+properties:
+  compatible:
+    const: microchip,sam9x7-lvds

What is "x"? Wildcard? Then no, don't use it and instead use proper SoC version number.

Quoted 7 lines

These SoCs actually do have an x in their name. However, and I do always get confused here, the sam9x7 is a series of SoCs (the cover letter does say this) rather than a specific device.
I think the series current consists of a sam9x70 sam9x72 and a sam9x75. The devices are largely similar, but I am not sure if the sam9x70 supports LVDS at all. Having a compatible for the series does not seem correct to me.

Yes, you are correct. Only sam9x72 and sam9x75 have LVDS support, while sam9x70 does not. I will revise the compatibility to include both sam9x72 and sam9x75, as outlined below:

Quoted 5 lines

properties:
compatible:
enum:
- microchip,sam9x72-lvds
- microchip,sam9x75-lvds

Quoted 4 lines

I would presume these 2 are the same, but the above implies they aren't. I think what you had is fine assuming these are all fundamentally the same part with just packaging or fused off h/w differences.

Quoted 4 lines

Yes, so is it okay to have compatible for a series? Shall I go ahead with "
compatible:
const: microchip,sam9x7-lvds

Quoted 4 lines

You said 9x70, which would match such 9x7 "series", is different, so I still think series should not be used. I don't know much about Microchip naming scheme, so this x is always confusing. However if these are the same, maybe just use sam9x72?

sam9x75 is the first board to be available publicly; hence, I shall use the "microchip,sam9x75-lvds" compatible and reuse the same in other boards that (features same IP) will come later.

Quoted 4 lines

Best regards,
Krzysztof

Signature · 2 lines
With Best Regards,
Dharma B.
#13 lore raw

Re: [PATCH 2/3] drm/bridge: add lvds controller support for sam9x7

In reply to Dharma Balasubiramani
kernel test robot noticed the following build warnings:

Hi Dharma,

kernel test robot noticed the following build warnings:

[auto build test WARNING on drm-misc/drm-misc-next]
[also build test WARNING on linus/master v6.8-rc2 next-20240202] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Dharma-Balasubiramani/dt-bindings-display-bridge-add-sam9x7-lvds-compatible/20240122-163209
base:   git://anongit.freedesktop.org/drm/drm-misc drm-misc-next
patch link:    https://lore.kernel.org/r/20240122082947.21645-3-dharma.b%40microchip.com
patch subject: [PATCH 2/3] drm/bridge: add lvds controller support for sam9x7
config: arm-randconfig-r112-20240203 (https://download.01.org/0day-ci/archive/20240203/[email protected]/config)
compiler: arm-linux-gnueabi-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20240203/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

sparse warnings: (new ones prefixed by >>)

>> drivers/gpu/drm/bridge/microchip-lvds.c:236:24: sparse: sparse: symbol 'mchp_lvds_driver' was not declared. Should it be static?

vim +/mchp_lvds_driver +236 drivers/gpu/drm/bridge/microchip-lvds.c

235

 > 236	struct platform_driver mchp_lvds_driver = {

237 .probe = mchp_lvds_probe,
238 .remove = mchp_lvds_remove,
239 .driver = {
240 .name = "microchip-lvds",
241 .of_match_table = mchp_lvds_dt_ids,
242 },
243 };
244 module_platform_driver(mchp_lvds_driver);
245

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki