Re: [RESENT PATCH] drm/panel: support Innolux P097PFG panel

2017-12-04 Thread Lothar Waßmann
Hi,

On Thu, 30 Nov 2017 14:14:40 +0800 Lin Huang wrote:
> Support Innolux P097PFG 9.7" 1536x2048 TFT LCD panel,
> it refactor Innolux P079ZCA panel driver, let it support
> multi panel, and add support P097PFG panel in this driver.
> 
> Signed-off-by: Lin Huang 
> 
> ---
>  drivers/gpu/drm/panel/panel-innolux-p079zca.c | 178 
> --
>  1 file changed, 136 insertions(+), 42 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panel/panel-innolux-p079zca.c 
> b/drivers/gpu/drm/panel/panel-innolux-p079zca.c
> index 6ba9344..a40798f 100644
> --- a/drivers/gpu/drm/panel/panel-innolux-p079zca.c
> +++ b/drivers/gpu/drm/panel/panel-innolux-p079zca.c
[...]
> @@ -209,20 +284,39 @@ static const struct drm_panel_funcs innolux_panel_funcs 
> = {
>  };
>  
>  static const struct of_device_id innolux_of_match[] = {
> - { .compatible = "innolux,p079zca", },
> - { }
> + { .compatible = "innolux,p079zca",
> +   .data = _p079zca_panel_desc
> + },
> + { .compatible = "innolux,p097pfg",
> +   .data = _p097pfg_panel_desc
> + }
>  };
>
This hunk deletes the empty entry which is required as an end of list
marker!


Lothar Waßmann


Re: [RESENT PATCH] drm/panel: support Innolux P097PFG panel

2017-12-04 Thread Lothar Waßmann
Hi,

On Thu, 30 Nov 2017 14:14:40 +0800 Lin Huang wrote:
> Support Innolux P097PFG 9.7" 1536x2048 TFT LCD panel,
> it refactor Innolux P079ZCA panel driver, let it support
> multi panel, and add support P097PFG panel in this driver.
> 
> Signed-off-by: Lin Huang 
> 
> ---
>  drivers/gpu/drm/panel/panel-innolux-p079zca.c | 178 
> --
>  1 file changed, 136 insertions(+), 42 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panel/panel-innolux-p079zca.c 
> b/drivers/gpu/drm/panel/panel-innolux-p079zca.c
> index 6ba9344..a40798f 100644
> --- a/drivers/gpu/drm/panel/panel-innolux-p079zca.c
> +++ b/drivers/gpu/drm/panel/panel-innolux-p079zca.c
[...]
> @@ -209,20 +284,39 @@ static const struct drm_panel_funcs innolux_panel_funcs 
> = {
>  };
>  
>  static const struct of_device_id innolux_of_match[] = {
> - { .compatible = "innolux,p079zca", },
> - { }
> + { .compatible = "innolux,p079zca",
> +   .data = _p079zca_panel_desc
> + },
> + { .compatible = "innolux,p097pfg",
> +   .data = _p097pfg_panel_desc
> + }
>  };
>
This hunk deletes the empty entry which is required as an end of list
marker!


Lothar Waßmann


Re: [PATCH] drm/panel: support Innolux P097PFG panel

2017-12-03 Thread hl

Hi Emil,


On Saturday, December 02, 2017 01:55 AM, Emil Velikov wrote:

On 30 November 2017 at 06:13, Lin Huang  wrote:

Support Innolux P097PFG 9.7" 1536x2048 TFT LCD panel,
it refactor Innolux P079ZCA panel driver, let it support
multi panel, and add support P097PFG panel in this driver.


Couple of drive-by suggestions:

Split the refactor vs new hw?

Sorry,  i don't get what you mean.



  MODULE_DESCRIPTION("Innolux P079ZCA panel driver");

Update this reference alongside the ones in Kconfig?

Okay, will fix it next version.


-Emil








Re: [PATCH] drm/panel: support Innolux P097PFG panel

2017-12-03 Thread hl

Hi Emil,


On Saturday, December 02, 2017 01:55 AM, Emil Velikov wrote:

On 30 November 2017 at 06:13, Lin Huang  wrote:

Support Innolux P097PFG 9.7" 1536x2048 TFT LCD panel,
it refactor Innolux P079ZCA panel driver, let it support
multi panel, and add support P097PFG panel in this driver.


Couple of drive-by suggestions:

Split the refactor vs new hw?

Sorry,  i don't get what you mean.



  MODULE_DESCRIPTION("Innolux P079ZCA panel driver");

Update this reference alongside the ones in Kconfig?

Okay, will fix it next version.


-Emil








Re: [PATCH] drm/panel: support Innolux P097PFG panel

2017-12-01 Thread Emil Velikov
On 30 November 2017 at 06:13, Lin Huang  wrote:
> Support Innolux P097PFG 9.7" 1536x2048 TFT LCD panel,
> it refactor Innolux P079ZCA panel driver, let it support
> multi panel, and add support P097PFG panel in this driver.
>
Couple of drive-by suggestions:

Split the refactor vs new hw?

>  MODULE_DESCRIPTION("Innolux P079ZCA panel driver");
Update this reference alongside the ones in Kconfig?

-Emil


Re: [PATCH] drm/panel: support Innolux P097PFG panel

2017-12-01 Thread Emil Velikov
On 30 November 2017 at 06:13, Lin Huang  wrote:
> Support Innolux P097PFG 9.7" 1536x2048 TFT LCD panel,
> it refactor Innolux P079ZCA panel driver, let it support
> multi panel, and add support P097PFG panel in this driver.
>
Couple of drive-by suggestions:

Split the refactor vs new hw?

>  MODULE_DESCRIPTION("Innolux P079ZCA panel driver");
Update this reference alongside the ones in Kconfig?

-Emil


Re: [RESENT PATCH] drm/panel: support Innolux P097PFG panel

2017-11-30 Thread hl

Hi


On Friday, December 01, 2017 10:54 AM, Brian Norris wrote:

One more comment:

On Thu, Nov 30, 2017 at 02:14:40PM +0800, Lin Huang wrote:

Support Innolux P097PFG 9.7" 1536x2048 TFT LCD panel,
it refactor Innolux P079ZCA panel driver, let it support
multi panel, and add support P097PFG panel in this driver.

Signed-off-by: Lin Huang 

---
  drivers/gpu/drm/panel/panel-innolux-p079zca.c | 178 --
  1 file changed, 136 insertions(+), 42 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-innolux-p079zca.c 
b/drivers/gpu/drm/panel/panel-innolux-p079zca.c
index 6ba9344..a40798f 100644
--- a/drivers/gpu/drm/panel/panel-innolux-p079zca.c
+++ b/drivers/gpu/drm/panel/panel-innolux-p079zca.c

...


@@ -209,20 +284,39 @@ static const struct drm_panel_funcs innolux_panel_funcs = 
{
  };
  
  static const struct of_device_id innolux_of_match[] = {

-   { .compatible = "innolux,p079zca", },
-   { }
+   { .compatible = "innolux,p079zca",
+ .data = _p079zca_panel_desc
+   },
+   { .compatible = "innolux,p097pfg",
+ .data = _p097pfg_panel_desc
+   }
  };
  MODULE_DEVICE_TABLE(of, innolux_of_match);
  
-static int innolux_panel_add(struct innolux_panel *innolux)

+static int innolux_panel_add(struct mipi_dsi_device *dsi,
+const struct panel_desc_dsi *desc)
  {
-   struct device *dev = >link->dev;
+   struct innolux_panel *innolux;
+   struct device *dev = >dev;
struct device_node *np;
int err;
  
-	innolux->supply = devm_regulator_get(dev, "power");

-   if (IS_ERR(innolux->supply))
-   return PTR_ERR(innolux->supply);
+   innolux = devm_kzalloc(dev, sizeof(*innolux), GFP_KERNEL);
+   if (!innolux)
+   return -ENOMEM;
+
+   innolux->dsi_desc = desc;
+   innolux->vddi = devm_regulator_get_optional(dev, "power");
+   if (IS_ERR(innolux->vddi))
+   return PTR_ERR(innolux->vddi);
+
+   innolux->avdd = devm_regulator_get(dev, "ppvarp");

This name ("ppvarp" and the "ppvarn" below) are names from our board
schematics, not from the panel datasheet. I would think these should be
"vdd" and "vee", like your variable names.

Okay, will fix it next version.


Brian


+   if (IS_ERR(innolux->avdd))
+   return PTR_ERR(innolux->avdd);
+
+   innolux->avee = devm_regulator_get(dev, "ppvarn");
+   if (IS_ERR(innolux->avee))
+   return PTR_ERR(innolux->avee);
  
  	innolux->enable_gpio = devm_gpiod_get_optional(dev, "enable",

   GPIOD_OUT_HIGH);

...








Re: [RESENT PATCH] drm/panel: support Innolux P097PFG panel

2017-11-30 Thread hl

Hi


On Friday, December 01, 2017 10:54 AM, Brian Norris wrote:

One more comment:

On Thu, Nov 30, 2017 at 02:14:40PM +0800, Lin Huang wrote:

Support Innolux P097PFG 9.7" 1536x2048 TFT LCD panel,
it refactor Innolux P079ZCA panel driver, let it support
multi panel, and add support P097PFG panel in this driver.

Signed-off-by: Lin Huang 

---
  drivers/gpu/drm/panel/panel-innolux-p079zca.c | 178 --
  1 file changed, 136 insertions(+), 42 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-innolux-p079zca.c 
b/drivers/gpu/drm/panel/panel-innolux-p079zca.c
index 6ba9344..a40798f 100644
--- a/drivers/gpu/drm/panel/panel-innolux-p079zca.c
+++ b/drivers/gpu/drm/panel/panel-innolux-p079zca.c

...


@@ -209,20 +284,39 @@ static const struct drm_panel_funcs innolux_panel_funcs = 
{
  };
  
  static const struct of_device_id innolux_of_match[] = {

-   { .compatible = "innolux,p079zca", },
-   { }
+   { .compatible = "innolux,p079zca",
+ .data = _p079zca_panel_desc
+   },
+   { .compatible = "innolux,p097pfg",
+ .data = _p097pfg_panel_desc
+   }
  };
  MODULE_DEVICE_TABLE(of, innolux_of_match);
  
-static int innolux_panel_add(struct innolux_panel *innolux)

+static int innolux_panel_add(struct mipi_dsi_device *dsi,
+const struct panel_desc_dsi *desc)
  {
-   struct device *dev = >link->dev;
+   struct innolux_panel *innolux;
+   struct device *dev = >dev;
struct device_node *np;
int err;
  
-	innolux->supply = devm_regulator_get(dev, "power");

-   if (IS_ERR(innolux->supply))
-   return PTR_ERR(innolux->supply);
+   innolux = devm_kzalloc(dev, sizeof(*innolux), GFP_KERNEL);
+   if (!innolux)
+   return -ENOMEM;
+
+   innolux->dsi_desc = desc;
+   innolux->vddi = devm_regulator_get_optional(dev, "power");
+   if (IS_ERR(innolux->vddi))
+   return PTR_ERR(innolux->vddi);
+
+   innolux->avdd = devm_regulator_get(dev, "ppvarp");

This name ("ppvarp" and the "ppvarn" below) are names from our board
schematics, not from the panel datasheet. I would think these should be
"vdd" and "vee", like your variable names.

Okay, will fix it next version.


Brian


+   if (IS_ERR(innolux->avdd))
+   return PTR_ERR(innolux->avdd);
+
+   innolux->avee = devm_regulator_get(dev, "ppvarn");
+   if (IS_ERR(innolux->avee))
+   return PTR_ERR(innolux->avee);
  
  	innolux->enable_gpio = devm_gpiod_get_optional(dev, "enable",

   GPIOD_OUT_HIGH);

...








Re: [RESENT PATCH] drm/panel: support Innolux P097PFG panel

2017-11-30 Thread Brian Norris
One more comment:

On Thu, Nov 30, 2017 at 02:14:40PM +0800, Lin Huang wrote:
> Support Innolux P097PFG 9.7" 1536x2048 TFT LCD panel,
> it refactor Innolux P079ZCA panel driver, let it support
> multi panel, and add support P097PFG panel in this driver.
> 
> Signed-off-by: Lin Huang 
> 
> ---
>  drivers/gpu/drm/panel/panel-innolux-p079zca.c | 178 
> --
>  1 file changed, 136 insertions(+), 42 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panel/panel-innolux-p079zca.c 
> b/drivers/gpu/drm/panel/panel-innolux-p079zca.c
> index 6ba9344..a40798f 100644
> --- a/drivers/gpu/drm/panel/panel-innolux-p079zca.c
> +++ b/drivers/gpu/drm/panel/panel-innolux-p079zca.c
...

> @@ -209,20 +284,39 @@ static const struct drm_panel_funcs innolux_panel_funcs 
> = {
>  };
>  
>  static const struct of_device_id innolux_of_match[] = {
> - { .compatible = "innolux,p079zca", },
> - { }
> + { .compatible = "innolux,p079zca",
> +   .data = _p079zca_panel_desc
> + },
> + { .compatible = "innolux,p097pfg",
> +   .data = _p097pfg_panel_desc
> + }
>  };
>  MODULE_DEVICE_TABLE(of, innolux_of_match);
>  
> -static int innolux_panel_add(struct innolux_panel *innolux)
> +static int innolux_panel_add(struct mipi_dsi_device *dsi,
> +  const struct panel_desc_dsi *desc)
>  {
> - struct device *dev = >link->dev;
> + struct innolux_panel *innolux;
> + struct device *dev = >dev;
>   struct device_node *np;
>   int err;
>  
> - innolux->supply = devm_regulator_get(dev, "power");
> - if (IS_ERR(innolux->supply))
> - return PTR_ERR(innolux->supply);
> + innolux = devm_kzalloc(dev, sizeof(*innolux), GFP_KERNEL);
> + if (!innolux)
> + return -ENOMEM;
> +
> + innolux->dsi_desc = desc;
> + innolux->vddi = devm_regulator_get_optional(dev, "power");
> + if (IS_ERR(innolux->vddi))
> + return PTR_ERR(innolux->vddi);
> +
> + innolux->avdd = devm_regulator_get(dev, "ppvarp");

This name ("ppvarp" and the "ppvarn" below) are names from our board
schematics, not from the panel datasheet. I would think these should be
"vdd" and "vee", like your variable names.

Brian

> + if (IS_ERR(innolux->avdd))
> + return PTR_ERR(innolux->avdd);
> +
> + innolux->avee = devm_regulator_get(dev, "ppvarn");
> + if (IS_ERR(innolux->avee))
> + return PTR_ERR(innolux->avee);
>  
>   innolux->enable_gpio = devm_gpiod_get_optional(dev, "enable",
>  GPIOD_OUT_HIGH);
...


Re: [RESENT PATCH] drm/panel: support Innolux P097PFG panel

2017-11-30 Thread Brian Norris
One more comment:

On Thu, Nov 30, 2017 at 02:14:40PM +0800, Lin Huang wrote:
> Support Innolux P097PFG 9.7" 1536x2048 TFT LCD panel,
> it refactor Innolux P079ZCA panel driver, let it support
> multi panel, and add support P097PFG panel in this driver.
> 
> Signed-off-by: Lin Huang 
> 
> ---
>  drivers/gpu/drm/panel/panel-innolux-p079zca.c | 178 
> --
>  1 file changed, 136 insertions(+), 42 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panel/panel-innolux-p079zca.c 
> b/drivers/gpu/drm/panel/panel-innolux-p079zca.c
> index 6ba9344..a40798f 100644
> --- a/drivers/gpu/drm/panel/panel-innolux-p079zca.c
> +++ b/drivers/gpu/drm/panel/panel-innolux-p079zca.c
...

> @@ -209,20 +284,39 @@ static const struct drm_panel_funcs innolux_panel_funcs 
> = {
>  };
>  
>  static const struct of_device_id innolux_of_match[] = {
> - { .compatible = "innolux,p079zca", },
> - { }
> + { .compatible = "innolux,p079zca",
> +   .data = _p079zca_panel_desc
> + },
> + { .compatible = "innolux,p097pfg",
> +   .data = _p097pfg_panel_desc
> + }
>  };
>  MODULE_DEVICE_TABLE(of, innolux_of_match);
>  
> -static int innolux_panel_add(struct innolux_panel *innolux)
> +static int innolux_panel_add(struct mipi_dsi_device *dsi,
> +  const struct panel_desc_dsi *desc)
>  {
> - struct device *dev = >link->dev;
> + struct innolux_panel *innolux;
> + struct device *dev = >dev;
>   struct device_node *np;
>   int err;
>  
> - innolux->supply = devm_regulator_get(dev, "power");
> - if (IS_ERR(innolux->supply))
> - return PTR_ERR(innolux->supply);
> + innolux = devm_kzalloc(dev, sizeof(*innolux), GFP_KERNEL);
> + if (!innolux)
> + return -ENOMEM;
> +
> + innolux->dsi_desc = desc;
> + innolux->vddi = devm_regulator_get_optional(dev, "power");
> + if (IS_ERR(innolux->vddi))
> + return PTR_ERR(innolux->vddi);
> +
> + innolux->avdd = devm_regulator_get(dev, "ppvarp");

This name ("ppvarp" and the "ppvarn" below) are names from our board
schematics, not from the panel datasheet. I would think these should be
"vdd" and "vee", like your variable names.

Brian

> + if (IS_ERR(innolux->avdd))
> + return PTR_ERR(innolux->avdd);
> +
> + innolux->avee = devm_regulator_get(dev, "ppvarn");
> + if (IS_ERR(innolux->avee))
> + return PTR_ERR(innolux->avee);
>  
>   innolux->enable_gpio = devm_gpiod_get_optional(dev, "enable",
>  GPIOD_OUT_HIGH);
...


Re: [RESENT PATCH] drm/panel: support Innolux P097PFG panel

2017-11-30 Thread Brian Norris
+ Derek

On Thu, Nov 30, 2017 at 02:14:40PM +0800, Lin Huang wrote:
> Support Innolux P097PFG 9.7" 1536x2048 TFT LCD panel,
> it refactor Innolux P079ZCA panel driver, let it support
> multi panel, and add support P097PFG panel in this driver.
> 
> Signed-off-by: Lin Huang 
> 
> ---
>  drivers/gpu/drm/panel/panel-innolux-p079zca.c | 178 
> --
>  1 file changed, 136 insertions(+), 42 deletions(-)

You'll want to add this to the device tree bindings.

Brian

> 
> diff --git a/drivers/gpu/drm/panel/panel-innolux-p079zca.c 
> b/drivers/gpu/drm/panel/panel-innolux-p079zca.c
> index 6ba9344..a40798f 100644
> --- a/drivers/gpu/drm/panel/panel-innolux-p079zca.c
> +++ b/drivers/gpu/drm/panel/panel-innolux-p079zca.c
> @@ -20,12 +20,32 @@
>  
>  #include 
>  
> +struct panel_desc {
> + const struct drm_display_mode *modes;
> + unsigned int bpc;
> + struct {
> + unsigned int width;
> + unsigned int height;
> + } size;
> +};
> +
> +struct panel_desc_dsi {
> + struct panel_desc desc;
> +
> + unsigned long flags;
> + enum mipi_dsi_pixel_format format;
> + unsigned int lanes;
> +};
> +
>  struct innolux_panel {
>   struct drm_panel base;
>   struct mipi_dsi_device *link;
> + const struct panel_desc_dsi *dsi_desc;
>  
>   struct backlight_device *backlight;
> - struct regulator *supply;
> + struct regulator *vddi;
> + struct regulator *avdd;
> + struct regulator *avee;
>   struct gpio_desc *enable_gpio;
>  
>   bool prepared;
> @@ -78,9 +98,9 @@ static int innolux_panel_unprepare(struct drm_panel *panel)
>   /* T8: 80ms - 1000ms */
>   msleep(80);
>  
> - err = regulator_disable(innolux->supply);
> - if (err < 0)
> - return err;
> + regulator_disable(innolux->avee);
> + regulator_disable(innolux->avdd);
> + regulator_disable(innolux->vddi);
>  
>   innolux->prepared = false;
>  
> @@ -97,10 +117,18 @@ static int innolux_panel_prepare(struct drm_panel *panel)
>  
>   gpiod_set_value_cansleep(innolux->enable_gpio, 0);
>  
> - err = regulator_enable(innolux->supply);
> + err = regulator_enable(innolux->vddi);
>   if (err < 0)
>   return err;
>  
> + err = regulator_enable(innolux->avdd);
> + if (err < 0)
> + goto disable_vddi;
> +
> + err = regulator_enable(innolux->avee);
> + if (err < 0)
> + goto disable_avdd;
> +
>   /* T2: 15ms - 1000ms */
>   usleep_range(15000, 16000);
>  
> @@ -134,12 +162,13 @@ static int innolux_panel_prepare(struct drm_panel 
> *panel)
>   return 0;
>  
>  poweroff:
> - regulator_err = regulator_disable(innolux->supply);
> - if (regulator_err)
> - DRM_DEV_ERROR(panel->dev, "failed to disable regulator: %d\n",
> -   regulator_err);
> -
>   gpiod_set_value_cansleep(innolux->enable_gpio, 0);
> + regulator_disable(innolux->avee);
> +disable_avdd:
> + regulator_disable(innolux->avdd);
> +disable_vddi:
> + regulator_disable(innolux->vddi);
> +
>   return err;
>  }
>  
> @@ -164,7 +193,7 @@ static int innolux_panel_enable(struct drm_panel *panel)
>   return 0;
>  }
>  
> -static const struct drm_display_mode default_mode = {
> +static const struct drm_display_mode innolux_p079zca_mode = {
>   .clock = 56900,
>   .hdisplay = 768,
>   .hsync_start = 768 + 40,
> @@ -177,15 +206,59 @@ static const struct drm_display_mode default_mode = {
>   .vrefresh = 60,
>  };
>  
> +static const struct panel_desc_dsi innolux_p079zca_panel_desc = {
> + .desc = {
> + .modes = _p079zca_mode,
> + .bpc = 8,
> + .size = {
> + .width = 120,
> + .height = 160,
> + },
> + },
> + .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
> +  MIPI_DSI_MODE_LPM,
> + .format = MIPI_DSI_FMT_RGB888,
> + .lanes = 4,
> +};
> +
> +static const struct drm_display_mode innolux_p097pfg_mode = {
> + .clock = 22,
> + .hdisplay = 1536,
> + .hsync_start = 1536 + 100,
> + .hsync_end = 1536 + 100 + 24,
> + .htotal = 1536 + 100 + 24 + 100,
> + .vdisplay = 2048,
> + .vsync_start = 2048 + 18,
> + .vsync_end = 2048 + 18 + 2,
> + .vtotal = 2048 + 18 + 2 + 18,
> + .vrefresh = 60,
> +};
> +
> +static const struct panel_desc_dsi innolux_p097pfg_panel_desc = {
> + .desc = {
> + .modes = _p097pfg_mode,
> + .bpc = 8,
> + .size = {
> + .width = 147,
> + .height = 196,
> + },
> + },
> + .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
> +  MIPI_DSI_MODE_LPM,
> + .format = MIPI_DSI_FMT_RGB888,
> + .lanes = 8,
> +};
> +
>  static int innolux_panel_get_modes(struct drm_panel *panel)
>  {
>   struct drm_display_mode 

Re: [RESENT PATCH] drm/panel: support Innolux P097PFG panel

2017-11-30 Thread Brian Norris
+ Derek

On Thu, Nov 30, 2017 at 02:14:40PM +0800, Lin Huang wrote:
> Support Innolux P097PFG 9.7" 1536x2048 TFT LCD panel,
> it refactor Innolux P079ZCA panel driver, let it support
> multi panel, and add support P097PFG panel in this driver.
> 
> Signed-off-by: Lin Huang 
> 
> ---
>  drivers/gpu/drm/panel/panel-innolux-p079zca.c | 178 
> --
>  1 file changed, 136 insertions(+), 42 deletions(-)

You'll want to add this to the device tree bindings.

Brian

> 
> diff --git a/drivers/gpu/drm/panel/panel-innolux-p079zca.c 
> b/drivers/gpu/drm/panel/panel-innolux-p079zca.c
> index 6ba9344..a40798f 100644
> --- a/drivers/gpu/drm/panel/panel-innolux-p079zca.c
> +++ b/drivers/gpu/drm/panel/panel-innolux-p079zca.c
> @@ -20,12 +20,32 @@
>  
>  #include 
>  
> +struct panel_desc {
> + const struct drm_display_mode *modes;
> + unsigned int bpc;
> + struct {
> + unsigned int width;
> + unsigned int height;
> + } size;
> +};
> +
> +struct panel_desc_dsi {
> + struct panel_desc desc;
> +
> + unsigned long flags;
> + enum mipi_dsi_pixel_format format;
> + unsigned int lanes;
> +};
> +
>  struct innolux_panel {
>   struct drm_panel base;
>   struct mipi_dsi_device *link;
> + const struct panel_desc_dsi *dsi_desc;
>  
>   struct backlight_device *backlight;
> - struct regulator *supply;
> + struct regulator *vddi;
> + struct regulator *avdd;
> + struct regulator *avee;
>   struct gpio_desc *enable_gpio;
>  
>   bool prepared;
> @@ -78,9 +98,9 @@ static int innolux_panel_unprepare(struct drm_panel *panel)
>   /* T8: 80ms - 1000ms */
>   msleep(80);
>  
> - err = regulator_disable(innolux->supply);
> - if (err < 0)
> - return err;
> + regulator_disable(innolux->avee);
> + regulator_disable(innolux->avdd);
> + regulator_disable(innolux->vddi);
>  
>   innolux->prepared = false;
>  
> @@ -97,10 +117,18 @@ static int innolux_panel_prepare(struct drm_panel *panel)
>  
>   gpiod_set_value_cansleep(innolux->enable_gpio, 0);
>  
> - err = regulator_enable(innolux->supply);
> + err = regulator_enable(innolux->vddi);
>   if (err < 0)
>   return err;
>  
> + err = regulator_enable(innolux->avdd);
> + if (err < 0)
> + goto disable_vddi;
> +
> + err = regulator_enable(innolux->avee);
> + if (err < 0)
> + goto disable_avdd;
> +
>   /* T2: 15ms - 1000ms */
>   usleep_range(15000, 16000);
>  
> @@ -134,12 +162,13 @@ static int innolux_panel_prepare(struct drm_panel 
> *panel)
>   return 0;
>  
>  poweroff:
> - regulator_err = regulator_disable(innolux->supply);
> - if (regulator_err)
> - DRM_DEV_ERROR(panel->dev, "failed to disable regulator: %d\n",
> -   regulator_err);
> -
>   gpiod_set_value_cansleep(innolux->enable_gpio, 0);
> + regulator_disable(innolux->avee);
> +disable_avdd:
> + regulator_disable(innolux->avdd);
> +disable_vddi:
> + regulator_disable(innolux->vddi);
> +
>   return err;
>  }
>  
> @@ -164,7 +193,7 @@ static int innolux_panel_enable(struct drm_panel *panel)
>   return 0;
>  }
>  
> -static const struct drm_display_mode default_mode = {
> +static const struct drm_display_mode innolux_p079zca_mode = {
>   .clock = 56900,
>   .hdisplay = 768,
>   .hsync_start = 768 + 40,
> @@ -177,15 +206,59 @@ static const struct drm_display_mode default_mode = {
>   .vrefresh = 60,
>  };
>  
> +static const struct panel_desc_dsi innolux_p079zca_panel_desc = {
> + .desc = {
> + .modes = _p079zca_mode,
> + .bpc = 8,
> + .size = {
> + .width = 120,
> + .height = 160,
> + },
> + },
> + .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
> +  MIPI_DSI_MODE_LPM,
> + .format = MIPI_DSI_FMT_RGB888,
> + .lanes = 4,
> +};
> +
> +static const struct drm_display_mode innolux_p097pfg_mode = {
> + .clock = 22,
> + .hdisplay = 1536,
> + .hsync_start = 1536 + 100,
> + .hsync_end = 1536 + 100 + 24,
> + .htotal = 1536 + 100 + 24 + 100,
> + .vdisplay = 2048,
> + .vsync_start = 2048 + 18,
> + .vsync_end = 2048 + 18 + 2,
> + .vtotal = 2048 + 18 + 2 + 18,
> + .vrefresh = 60,
> +};
> +
> +static const struct panel_desc_dsi innolux_p097pfg_panel_desc = {
> + .desc = {
> + .modes = _p097pfg_mode,
> + .bpc = 8,
> + .size = {
> + .width = 147,
> + .height = 196,
> + },
> + },
> + .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
> +  MIPI_DSI_MODE_LPM,
> + .format = MIPI_DSI_FMT_RGB888,
> + .lanes = 8,
> +};
> +
>  static int innolux_panel_get_modes(struct drm_panel *panel)
>  {
>   struct drm_display_mode *mode;
> + struct 

[RESENT PATCH] drm/panel: support Innolux P097PFG panel

2017-11-29 Thread Lin Huang
Support Innolux P097PFG 9.7" 1536x2048 TFT LCD panel,
it refactor Innolux P079ZCA panel driver, let it support
multi panel, and add support P097PFG panel in this driver.

Signed-off-by: Lin Huang 

---
 drivers/gpu/drm/panel/panel-innolux-p079zca.c | 178 --
 1 file changed, 136 insertions(+), 42 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-innolux-p079zca.c 
b/drivers/gpu/drm/panel/panel-innolux-p079zca.c
index 6ba9344..a40798f 100644
--- a/drivers/gpu/drm/panel/panel-innolux-p079zca.c
+++ b/drivers/gpu/drm/panel/panel-innolux-p079zca.c
@@ -20,12 +20,32 @@
 
 #include 
 
+struct panel_desc {
+   const struct drm_display_mode *modes;
+   unsigned int bpc;
+   struct {
+   unsigned int width;
+   unsigned int height;
+   } size;
+};
+
+struct panel_desc_dsi {
+   struct panel_desc desc;
+
+   unsigned long flags;
+   enum mipi_dsi_pixel_format format;
+   unsigned int lanes;
+};
+
 struct innolux_panel {
struct drm_panel base;
struct mipi_dsi_device *link;
+   const struct panel_desc_dsi *dsi_desc;
 
struct backlight_device *backlight;
-   struct regulator *supply;
+   struct regulator *vddi;
+   struct regulator *avdd;
+   struct regulator *avee;
struct gpio_desc *enable_gpio;
 
bool prepared;
@@ -78,9 +98,9 @@ static int innolux_panel_unprepare(struct drm_panel *panel)
/* T8: 80ms - 1000ms */
msleep(80);
 
-   err = regulator_disable(innolux->supply);
-   if (err < 0)
-   return err;
+   regulator_disable(innolux->avee);
+   regulator_disable(innolux->avdd);
+   regulator_disable(innolux->vddi);
 
innolux->prepared = false;
 
@@ -97,10 +117,18 @@ static int innolux_panel_prepare(struct drm_panel *panel)
 
gpiod_set_value_cansleep(innolux->enable_gpio, 0);
 
-   err = regulator_enable(innolux->supply);
+   err = regulator_enable(innolux->vddi);
if (err < 0)
return err;
 
+   err = regulator_enable(innolux->avdd);
+   if (err < 0)
+   goto disable_vddi;
+
+   err = regulator_enable(innolux->avee);
+   if (err < 0)
+   goto disable_avdd;
+
/* T2: 15ms - 1000ms */
usleep_range(15000, 16000);
 
@@ -134,12 +162,13 @@ static int innolux_panel_prepare(struct drm_panel *panel)
return 0;
 
 poweroff:
-   regulator_err = regulator_disable(innolux->supply);
-   if (regulator_err)
-   DRM_DEV_ERROR(panel->dev, "failed to disable regulator: %d\n",
- regulator_err);
-
gpiod_set_value_cansleep(innolux->enable_gpio, 0);
+   regulator_disable(innolux->avee);
+disable_avdd:
+   regulator_disable(innolux->avdd);
+disable_vddi:
+   regulator_disable(innolux->vddi);
+
return err;
 }
 
@@ -164,7 +193,7 @@ static int innolux_panel_enable(struct drm_panel *panel)
return 0;
 }
 
-static const struct drm_display_mode default_mode = {
+static const struct drm_display_mode innolux_p079zca_mode = {
.clock = 56900,
.hdisplay = 768,
.hsync_start = 768 + 40,
@@ -177,15 +206,59 @@ static const struct drm_display_mode default_mode = {
.vrefresh = 60,
 };
 
+static const struct panel_desc_dsi innolux_p079zca_panel_desc = {
+   .desc = {
+   .modes = _p079zca_mode,
+   .bpc = 8,
+   .size = {
+   .width = 120,
+   .height = 160,
+   },
+   },
+   .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
+MIPI_DSI_MODE_LPM,
+   .format = MIPI_DSI_FMT_RGB888,
+   .lanes = 4,
+};
+
+static const struct drm_display_mode innolux_p097pfg_mode = {
+   .clock = 22,
+   .hdisplay = 1536,
+   .hsync_start = 1536 + 100,
+   .hsync_end = 1536 + 100 + 24,
+   .htotal = 1536 + 100 + 24 + 100,
+   .vdisplay = 2048,
+   .vsync_start = 2048 + 18,
+   .vsync_end = 2048 + 18 + 2,
+   .vtotal = 2048 + 18 + 2 + 18,
+   .vrefresh = 60,
+};
+
+static const struct panel_desc_dsi innolux_p097pfg_panel_desc = {
+   .desc = {
+   .modes = _p097pfg_mode,
+   .bpc = 8,
+   .size = {
+   .width = 147,
+   .height = 196,
+   },
+   },
+   .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
+MIPI_DSI_MODE_LPM,
+   .format = MIPI_DSI_FMT_RGB888,
+   .lanes = 8,
+};
+
 static int innolux_panel_get_modes(struct drm_panel *panel)
 {
struct drm_display_mode *mode;
+   struct innolux_panel *innolux = to_innolux_panel(panel);
+   const struct drm_display_mode *m = innolux->dsi_desc->desc.modes;
 
-   mode = drm_mode_duplicate(panel->drm, _mode);
+   mode = drm_mode_duplicate(panel->drm, m);
if (!mode) {
   

[RESENT PATCH] drm/panel: support Innolux P097PFG panel

2017-11-29 Thread Lin Huang
Support Innolux P097PFG 9.7" 1536x2048 TFT LCD panel,
it refactor Innolux P079ZCA panel driver, let it support
multi panel, and add support P097PFG panel in this driver.

Signed-off-by: Lin Huang 

---
 drivers/gpu/drm/panel/panel-innolux-p079zca.c | 178 --
 1 file changed, 136 insertions(+), 42 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-innolux-p079zca.c 
b/drivers/gpu/drm/panel/panel-innolux-p079zca.c
index 6ba9344..a40798f 100644
--- a/drivers/gpu/drm/panel/panel-innolux-p079zca.c
+++ b/drivers/gpu/drm/panel/panel-innolux-p079zca.c
@@ -20,12 +20,32 @@
 
 #include 
 
+struct panel_desc {
+   const struct drm_display_mode *modes;
+   unsigned int bpc;
+   struct {
+   unsigned int width;
+   unsigned int height;
+   } size;
+};
+
+struct panel_desc_dsi {
+   struct panel_desc desc;
+
+   unsigned long flags;
+   enum mipi_dsi_pixel_format format;
+   unsigned int lanes;
+};
+
 struct innolux_panel {
struct drm_panel base;
struct mipi_dsi_device *link;
+   const struct panel_desc_dsi *dsi_desc;
 
struct backlight_device *backlight;
-   struct regulator *supply;
+   struct regulator *vddi;
+   struct regulator *avdd;
+   struct regulator *avee;
struct gpio_desc *enable_gpio;
 
bool prepared;
@@ -78,9 +98,9 @@ static int innolux_panel_unprepare(struct drm_panel *panel)
/* T8: 80ms - 1000ms */
msleep(80);
 
-   err = regulator_disable(innolux->supply);
-   if (err < 0)
-   return err;
+   regulator_disable(innolux->avee);
+   regulator_disable(innolux->avdd);
+   regulator_disable(innolux->vddi);
 
innolux->prepared = false;
 
@@ -97,10 +117,18 @@ static int innolux_panel_prepare(struct drm_panel *panel)
 
gpiod_set_value_cansleep(innolux->enable_gpio, 0);
 
-   err = regulator_enable(innolux->supply);
+   err = regulator_enable(innolux->vddi);
if (err < 0)
return err;
 
+   err = regulator_enable(innolux->avdd);
+   if (err < 0)
+   goto disable_vddi;
+
+   err = regulator_enable(innolux->avee);
+   if (err < 0)
+   goto disable_avdd;
+
/* T2: 15ms - 1000ms */
usleep_range(15000, 16000);
 
@@ -134,12 +162,13 @@ static int innolux_panel_prepare(struct drm_panel *panel)
return 0;
 
 poweroff:
-   regulator_err = regulator_disable(innolux->supply);
-   if (regulator_err)
-   DRM_DEV_ERROR(panel->dev, "failed to disable regulator: %d\n",
- regulator_err);
-
gpiod_set_value_cansleep(innolux->enable_gpio, 0);
+   regulator_disable(innolux->avee);
+disable_avdd:
+   regulator_disable(innolux->avdd);
+disable_vddi:
+   regulator_disable(innolux->vddi);
+
return err;
 }
 
@@ -164,7 +193,7 @@ static int innolux_panel_enable(struct drm_panel *panel)
return 0;
 }
 
-static const struct drm_display_mode default_mode = {
+static const struct drm_display_mode innolux_p079zca_mode = {
.clock = 56900,
.hdisplay = 768,
.hsync_start = 768 + 40,
@@ -177,15 +206,59 @@ static const struct drm_display_mode default_mode = {
.vrefresh = 60,
 };
 
+static const struct panel_desc_dsi innolux_p079zca_panel_desc = {
+   .desc = {
+   .modes = _p079zca_mode,
+   .bpc = 8,
+   .size = {
+   .width = 120,
+   .height = 160,
+   },
+   },
+   .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
+MIPI_DSI_MODE_LPM,
+   .format = MIPI_DSI_FMT_RGB888,
+   .lanes = 4,
+};
+
+static const struct drm_display_mode innolux_p097pfg_mode = {
+   .clock = 22,
+   .hdisplay = 1536,
+   .hsync_start = 1536 + 100,
+   .hsync_end = 1536 + 100 + 24,
+   .htotal = 1536 + 100 + 24 + 100,
+   .vdisplay = 2048,
+   .vsync_start = 2048 + 18,
+   .vsync_end = 2048 + 18 + 2,
+   .vtotal = 2048 + 18 + 2 + 18,
+   .vrefresh = 60,
+};
+
+static const struct panel_desc_dsi innolux_p097pfg_panel_desc = {
+   .desc = {
+   .modes = _p097pfg_mode,
+   .bpc = 8,
+   .size = {
+   .width = 147,
+   .height = 196,
+   },
+   },
+   .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
+MIPI_DSI_MODE_LPM,
+   .format = MIPI_DSI_FMT_RGB888,
+   .lanes = 8,
+};
+
 static int innolux_panel_get_modes(struct drm_panel *panel)
 {
struct drm_display_mode *mode;
+   struct innolux_panel *innolux = to_innolux_panel(panel);
+   const struct drm_display_mode *m = innolux->dsi_desc->desc.modes;
 
-   mode = drm_mode_duplicate(panel->drm, _mode);
+   mode = drm_mode_duplicate(panel->drm, m);
if (!mode) {

[PATCH] drm/panel: support Innolux P097PFG panel

2017-11-29 Thread Lin Huang
Support Innolux P097PFG 9.7" 1536x2048 TFT LCD panel,
it refactor Innolux P079ZCA panel driver, let it support
multi panel, and add support P097PFG panel in this driver.

Change-Id: If342e58a3de2861219b0b1313f402b6cb41ffa29
Signed-off-by: Lin Huang 
---
 drivers/gpu/drm/panel/panel-innolux-p079zca.c | 178 --
 1 file changed, 136 insertions(+), 42 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-innolux-p079zca.c 
b/drivers/gpu/drm/panel/panel-innolux-p079zca.c
index 6ba9344..a40798f 100644
--- a/drivers/gpu/drm/panel/panel-innolux-p079zca.c
+++ b/drivers/gpu/drm/panel/panel-innolux-p079zca.c
@@ -20,12 +20,32 @@
 
 #include 
 
+struct panel_desc {
+   const struct drm_display_mode *modes;
+   unsigned int bpc;
+   struct {
+   unsigned int width;
+   unsigned int height;
+   } size;
+};
+
+struct panel_desc_dsi {
+   struct panel_desc desc;
+
+   unsigned long flags;
+   enum mipi_dsi_pixel_format format;
+   unsigned int lanes;
+};
+
 struct innolux_panel {
struct drm_panel base;
struct mipi_dsi_device *link;
+   const struct panel_desc_dsi *dsi_desc;
 
struct backlight_device *backlight;
-   struct regulator *supply;
+   struct regulator *vddi;
+   struct regulator *avdd;
+   struct regulator *avee;
struct gpio_desc *enable_gpio;
 
bool prepared;
@@ -78,9 +98,9 @@ static int innolux_panel_unprepare(struct drm_panel *panel)
/* T8: 80ms - 1000ms */
msleep(80);
 
-   err = regulator_disable(innolux->supply);
-   if (err < 0)
-   return err;
+   regulator_disable(innolux->avee);
+   regulator_disable(innolux->avdd);
+   regulator_disable(innolux->vddi);
 
innolux->prepared = false;
 
@@ -97,10 +117,18 @@ static int innolux_panel_prepare(struct drm_panel *panel)
 
gpiod_set_value_cansleep(innolux->enable_gpio, 0);
 
-   err = regulator_enable(innolux->supply);
+   err = regulator_enable(innolux->vddi);
if (err < 0)
return err;
 
+   err = regulator_enable(innolux->avdd);
+   if (err < 0)
+   goto disable_vddi;
+
+   err = regulator_enable(innolux->avee);
+   if (err < 0)
+   goto disable_avdd;
+
/* T2: 15ms - 1000ms */
usleep_range(15000, 16000);
 
@@ -134,12 +162,13 @@ static int innolux_panel_prepare(struct drm_panel *panel)
return 0;
 
 poweroff:
-   regulator_err = regulator_disable(innolux->supply);
-   if (regulator_err)
-   DRM_DEV_ERROR(panel->dev, "failed to disable regulator: %d\n",
- regulator_err);
-
gpiod_set_value_cansleep(innolux->enable_gpio, 0);
+   regulator_disable(innolux->avee);
+disable_avdd:
+   regulator_disable(innolux->avdd);
+disable_vddi:
+   regulator_disable(innolux->vddi);
+
return err;
 }
 
@@ -164,7 +193,7 @@ static int innolux_panel_enable(struct drm_panel *panel)
return 0;
 }
 
-static const struct drm_display_mode default_mode = {
+static const struct drm_display_mode innolux_p079zca_mode = {
.clock = 56900,
.hdisplay = 768,
.hsync_start = 768 + 40,
@@ -177,15 +206,59 @@ static const struct drm_display_mode default_mode = {
.vrefresh = 60,
 };
 
+static const struct panel_desc_dsi innolux_p079zca_panel_desc = {
+   .desc = {
+   .modes = _p079zca_mode,
+   .bpc = 8,
+   .size = {
+   .width = 120,
+   .height = 160,
+   },
+   },
+   .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
+MIPI_DSI_MODE_LPM,
+   .format = MIPI_DSI_FMT_RGB888,
+   .lanes = 4,
+};
+
+static const struct drm_display_mode innolux_p097pfg_mode = {
+   .clock = 22,
+   .hdisplay = 1536,
+   .hsync_start = 1536 + 100,
+   .hsync_end = 1536 + 100 + 24,
+   .htotal = 1536 + 100 + 24 + 100,
+   .vdisplay = 2048,
+   .vsync_start = 2048 + 18,
+   .vsync_end = 2048 + 18 + 2,
+   .vtotal = 2048 + 18 + 2 + 18,
+   .vrefresh = 60,
+};
+
+static const struct panel_desc_dsi innolux_p097pfg_panel_desc = {
+   .desc = {
+   .modes = _p097pfg_mode,
+   .bpc = 8,
+   .size = {
+   .width = 147,
+   .height = 196,
+   },
+   },
+   .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
+MIPI_DSI_MODE_LPM,
+   .format = MIPI_DSI_FMT_RGB888,
+   .lanes = 8,
+};
+
 static int innolux_panel_get_modes(struct drm_panel *panel)
 {
struct drm_display_mode *mode;
+   struct innolux_panel *innolux = to_innolux_panel(panel);
+   const struct drm_display_mode *m = innolux->dsi_desc->desc.modes;
 
-   mode = drm_mode_duplicate(panel->drm, _mode);
+   mode = 

[PATCH] drm/panel: support Innolux P097PFG panel

2017-11-29 Thread Lin Huang
Support Innolux P097PFG 9.7" 1536x2048 TFT LCD panel,
it refactor Innolux P079ZCA panel driver, let it support
multi panel, and add support P097PFG panel in this driver.

Change-Id: If342e58a3de2861219b0b1313f402b6cb41ffa29
Signed-off-by: Lin Huang 
---
 drivers/gpu/drm/panel/panel-innolux-p079zca.c | 178 --
 1 file changed, 136 insertions(+), 42 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-innolux-p079zca.c 
b/drivers/gpu/drm/panel/panel-innolux-p079zca.c
index 6ba9344..a40798f 100644
--- a/drivers/gpu/drm/panel/panel-innolux-p079zca.c
+++ b/drivers/gpu/drm/panel/panel-innolux-p079zca.c
@@ -20,12 +20,32 @@
 
 #include 
 
+struct panel_desc {
+   const struct drm_display_mode *modes;
+   unsigned int bpc;
+   struct {
+   unsigned int width;
+   unsigned int height;
+   } size;
+};
+
+struct panel_desc_dsi {
+   struct panel_desc desc;
+
+   unsigned long flags;
+   enum mipi_dsi_pixel_format format;
+   unsigned int lanes;
+};
+
 struct innolux_panel {
struct drm_panel base;
struct mipi_dsi_device *link;
+   const struct panel_desc_dsi *dsi_desc;
 
struct backlight_device *backlight;
-   struct regulator *supply;
+   struct regulator *vddi;
+   struct regulator *avdd;
+   struct regulator *avee;
struct gpio_desc *enable_gpio;
 
bool prepared;
@@ -78,9 +98,9 @@ static int innolux_panel_unprepare(struct drm_panel *panel)
/* T8: 80ms - 1000ms */
msleep(80);
 
-   err = regulator_disable(innolux->supply);
-   if (err < 0)
-   return err;
+   regulator_disable(innolux->avee);
+   regulator_disable(innolux->avdd);
+   regulator_disable(innolux->vddi);
 
innolux->prepared = false;
 
@@ -97,10 +117,18 @@ static int innolux_panel_prepare(struct drm_panel *panel)
 
gpiod_set_value_cansleep(innolux->enable_gpio, 0);
 
-   err = regulator_enable(innolux->supply);
+   err = regulator_enable(innolux->vddi);
if (err < 0)
return err;
 
+   err = regulator_enable(innolux->avdd);
+   if (err < 0)
+   goto disable_vddi;
+
+   err = regulator_enable(innolux->avee);
+   if (err < 0)
+   goto disable_avdd;
+
/* T2: 15ms - 1000ms */
usleep_range(15000, 16000);
 
@@ -134,12 +162,13 @@ static int innolux_panel_prepare(struct drm_panel *panel)
return 0;
 
 poweroff:
-   regulator_err = regulator_disable(innolux->supply);
-   if (regulator_err)
-   DRM_DEV_ERROR(panel->dev, "failed to disable regulator: %d\n",
- regulator_err);
-
gpiod_set_value_cansleep(innolux->enable_gpio, 0);
+   regulator_disable(innolux->avee);
+disable_avdd:
+   regulator_disable(innolux->avdd);
+disable_vddi:
+   regulator_disable(innolux->vddi);
+
return err;
 }
 
@@ -164,7 +193,7 @@ static int innolux_panel_enable(struct drm_panel *panel)
return 0;
 }
 
-static const struct drm_display_mode default_mode = {
+static const struct drm_display_mode innolux_p079zca_mode = {
.clock = 56900,
.hdisplay = 768,
.hsync_start = 768 + 40,
@@ -177,15 +206,59 @@ static const struct drm_display_mode default_mode = {
.vrefresh = 60,
 };
 
+static const struct panel_desc_dsi innolux_p079zca_panel_desc = {
+   .desc = {
+   .modes = _p079zca_mode,
+   .bpc = 8,
+   .size = {
+   .width = 120,
+   .height = 160,
+   },
+   },
+   .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
+MIPI_DSI_MODE_LPM,
+   .format = MIPI_DSI_FMT_RGB888,
+   .lanes = 4,
+};
+
+static const struct drm_display_mode innolux_p097pfg_mode = {
+   .clock = 22,
+   .hdisplay = 1536,
+   .hsync_start = 1536 + 100,
+   .hsync_end = 1536 + 100 + 24,
+   .htotal = 1536 + 100 + 24 + 100,
+   .vdisplay = 2048,
+   .vsync_start = 2048 + 18,
+   .vsync_end = 2048 + 18 + 2,
+   .vtotal = 2048 + 18 + 2 + 18,
+   .vrefresh = 60,
+};
+
+static const struct panel_desc_dsi innolux_p097pfg_panel_desc = {
+   .desc = {
+   .modes = _p097pfg_mode,
+   .bpc = 8,
+   .size = {
+   .width = 147,
+   .height = 196,
+   },
+   },
+   .flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
+MIPI_DSI_MODE_LPM,
+   .format = MIPI_DSI_FMT_RGB888,
+   .lanes = 8,
+};
+
 static int innolux_panel_get_modes(struct drm_panel *panel)
 {
struct drm_display_mode *mode;
+   struct innolux_panel *innolux = to_innolux_panel(panel);
+   const struct drm_display_mode *m = innolux->dsi_desc->desc.modes;
 
-   mode = drm_mode_duplicate(panel->drm, _mode);
+   mode =