[PATCH V2 3/9] drm/panel: Add driver for exynos_dp based panels

2014-04-22 Thread Ajay kumar
Hi Thierry,


On Tue, Apr 22, 2014 at 1:56 PM, Thierry Reding
 wrote:
> On Tue, Apr 22, 2014 at 04:09:12AM +0530, Ajay Kumar wrote:
>> This patch adds a simple driver to handle all the LCD and LED
>> powerup/down routines needed to support eDP/eDP-LVDS panels
>> supported on exynos boards.
>>
>> The LCD and LED units are usually powered up via regulators,
>> and almost on all boards, we will have a BL_EN pin to enable/
>> disable the backlight. Sometimes, we can have LCD_EN switches
>> as well. The routines in this driver can be used to control
>> panel power sequence on such boards.
>>
>> Signed-off-by: Ajay Kumar 
>> ---
>> Changes since V1:
>>   Added routine for post_disable, removed few unwanted headers.
>>   Refactored a lot of code.
>>
>>  .../devicetree/bindings/panel/exynos-dp-panel.txt  |   45 
>>  drivers/gpu/drm/panel/Kconfig  |9 +
>>  drivers/gpu/drm/panel/Makefile |1 +
>>  drivers/gpu/drm/panel/panel-exynos-dp.c|  251 
>> 
>>  4 files changed, 306 insertions(+)
>>  create mode 100644 
>> Documentation/devicetree/bindings/panel/exynos-dp-panel.txt
>>  create mode 100644 drivers/gpu/drm/panel/panel-exynos-dp.c
>
> What this patch does is in no way Exynos specific. It is also not eDP
> specific.
>
Right. This is not at all writing into any "exynos" specific register,
but can't this be just a placeholder for all the panel controls
which can serve boards which use exynos_dp?

> This conflates panel drivers with board drivers in a strange way. Panel
> drivers should be for *panels*, not for a given SoC or specific outputs
> on that SoC.
>
Right. But for that matter, even the "panel-simple" driver is doing the same,
which is just a placeholder for "generic" panel controls which serves
multiple boards.
I din't choose to reuse that because the boards which I have expect more
control over the panel sequence as mentioned before.
If you don't mind, I can fit in all these settings into panel-simple
driver itself ;)
But again, I should be able to register the panel driver much before
exynos_dp gets probed, That's the actual catch!


Thanks and regards,
Ajay Kumar


[PATCH V2 3/9] drm/panel: Add driver for exynos_dp based panels

2014-04-22 Thread Ajay kumar
Hi Jingoo,


On Tue, Apr 22, 2014 at 12:52 PM, Jingoo Han  wrote:
>
> On Tuesday, April 22, 2014 7:39 AM, Ajay Kumar wrote:
> >
> > This patch adds a simple driver to handle all the LCD and LED
> > powerup/down routines needed to support eDP/eDP-LVDS panels
> > supported on exynos boards.
> >
> > The LCD and LED units are usually powered up via regulators,
> > and almost on all boards, we will have a BL_EN pin to enable/
> > disable the backlight. Sometimes, we can have LCD_EN switches
> > as well. The routines in this driver can be used to control
> > panel power sequence on such boards.
> >
> > Signed-off-by: Ajay Kumar 
> > ---
> > Changes since V1:
> >   Added routine for post_disable, removed few unwanted headers.
> >   Refactored a lot of code.
> >
> >  .../devicetree/bindings/panel/exynos-dp-panel.txt  |   45 
> >  drivers/gpu/drm/panel/Kconfig  |9 +
> >  drivers/gpu/drm/panel/Makefile |1 +
> >  drivers/gpu/drm/panel/panel-exynos-dp.c|  251 
> > 
> >  4 files changed, 306 insertions(+)
> >  create mode 100644 
> > Documentation/devicetree/bindings/panel/exynos-dp-panel.txt
> >  create mode 100644 drivers/gpu/drm/panel/panel-exynos-dp.c
> >
> > diff --git a/Documentation/devicetree/bindings/panel/exynos-dp-panel.txt
> > b/Documentation/devicetree/bindings/panel/exynos-dp-panel.txt
> > new file mode 100644
> > index 000..3fbca54
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/panel/exynos-dp-panel.txt
> > @@ -0,0 +1,45 @@
> > +exynos_DP_panel/DP_to_LVDS_panel
>
> Please fix it as below.
>
> +Exynos DP panel/DP to LVDS panel
>
Ok.

> []
>
> > diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
> > index 4ec874d..ea9d5ac 100644
> > --- a/drivers/gpu/drm/panel/Kconfig
> > +++ b/drivers/gpu/drm/panel/Kconfig
> > @@ -30,4 +30,13 @@ config DRM_PANEL_S6E8AA0
> >   select DRM_MIPI_DSI
> >   select VIDEOMODE_HELPERS
> >
> > +config DRM_PANEL_EXYNOS_DP
> > + tristate "support for DP panels"
>
> It looks very general. Please fix it as below.
>
> +   tristate "support for Exynos DP panels"
>
Ok.

> Best regards,
> Jingoo Han
>
> > + depends on OF && DRM_PANEL && DRM_EXYNOS_DP
> > + help
> > +   DRM panel driver for DP panels and LVDS connected via DP bridges
> > +   that need at most a regulator for LCD unit, a regulator for LED unit
> > +   and/or enable GPIOs for LCD or LED units. Delay values can also be
> > +   specified to support powerup and powerdown process.
> > +
>
> [.]
>
>

Thanks and Regards,
Ajay Kumar


[PATCH V2 3/9] drm/panel: Add driver for exynos_dp based panels

2014-04-22 Thread Thierry Reding
On Tue, Apr 22, 2014 at 08:23:03PM +0530, Ajay kumar wrote:
> Hi Thierry,
> 
> 
> On Tue, Apr 22, 2014 at 1:56 PM, Thierry Reding
>  wrote:
> > On Tue, Apr 22, 2014 at 04:09:12AM +0530, Ajay Kumar wrote:
> >> This patch adds a simple driver to handle all the LCD and LED
> >> powerup/down routines needed to support eDP/eDP-LVDS panels
> >> supported on exynos boards.
> >>
> >> The LCD and LED units are usually powered up via regulators,
> >> and almost on all boards, we will have a BL_EN pin to enable/
> >> disable the backlight. Sometimes, we can have LCD_EN switches
> >> as well. The routines in this driver can be used to control
> >> panel power sequence on such boards.
> >>
> >> Signed-off-by: Ajay Kumar 
> >> ---
> >> Changes since V1:
> >>   Added routine for post_disable, removed few unwanted headers.
> >>   Refactored a lot of code.
> >>
> >>  .../devicetree/bindings/panel/exynos-dp-panel.txt  |   45 
> >>  drivers/gpu/drm/panel/Kconfig  |9 +
> >>  drivers/gpu/drm/panel/Makefile |1 +
> >>  drivers/gpu/drm/panel/panel-exynos-dp.c|  251 
> >> 
> >>  4 files changed, 306 insertions(+)
> >>  create mode 100644 
> >> Documentation/devicetree/bindings/panel/exynos-dp-panel.txt
> >>  create mode 100644 drivers/gpu/drm/panel/panel-exynos-dp.c
> >
> > What this patch does is in no way Exynos specific. It is also not eDP
> > specific.
> >
> Right. This is not at all writing into any "exynos" specific register,
> but can't this be just a placeholder for all the panel controls
> which can serve boards which use exynos_dp?

No, it shouldn't. Like I said, if I have a panel that happens to be used
on an Exynos board but I use it on a different board, then I don't want
to have to know that the panel might be supported by Exynos so that I
know which driver to use.

So ideally there should be one driver per panel. panel-simple was
introduced because of the five panels that I had access to at the time,
five panels could be supported using the same code.

> > This conflates panel drivers with board drivers in a strange way. Panel
> > drivers should be for *panels*, not for a given SoC or specific outputs
> > on that SoC.
> >
> Right. But for that matter, even the "panel-simple" driver is doing the same,
> which is just a placeholder for "generic" panel controls which serves
> multiple boards.

panel-simple is meant for panels that require only the parameters that
are specified for those. Anything that needs more is by definition no
longer "simple".

And the difference here is that panel-simple is a true wildcard, but it
isn't specific to one SoC. And the name doesn't imply that either. Also
each panel is still identified by the specific compatible value, which
makes it easier to find out which driver supports the panel.

Thierry
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: 



[PATCH V2 3/9] drm/panel: Add driver for exynos_dp based panels

2014-04-22 Thread Jingoo Han
On Tuesday, April 22, 2014 7:39 AM, Ajay Kumar wrote:
> 
> This patch adds a simple driver to handle all the LCD and LED
> powerup/down routines needed to support eDP/eDP-LVDS panels
> supported on exynos boards.
> 
> The LCD and LED units are usually powered up via regulators,
> and almost on all boards, we will have a BL_EN pin to enable/
> disable the backlight. Sometimes, we can have LCD_EN switches
> as well. The routines in this driver can be used to control
> panel power sequence on such boards.
> 
> Signed-off-by: Ajay Kumar 
> ---
> Changes since V1:
>   Added routine for post_disable, removed few unwanted headers.
>   Refactored a lot of code.
> 
>  .../devicetree/bindings/panel/exynos-dp-panel.txt  |   45 
>  drivers/gpu/drm/panel/Kconfig  |9 +
>  drivers/gpu/drm/panel/Makefile |1 +
>  drivers/gpu/drm/panel/panel-exynos-dp.c|  251 
> 
>  4 files changed, 306 insertions(+)
>  create mode 100644 
> Documentation/devicetree/bindings/panel/exynos-dp-panel.txt
>  create mode 100644 drivers/gpu/drm/panel/panel-exynos-dp.c
> 
> diff --git a/Documentation/devicetree/bindings/panel/exynos-dp-panel.txt
> b/Documentation/devicetree/bindings/panel/exynos-dp-panel.txt
> new file mode 100644
> index 000..3fbca54
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/panel/exynos-dp-panel.txt
> @@ -0,0 +1,45 @@
> +exynos_DP_panel/DP_to_LVDS_panel

Please fix it as below.

+Exynos DP panel/DP to LVDS panel

[]

> diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
> index 4ec874d..ea9d5ac 100644
> --- a/drivers/gpu/drm/panel/Kconfig
> +++ b/drivers/gpu/drm/panel/Kconfig
> @@ -30,4 +30,13 @@ config DRM_PANEL_S6E8AA0
>   select DRM_MIPI_DSI
>   select VIDEOMODE_HELPERS
> 
> +config DRM_PANEL_EXYNOS_DP
> + tristate "support for DP panels"

It looks very general. Please fix it as below.

+   tristate "support for Exynos DP panels"

Best regards,
Jingoo Han

> + depends on OF && DRM_PANEL && DRM_EXYNOS_DP
> + help
> +   DRM panel driver for DP panels and LVDS connected via DP bridges
> +   that need at most a regulator for LCD unit, a regulator for LED unit
> +   and/or enable GPIOs for LCD or LED units. Delay values can also be
> +   specified to support powerup and powerdown process.
> +

[.]




[PATCH V2 3/9] drm/panel: Add driver for exynos_dp based panels

2014-04-22 Thread Thierry Reding
On Tue, Apr 22, 2014 at 04:09:12AM +0530, Ajay Kumar wrote:
> This patch adds a simple driver to handle all the LCD and LED
> powerup/down routines needed to support eDP/eDP-LVDS panels
> supported on exynos boards.
> 
> The LCD and LED units are usually powered up via regulators,
> and almost on all boards, we will have a BL_EN pin to enable/
> disable the backlight. Sometimes, we can have LCD_EN switches
> as well. The routines in this driver can be used to control
> panel power sequence on such boards.
> 
> Signed-off-by: Ajay Kumar 
> ---
> Changes since V1:
>   Added routine for post_disable, removed few unwanted headers.
>   Refactored a lot of code.
> 
>  .../devicetree/bindings/panel/exynos-dp-panel.txt  |   45 
>  drivers/gpu/drm/panel/Kconfig  |9 +
>  drivers/gpu/drm/panel/Makefile |1 +
>  drivers/gpu/drm/panel/panel-exynos-dp.c|  251 
> 
>  4 files changed, 306 insertions(+)
>  create mode 100644 
> Documentation/devicetree/bindings/panel/exynos-dp-panel.txt
>  create mode 100644 drivers/gpu/drm/panel/panel-exynos-dp.c

What this patch does is in no way Exynos specific. It is also not eDP
specific.

This conflates panel drivers with board drivers in a strange way. Panel
drivers should be for *panels*, not for a given SoC or specific outputs
on that SoC.

Thierry
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: 



[PATCH V2 3/9] drm/panel: Add driver for exynos_dp based panels

2014-04-22 Thread Ajay Kumar
This patch adds a simple driver to handle all the LCD and LED
powerup/down routines needed to support eDP/eDP-LVDS panels
supported on exynos boards.

The LCD and LED units are usually powered up via regulators,
and almost on all boards, we will have a BL_EN pin to enable/
disable the backlight. Sometimes, we can have LCD_EN switches
as well. The routines in this driver can be used to control
panel power sequence on such boards.

Signed-off-by: Ajay Kumar 
---
Changes since V1:
Added routine for post_disable, removed few unwanted headers.
Refactored a lot of code.

 .../devicetree/bindings/panel/exynos-dp-panel.txt  |   45 
 drivers/gpu/drm/panel/Kconfig  |9 +
 drivers/gpu/drm/panel/Makefile |1 +
 drivers/gpu/drm/panel/panel-exynos-dp.c|  251 
 4 files changed, 306 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/panel/exynos-dp-panel.txt
 create mode 100644 drivers/gpu/drm/panel/panel-exynos-dp.c

diff --git a/Documentation/devicetree/bindings/panel/exynos-dp-panel.txt 
b/Documentation/devicetree/bindings/panel/exynos-dp-panel.txt
new file mode 100644
index 000..3fbca54
--- /dev/null
+++ b/Documentation/devicetree/bindings/panel/exynos-dp-panel.txt
@@ -0,0 +1,45 @@
+exynos_DP_panel/DP_to_LVDS_panel
+
+Required properties:
+  - compatible: "samsung,exynos-dp-panel"
+
+Optional properties:
+   -samsung,lcd-en-gpio:
+   eDP panel LCD poweron GPIO.
+   Indicates which GPIO needs to be powered up as output
+   to powerup/enable the switch to the LCD panel.
+   -samsung,led-en-gpio:
+   eDP panel LED enable GPIO.
+   Indicates which GPIO needs to be powered up as output
+   to enable the backlight.
+   -samsung,panel-pre-enable-delay:
+   delay value in ms required for panel_pre_enable process
+   Delay in ms needed for the eDP panel LCD unit to
+   powerup, and delay needed between panel_VCC and
+   video_enable.
+   -samsung,panel-enable-delay:
+   delay value in ms required for panel_enable process
+   Delay in ms needed for the eDP panel backlight/LED unit
+   to powerup, and delay needed between video_enable and
+   BL_EN.
+   samsung,panel-disable-delay:
+   delay value in ms required for panel_disable process
+   Delay in ms needed for the eDP panel backlight/LED unit
+   powerdown, and delay needed between BL_DISABLE and
+   video_disable.
+   samsung,panel-post-disable-delay:
+   delay value in ms required for panel_post_disable process
+   Delay in ms needed for the eDP panel LCD unit to
+   to powerdown, and delay between video_disable and
+   panel_VCC going down.
+
+Example:
+
+   dp-panel {
+   compatible = "samsung,exynos-dp-panel";
+   samsung,led-en-gpio = <&gpx3 0 1>;
+   samsung,panel-pre-enable-delay = <40>;
+   samsung,panel-enable-delay = <20>;
+   samsung,panel-disable-delay = <20>;
+   samsung,panel-post-disable-delay = <30>;
+   };
diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index 4ec874d..ea9d5ac 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -30,4 +30,13 @@ config DRM_PANEL_S6E8AA0
select DRM_MIPI_DSI
select VIDEOMODE_HELPERS

+config DRM_PANEL_EXYNOS_DP
+   tristate "support for DP panels"
+   depends on OF && DRM_PANEL && DRM_EXYNOS_DP
+   help
+ DRM panel driver for DP panels and LVDS connected via DP bridges
+ that need at most a regulator for LCD unit, a regulator for LED unit
+ and/or enable GPIOs for LCD or LED units. Delay values can also be
+ specified to support powerup and powerdown process.
+
 endmenu
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index 8b92921..30311a4 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -1,3 +1,4 @@
 obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o
 obj-$(CONFIG_DRM_PANEL_LD9040) += panel-ld9040.o
 obj-$(CONFIG_DRM_PANEL_S6E8AA0) += panel-s6e8aa0.o
+obj-$(CONFIG_DRM_PANEL_EXYNOS_DP) += panel-exynos-dp.o
diff --git a/drivers/gpu/drm/panel/panel-exynos-dp.c 
b/drivers/gpu/drm/panel/panel-exynos-dp.c
new file mode 100644
index 000..5568d6a
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-exynos-dp.c
@@ -0,0 +1,251 @@
+/*
+ * Exynos DP panel driver
+ *
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd
+ *
+ * Ajay Kumar 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public L