[PATCH v7 2/2] drm/panel: Add JDI LT070ME05000 WUXGA DSI Panel

2016-07-11 Thread Vinay Simha
emil,

As you had suggested to drop the spurious returns in
jdi_panel_unprepare and drop the return itself.
But as i had mentioned earlier , we cannot drop the return function
and void for jdi_panel_unprepare , since the drm fun* requires int as
return type (drm_panel_funcs .unprepare).

please do re-point out if i had still missed anything.

fyi,
v7:
 * emil review comments incorporated
   added ARRAY_SIZE in struct, regulator_bulk_disable in poweroff,
   gpios checks dropped.
   some returns cannot be dropped, since drm panel framework return
   type required.

On Mon, Jul 11, 2016 at 5:50 PM, Thierry Reding
 wrote:
> On Sun, Jul 03, 2016 at 11:52:11PM +0100, Emil Velikov wrote:
>> On 28 June 2016 at 16:59, Vinay Simha  wrote:
>> > hi,
>> >
>> > Any further comments or reviews?
>> >
>> You still haven't covered my earlier suggestions, as such I cannot
>> give you a r-b :-( They are not blockers by any means, but it'll be
>> up-to the maintainer to ack/pick this up.
>>
>> Thierry ?
>
> Vinay, please address Emil's comments and resend. I also see that you
> stopped sending the device tree bindings patch at some point. Please do
> include that when you repost as I don't seem to be able to find a recent
> version anywhere.
>
> Thierry



-- 
Regards,

Vinay Simha.B.N.


[PATCH v7 2/2] drm/panel: Add JDI LT070ME05000 WUXGA DSI Panel

2016-07-11 Thread Emil Velikov
On 11 July 2016 at 13:31, Vinay Simha  wrote:
> emil,
>
> As you had suggested to drop the spurious returns in
> jdi_panel_unprepare and drop the return itself.
> But as i had mentioned earlier , we cannot drop the return function
> and void for jdi_panel_unprepare , since the drm fun* requires int as
> return type (drm_panel_funcs .unprepare).
>
> please do re-point out if i had still missed anything.
>
Simple steps:
 - forget/ignore anything you know about the driver for a moment.
 - note: existing DRM interfaces cannot be changed.
 - teardown path(s) should _not_ return prematurely. be that within
the function itself or any of the functions that it uses.

Now put the above into practise:
 - jdi_panel_unprepare, should _not_ return if jdi_panel_off fails.
 - similarly, _everything_ in jdi_panel_off should be executed, hence
one can drop the return type all together.
 - bonus points for inlining the {2,4} line helpers
jdi_panel_{on,off}. don't bother with this if it makes things too
complex/confusing from your POV.

If the above is still ambiguous, just copy/pasta from panel-sharp-lq101r1sx01.c.

Regards,
Emil

P.S. Please avoid top-posting where possible.


[PATCH v7 2/2] drm/panel: Add JDI LT070ME05000 WUXGA DSI Panel

2016-07-11 Thread Thierry Reding
On Sun, Jul 03, 2016 at 11:52:11PM +0100, Emil Velikov wrote:
> On 28 June 2016 at 16:59, Vinay Simha  wrote:
> > hi,
> >
> > Any further comments or reviews?
> >
> You still haven't covered my earlier suggestions, as such I cannot
> give you a r-b :-( They are not blockers by any means, but it'll be
> up-to the maintainer to ack/pick this up.
> 
> Thierry ?

Vinay, please address Emil's comments and resend. I also see that you
stopped sending the device tree bindings patch at some point. Please do
include that when you repost as I don't seem to be able to find a recent
version anywhere.

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



[PATCH v7 2/2] drm/panel: Add JDI LT070ME05000 WUXGA DSI Panel

2016-07-06 Thread Emil Velikov
On 4 July 2016 at 07:27, Vinay Simha  wrote:
> On Mon, Jul 4, 2016 at 4:22 AM, Emil Velikov  
> wrote:
>> On 28 June 2016 at 16:59, Vinay Simha  wrote:
>>> hi,
>>>
>>> Any further comments or reviews?
>>>
>> You still haven't covered my earlier suggestions, as such I cannot
>> give you a r-b :-( They are not blockers by any means, but it'll be
>> up-to the maintainer to ack/pick this up.
> i do have covered the suggestions from you.
> As i had mentioned earlier we cannot drop few returns and keep it
> void(drm_panel_funcs - unprepare), since drm framework requires
> return. if do you have any alternate solution please suggest, will
> incorporate.
Please re-read what I said. I don't recall suggesting changes to the
vfunc signature but the helper that you're calling. Why ? Because it's
uncommon/unwise to prematurely exit during the teardown/destructor
stage.

Although as said previously, its nothing serious, hence why people
rarely bother.
-Emil


[PATCH v7 2/2] drm/panel: Add JDI LT070ME05000 WUXGA DSI Panel

2016-07-04 Thread Vinay Simha
On Mon, Jul 4, 2016 at 4:22 AM, Emil Velikov  
wrote:
> On 28 June 2016 at 16:59, Vinay Simha  wrote:
>> hi,
>>
>> Any further comments or reviews?
>>
> You still haven't covered my earlier suggestions, as such I cannot
> give you a r-b :-( They are not blockers by any means, but it'll be
> up-to the maintainer to ack/pick this up.
i do have covered the suggestions from you.
As i had mentioned earlier we cannot drop few returns and keep it
void(drm_panel_funcs - unprepare), since drm framework requires
return. if do you have any alternate solution please suggest, will
incorporate.
>
> Thierry ?
>
> Regards,
> Emil



-- 
Regards,

Vinay Simha.B.N.


[PATCH v7 2/2] drm/panel: Add JDI LT070ME05000 WUXGA DSI Panel

2016-07-04 Thread Emil Velikov
On 28 June 2016 at 16:59, Vinay Simha  wrote:
> hi,
>
> Any further comments or reviews?
>
You still haven't covered my earlier suggestions, as such I cannot
give you a r-b :-( They are not blockers by any means, but it'll be
up-to the maintainer to ack/pick this up.

Thierry ?

Regards,
Emil


[PATCH v7 2/2] drm/panel: Add JDI LT070ME05000 WUXGA DSI Panel

2016-06-28 Thread Vinay Simha
hi,

Any further comments or reviews?

On Mon, Jun 20, 2016 at 11:23 AM, Vinay Simha BN  wrote:
> Add support for the JDI LT070ME05000 WUXGA DSI panel used in
> Nexus 7 2013 devices.
>
> Programming sequence for the panel is was originally found in the
> android-msm-flo-3.4-lollipop-release branch from:
> https://android.googlesource.com/kernel/msm.git
>
> And video mode setting is from dsi-panel-jdi-dualmipi1-video.dtsi
> file in:
> git://codeaurora.org/kernel/msm-3.10.git  LNX.LA.3.6_rb1.27
>
> Cc: Archit Taneja 
> Cc: Rob Clark 
> Cc: Sumit Semwal 
> Cc: John Stultz 
> Cc: Emil Velikov 
> Cc: Thierry Reding 
> Cc: David Airlie 
> Signed-off-by: Sumit Semwal 
> Signed-off-by: John Stultz 
> Signed-off-by: Vinay Simha BN 
>
> ---
> v1:
>  * sumit ported to drm/panel framework, john cherry-picked to mainline,
>folded down other fixes from Vinay and Archit, vinay removed interface
>setting cmd mode, video mode panel selected
>
> v2:
>  * incorporated code reviews from theiry, archit
>code style, alphabetical soring in Makefile, Kconfig, regulator_bulk,
>arrays of u8, generic helper function, documentation bindings,
>
> v3:
>  * dcs backlight support added
>  * tested this panel driver in nexus7 2013 device
>
> v4:
>  * backlight interface added in the panel driver
>  * incorporated width_mm and height_mm suggested by rob herring
>
> v5:
>  * theirry review comments incorporated
>panel model naming consistent, alphabetical soring in Kconfig
>Makefile, MAX_BRIGHTNESS dropped, regulator_names, parameterize
>panel width and height, descprition for control display, cabc
>and interface setting, temporary variable removed, consistent
>error reporting and commit message
>  * removed tear on/off, scanline, since these are required only
>for command mode panels
>
> v6:
>  * emil review comments incorporated
>PANEL_NUM_REGULATORS dropped, return ret added at necessary
>places, if checks dropped for backlight and gpios
>
> v7:
>  * emil review comments incorporated
>added ARRAY_SIZE in struct, regulator_bulk_disable in poweroff,
>gpios checks dropped.
>some returns cannot be dropped, since drm panel framework return
>type required.
> ---
>  drivers/gpu/drm/panel/Kconfig  |  11 +
>  drivers/gpu/drm/panel/Makefile |   1 +
>  drivers/gpu/drm/panel/panel-jdi-lt070me05000.c | 495 
> +
>  3 files changed, 507 insertions(+)
>  create mode 100644 drivers/gpu/drm/panel/panel-jdi-lt070me05000.c
>
> diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
> index 1500ab9..62aba97 100644
> --- a/drivers/gpu/drm/panel/Kconfig
> +++ b/drivers/gpu/drm/panel/Kconfig
> @@ -18,6 +18,17 @@ config DRM_PANEL_SIMPLE
>   that it can be automatically turned off when the panel goes into a
>   low power state.
>
> +config DRM_PANEL_JDI_LT070ME05000
> +   tristate "JDI LT070ME05000 WUXGA DSI panel"
> +   depends on OF
> +   depends on DRM_MIPI_DSI
> +   depends on BACKLIGHT_CLASS_DEVICE
> +   help
> + Say Y here if you want to enable support for JDI DSI video mode
> + panel as found in Google Nexus 7 (2013) devices.
> + The panel has a 1200(RGB)×1920 (WUXGA) resolution and uses
> + 24 bit per pixel.
> +
>  config DRM_PANEL_SAMSUNG_LD9040
> tristate "Samsung LD9040 RGB/SPI panel"
> depends on OF && SPI
> diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
> index f277eed..a5c7ec0 100644
> --- a/drivers/gpu/drm/panel/Makefile
> +++ b/drivers/gpu/drm/panel/Makefile
> @@ -1,4 +1,5 @@
>  obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o
> +obj-$(CONFIG_DRM_PANEL_JDI_LT070ME05000) += panel-jdi-lt070me05000.o
>  obj-$(CONFIG_DRM_PANEL_LG_LG4573) += panel-lg-lg4573.o
>  obj-$(CONFIG_DRM_PANEL_PANASONIC_VVX10F034N00) += 
> panel-panasonic-vvx10f034n00.o
>  obj-$(CONFIG_DRM_PANEL_SAMSUNG_LD9040) += panel-samsung-ld9040.o
> diff --git a/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c 
> b/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c
> new file mode 100644
> index 000..888fe2b
> --- /dev/null
> +++ b/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c
> @@ -0,0 +1,495 @@
> +/*
> + * Copyright (C) 2016 InforceComputing
> + * Author: Vinay Simha BN 
> + *
> + * Copyright (C) 2016 Linaro Ltd
> + * Author: Sumit Semwal 
> + *
> + * From internet archives, the panel for Nexus 7 2nd Gen, 2013 model is a
> + * JDI model LT070ME05000, and its data sheet is at:
> + * http://panelone.net/en/7-0-inch/JDI_LT070ME05000_7.0_inch-datasheet
> + *
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License version 2 as published 
> by
> + * the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful, but 
> WITHOUT
> + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
> + * FITNESS 

[PATCH v7 2/2] drm/panel: Add JDI LT070ME05000 WUXGA DSI Panel

2016-06-20 Thread Vinay Simha BN
Add support for the JDI LT070ME05000 WUXGA DSI panel used in
Nexus 7 2013 devices.

Programming sequence for the panel is was originally found in the
android-msm-flo-3.4-lollipop-release branch from:
https://android.googlesource.com/kernel/msm.git

And video mode setting is from dsi-panel-jdi-dualmipi1-video.dtsi
file in:
git://codeaurora.org/kernel/msm-3.10.git  LNX.LA.3.6_rb1.27

Cc: Archit Taneja 
Cc: Rob Clark 
Cc: Sumit Semwal 
Cc: John Stultz 
Cc: Emil Velikov 
Cc: Thierry Reding 
Cc: David Airlie 
Signed-off-by: Sumit Semwal 
Signed-off-by: John Stultz 
Signed-off-by: Vinay Simha BN 

---
v1:
 * sumit ported to drm/panel framework, john cherry-picked to mainline,
   folded down other fixes from Vinay and Archit, vinay removed interface
   setting cmd mode, video mode panel selected

v2:
 * incorporated code reviews from theiry, archit
   code style, alphabetical soring in Makefile, Kconfig, regulator_bulk,
   arrays of u8, generic helper function, documentation bindings,

v3:
 * dcs backlight support added
 * tested this panel driver in nexus7 2013 device

v4:
 * backlight interface added in the panel driver
 * incorporated width_mm and height_mm suggested by rob herring

v5:
 * theirry review comments incorporated
   panel model naming consistent, alphabetical soring in Kconfig
   Makefile, MAX_BRIGHTNESS dropped, regulator_names, parameterize
   panel width and height, descprition for control display, cabc
   and interface setting, temporary variable removed, consistent
   error reporting and commit message
 * removed tear on/off, scanline, since these are required only
   for command mode panels

v6:
 * emil review comments incorporated
   PANEL_NUM_REGULATORS dropped, return ret added at necessary
   places, if checks dropped for backlight and gpios

v7:
 * emil review comments incorporated
   added ARRAY_SIZE in struct, regulator_bulk_disable in poweroff,
   gpios checks dropped.
   some returns cannot be dropped, since drm panel framework return
   type required.
---
 drivers/gpu/drm/panel/Kconfig  |  11 +
 drivers/gpu/drm/panel/Makefile |   1 +
 drivers/gpu/drm/panel/panel-jdi-lt070me05000.c | 495 +
 3 files changed, 507 insertions(+)
 create mode 100644 drivers/gpu/drm/panel/panel-jdi-lt070me05000.c

diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index 1500ab9..62aba97 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -18,6 +18,17 @@ config DRM_PANEL_SIMPLE
  that it can be automatically turned off when the panel goes into a
  low power state.

+config DRM_PANEL_JDI_LT070ME05000
+   tristate "JDI LT070ME05000 WUXGA DSI panel"
+   depends on OF
+   depends on DRM_MIPI_DSI
+   depends on BACKLIGHT_CLASS_DEVICE
+   help
+ Say Y here if you want to enable support for JDI DSI video mode
+ panel as found in Google Nexus 7 (2013) devices.
+ The panel has a 1200(RGB)×1920 (WUXGA) resolution and uses
+ 24 bit per pixel.
+
 config DRM_PANEL_SAMSUNG_LD9040
tristate "Samsung LD9040 RGB/SPI panel"
depends on OF && SPI
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index f277eed..a5c7ec0 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -1,4 +1,5 @@
 obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o
+obj-$(CONFIG_DRM_PANEL_JDI_LT070ME05000) += panel-jdi-lt070me05000.o
 obj-$(CONFIG_DRM_PANEL_LG_LG4573) += panel-lg-lg4573.o
 obj-$(CONFIG_DRM_PANEL_PANASONIC_VVX10F034N00) += 
panel-panasonic-vvx10f034n00.o
 obj-$(CONFIG_DRM_PANEL_SAMSUNG_LD9040) += panel-samsung-ld9040.o
diff --git a/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c 
b/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c
new file mode 100644
index 000..888fe2b
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c
@@ -0,0 +1,495 @@
+/*
+ * Copyright (C) 2016 InforceComputing
+ * Author: Vinay Simha BN 
+ *
+ * Copyright (C) 2016 Linaro Ltd
+ * Author: Sumit Semwal 
+ *
+ * From internet archives, the panel for Nexus 7 2nd Gen, 2013 model is a
+ * JDI model LT070ME05000, and its data sheet is at:
+ * http://panelone.net/en/7-0-inch/JDI_LT070ME05000_7.0_inch-datasheet
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program.  If not, see .
+ */
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#include