ARM: dts: sun6i: hummingbird-a31: Enable display output through VGA bridge
Subsystems (5)
v4 cover ARM: dts: sun6i: hummingbird-a31: Enable display output through VGA bridge
Hi,
This is v4 of my sun6i DRM/KMS display enablement series. It adds regulator support to the dumb-vga-dac bridge and enables the VGA output on the A31 Hummingbird.
Changes since v3:
- Add Rob's Ack.
- Fix up enable/disable callbacks as Archit suggested.
- Dropped pinmux settings for GPIO pin.
Changes since v2:
- Changed the enable-gpio of dumb-vga-dac to vdd-supply regulator. This better matches the hardware that I have: the DAC has a fixed regulator dropping the voltage from the board-wide 5V to 3.3V the DAC uses. The regulator is controlled through a GPIO pin.
- Renamed the node of the VGA connector from "vga" to "vga-connector".
- Renamed the node of the VGA DAC from "bridge" to "vga-dac".
Regards
ChenYu
Chen-Yu Tsai (2):
drm/bridge: dumb-vga-dac: Support a VDD regulator supply
ARM: dts: sun6i: hummingbird-a31: Enable display output through VGA
bridge
.../bindings/display/bridge/dumb-vga-dac.txt | 2 + arch/arm/boot/dts/sun6i-a31-hummingbird.dts | 67 ++++++++++++++++++++++ drivers/gpu/drm/bridge/dumb-vga-dac.c | 35 +++++++++++ 3 files changed, 104 insertions(+)
Signature · 1 line
2.10.2
PATCH v4 1/2 drm/bridge: dumb-vga-dac: Support a VDD regulator supply
Some dumb VGA DACs are active components which require external power. Add support for specifying a regulator as its power supply.
--- .../bindings/display/bridge/dumb-vga-dac.txt | 2 ++ drivers/gpu/drm/bridge/dumb-vga-dac.c | 35 ++++++++++++++++++++++ 2 files changed, 37 insertions(+)
Documentation/devicetree/bindings/display/bridge/dumb-vga-dac.txt +2 -0
@@ -16,6 +16,8 @@ graph bindings specified in Documentation/devicetree/bindings/graph.txt. - Video port 0 for RGB input - Video port 1 for VGA output +Optional properties: +- vdd-supply: Power supply for DAC Example -------
drivers/gpu/drm/bridge/dumb-vga-dac.c +35 -0
@@ -12,6 +12,7 @@#include <linux/module.h> #include <linux/of_graph.h> +#include <linux/regulator/consumer.h> #include <drm/drmP.h> #include <drm/drm_atomic_helper.h>
@@ -23,6 +24,7 @@ struct dumb_vga {struct drm_connector connector;struct i2c_adapter *ddc; +struct regulator *vdd; }; static inline struct dumb_vga *
@@ -124,8 +126,32 @@ static int dumb_vga_attach(struct drm_bridge *bridge)return 0 ; } +static void dumb_vga_enable (struct drm_bridge *bridge) +{ +struct dumb_vga *vga =drm_bridge_to_dumb_vga (bridge); +int ret =0 ; + +if (vga->vdd) + ret =regulator_enable (vga->vdd); + +if (ret) { +DRM_ERROR ("Failed to enable vdd regulator: %d\n" , ret); +return ; + } +} + +static void dumb_vga_disable (struct drm_bridge *bridge) +{ +struct dumb_vga *vga =drm_bridge_to_dumb_vga (bridge); + +if (vga->vdd) +regulator_disable (vga->vdd); +} +static const struct drm_bridge_funcs dumb_vga_bridge_funcs = { .attach = dumb_vga_attach, + .enable = dumb_vga_enable, + .disable = dumb_vga_disable, };static struct i2c_adapter *dumb_vga_retrieve_ddc (struct device *dev)
@@ -169,6 +195,15 @@ static int dumb_vga_probe(struct platform_device *pdev)return -ENOMEM ;platform_set_drvdata (pdev, vga); + vga->vdd =devm_regulator_get_optional (&pdev->dev,"vdd" ); +if (IS_ERR (vga->vdd)) { + ret =PTR_ERR (vga->vdd); +if (ret == -EPROBE_DEFER ) +return -EPROBE_DEFER ; + vga->vdd =NULL ; +dev_dbg (&pdev->dev,"No vdd regulator found: %d\n" , ret); + } + vga->ddc =dumb_vga_retrieve_ddc (&pdev->dev);if (IS_ERR (vga->ddc)) {if (PTR_ERR (vga->ddc) == -ENODEV ) {
Signature · 6 lines
2.10.2 -- 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
Re: [PATCH v4 1/2] drm/bridge: dumb-vga-dac: Support a VDD regulator supply
Hi,
Thanks for the patch.
Quoted 48 lines · Chen-Yu Tsai
Some dumb VGA DACs are active components which require external power. Add support for specifying a regulator as its power supply.
Signed-off-by Chen-Yu Tsai <[email protected]>Acked-by Rob Herring <[email protected]>--- .../bindings/display/bridge/dumb-vga-dac.txt | 2 ++ drivers/gpu/drm/bridge/dumb-vga-dac.c | 35 ++++++++++++++++++++++ 2 files changed, 37 insertions(+)Documentation/devicetree/bindings/display/bridge/dumb-vga-dac.txt +2
-0@@ -16,6 +16,8 @@ graph bindings specified in Documentation/devicetree/bindings/graph.txt. - Video port 0 for RGB input - Video port 1 for VGA output +Optional properties: +- vdd-supply: Power supply for DAC Example -------drivers/gpu/drm/bridge/dumb-vga-dac.c +3
-0@@ -12,6 +12,7 @@#include <linux/module.h> #include <linux/of_graph.h> +#include <linux/regulator/consumer.h> #include <drm/drmP.h> #include <drm/drm_atomic_helper.h> @@ -23,6 +24,7 @@ struct dumb_vga {struct drm_connector connector;struct i2c_adapter *ddc; +struct regulator *vdd; }; static inline struct dumb_vga *@@ -124,8 +126,32 @@ static int dumb_vga_attach(struct drm_bridge *bridge)return 0 ; } +static void dumb_vga_enable (struct drm_bridge *bridge)
drivers/gpu/drm/bridge/dumb-vga-dac.c static int dumb_vga_attach(struct drm_bridge *bridge) · line 139
Quoted 10 lines
drivers/gpu/drm/bridge/dumb-vga-dac.c +10
-0+{ +struct dumb_vga *vga =drm_bridge_to_dumb_vga (bridge); +int ret =0 ; + +if (vga->vdd) + ret =regulator_enable (vga->vdd); + +if (ret) { +DRM_ERROR ("Failed to enable vdd regulator: %d\n" , ret); +return ;
We don't need this return for now. If you're okay with it, can I fix this and queue to misc?
Thanks,
Archit
Quoted 35 lines
drivers/gpu/drm/bridge/dumb-vga-dac.c +22
-0+ } +} + +static void dumb_vga_disable (struct drm_bridge *bridge) +{ +struct dumb_vga *vga =drm_bridge_to_dumb_vga (bridge); + +if (vga->vdd) +regulator_disable (vga->vdd); +} +static const struct drm_bridge_funcs dumb_vga_bridge_funcs = { .attach = dumb_vga_attach, + .enable = dumb_vga_enable, + .disable = dumb_vga_disable, };static struct i2c_adapter *dumb_vga_retrieve_ddc (struct device *dev)@@ -169,6 +195,15 @@ static int dumb_vga_probe(struct platform_device *pdev)return -ENOMEM ;platform_set_drvdata (pdev, vga); + vga->vdd =devm_regulator_get_optional (&pdev->dev,"vdd" ); +if (IS_ERR (vga->vdd)) { + ret =PTR_ERR (vga->vdd); +if (ret == -EPROBE_DEFER ) +return -EPROBE_DEFER ; + vga->vdd =NULL ; +dev_dbg (&pdev->dev,"No vdd regulator found: %d\n" , ret); + } + vga->ddc =dumb_vga_retrieve_ddc (&pdev->dev);if (IS_ERR (vga->ddc)) {if (PTR_ERR (vga->ddc) == -ENODEV ) {
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
Re: [PATCH v4 1/2] drm/bridge: dumb-vga-dac: Support a VDD regulator supply
Quoted 59 lines · Archit Taneja
Hi,
Thanks for the patch.
Quoted 53 lines · Chen-Yu Tsai
Some dumb VGA DACs are active components which require external power. Add support for specifying a regulator as its power supply.
Signed-off-by Chen-Yu Tsai <[email protected]>Acked-by Rob Herring <[email protected]>--- .../bindings/display/bridge/dumb-vga-dac.txt | 2 ++ drivers/gpu/drm/bridge/dumb-vga-dac.c | 35 ++++++++++++++++++++++ 2 files changed, 37 insertions(+)diff --git
a/Documentation/devicetree/bindings/display/bridge/dumb-vga-dac.txtb/Documentation/devicetree/bindings/display/bridge/dumb-vga-dac.txtindex003bc246a270..164cbb15f04c100644Documentation/devicetree/bindings/display/bridge/dumb-vga-dac.txt +0
-0@@ -16,6 +16,8 @@ graph bindings specified in
Documentation/devicetree/bindings/graph.txt.
- Video port 0 for RGB input
- Video port 1 for VGA outputDocumentation/devicetree/bindings/display/bridge/dumb-vga-dac.txt +2
-0+Optional properties: +- vdd-supply: Power supply for DAC Example -------drivers/gpu/drm/bridge/dumb-vga-dac.c +2
-0@@ -12,6 +12,7 @@#include <linux/module.h> #include <linux/of_graph.h> +#include <linux/regulator/consumer.h> #include <drm/drmP.h> #include <drm/drm_atomic_helper.h> @@ -23,6 +24,7 @@ struct dumb_vga {struct drm_connector connector;struct i2c_adapter *ddc; +struct regulator *vdd; }; static inline struct dumb_vga *@@ -124,8 +126,32 @@ static int dumb_vga_attach(struct drm_bridge *bridge)return 0 ; }
Quoted 15 lines
drivers/gpu/drm/bridge/dumb-vga-dac.c static int dumb_vga_attach(struct drm_bridge *bridge) · line 139
Quoted 11 lines
drivers/gpu/drm/bridge/dumb-vga-dac.c +11
-0+static void dumb_vga_enable (struct drm_bridge *bridge) +{ +struct dumb_vga *vga =drm_bridge_to_dumb_vga (bridge); +int ret =0 ; + +if (vga->vdd) + ret =regulator_enable (vga->vdd); + +if (ret) { +DRM_ERROR ("Failed to enable vdd regulator: %d\n" , ret); +return ;We don't need this return for now. If you're okay with it, can I fix this and queue to misc?
Yes, please!
Thanks
ChenYu
Quoted 45 lines
Thanks,
ArchitQuoted 34 lines
drivers/gpu/drm/bridge/dumb-vga-dac.c +22
-0+ } +} + +static void dumb_vga_disable (struct drm_bridge *bridge) +{ +struct dumb_vga *vga =drm_bridge_to_dumb_vga (bridge); + +if (vga->vdd) +regulator_disable (vga->vdd); +} +static const struct drm_bridge_funcs dumb_vga_bridge_funcs = { .attach = dumb_vga_attach, + .enable = dumb_vga_enable, + .disable = dumb_vga_disable, };static struct i2c_adapter *dumb_vga_retrieve_ddc (struct device *dev)@@ -169,6 +195,15 @@ static int dumb_vga_probe(struct platform_device *pdev)return -ENOMEM ;platform_set_drvdata (pdev, vga); + vga->vdd =devm_regulator_get_optional (&pdev->dev,"vdd" ); +if (IS_ERR (vga->vdd)) { + ret =PTR_ERR (vga->vdd); +if (ret == -EPROBE_DEFER ) +return -EPROBE_DEFER ; + vga->vdd =NULL ; +dev_dbg (&pdev->dev,"No vdd regulator found: %d\n" , ret); + } + vga->ddc =dumb_vga_retrieve_ddc (&pdev->dev);if (IS_ERR (vga->ddc)) {Quoted 2 lines
if (PTR_ERR(vga->ddc) == -ENODEV) {--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
Archit Taneja
AppliedRe: [PATCH v4 1/2] drm/bridge: dumb-vga-dac: Support a VDD regulator supply
Quoted 76 lines · Chen-Yu Tsai
Quoted 59 lines · Archit Taneja
Hi,
Thanks for the patch.
Quoted 53 lines · Chen-Yu Tsai
Some dumb VGA DACs are active components which require external power. Add support for specifying a regulator as its power supply.
Signed-off-by Chen-Yu Tsai <[email protected]>Acked-by Rob Herring <[email protected]>--- .../bindings/display/bridge/dumb-vga-dac.txt | 2 ++ drivers/gpu/drm/bridge/dumb-vga-dac.c | 35 ++++++++++++++++++++++ 2 files changed, 37 insertions(+)diff --git
a/Documentation/devicetree/bindings/display/bridge/dumb-vga-dac.txtb/Documentation/devicetree/bindings/display/bridge/dumb-vga-dac.txtindex003bc246a270..164cbb15f04c100644Documentation/devicetree/bindings/display/bridge/dumb-vga-dac.txt +0
-0@@ -16,6 +16,8 @@ graph bindings specified in
Documentation/devicetree/bindings/graph.txt.
- Video port 0 for RGB input
- Video port 1 for VGA outputDocumentation/devicetree/bindings/display/bridge/dumb-vga-dac.txt +2
-0+Optional properties: +- vdd-supply: Power supply for DAC Example -------drivers/gpu/drm/bridge/dumb-vga-dac.c +2
-0@@ -12,6 +12,7 @@#include <linux/module.h> #include <linux/of_graph.h> +#include <linux/regulator/consumer.h> #include <drm/drmP.h> #include <drm/drm_atomic_helper.h> @@ -23,6 +24,7 @@ struct dumb_vga {struct drm_connector connector;struct i2c_adapter *ddc; +struct regulator *vdd; }; static inline struct dumb_vga *@@ -124,8 +126,32 @@ static int dumb_vga_attach(struct drm_bridge *bridge)return 0 ; }Quoted 15 lines
drivers/gpu/drm/bridge/dumb-vga-dac.c static int dumb_vga_attach(struct drm_bridge *bridge) · line 139
Quoted 11 lines
drivers/gpu/drm/bridge/dumb-vga-dac.c +11
-0+static void dumb_vga_enable (struct drm_bridge *bridge) +{ +struct dumb_vga *vga =drm_bridge_to_dumb_vga (bridge); +int ret =0 ; + +if (vga->vdd) + ret =regulator_enable (vga->vdd); + +if (ret) { +DRM_ERROR ("Failed to enable vdd regulator: %d\n" , ret); +return ;We don't need this return for now. If you're okay with it, can I fix this and queue to misc?
Quoted 1 line
Yes, please!
pushed to drm-misc.
Thanks,
Archit
Quoted 49 lines
Thanks
ChenYuQuoted 45 lines
Thanks,
ArchitQuoted 34 lines
drivers/gpu/drm/bridge/dumb-vga-dac.c +22
-0+ } +} + +static void dumb_vga_disable (struct drm_bridge *bridge) +{ +struct dumb_vga *vga =drm_bridge_to_dumb_vga (bridge); + +if (vga->vdd) +regulator_disable (vga->vdd); +} +static const struct drm_bridge_funcs dumb_vga_bridge_funcs = { .attach = dumb_vga_attach, + .enable = dumb_vga_enable, + .disable = dumb_vga_disable, };static struct i2c_adapter *dumb_vga_retrieve_ddc (struct device *dev)@@ -169,6 +195,15 @@ static int dumb_vga_probe(struct platform_device *pdev)return -ENOMEM ;platform_set_drvdata (pdev, vga); + vga->vdd =devm_regulator_get_optional (&pdev->dev,"vdd" ); +if (IS_ERR (vga->vdd)) { + ret =PTR_ERR (vga->vdd); +if (ret == -EPROBE_DEFER ) +return -EPROBE_DEFER ; + vga->vdd =NULL ; +dev_dbg (&pdev->dev,"No vdd regulator found: %d\n" , ret); + } + vga->ddc =dumb_vga_retrieve_ddc (&pdev->dev);if (IS_ERR (vga->ddc)) {Quoted 2 lines
if (PTR_ERR(vga->ddc) == -ENODEV) {--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
PATCH v4 2/2 ARM: dts: sun6i: hummingbird-a31: Enable display output through VGA bridge
In reply to Chen-Yu TsaiThe Hummingbird A31 board has a VGA DAC which converts RGB output from the LCD interface to VGA analog signals.
Add nodes for the VGA DAC, its power supply, and enable this part of the display pipeline.
--- arch/arm/boot/dts/sun6i-a31-hummingbird.dts | 67 +++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+)
arch/arm/boot/dts/sun6i-a31-hummingbird.dts +67 -0
@@ -63,6 +63,60 @@ stdout-path = "serial0:115200n8"; }; + vga-connector { + compatible = "vga-connector"; + + port { + vga_con_in: endpoint { + remote-endpoint = <&vga_dac_out>; + }; + }; + }; + + vga-dac { + compatible = "dumb-vga-dac"; + vdd-supply = <®_vga_3v3>; + #address-cells = <1>; + #size-cells = <0>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + vga_dac_in: endpoint@0 { + reg = <0>; + remote-endpoint = <&tcon0_out_vga>; + }; + }; + + port@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + + vga_dac_out: endpoint@0 { + reg = <0>; + remote-endpoint = <&vga_con_in>; + }; + }; + }; + }; + + reg_vga_3v3: vga_3v3_regulator { + compatible = "regulator-fixed"; + regulator-name = "vga-3v3"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; + enable-active-high; + gpio = <&pio 7 25 GPIO_ACTIVE_HIGH>; /* PH25 */ + }; + wifi_pwrseq: wifi_pwrseq { compatible = "mmc-pwrseq-simple"; reset-gpios = <&pio 6 10 GPIO_ACTIVE_LOW>; /* PG10 */
@@ -253,6 +307,19 @@ status = "okay"; }; +&tcon0 { + pinctrl-names = "default"; + pinctrl-0 = <&lcd0_rgb888_pins>; + status = "okay"; +}; + +&tcon0_out { + tcon0_out_vga: endpoint@0 { + reg = <0>; + remote-endpoint = <&vga_dac_in>; + }; +}; + &uart0 { pinctrl-names = "default"; pinctrl-0 = <&uart0_pins_a>;
Signature · 1 line
2.10.2
Maxime Ripard
AppliedQuoted 7 lines · Chen-Yu Tsai
The Hummingbird A31 board has a VGA DAC which converts RGB output from the LCD interface to VGA analog signals.
Add nodes for the VGA DAC, its power supply, and enable this part of the display pipeline.
Signed-off-by Chen-Yu Tsai <[email protected]>
Applied, thanks!
Maxime
Signature · 3 lines
Maxime Ripard, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com