Re: [PATCH v4 RESEND] drm/panel: add Kingdisplay kd097d04 panel driver

2019-01-28 Thread Ezequiel Garcia
On Mon, 28 Jan 2019 at 12:59, Thierry Reding  wrote:
>
> On Thu, Jan 24, 2019 at 12:51:36PM -0500, Sean Paul wrote:
> > On Thu, Jan 24, 2019 at 05:18:12PM +0100, Thierry Reding wrote:
> > > On Thu, Jan 24, 2019 at 12:01:55PM -0300, Ezequiel Garcia wrote:
> > > > On Tue, 2018-10-30 at 10:15 +0100, Heiko Stuebner wrote:
> > > > > From: Nickey Yang 
> > > > >
> > > > > Support Kingdisplay kd097d04 9.7" 1536x2048 TFT LCD panel,
> > > > > it is a MIPI dual-DSI panel.
> > > > >
> > > > > v4-resend:
> > > > > - Thierry noted missing dt-bindings for v4 but forgot that he
> > > > >   already had applied them one kernel release back in
> > > > >   
> > > > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ebc950fdff6d5f9250cd5a5a348af97f7d8508df
> > > > > v4:
> > > > > - address Philipp's comments
> > > > >   - real range for usleep_range and
> > > > >   - poweroff ordering in kingdisplay_panel_prepare
> > > > >   - return value beautification in panel_probe
> > > > > - update author naming for full name
> > > > > v3:
> > > > > - address Thierry's comments
> > > > >   - error handling for init dsi writes in init
> > > > >   - unconditionally remove the panel
> > > > >   - don't use drm_panel_detach
> > > > >   - a bit of variable signednes wiggling
> > > > > - I did talk to ChromeOS people and the delays really should be as 
> > > > > short
> > > > >   as possible, so dropped the 100ms from the delay comments
> > > > > v2:
> > > > > - update timing + cmds from chromeos kernel
> > > > > - new backlight API including switch to devm_of_find_backlight
> > > > > - fix most of Sean Paul's comments
> > > > >   enable/prepare tracking seems something all panels do
> > > > > - document origins of the init sequence
> > > > > - lanes per dsi interface to 4 (two interfaces). Matches how tegra
> > > > >   and pending rockchip dual-dsi handle (dual-)dsi lanes
> > > > > - spdx header instead of license boilerplate
> > > > >
> > > > > Signed-off-by: Nickey Yang 
> > > > > Signed-off-by: Heiko Stuebner 
> > > >
> > > > Hm, this v4 patch has been stalling here for *four full months*.
> > > >
> > > > Which deity do we need to pray to get this one moving? ;-)
> > > >
> > > > Seriously, can someone please apply this?
> > >
> > > If you care about this driver, perhaps you'd like to review and provide
> > > a Reviewed-by?
> >
> > Looks good to me,
> >
> > Reviewed-by: Sean Paul 
>
> I was aiming for a Reviewed-by from Ezequiel, but I'll take yours as
> well, thanks very much.
>

Looks like this got reviewed and merged before I could react.

Thanks Sean and reviewing and Thierry for merging it!
-- 
Ezequiel García, VanguardiaSur
www.vanguardiasur.com.ar
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v4 RESEND] drm/panel: add Kingdisplay kd097d04 panel driver

2019-01-28 Thread Thierry Reding
On Thu, Jan 24, 2019 at 12:51:36PM -0500, Sean Paul wrote:
> On Thu, Jan 24, 2019 at 05:18:12PM +0100, Thierry Reding wrote:
> > On Thu, Jan 24, 2019 at 12:01:55PM -0300, Ezequiel Garcia wrote:
> > > On Tue, 2018-10-30 at 10:15 +0100, Heiko Stuebner wrote:
> > > > From: Nickey Yang 
> > > > 
> > > > Support Kingdisplay kd097d04 9.7" 1536x2048 TFT LCD panel,
> > > > it is a MIPI dual-DSI panel.
> > > > 
> > > > v4-resend:
> > > > - Thierry noted missing dt-bindings for v4 but forgot that he
> > > >   already had applied them one kernel release back in
> > > >   
> > > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ebc950fdff6d5f9250cd5a5a348af97f7d8508df
> > > > v4:
> > > > - address Philipp's comments
> > > >   - real range for usleep_range and
> > > >   - poweroff ordering in kingdisplay_panel_prepare
> > > >   - return value beautification in panel_probe
> > > > - update author naming for full name
> > > > v3:
> > > > - address Thierry's comments
> > > >   - error handling for init dsi writes in init
> > > >   - unconditionally remove the panel
> > > >   - don't use drm_panel_detach
> > > >   - a bit of variable signednes wiggling
> > > > - I did talk to ChromeOS people and the delays really should be as short
> > > >   as possible, so dropped the 100ms from the delay comments
> > > > v2:
> > > > - update timing + cmds from chromeos kernel
> > > > - new backlight API including switch to devm_of_find_backlight
> > > > - fix most of Sean Paul's comments
> > > >   enable/prepare tracking seems something all panels do
> > > > - document origins of the init sequence
> > > > - lanes per dsi interface to 4 (two interfaces). Matches how tegra
> > > >   and pending rockchip dual-dsi handle (dual-)dsi lanes
> > > > - spdx header instead of license boilerplate
> > > > 
> > > > Signed-off-by: Nickey Yang 
> > > > Signed-off-by: Heiko Stuebner 
> > > 
> > > Hm, this v4 patch has been stalling here for *four full months*.
> > > 
> > > Which deity do we need to pray to get this one moving? ;-)
> > > 
> > > Seriously, can someone please apply this?
> > 
> > If you care about this driver, perhaps you'd like to review and provide
> > a Reviewed-by?
> 
> Looks good to me,
> 
> Reviewed-by: Sean Paul 

I was aiming for a Reviewed-by from Ezequiel, but I'll take yours as
well, thanks very much.

Thierry


signature.asc
Description: PGP signature
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v4 RESEND] drm/panel: add Kingdisplay kd097d04 panel driver

2019-01-28 Thread Thierry Reding
On Tue, Oct 30, 2018 at 10:15:28AM +0100, Heiko Stuebner wrote:
> From: Nickey Yang 
> 
> Support Kingdisplay kd097d04 9.7" 1536x2048 TFT LCD panel,
> it is a MIPI dual-DSI panel.
> 
> v4-resend:
> - Thierry noted missing dt-bindings for v4 but forgot that he
>   already had applied them one kernel release back in
>   
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ebc950fdff6d5f9250cd5a5a348af97f7d8508df
> v4:
> - address Philipp's comments
>   - real range for usleep_range and
>   - poweroff ordering in kingdisplay_panel_prepare
>   - return value beautification in panel_probe
> - update author naming for full name
> v3:
> - address Thierry's comments
>   - error handling for init dsi writes in init
>   - unconditionally remove the panel
>   - don't use drm_panel_detach
>   - a bit of variable signednes wiggling
> - I did talk to ChromeOS people and the delays really should be as short
>   as possible, so dropped the 100ms from the delay comments
> v2:
> - update timing + cmds from chromeos kernel
> - new backlight API including switch to devm_of_find_backlight
> - fix most of Sean Paul's comments
>   enable/prepare tracking seems something all panels do
> - document origins of the init sequence
> - lanes per dsi interface to 4 (two interfaces). Matches how tegra
>   and pending rockchip dual-dsi handle (dual-)dsi lanes
> - spdx header instead of license boilerplate
> 
> Signed-off-by: Nickey Yang 
> Signed-off-by: Heiko Stuebner 
> ---
>  drivers/gpu/drm/panel/Kconfig |  11 +
>  drivers/gpu/drm/panel/Makefile|   1 +
>  .../drm/panel/panel-kingdisplay-kd097d04.c| 473 ++
>  3 files changed, 485 insertions(+)
>  create mode 100644 drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c

Applied to drm-misc-next, thanks.

Thierry


signature.asc
Description: PGP signature
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v4 RESEND] drm/panel: add Kingdisplay kd097d04 panel driver

2019-01-24 Thread Sean Paul
On Thu, Jan 24, 2019 at 05:18:12PM +0100, Thierry Reding wrote:
> On Thu, Jan 24, 2019 at 12:01:55PM -0300, Ezequiel Garcia wrote:
> > On Tue, 2018-10-30 at 10:15 +0100, Heiko Stuebner wrote:
> > > From: Nickey Yang 
> > > 
> > > Support Kingdisplay kd097d04 9.7" 1536x2048 TFT LCD panel,
> > > it is a MIPI dual-DSI panel.
> > > 
> > > v4-resend:
> > > - Thierry noted missing dt-bindings for v4 but forgot that he
> > >   already had applied them one kernel release back in
> > >   
> > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ebc950fdff6d5f9250cd5a5a348af97f7d8508df
> > > v4:
> > > - address Philipp's comments
> > >   - real range for usleep_range and
> > >   - poweroff ordering in kingdisplay_panel_prepare
> > >   - return value beautification in panel_probe
> > > - update author naming for full name
> > > v3:
> > > - address Thierry's comments
> > >   - error handling for init dsi writes in init
> > >   - unconditionally remove the panel
> > >   - don't use drm_panel_detach
> > >   - a bit of variable signednes wiggling
> > > - I did talk to ChromeOS people and the delays really should be as short
> > >   as possible, so dropped the 100ms from the delay comments
> > > v2:
> > > - update timing + cmds from chromeos kernel
> > > - new backlight API including switch to devm_of_find_backlight
> > > - fix most of Sean Paul's comments
> > >   enable/prepare tracking seems something all panels do
> > > - document origins of the init sequence
> > > - lanes per dsi interface to 4 (two interfaces). Matches how tegra
> > >   and pending rockchip dual-dsi handle (dual-)dsi lanes
> > > - spdx header instead of license boilerplate
> > > 
> > > Signed-off-by: Nickey Yang 
> > > Signed-off-by: Heiko Stuebner 
> > 
> > Hm, this v4 patch has been stalling here for *four full months*.
> > 
> > Which deity do we need to pray to get this one moving? ;-)
> > 
> > Seriously, can someone please apply this?
> 
> If you care about this driver, perhaps you'd like to review and provide
> a Reviewed-by?

Looks good to me,

Reviewed-by: Sean Paul 

> 
> Thierry



-- 
Sean Paul, Software Engineer, Google / Chromium OS
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v4 RESEND] drm/panel: add Kingdisplay kd097d04 panel driver

2019-01-24 Thread Thierry Reding
On Thu, Jan 24, 2019 at 12:01:55PM -0300, Ezequiel Garcia wrote:
> On Tue, 2018-10-30 at 10:15 +0100, Heiko Stuebner wrote:
> > From: Nickey Yang 
> > 
> > Support Kingdisplay kd097d04 9.7" 1536x2048 TFT LCD panel,
> > it is a MIPI dual-DSI panel.
> > 
> > v4-resend:
> > - Thierry noted missing dt-bindings for v4 but forgot that he
> >   already had applied them one kernel release back in
> >   
> > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ebc950fdff6d5f9250cd5a5a348af97f7d8508df
> > v4:
> > - address Philipp's comments
> >   - real range for usleep_range and
> >   - poweroff ordering in kingdisplay_panel_prepare
> >   - return value beautification in panel_probe
> > - update author naming for full name
> > v3:
> > - address Thierry's comments
> >   - error handling for init dsi writes in init
> >   - unconditionally remove the panel
> >   - don't use drm_panel_detach
> >   - a bit of variable signednes wiggling
> > - I did talk to ChromeOS people and the delays really should be as short
> >   as possible, so dropped the 100ms from the delay comments
> > v2:
> > - update timing + cmds from chromeos kernel
> > - new backlight API including switch to devm_of_find_backlight
> > - fix most of Sean Paul's comments
> >   enable/prepare tracking seems something all panels do
> > - document origins of the init sequence
> > - lanes per dsi interface to 4 (two interfaces). Matches how tegra
> >   and pending rockchip dual-dsi handle (dual-)dsi lanes
> > - spdx header instead of license boilerplate
> > 
> > Signed-off-by: Nickey Yang 
> > Signed-off-by: Heiko Stuebner 
> 
> Hm, this v4 patch has been stalling here for *four full months*.
> 
> Which deity do we need to pray to get this one moving? ;-)
> 
> Seriously, can someone please apply this?

If you care about this driver, perhaps you'd like to review and provide
a Reviewed-by?

Thierry


signature.asc
Description: PGP signature
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v4 RESEND] drm/panel: add Kingdisplay kd097d04 panel driver

2019-01-24 Thread Ezequiel Garcia
On Tue, 2018-10-30 at 10:15 +0100, Heiko Stuebner wrote:
> From: Nickey Yang 
> 
> Support Kingdisplay kd097d04 9.7" 1536x2048 TFT LCD panel,
> it is a MIPI dual-DSI panel.
> 
> v4-resend:
> - Thierry noted missing dt-bindings for v4 but forgot that he
>   already had applied them one kernel release back in
>   
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ebc950fdff6d5f9250cd5a5a348af97f7d8508df
> v4:
> - address Philipp's comments
>   - real range for usleep_range and
>   - poweroff ordering in kingdisplay_panel_prepare
>   - return value beautification in panel_probe
> - update author naming for full name
> v3:
> - address Thierry's comments
>   - error handling for init dsi writes in init
>   - unconditionally remove the panel
>   - don't use drm_panel_detach
>   - a bit of variable signednes wiggling
> - I did talk to ChromeOS people and the delays really should be as short
>   as possible, so dropped the 100ms from the delay comments
> v2:
> - update timing + cmds from chromeos kernel
> - new backlight API including switch to devm_of_find_backlight
> - fix most of Sean Paul's comments
>   enable/prepare tracking seems something all panels do
> - document origins of the init sequence
> - lanes per dsi interface to 4 (two interfaces). Matches how tegra
>   and pending rockchip dual-dsi handle (dual-)dsi lanes
> - spdx header instead of license boilerplate
> 
> Signed-off-by: Nickey Yang 
> Signed-off-by: Heiko Stuebner 

Hm, this v4 patch has been stalling here for *four full months*.

Which deity do we need to pray to get this one moving? ;-)

Seriously, can someone please apply this?

> ---
>  drivers/gpu/drm/panel/Kconfig |  11 +
>  drivers/gpu/drm/panel/Makefile|   1 +
>  .../drm/panel/panel-kingdisplay-kd097d04.c| 473 ++
>  3 files changed, 485 insertions(+)
>  create mode 100644 drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c
> 
> diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
> index 6020c30a33b3..458253dc0842 100644
> --- a/drivers/gpu/drm/panel/Kconfig
> +++ b/drivers/gpu/drm/panel/Kconfig
> @@ -77,6 +77,17 @@ config DRM_PANEL_JDI_LT070ME05000
> The panel has a 1200(RGB)×1920 (WUXGA) resolution and uses
> 24 bit per pixel.
>  
> +config DRM_PANEL_KINGDISPLAY_KD097D04
> + tristate "Kingdisplay kd097d04 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 Kingdisplay kd097d04
> +   TFT-LCD modules. The panel has a 1536x2048 resolution and uses
> +   24 bit RGB per pixel. It provides a MIPI DSI interface to
> +   the host and has a built-in LED backlight.
> +
>  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 5ccaaa9d13af..d59f75b84d48 100644
> --- a/drivers/gpu/drm/panel/Makefile
> +++ b/drivers/gpu/drm/panel/Makefile
> @@ -6,6 +6,7 @@ obj-$(CONFIG_DRM_PANEL_ILITEK_IL9322) += 
> panel-ilitek-ili9322.o
>  obj-$(CONFIG_DRM_PANEL_ILITEK_ILI9881C) += panel-ilitek-ili9881c.o
>  obj-$(CONFIG_DRM_PANEL_INNOLUX_P079ZCA) += panel-innolux-p079zca.o
>  obj-$(CONFIG_DRM_PANEL_JDI_LT070ME05000) += panel-jdi-lt070me05000.o
> +obj-$(CONFIG_DRM_PANEL_KINGDISPLAY_KD097D04) += panel-kingdisplay-kd097d04.o
>  obj-$(CONFIG_DRM_PANEL_LG_LG4573) += panel-lg-lg4573.o
>  obj-$(CONFIG_DRM_PANEL_ORISETECH_OTM8009A) += panel-orisetech-otm8009a.o
>  obj-$(CONFIG_DRM_PANEL_PANASONIC_VVX10F034N00) += 
> panel-panasonic-vvx10f034n00.o
> diff --git a/drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c 
> b/drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c
> new file mode 100644
> index ..2a25a914d09e
> --- /dev/null
> +++ b/drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c
> @@ -0,0 +1,473 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + * Copyright (c) 2017, Fuzhou Rockchip Electronics Co., Ltd
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include 
> +
> +struct kingdisplay_panel {
> + struct drm_panel base;
> + struct mipi_dsi_device *link;
> +
> + struct backlight_device *backlight;
> + struct regulator *supply;
> + struct gpio_desc *enable_gpio;
> +
> + bool prepared;
> + bool enabled;
> +};
> +
> +struct kingdisplay_panel_cmd {
> + char cmd;
> + char data;
> +};
> +
> +/*
> + * According to the discussion on
> + * https://review.coreboot.org/#/c/coreboot/+/22472/
> + * the panel init array is not part of the panels datasheet but instead
> + * just came in this form from the panel vendor.
> + */
> +static const struct kingdisplay_panel_cmd init_code[] = {
> + /* voltage setting */
> + { 0xB0, 0x00 },
> + { 0xB2, 0x02 },
> + { 0xB3, 0x11 },
> + { 

[PATCH v4 RESEND] drm/panel: add Kingdisplay kd097d04 panel driver

2018-10-30 Thread Heiko Stuebner
From: Nickey Yang 

Support Kingdisplay kd097d04 9.7" 1536x2048 TFT LCD panel,
it is a MIPI dual-DSI panel.

v4-resend:
- Thierry noted missing dt-bindings for v4 but forgot that he
  already had applied them one kernel release back in
  
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ebc950fdff6d5f9250cd5a5a348af97f7d8508df
v4:
- address Philipp's comments
  - real range for usleep_range and
  - poweroff ordering in kingdisplay_panel_prepare
  - return value beautification in panel_probe
- update author naming for full name
v3:
- address Thierry's comments
  - error handling for init dsi writes in init
  - unconditionally remove the panel
  - don't use drm_panel_detach
  - a bit of variable signednes wiggling
- I did talk to ChromeOS people and the delays really should be as short
  as possible, so dropped the 100ms from the delay comments
v2:
- update timing + cmds from chromeos kernel
- new backlight API including switch to devm_of_find_backlight
- fix most of Sean Paul's comments
  enable/prepare tracking seems something all panels do
- document origins of the init sequence
- lanes per dsi interface to 4 (two interfaces). Matches how tegra
  and pending rockchip dual-dsi handle (dual-)dsi lanes
- spdx header instead of license boilerplate

Signed-off-by: Nickey Yang 
Signed-off-by: Heiko Stuebner 
---
 drivers/gpu/drm/panel/Kconfig |  11 +
 drivers/gpu/drm/panel/Makefile|   1 +
 .../drm/panel/panel-kingdisplay-kd097d04.c| 473 ++
 3 files changed, 485 insertions(+)
 create mode 100644 drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c

diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index 6020c30a33b3..458253dc0842 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -77,6 +77,17 @@ config DRM_PANEL_JDI_LT070ME05000
  The panel has a 1200(RGB)×1920 (WUXGA) resolution and uses
  24 bit per pixel.
 
+config DRM_PANEL_KINGDISPLAY_KD097D04
+   tristate "Kingdisplay kd097d04 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 Kingdisplay kd097d04
+ TFT-LCD modules. The panel has a 1536x2048 resolution and uses
+ 24 bit RGB per pixel. It provides a MIPI DSI interface to
+ the host and has a built-in LED backlight.
+
 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 5ccaaa9d13af..d59f75b84d48 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -6,6 +6,7 @@ obj-$(CONFIG_DRM_PANEL_ILITEK_IL9322) += panel-ilitek-ili9322.o
 obj-$(CONFIG_DRM_PANEL_ILITEK_ILI9881C) += panel-ilitek-ili9881c.o
 obj-$(CONFIG_DRM_PANEL_INNOLUX_P079ZCA) += panel-innolux-p079zca.o
 obj-$(CONFIG_DRM_PANEL_JDI_LT070ME05000) += panel-jdi-lt070me05000.o
+obj-$(CONFIG_DRM_PANEL_KINGDISPLAY_KD097D04) += panel-kingdisplay-kd097d04.o
 obj-$(CONFIG_DRM_PANEL_LG_LG4573) += panel-lg-lg4573.o
 obj-$(CONFIG_DRM_PANEL_ORISETECH_OTM8009A) += panel-orisetech-otm8009a.o
 obj-$(CONFIG_DRM_PANEL_PANASONIC_VVX10F034N00) += 
panel-panasonic-vvx10f034n00.o
diff --git a/drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c 
b/drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c
new file mode 100644
index ..2a25a914d09e
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c
@@ -0,0 +1,473 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (c) 2017, Fuzhou Rockchip Electronics Co., Ltd
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+struct kingdisplay_panel {
+   struct drm_panel base;
+   struct mipi_dsi_device *link;
+
+   struct backlight_device *backlight;
+   struct regulator *supply;
+   struct gpio_desc *enable_gpio;
+
+   bool prepared;
+   bool enabled;
+};
+
+struct kingdisplay_panel_cmd {
+   char cmd;
+   char data;
+};
+
+/*
+ * According to the discussion on
+ * https://review.coreboot.org/#/c/coreboot/+/22472/
+ * the panel init array is not part of the panels datasheet but instead
+ * just came in this form from the panel vendor.
+ */
+static const struct kingdisplay_panel_cmd init_code[] = {
+   /* voltage setting */
+   { 0xB0, 0x00 },
+   { 0xB2, 0x02 },
+   { 0xB3, 0x11 },
+   { 0xB4, 0x00 },
+   { 0xB6, 0x80 },
+   /* VCOM disable */
+   { 0xB7, 0x02 },
+   { 0xB8, 0x80 },
+   { 0xBA, 0x43 },
+   /* VCOM setting */
+   { 0xBB, 0x53 },
+   /* VSP setting */
+   { 0xBC, 0x0A },
+   /* VSN setting */
+   { 0xBD, 0x4A },
+   /* VGH setting */
+   { 0xBE, 0x2F },
+   /* VGL setting */
+   { 0xBF, 0x1A },
+   { 0xF0, 0x39 },
+   { 0xF1, 0x22 },
+