* [PATCH v1 0/2] drm/panel: otm8009a: Add support for the optional power-supply
@ 2018-02-05 9:45 Philippe Cornu
[not found] ` <20180205094532.23547-1-philippe.cornu-qxv4g6HH51o@public.gmane.org>
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Philippe Cornu @ 2018-02-05 9:45 UTC (permalink / raw)
To: Thierry Reding, David Airlie, Rob Herring, Mark Rutland,
dri-devel, devicetree, linux-kernel
Cc: Alexandre Torgue, Philippe Cornu, Yannick Fertre, Vincent Abriou
Some boards use a dedicated voltage regulator for this panel.
Add & Document this related optional power-supply property and
add its support in the driver.
Philippe Cornu (2):
dt-bindings/display/panel: otm8009a: Add optional power-supply
property
drm/panel: otm8009a: Add support for the optional power-supply
.../bindings/display/panel/orisetech,otm8009a.txt | 2 ++
drivers/gpu/drm/panel/panel-orisetech-otm8009a.c | 17 +++++++++++++++++
2 files changed, 19 insertions(+)
--
2.15.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v1 1/2] dt-bindings/display/panel: otm8009a: Add optional power-supply property
[not found] ` <20180205094532.23547-1-philippe.cornu-qxv4g6HH51o@public.gmane.org>
@ 2018-02-05 9:45 ` Philippe Cornu
2018-02-06 9:05 ` Yannick FERTRE
2018-02-09 2:26 ` Rob Herring
0 siblings, 2 replies; 8+ messages in thread
From: Philippe Cornu @ 2018-02-05 9:45 UTC (permalink / raw)
To: Thierry Reding, David Airlie, Rob Herring, Mark Rutland,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
Cc: Andrzej Hajda, Yannick Fertre, Philippe Cornu, Benjamin Gaignard,
Vincent Abriou, Alexandre Torgue
Some boards use a dedicated voltage regulator for this panel.
Add & document this related optional power-supply property.
Signed-off-by: Philippe Cornu <philippe.cornu-qxv4g6HH51o@public.gmane.org>
---
Documentation/devicetree/bindings/display/panel/orisetech,otm8009a.txt | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Documentation/devicetree/bindings/display/panel/orisetech,otm8009a.txt b/Documentation/devicetree/bindings/display/panel/orisetech,otm8009a.txt
index 6862028e7b2e..203b03eefb68 100644
--- a/Documentation/devicetree/bindings/display/panel/orisetech,otm8009a.txt
+++ b/Documentation/devicetree/bindings/display/panel/orisetech,otm8009a.txt
@@ -9,6 +9,7 @@ Required properties:
Optional properties:
- reset-gpios: a GPIO spec for the reset pin (active low).
+ - power-supply: phandle of the regulator that provides the supply voltage.
Example:
&dsi {
@@ -17,5 +18,6 @@ Example:
compatible = "orisetech,otm8009a";
reg = <0>;
reset-gpios = <&gpioh 7 GPIO_ACTIVE_LOW>;
+ power-supply = <&v1v8>;
};
};
--
2.15.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v1 2/2] drm/panel: otm8009a: Add support for the optional power-supply
2018-02-05 9:45 [PATCH v1 0/2] drm/panel: otm8009a: Add support for the optional power-supply Philippe Cornu
[not found] ` <20180205094532.23547-1-philippe.cornu-qxv4g6HH51o@public.gmane.org>
@ 2018-02-05 9:45 ` Philippe Cornu
2018-02-06 9:06 ` Yannick FERTRE
2018-02-23 8:30 ` Philippe CORNU
2018-03-12 8:47 ` [PATCH v1 0/2] " Thierry Reding
2 siblings, 2 replies; 8+ messages in thread
From: Philippe Cornu @ 2018-02-05 9:45 UTC (permalink / raw)
To: Thierry Reding, David Airlie, Rob Herring, Mark Rutland,
dri-devel, devicetree, linux-kernel
Cc: Alexandre Torgue, Philippe Cornu, Yannick Fertre, Vincent Abriou
Add support for the optional power-supply.
Note: A "dummy regulator" is returned by devm_regulator_get()
if the optional regulator is not present in the device tree,
simplifying the source code when enabling/disabling the regulator.
Signed-off-by: Philippe Cornu <philippe.cornu@st.com>
---
drivers/gpu/drm/panel/panel-orisetech-otm8009a.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c b/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c
index 72530983d55d..90f1ae4af93c 100644
--- a/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c
+++ b/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c
@@ -11,6 +11,7 @@
#include <drm/drm_panel.h>
#include <linux/backlight.h>
#include <linux/gpio/consumer.h>
+#include <linux/regulator/consumer.h>
#include <video/mipi_display.h>
#define DRV_NAME "orisetech_otm8009a"
@@ -62,6 +63,7 @@ struct otm8009a {
struct drm_panel panel;
struct backlight_device *bl_dev;
struct gpio_desc *reset_gpio;
+ struct regulator *supply;
bool prepared;
bool enabled;
};
@@ -279,6 +281,8 @@ static int otm8009a_unprepare(struct drm_panel *panel)
msleep(20);
}
+ regulator_disable(ctx->supply);
+
ctx->prepared = false;
return 0;
@@ -292,6 +296,12 @@ static int otm8009a_prepare(struct drm_panel *panel)
if (ctx->prepared)
return 0;
+ ret = regulator_enable(ctx->supply);
+ if (ret < 0) {
+ DRM_ERROR("failed to enable supply: %d\n", ret);
+ return ret;
+ }
+
if (ctx->reset_gpio) {
gpiod_set_value_cansleep(ctx->reset_gpio, 0);
gpiod_set_value_cansleep(ctx->reset_gpio, 1);
@@ -414,6 +424,13 @@ static int otm8009a_probe(struct mipi_dsi_device *dsi)
return PTR_ERR(ctx->reset_gpio);
}
+ ctx->supply = devm_regulator_get(dev, "power");
+ if (IS_ERR(ctx->supply)) {
+ ret = PTR_ERR(ctx->supply);
+ dev_err(dev, "failed to request regulator: %d\n", ret);
+ return ret;
+ }
+
mipi_dsi_set_drvdata(dsi, ctx);
ctx->dev = dev;
--
2.15.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v1 1/2] dt-bindings/display/panel: otm8009a: Add optional power-supply property
2018-02-05 9:45 ` [PATCH v1 1/2] dt-bindings/display/panel: otm8009a: Add optional power-supply property Philippe Cornu
@ 2018-02-06 9:05 ` Yannick FERTRE
2018-02-09 2:26 ` Rob Herring
1 sibling, 0 replies; 8+ messages in thread
From: Yannick FERTRE @ 2018-02-06 9:05 UTC (permalink / raw)
To: Philippe CORNU, Thierry Reding, David Airlie, Rob Herring,
Mark Rutland, dri-devel@lists.freedesktop.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Vincent ABRIOU, Alexandre TORGUE
Reviewed-by: Yannick Fertré <yannick.fertre@st.com>
On 02/05/2018 10:45 AM, Philippe Cornu wrote:
> Some boards use a dedicated voltage regulator for this panel.
> Add & document this related optional power-supply property.
>
> Signed-off-by: Philippe Cornu <philippe.cornu@st.com>
> ---
> Documentation/devicetree/bindings/display/panel/orisetech,otm8009a.txt | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/display/panel/orisetech,otm8009a.txt b/Documentation/devicetree/bindings/display/panel/orisetech,otm8009a.txt
> index 6862028e7b2e..203b03eefb68 100644
> --- a/Documentation/devicetree/bindings/display/panel/orisetech,otm8009a.txt
> +++ b/Documentation/devicetree/bindings/display/panel/orisetech,otm8009a.txt
> @@ -9,6 +9,7 @@ Required properties:
>
> Optional properties:
> - reset-gpios: a GPIO spec for the reset pin (active low).
> + - power-supply: phandle of the regulator that provides the supply voltage.
>
> Example:
> &dsi {
> @@ -17,5 +18,6 @@ Example:
> compatible = "orisetech,otm8009a";
> reg = <0>;
> reset-gpios = <&gpioh 7 GPIO_ACTIVE_LOW>;
> + power-supply = <&v1v8>;
> };
> };
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v1 2/2] drm/panel: otm8009a: Add support for the optional power-supply
2018-02-05 9:45 ` [PATCH v1 2/2] drm/panel: otm8009a: Add support for the optional power-supply Philippe Cornu
@ 2018-02-06 9:06 ` Yannick FERTRE
2018-02-23 8:30 ` Philippe CORNU
1 sibling, 0 replies; 8+ messages in thread
From: Yannick FERTRE @ 2018-02-06 9:06 UTC (permalink / raw)
To: Philippe CORNU, Thierry Reding, David Airlie, Rob Herring,
Mark Rutland, dri-devel@lists.freedesktop.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Vincent ABRIOU, Alexandre TORGUE
Reviewed-by: Yannick Fertré <yannick.fertre@st.com>
On 02/05/2018 10:45 AM, Philippe Cornu wrote:
> Add support for the optional power-supply.
>
> Note: A "dummy regulator" is returned by devm_regulator_get()
> if the optional regulator is not present in the device tree,
> simplifying the source code when enabling/disabling the regulator.
>
> Signed-off-by: Philippe Cornu <philippe.cornu@st.com>
> ---
> drivers/gpu/drm/panel/panel-orisetech-otm8009a.c | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)
>
> diff --git a/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c b/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c
> index 72530983d55d..90f1ae4af93c 100644
> --- a/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c
> +++ b/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c
> @@ -11,6 +11,7 @@
> #include <drm/drm_panel.h>
> #include <linux/backlight.h>
> #include <linux/gpio/consumer.h>
> +#include <linux/regulator/consumer.h>
> #include <video/mipi_display.h>
>
> #define DRV_NAME "orisetech_otm8009a"
> @@ -62,6 +63,7 @@ struct otm8009a {
> struct drm_panel panel;
> struct backlight_device *bl_dev;
> struct gpio_desc *reset_gpio;
> + struct regulator *supply;
> bool prepared;
> bool enabled;
> };
> @@ -279,6 +281,8 @@ static int otm8009a_unprepare(struct drm_panel *panel)
> msleep(20);
> }
>
> + regulator_disable(ctx->supply);
> +
> ctx->prepared = false;
>
> return 0;
> @@ -292,6 +296,12 @@ static int otm8009a_prepare(struct drm_panel *panel)
> if (ctx->prepared)
> return 0;
>
> + ret = regulator_enable(ctx->supply);
> + if (ret < 0) {
> + DRM_ERROR("failed to enable supply: %d\n", ret);
> + return ret;
> + }
> +
> if (ctx->reset_gpio) {
> gpiod_set_value_cansleep(ctx->reset_gpio, 0);
> gpiod_set_value_cansleep(ctx->reset_gpio, 1);
> @@ -414,6 +424,13 @@ static int otm8009a_probe(struct mipi_dsi_device *dsi)
> return PTR_ERR(ctx->reset_gpio);
> }
>
> + ctx->supply = devm_regulator_get(dev, "power");
> + if (IS_ERR(ctx->supply)) {
> + ret = PTR_ERR(ctx->supply);
> + dev_err(dev, "failed to request regulator: %d\n", ret);
> + return ret;
> + }
> +
> mipi_dsi_set_drvdata(dsi, ctx);
>
> ctx->dev = dev;
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v1 1/2] dt-bindings/display/panel: otm8009a: Add optional power-supply property
2018-02-05 9:45 ` [PATCH v1 1/2] dt-bindings/display/panel: otm8009a: Add optional power-supply property Philippe Cornu
2018-02-06 9:05 ` Yannick FERTRE
@ 2018-02-09 2:26 ` Rob Herring
1 sibling, 0 replies; 8+ messages in thread
From: Rob Herring @ 2018-02-09 2:26 UTC (permalink / raw)
To: Philippe Cornu
Cc: Mark Rutland, devicetree, Alexandre Torgue, David Airlie,
linux-kernel, dri-devel, Yannick Fertre, Thierry Reding,
Vincent Abriou
On Mon, Feb 05, 2018 at 10:45:31AM +0100, Philippe Cornu wrote:
> Some boards use a dedicated voltage regulator for this panel.
> Add & document this related optional power-supply property.
>
> Signed-off-by: Philippe Cornu <philippe.cornu@st.com>
> ---
> Documentation/devicetree/bindings/display/panel/orisetech,otm8009a.txt | 2 ++
> 1 file changed, 2 insertions(+)
Reviewed-by: Rob Herring <robh@kernel.org>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v1 2/2] drm/panel: otm8009a: Add support for the optional power-supply
2018-02-05 9:45 ` [PATCH v1 2/2] drm/panel: otm8009a: Add support for the optional power-supply Philippe Cornu
2018-02-06 9:06 ` Yannick FERTRE
@ 2018-02-23 8:30 ` Philippe CORNU
1 sibling, 0 replies; 8+ messages in thread
From: Philippe CORNU @ 2018-02-23 8:30 UTC (permalink / raw)
To: Thierry Reding, David Airlie, Rob Herring, Mark Rutland,
dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: Yannick FERTRE, Vincent ABRIOU, Alexandre TORGUE
Hi Thierry & David,
May I ask you please your feedback on this small patch?
Many thanks,
Philippe :-)
On 02/05/2018 10:45 AM, Philippe Cornu wrote:
> Add support for the optional power-supply.
>
> Note: A "dummy regulator" is returned by devm_regulator_get()
> if the optional regulator is not present in the device tree,
> simplifying the source code when enabling/disabling the regulator.
>
> Signed-off-by: Philippe Cornu <philippe.cornu@st.com>
> ---
> drivers/gpu/drm/panel/panel-orisetech-otm8009a.c | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)
>
> diff --git a/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c b/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c
> index 72530983d55d..90f1ae4af93c 100644
> --- a/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c
> +++ b/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c
> @@ -11,6 +11,7 @@
> #include <drm/drm_panel.h>
> #include <linux/backlight.h>
> #include <linux/gpio/consumer.h>
> +#include <linux/regulator/consumer.h>
> #include <video/mipi_display.h>
>
> #define DRV_NAME "orisetech_otm8009a"
> @@ -62,6 +63,7 @@ struct otm8009a {
> struct drm_panel panel;
> struct backlight_device *bl_dev;
> struct gpio_desc *reset_gpio;
> + struct regulator *supply;
> bool prepared;
> bool enabled;
> };
> @@ -279,6 +281,8 @@ static int otm8009a_unprepare(struct drm_panel *panel)
> msleep(20);
> }
>
> + regulator_disable(ctx->supply);
> +
> ctx->prepared = false;
>
> return 0;
> @@ -292,6 +296,12 @@ static int otm8009a_prepare(struct drm_panel *panel)
> if (ctx->prepared)
> return 0;
>
> + ret = regulator_enable(ctx->supply);
> + if (ret < 0) {
> + DRM_ERROR("failed to enable supply: %d\n", ret);
> + return ret;
> + }
> +
> if (ctx->reset_gpio) {
> gpiod_set_value_cansleep(ctx->reset_gpio, 0);
> gpiod_set_value_cansleep(ctx->reset_gpio, 1);
> @@ -414,6 +424,13 @@ static int otm8009a_probe(struct mipi_dsi_device *dsi)
> return PTR_ERR(ctx->reset_gpio);
> }
>
> + ctx->supply = devm_regulator_get(dev, "power");
> + if (IS_ERR(ctx->supply)) {
> + ret = PTR_ERR(ctx->supply);
> + dev_err(dev, "failed to request regulator: %d\n", ret);
> + return ret;
> + }
> +
> mipi_dsi_set_drvdata(dsi, ctx);
>
> ctx->dev = dev;
>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v1 0/2] drm/panel: otm8009a: Add support for the optional power-supply
2018-02-05 9:45 [PATCH v1 0/2] drm/panel: otm8009a: Add support for the optional power-supply Philippe Cornu
[not found] ` <20180205094532.23547-1-philippe.cornu-qxv4g6HH51o@public.gmane.org>
2018-02-05 9:45 ` [PATCH v1 2/2] drm/panel: otm8009a: Add support for the optional power-supply Philippe Cornu
@ 2018-03-12 8:47 ` Thierry Reding
2 siblings, 0 replies; 8+ messages in thread
From: Thierry Reding @ 2018-03-12 8:47 UTC (permalink / raw)
To: Philippe Cornu
Cc: Mark Rutland, devicetree, Alexandre Torgue, David Airlie,
linux-kernel, dri-devel, Yannick Fertre, Rob Herring,
Vincent Abriou
[-- Attachment #1.1: Type: text/plain, Size: 633 bytes --]
On Mon, Feb 05, 2018 at 10:45:30AM +0100, Philippe Cornu wrote:
> Some boards use a dedicated voltage regulator for this panel.
> Add & Document this related optional power-supply property and
> add its support in the driver.
>
> Philippe Cornu (2):
> dt-bindings/display/panel: otm8009a: Add optional power-supply
> property
> drm/panel: otm8009a: Add support for the optional power-supply
>
> .../bindings/display/panel/orisetech,otm8009a.txt | 2 ++
> drivers/gpu/drm/panel/panel-orisetech-otm8009a.c | 17 +++++++++++++++++
> 2 files changed, 19 insertions(+)
Applied, thanks.
Thierry
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2018-03-12 8:47 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-05 9:45 [PATCH v1 0/2] drm/panel: otm8009a: Add support for the optional power-supply Philippe Cornu
[not found] ` <20180205094532.23547-1-philippe.cornu-qxv4g6HH51o@public.gmane.org>
2018-02-05 9:45 ` [PATCH v1 1/2] dt-bindings/display/panel: otm8009a: Add optional power-supply property Philippe Cornu
2018-02-06 9:05 ` Yannick FERTRE
2018-02-09 2:26 ` Rob Herring
2018-02-05 9:45 ` [PATCH v1 2/2] drm/panel: otm8009a: Add support for the optional power-supply Philippe Cornu
2018-02-06 9:06 ` Yannick FERTRE
2018-02-23 8:30 ` Philippe CORNU
2018-03-12 8:47 ` [PATCH v1 0/2] " Thierry Reding
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).