Skip to contentSkip to conversation

Dcumentation: bridge: Add documentation for ps8640 DT properties

RFC In review CK Hu 5 participants 10 messages Oct 16, 2015

Subsystems (6)
lore
Share & tools
lore

CK Hu

author
#0 lore raw

RFC 1/2 Dcumentation: bridge: Add documentation for ps8640 DT properties

From: Jitao Shi <jitao.shi-NuS5LvNUpcJWk0Htik3J/[email protected]>

Add documentation for DT properties supported by ps8640 DSI-eDP converter.

---
 .../devicetree/bindings/video/bridge/ps8640.txt    |   48 ++++++++++++++++++++
 1 file changed, 48 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/video/bridge/ps8640.txt
Documentation/devicetree/bindings/video/bridge/ps8640.txt new file +48 -0
new file mode 100644
index 0000000..450b5df
@@ -0,0 +1,48 @@
+ps8640-bridge bindings
+
+Required properties:
+	- compatible: "parade,ps8640"
+	- reg: first i2c address of the bridge
+	- power-gpios: OF device-tree gpio specification for power pin.
+	- reset-gpios: OF device-tree gpio specification for reset pin.
+	- mode-sel-gpios: OF device-tree gpio specification for mode-sel pin.
+	- ps8640-1v2-supply: OF device-tree regulator specification for 1v2.
+	- ps8640-3v3-supply: OF device-tree regulator specification for 3v3.
+
+Optional properties:
+	- video interfaces: Device node can contain video interface port
+			    nodes for panel according to [1].
+
+[1]: Documentation/devicetree/bindings/media/video-interfaces.txt
+
+Example:
+	edp-bridge@18 {
+		compatible = "parade,ps8640";
+		reg = <0x18>;
+		power-gpios = <&pio 116 GPIO_ACTIVE_HIGH>;
+		reset-gpios = <&pio 115 GPIO_ACTIVE_HIGH>;
+		mode-sel-gpios = <&pio 92 GPIO_ACTIVE_HIGH>;
+		ps8640-1v2-supply = <&ps8640_fixed_1v2>;
+		ps8640-3v3-supply = <&mt6397_vgp2_reg>;
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			port@0 {
+				reg = <0>;
+
+				ps8640_in: endpoint {
+					remote-endpoint = <&dsi0_out>;
+				};
+			};
+
+			port@1 {
+				reg = <1>;
+
+				ps8640_out: endpoint {
+					remote-endpoint = <&panel_in>;
+				};
+			};
+		};
+	};
Signature · 6 lines
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
author
#1 lore raw

RFC 2/2 drm/bridge: Add I2C based driver for ps8640 bridge

From: Jitao Shi <[email protected]>

This patch adds drm_bridge driver for parade DSI
to eDP bridge chip.

---
 drivers/gpu/drm/bridge/Kconfig         |    9 +
 drivers/gpu/drm/bridge/Makefile        |    1 +
 drivers/gpu/drm/bridge/parade-ps8640.c |  489 ++++++++++++++++++++++++++++++++
 3 files changed, 499 insertions(+)
 create mode 100644 drivers/gpu/drm/bridge/parade-ps8640.c
drivers/gpu/drm/bridge/Kconfig +9 -0
index 2de52a5..8ecaeed 100644
@@ -29,4 +29,13 @@ config DRM_PARADE_PS8622
 	---help---
 	  Parade eDP-LVDS bridge chip driver.
 
+config DRM_PARADE_PS8640
+	bool "Parade PS8640 MIPI DSI to eDP Converter"
+	select DRM_KMS_HELPER
+	select DRM_PANEL
+	---help---
+	  Choose this option if you have PS8640 for display
+	  The PS8640 is a high-performance and low-power
+	  MIPI DSI to eDP converter
+
 endmenu
drivers/gpu/drm/bridge/Makefile +1 -0
index e2eef1c..da9e4a4 100644
@@ -3,3 +3,4 @@ ccflags-y := -Iinclude/drm
 obj-$(CONFIG_DRM_DW_HDMI) += dw_hdmi.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/parade-ps8640.c new file +489 -0

489 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#7 lore raw
In reply to CK Hu
Quoted 17 lines · CK Hu

From: Jitao Shi <[email protected]>

Add documentation for DT properties supported by ps8640 DSI-eDP converter.

---
 .../devicetree/bindings/video/bridge/ps8640.txt    |   48 ++++++++++++++++++++
 1 file changed, 48 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/video/bridge/ps8640.txt
Documentation/devicetree/bindings/video/bridge/ps8640.txt new file +0 -0
new file mode 100644
index 0000000..450b5df

Documentation/devicetree/bindings/video/bridge/ps8640.txt line 5

Quoted 5 lines
Documentation/devicetree/bindings/video/bridge/ps8640.txt new file +5 -0
@@ -0,0 +1,48 @@
+ps8640-bridge bindings
+
+Required properties:
+	- compatible: "parade,ps8640"
+	- reg: first i2c address of the bridge

Ther can be multiple addresses?

Documentation/devicetree/bindings/video/bridge/ps8640.txt line 10

Quoted 5 lines
Documentation/devicetree/bindings/video/bridge/ps8640.txt new file +5 -0
+	- power-gpios: OF device-tree gpio specification for power pin.
+	- reset-gpios: OF device-tree gpio specification for reset pin.
+	- mode-sel-gpios: OF device-tree gpio specification for mode-sel pin.
+	- ps8640-1v2-supply: OF device-tree regulator specification for 1v2.
+	- ps8640-3v3-supply: OF device-tree regulator specification for 3v3.

There's no need for the "ps8640-" prefix on these two. Please drop it.

Documentation/devicetree/bindings/video/bridge/ps8640.txt line 14

Quoted 3 lines
Documentation/devicetree/bindings/video/bridge/ps8640.txt new file +3 -0
+Optional properties:
+	- video interfaces: Device node can contain video interface port
+			    nodes for panel according to [1].

Replace this part with:

The device node can contain video interface port nodes per the video-interfaces binding [1].

Thanks,
Mark.

Quoted 37 lines
Documentation/devicetree/bindings/video/bridge/ps8640.txt new file +34 -0
+
+[1]: Documentation/devicetree/bindings/media/video-interfaces.txt
+
+Example:
+	edp-bridge@18 {
+		compatible = "parade,ps8640";
+		reg = <0x18>;
+		power-gpios = <&pio 116 GPIO_ACTIVE_HIGH>;
+		reset-gpios = <&pio 115 GPIO_ACTIVE_HIGH>;
+		mode-sel-gpios = <&pio 92 GPIO_ACTIVE_HIGH>;
+		ps8640-1v2-supply = <&ps8640_fixed_1v2>;
+		ps8640-3v3-supply = <&mt6397_vgp2_reg>;
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			port@0 {
+				reg = <0>;
+
+				ps8640_in: endpoint {
+					remote-endpoint = <&dsi0_out>;
+				};
+			};
+
+			port@1 {
+				reg = <1>;
+
+				ps8640_out: endpoint {
+					remote-endpoint = <&panel_in>;
+				};
+			};
+		};
+	};
Signature · 1 line
1.7.9.5
#2 lore raw

Re: [RFC 2/2] drm/bridge: Add I2C based driver for ps8640 bridge

In reply to CK Hu

drivers/gpu/drm/bridge/parade-ps8640.c line 355

Quoted 2 lines
drivers/gpu/drm/bridge/parade-ps8640.c new file +2 -0
+	/* FIXME - use of_graph_get_port_by_id(np, 1) on newer kernels */
+	in_ep = of_graph_get_next_endpoint(np, NULL);

Huh?

drivers/gpu/drm/bridge/parade-ps8640.c line 373

Quoted 1 line
drivers/gpu/drm/bridge/parade-ps8640.c new file +1 -0
+	edidp = of_get_property(np, "edid", &size);

This property wasn't mentioned in the binding document.

Please describe it. If it's from a more generic binding, refer to that from the binding document.

Thanks,
Mark.

#8 lore raw
In reply to CK Hu

Hi CK,

there is a typo in the subject: s/Dcumentation/Documentation/.

Am Freitag, den 16.10.2015, 20:15 +0800 schrieb CK Hu:

Quoted 6 lines

From: Jitao Shi <[email protected]>

Add documentation for DT properties supported by ps8640 DSI-eDP converter.

[...]

Documentation/devicetree/bindings/video/bridge/ps8640.txt line 10

Quoted 2 lines
Documentation/devicetree/bindings/video/bridge/ps8640.txt new file +2 -0
+	- ps8640-1v2-supply: OF device-tree regulator specification for 1v2.
+	- ps8640-3v3-supply: OF device-tree regulator specification for 3v3.

The ps8640- part of the regulator supply property names is redundant. The PS8622 driver uses vdd12-supply as its regulator. Should we strive for consistency here? Or if you have access to the datasheet, how are these inputs called there?

Documentation/devicetree/bindings/video/bridge/ps8640.txt line 16

Quoted 6 lines
Documentation/devicetree/bindings/video/bridge/ps8640.txt new file +6 -0
+
+Optional properties:
+	- video interfaces: Device node can contain video interface port
+			    nodes for panel according to [1].
+
+[1]: Documentation/devicetree/bindings/media/video-interfaces.txt

It should be documented here that port at 0 is the input port and port at 1 is the output port.

best regards
Philipp

#9 lore raw
In reply to CK Hu
Quoted 8 lines · CK Hu

From: Jitao Shi <jitao.shi-NuS5LvNUpcJWk0Htik3J/[email protected]>

Add documentation for DT properties supported by ps8640 DSI-eDP converter.

---
 .../devicetree/bindings/video/bridge/ps8640.txt    |   48 ++++++++++++++++++++

Please move to bindings/display/bridge/.

Quoted 9 lines
 1 file changed, 48 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/video/bridge/ps8640.txt
Documentation/devicetree/bindings/video/bridge/ps8640.txt new file +0 -0
new file mode 100644
index 0000000..450b5df

Documentation/devicetree/bindings/video/bridge/ps8640.txt line 10

Quoted 10 lines
Documentation/devicetree/bindings/video/bridge/ps8640.txt new file +10 -0
@@ -0,0 +1,48 @@
+ps8640-bridge bindings
+
+Required properties:
+       - compatible: "parade,ps8640"
+       - reg: first i2c address of the bridge
+       - power-gpios: OF device-tree gpio specification for power pin.
+       - reset-gpios: OF device-tree gpio specification for reset pin.
+       - mode-sel-gpios: OF device-tree gpio specification for mode-sel pin.
+       - ps8640-1v2-supply: OF device-tree regulator specification for 1v2.
+       - ps8640-3v3-supply: OF device-tree regulator specification for 3v3.

As others have said, I would drop the part number and name them based on the supply name (e.g. vdd?, vcore?).

Documentation/devicetree/bindings/video/bridge/ps8640.txt line 14

Quoted 4 lines
Documentation/devicetree/bindings/video/bridge/ps8640.txt new file +4 -0
+
+Optional properties:
+       - video interfaces: Device node can contain video interface port
+                           nodes for panel according to [1].

I don't think this should be optional.

Quoted 35 lines
Documentation/devicetree/bindings/video/bridge/ps8640.txt new file +34 -1
+
+[1]: Documentation/devicetree/bindings/media/video-interfaces.txt
+
+Example:
+       edp-bridge@18 {
+               compatible = "parade,ps8640";
+               reg = <0x18>;
+               power-gpios = <&pio 116 GPIO_ACTIVE_HIGH>;
+               reset-gpios = <&pio 115 GPIO_ACTIVE_HIGH>;
+               mode-sel-gpios = <&pio 92 GPIO_ACTIVE_HIGH>;
+               ps8640-1v2-supply = <&ps8640_fixed_1v2>;
+               ps8640-3v3-supply = <&mt6397_vgp2_reg>;
+
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       port@0 {
+                               reg = <0>;
+
+                               ps8640_in: endpoint {
+                                       remote-endpoint = <&dsi0_out>;
+                               };
+                       };
+
+                       port@1 {
+                               reg = <1>;
+
+                               ps8640_out: endpoint {
+                                       remote-endpoint = <&panel_in>;
+                               };
+                       };
+               };
+       };
--
Quoted 2 lines

1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw

Re: [RFC 2/2] drm/bridge: Add I2C based driver for ps8640 bridge

In reply to Mark Rutland
Quoted 11 lines · Mark Rutland

drivers/gpu/drm/bridge/parade-ps8640.c line 355

Quoted 2 lines
drivers/gpu/drm/bridge/parade-ps8640.c new file +2 -0
+     /* FIXME - use of_graph_get_port_by_id(np, 1) on newer kernels */
+     in_ep = of_graph_get_next_endpoint(np, NULL);

Huh?

Quoted 1 line

+ edidp = of_get_property(np, "edid", &size);

This property wasn't mentioned in the binding document.

Please describe it. If it's from a more generic binding, refer to that from the binding document.

It should be generic, but currently documented in individual drivers. I also think this is not the right location in the DT for this property. It should be part of the panel or connector node instead.

Rob

#4 lore raw

Re: [RFC 2/2] drm/bridge: Add I2C based driver for ps8640 bridge

In reply to CK Hu
url: https://github.com/0day-ci/linux/commits/CK-Hu/Dcumentation-bridge-Add-documentation-for-ps8640-DT-properties/20151016-201658

Hi Jitao,

[auto build test WARNING on drm-exynos/exynos-drm/for-next -- if it's inappropriate base, please suggest rules for selecting the more suitable base]

url: https://github.com/0day-ci/linux/commits/CK-Hu/Dcumentation-bridge-Add-documentation-for-ps8640-DT-properties/20151016-201658

coccinelle warnings: (new ones prefixed by >>)

>> drivers/gpu/drm/bridge/parade-ps8640.c:480:3-8: No need to set .owner here. The core will do it.

Please review and possibly fold the followup patch.

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#5 lore raw

[PATCH] drm/bridge: fix platform_no_drv_owner.cocci warnings

In reply to CK Hu
drivers/gpu/drm/bridge/parade-ps8640.c:480:3-8: No need to set .owner here. The core will do it.

drivers/gpu/drm/bridge/parade-ps8640.c:480:3-8: No need to set .owner here. The core will do it.

Remove .owner field if calls are used which set it automatically

Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci

---

 parade-ps8640.c |    1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/bridge/parade-ps8640.c +0 -1
@@ -477,7 +477,6 @@ static struct i2c_driver ps8640_driver =
 	.remove = ps8640_remove,
 	.driver = {
 		.name = "parade,ps8640",
-		.owner = THIS_MODULE,
 		.of_match_table = ps8640_match,
 	},
 };
#6 lore raw

Re: [RFC 2/2] drm/bridge: Add I2C based driver for ps8640 bridge

In reply to CK Hu
reproduce: wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # save the attached .config to linux build tree…

Hi Jitao,

[auto build test ERROR on drm-exynos/exynos-drm/for-next -- if it's inappropriate base, please suggest rules for selecting the more suitable base]

url:    https://github.com/0day-ci/linux/commits/CK-Hu/Dcumentation-bridge-Add-documentation-for-ps8640-DT-properties/20151016-201658
config: s390-allmodconfig (attached as .config)

reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=s390

All errors (new ones prefixed by >>):

drivers/gpu/drm/bridge/parade-ps8640.c: In function 'ps8640_prepare':

>> drivers/gpu/drm/bridge/parade-ps8640.c:178:2: error: implicit declaration of function 'gpiod_set_value' [-Werror=implicit-function-declaration]
     gpiod_set_value(ps_bridge->gpio_pwr_n, 1);
     ^
   drivers/gpu/drm/bridge/parade-ps8640.c: In function 'ps8640_probe':
>> drivers/gpu/drm/bridge/parade-ps8640.c:391:2: error: implicit declaration of function 'devm_gpiod_get' [-Werror=implicit-function-declaration]
     ps_bridge->gpio_mode_sel_n = devm_gpiod_get(&client->dev, "mode-sel",
     ^
>> drivers/gpu/drm/bridge/parade-ps8640.c:392:11: error: 'GPIOD_OUT_HIGH' undeclared (first use in this function)
              GPIOD_OUT_HIGH);
              ^
   drivers/gpu/drm/bridge/parade-ps8640.c:392:11: note: each undeclared identifier is reported only once for each function it appears in
>> drivers/gpu/drm/bridge/parade-ps8640.c:399:2: error: implicit declaration of function 'gpiod_direction_output' [-Werror=implicit-function-declaration]
     ret = gpiod_direction_output(ps_bridge->gpio_mode_sel_n, 1);
     ^

cc1: some warnings being treated as errors

vim +/gpiod_set_value +178 drivers/gpu/drm/bridge/parade-ps8640.c

172 err = regulator_enable(ps_bridge->pwr_3v3_supply);
173 if (err < 0) {
174 DRM_ERROR("failed to enable pwr_3v3_supply: %d\n", err);
175 return;
176 }
177

 > 178		gpiod_set_value(ps_bridge->gpio_pwr_n, 1);

179 gpiod_set_value(ps_bridge->gpio_rst_n, 0);
180 usleep_range(500, 700);
181 gpiod_set_value(ps_bridge->gpio_rst_n, 1);

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation