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

2016-06-14 Thread Vinay Simha
On Tue, Jun 14, 2016 at 4:55 PM, Thierry Reding
 wrote:
> On Tue, Jun 14, 2016 at 04:27:53PM +0530, Vinay Simha wrote:
> [...]
>> On Mon, Jun 13, 2016 at 6:05 PM, Thierry Reding
>>  wrote:
>> > On Mon, Jun 13, 2016 at 03:55:28PM +0530, Vinay Simha BN wrote:
> [...]
>> >> +const char *regs[] = {
>> >> + "vddp",
>> >> + "dcdc_en",
>> >> + "vcc"
>> >> +};
>> >
>> > This should be static. Also use a more sensible name, such as
>> > regulator_names, please.
>> it kept as regs, to keep constant names as used in
>> the dsi_cfg file
>> drivers/gpu/drm/msm/dsi/dsi_cfg.c
>
> That's a completely different driver, no need to be consistent.
>
>> >> +static int jdi_panel_init(struct jdi_panel *jdi)
>> >> +{
>> > [...]
>> >> + struct mipi_dsi_device *dsi = jdi->dsi;
>> >> + int ret;
>> >> +
>> >> + dsi->mode_flags |= MIPI_DSI_MODE_LPM;
>> >> +
>> >> + ret = mipi_dsi_dcs_soft_reset(dsi);
>> >> + if (ret < 0)
>> >> + return ret;
>> >> +
>> >> + usleep_range(1, 2);
>> >> +
>> >> + ret = mipi_dsi_dcs_set_pixel_format(dsi, 0x70);
>> >> + if (ret < 0)
>> >> + return ret;
>> >
>> > Please use the existing symbolic constants for this.
>> i am not clear on the symbolic constants for pixel_format ?
>
> See include/video/mipi_display.h
>
>> >> +
>> >> + ret = mipi_dsi_dcs_write(dsi, MIPI_DCS_WRITE_CONTROL_DISPLAY,
>> >> +  (u8[]){ 0x24 }, 1);
>> >> + if (ret < 0)
>> >> + return ret;
>> brightness control setting, to enable pwm/backlight
>> >> +
>> >> + ret = mipi_dsi_dcs_write(dsi, MIPI_DCS_WRITE_POWER_SAVE,
>> >> +  (u8[]){ 0x00 }, 1);
>> >> + if (ret < 0)
>> >> + return ret;
>> >
>> this is to set cabc off/on
>
> Can you point me to the specification of these? I'd like to investigate
> whether or not we can turn these into more sensible commands. As-is, it
> is completely obfuscated and I'd like to avoid that where possible.
https://cdn-shop.adafruit.com/datasheets/HX8357-D_DS_April2012.pdf

MIPI_DCS_WRITE_CONTROL_DISPLAY
This is one of the panel i got in google search,
refer 6.2.44 Write control display (53h) (page 171)

MIPI_DCS_WRITE_POWER_SAVE
6.2.46 Write content adaptive brightness control (55h) (page 173)

fyi,
nx7 2013 panel/schematic datasheet is not available in opensource,
>
>> >> + ret = mipi_dsi_generic_write(dsi, (u8[]){0xB0, 0x00}, 2);
>> >> + if (ret < 0)
>> >> + return ret;
>> >> + mdelay(10);
>> >
>> > Same here. This also needs at least a comment, though ideally you'd use
>> > symbolic names for those magic numbers.
>> i do not have the datasheet to give more description.
>> this is for interface setting, either command mode/video mode
>
> Okay, please add a comment on what this is supposed to do, then.
>
>> >> +
>> >> + jdi->mode = _mode;
>> >> +
>> >> + for (i = 0; i < num; i++)
>> >> + s[i].supply = regs[i];
>> >> +
>> >> + ret = devm_regulator_bulk_get(dev, num, s);
>> >> + if (ret < 0) {
>> >> + dev_err(dev, "%s: failed to init regulator, ret=%d\n",
>> >> + __func__, ret);
>> >> + return ret;
>> >> + }
>> >> +
>> >> + jdi->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);
>> >> + if (IS_ERR(jdi->reset_gpio)) {
>> >> + dev_err(dev, "cannot get reset-gpios %ld\n",
>> >> + PTR_ERR(jdi->reset_gpio));
>> >
>> > This is a third variant of error reporting. Please stick to one.
>> for PTR_ERR(jdi->reset_gpio) returns unsigned long, so this error reporting
>> cannot be changed to ret,
>> others error reporting incorporated consistently.
>
> PTR_ERR() returns signed long, not unsigned.
>
> You can still use the same format for the message and substitute the
> %ld printk specifier to match the type.
>
> Thierry



-- 
Regards,

Vinay Simha.B.N.


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

2016-06-14 Thread Vinay Simha
thierry,

reviews are incorportated in v4, need some clarification on few reviews.

On Mon, Jun 13, 2016 at 6:05 PM, Thierry Reding
 wrote:
> On Mon, Jun 13, 2016 at 03:55:28PM +0530, Vinay Simha BN wrote:
>> Add support for the JDI lt070me05000 WUXGA DSI panel used in
>
> Can you please make the names consistent? Use the all-uppercase spelling
> for the panel model.
>
>> 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 
>> [sumit.semwal: Ported to the drm/panel framework]
>> Signed-off-by: Sumit Semwal 
>> [jstultz: Cherry-picked to mainline, folded down other fixes
>>  from Vinay and Archit]
>> Signed-off-by: John Stultz 
>> [vinay simha bn: removed interface setting cmd mode, video
>> mode panel setting selection]
>> Cc: Rob Clark 
>> Signed-off-by: Vinay Simha BN 
>> --
>> 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
>> ---
>>  drivers/gpu/drm/panel/Kconfig  |  11 +
>>  drivers/gpu/drm/panel/Makefile |   1 +
>>  drivers/gpu/drm/panel/panel-jdi-lt070me05000.c | 539 
>> +
>>  3 files changed, 551 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..83e89e7 100644
>> --- a/drivers/gpu/drm/panel/Kconfig
>> +++ b/drivers/gpu/drm/panel/Kconfig
>> @@ -7,6 +7,17 @@ config DRM_PANEL
>>  menu "Display Panels"
>>   depends on DRM && DRM_PANEL
>>
>> +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
>
> Please use consistent indentation here. Also, this is badly sorted. The
> DRM_PANEL_SIMPLE is special in that it doesn't have a vendor prefix, all
> others should be sorted after panel-simple and in alphabetical order by
> vendor, then model.
>
>> +Say Y here if you want to enable support for JDI WUXGA 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 RGB per pixel.
>
> It's kind of redundant to say 1200(RGB) when you say that it's 24 bit
> RGB afterwards. You also repeat WUXGA twice, so you can drop either of
> the occurrences as well.
>
>> diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
>> index f277eed..5d74ac2 100644
>> --- a/drivers/gpu/drm/panel/Makefile
>> +++ b/drivers/gpu/drm/panel/Makefile
>> @@ -1,3 +1,4 @@
>> +obj-$(CONFIG_DRM_PANEL_JDI_LT070ME05000) += panel-jdi-lt070me05000.o
>
> Please sort this the same way as the Kconfig entries.
>
>>  obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o
>>  obj-$(CONFIG_DRM_PANEL_LG_LG4573) += panel-lg-lg4573.o
>>  obj-$(CONFIG_DRM_PANEL_PANASONIC_VVX10F034N00) += 
>> panel-panasonic-vvx10f034n00.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..8657e5f
>> --- /dev/null
>> +++ b/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c
>> @@ -0,0 +1,539 @@
>> +/*
>> + * 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 

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

2016-06-14 Thread Thierry Reding
On Tue, Jun 14, 2016 at 04:27:53PM +0530, Vinay Simha wrote:
[...]
> On Mon, Jun 13, 2016 at 6:05 PM, Thierry Reding
>  wrote:
> > On Mon, Jun 13, 2016 at 03:55:28PM +0530, Vinay Simha BN wrote:
[...]
> >> +const char *regs[] = {
> >> + "vddp",
> >> + "dcdc_en",
> >> + "vcc"
> >> +};
> >
> > This should be static. Also use a more sensible name, such as
> > regulator_names, please.
> it kept as regs, to keep constant names as used in
> the dsi_cfg file
> drivers/gpu/drm/msm/dsi/dsi_cfg.c

That's a completely different driver, no need to be consistent.

> >> +static int jdi_panel_init(struct jdi_panel *jdi)
> >> +{
> > [...]
> >> + struct mipi_dsi_device *dsi = jdi->dsi;
> >> + int ret;
> >> +
> >> + dsi->mode_flags |= MIPI_DSI_MODE_LPM;
> >> +
> >> + ret = mipi_dsi_dcs_soft_reset(dsi);
> >> + if (ret < 0)
> >> + return ret;
> >> +
> >> + usleep_range(1, 2);
> >> +
> >> + ret = mipi_dsi_dcs_set_pixel_format(dsi, 0x70);
> >> + if (ret < 0)
> >> + return ret;
> >
> > Please use the existing symbolic constants for this.
> i am not clear on the symbolic constants for pixel_format ?

See include/video/mipi_display.h

> >> +
> >> + ret = mipi_dsi_dcs_write(dsi, MIPI_DCS_WRITE_CONTROL_DISPLAY,
> >> +  (u8[]){ 0x24 }, 1);
> >> + if (ret < 0)
> >> + return ret;
> brightness control setting, to enable pwm/backlight
> >> +
> >> + ret = mipi_dsi_dcs_write(dsi, MIPI_DCS_WRITE_POWER_SAVE,
> >> +  (u8[]){ 0x00 }, 1);
> >> + if (ret < 0)
> >> + return ret;
> >
> this is to set cabc off/on

Can you point me to the specification of these? I'd like to investigate
whether or not we can turn these into more sensible commands. As-is, it
is completely obfuscated and I'd like to avoid that where possible.

> >> + ret = mipi_dsi_generic_write(dsi, (u8[]){0xB0, 0x00}, 2);
> >> + if (ret < 0)
> >> + return ret;
> >> + mdelay(10);
> >
> > Same here. This also needs at least a comment, though ideally you'd use
> > symbolic names for those magic numbers.
> i do not have the datasheet to give more description.
> this is for interface setting, either command mode/video mode

Okay, please add a comment on what this is supposed to do, then.

> >> +
> >> + jdi->mode = _mode;
> >> +
> >> + for (i = 0; i < num; i++)
> >> + s[i].supply = regs[i];
> >> +
> >> + ret = devm_regulator_bulk_get(dev, num, s);
> >> + if (ret < 0) {
> >> + dev_err(dev, "%s: failed to init regulator, ret=%d\n",
> >> + __func__, ret);
> >> + return ret;
> >> + }
> >> +
> >> + jdi->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);
> >> + if (IS_ERR(jdi->reset_gpio)) {
> >> + dev_err(dev, "cannot get reset-gpios %ld\n",
> >> + PTR_ERR(jdi->reset_gpio));
> >
> > This is a third variant of error reporting. Please stick to one.
> for PTR_ERR(jdi->reset_gpio) returns unsigned long, so this error reporting
> cannot be changed to ret,
> others error reporting incorporated consistently.

PTR_ERR() returns signed long, not unsigned.

You can still use the same format for the message and substitute the
%ld printk specifier to match the type.

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



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

2016-06-13 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 
[sumit.semwal: Ported to the drm/panel framework]
Signed-off-by: Sumit Semwal 
[jstultz: Cherry-picked to mainline, folded down other fixes
 from Vinay and Archit]
Signed-off-by: John Stultz 
[vinay simha bn: removed interface setting cmd mode, video
mode panel setting selection]
Cc: Rob Clark 
Signed-off-by: Vinay Simha BN 
--
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
---
 drivers/gpu/drm/panel/Kconfig  |  11 +
 drivers/gpu/drm/panel/Makefile |   1 +
 drivers/gpu/drm/panel/panel-jdi-lt070me05000.c | 539 +
 3 files changed, 551 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..83e89e7 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -7,6 +7,17 @@ config DRM_PANEL
 menu "Display Panels"
depends on DRM && DRM_PANEL

+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 WUXGA 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 RGB per pixel.
+
 config DRM_PANEL_SIMPLE
tristate "support for simple panels"
depends on OF
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index f277eed..5d74ac2 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -1,3 +1,4 @@
+obj-$(CONFIG_DRM_PANEL_JDI_LT070ME05000) += panel-jdi-lt070me05000.o
 obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o
 obj-$(CONFIG_DRM_PANEL_LG_LG4573) += panel-lg-lg4573.o
 obj-$(CONFIG_DRM_PANEL_PANASONIC_VVX10F034N00) += 
panel-panasonic-vvx10f034n00.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..8657e5f
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c
@@ -0,0 +1,539 @@
+/*
+ * 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 
+
+#define PANEL_DEV_REGULATOR_MAX   3
+#define PANEL_MAX_BRIGHTNESS   0xFF
+
+const char *regs[] = {
+   "vddp",
+   "dcdc_en",
+   "vcc"
+};
+
+struct jdi_panel {
+   struct drm_panel base;
+   struct mipi_dsi_device *dsi;
+
+   struct regulator_bulk_data supplies[PANEL_DEV_REGULATOR_MAX];
+
+   struct gpio_desc *reset_gpio;
+   struct gpio_desc *enable_gpio;
+   struct backlight_device *backlight;
+
+   bool prepared;
+   bool enabled;
+
+   const struct drm_display_mode *mode;
+};
+
+static inline struct jdi_panel *to_jdi_panel(struct drm_panel *panel)
+{
+   return container_of(panel, struct jdi_panel, base);
+}
+
+static int jdi_panel_init(struct jdi_panel *jdi)
+{
+   struct mipi_dsi_device *dsi = jdi->dsi;
+   int ret;
+
+   dsi->mode_flags |= MIPI_DSI_MODE_LPM;
+
+   ret = mipi_dsi_dcs_soft_reset(dsi);
+   if (ret < 0)
+   return ret;
+
+   usleep_range(1, 2);
+
+   ret = 

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

2016-06-13 Thread Thierry Reding
On Mon, Jun 13, 2016 at 03:55:28PM +0530, Vinay Simha BN wrote:
> Add support for the JDI lt070me05000 WUXGA DSI panel used in

Can you please make the names consistent? Use the all-uppercase spelling
for the panel model.

> 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 
> [sumit.semwal: Ported to the drm/panel framework]
> Signed-off-by: Sumit Semwal 
> [jstultz: Cherry-picked to mainline, folded down other fixes
>  from Vinay and Archit]
> Signed-off-by: John Stultz 
> [vinay simha bn: removed interface setting cmd mode, video
> mode panel setting selection]
> Cc: Rob Clark 
> Signed-off-by: Vinay Simha BN 
> --
> 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
> ---
>  drivers/gpu/drm/panel/Kconfig  |  11 +
>  drivers/gpu/drm/panel/Makefile |   1 +
>  drivers/gpu/drm/panel/panel-jdi-lt070me05000.c | 539 
> +
>  3 files changed, 551 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..83e89e7 100644
> --- a/drivers/gpu/drm/panel/Kconfig
> +++ b/drivers/gpu/drm/panel/Kconfig
> @@ -7,6 +7,17 @@ config DRM_PANEL
>  menu "Display Panels"
>   depends on DRM && DRM_PANEL
>  
> +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

Please use consistent indentation here. Also, this is badly sorted. The
DRM_PANEL_SIMPLE is special in that it doesn't have a vendor prefix, all
others should be sorted after panel-simple and in alphabetical order by
vendor, then model.

> +Say Y here if you want to enable support for JDI WUXGA 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 RGB per pixel.

It's kind of redundant to say 1200(RGB) when you say that it's 24 bit
RGB afterwards. You also repeat WUXGA twice, so you can drop either of
the occurrences as well.

> diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
> index f277eed..5d74ac2 100644
> --- a/drivers/gpu/drm/panel/Makefile
> +++ b/drivers/gpu/drm/panel/Makefile
> @@ -1,3 +1,4 @@
> +obj-$(CONFIG_DRM_PANEL_JDI_LT070ME05000) += panel-jdi-lt070me05000.o

Please sort this the same way as the Kconfig entries.

>  obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o
>  obj-$(CONFIG_DRM_PANEL_LG_LG4573) += panel-lg-lg4573.o
>  obj-$(CONFIG_DRM_PANEL_PANASONIC_VVX10F034N00) += 
> panel-panasonic-vvx10f034n00.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..8657e5f
> --- /dev/null
> +++ b/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c
> @@ -0,0 +1,539 @@
> +/*
> + * 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 
> +
> +#define PANEL_DEV_REGULATOR_MAX   3

_MAX suggests that the number of regulators is actually variable, but
it's not. PANEL_NUM_REGULATORS, perhaps?

> +#define PANEL_MAX_BRIGHTNESS 0xFF

There isn't really a need for this macro, you only