Re: [PATCH] [v8, 2/2] drm/panel: Add Boe Himax8279d MIPI-DSI LCD panel

2019-04-25 Thread Jerry Han
Hi Thierry Reding:

*Could you please help to check whether there is any problem with the
sign-off identity**?*

*Thanks*

Jerry Han  于2019年4月25日周四 上午11:27写道:

> Support Boe Himax8279d 8.0" 1200x1920 TFT LCD panel, it is a MIPI DSI
> panel.
>
> V8:
> - Modify communication address
>
> V7:
> - Add the information of the reviewer
> - Remove unnecessary delays, The udelay_range code gracefully returns
> without hitting the scheduler on a delay of 0. (Derek)
> - Merge the same data structures, like display_mode and off_cmds (Derek)
> - Optimize the processing of results returned by
> devm_gpiod_get_optional (Derek)
>
> V6:
> - Add the information of the reviewer (Sam)
> - Delete unnecessary header files #include  (Sam)
> - The config DRM_PANEL_BOE_HIMAX8279D appears twice. Drop one of them (Sam)
> - ADD static, set_gpios function is not used outside this module (Sam)
>
> V5:
> - Added changelog
>
> V4:
> - Frefix all function maes with boe_ (Sam)
> - Fsed "enable_gpio" replace "reset_gpio", Make it look clearer (Sam)
> - Sort include lines alphabetically (Sam)
> - Fixed entries in the makefile must be sorted alphabetically (Sam)
> - Add send_mipi_cmds function to avoid duplicating the code (Sam)
> - Add the necessary delay(reset_delay_t5) between reset and sending
> the initialization command (Rock wang)
>
> V3:
> - Remove unnecessary delays in sending initialization commands (Jitao Shi)
>
> V2:
> - Use SPDX identifier (Sam)
> - Use necessary header files replace drmP.h (Sam)
> - Delete unnecessary header files #include  (Sam)
> - Specifies a GPIOs array to control the reset timing,
> instead of reading "dsi-reset-sequence" data from DTS (Sam)
> - Delete backlight_disable() function when already disabled (Sam)
> - Use devm_of_find_backlight() replace of_find_backlight_by_node() (Sam)
> - Move the necessary data in the DTS to the current file,
> like porch, display_mode and Init code etc. (Sam)
> - Add compatible device "boe,himax8279d10p" (Sam)
>
> Signed-off-by: Jerry Han 
> Reviewed-by: Sam Ravnborg 
> Reviewed-by: Derek Basehore 
> Cc: Jitao Shi 
> Cc: Rock wang 
> ---
>  MAINTAINERS  |6 +
>  drivers/gpu/drm/panel/Kconfig|   11 +
>  drivers/gpu/drm/panel/Makefile   |1 +
>  drivers/gpu/drm/panel/panel-boe-himax8279d.c | 1050 ++
>  4 files changed, 1068 insertions(+)
>  create mode 100644 drivers/gpu/drm/panel/panel-boe-himax8279d.c
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index f8e63bcc4c1c..267468ca72bb 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -4816,6 +4816,12 @@ T:   git git://
> anongit.freedesktop.org/drm/drm-misc
>  S: Maintained
>  F: drivers/gpu/drm/bochs/
>
> +DRM DRIVER FOR BOE HIMAX8279D PANELS
> +M: Jerry Han 
> +S: Maintained
> +F: drivers/gpu/drm/panel/panel-boe-himax8279d.c
> +F: Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt
> +
>  DRM DRIVER FOR FARADAY TVE200 TV ENCODER
>  M: Linus Walleij 
>  T: git git://anongit.freedesktop.org/drm/drm-misc
> diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
> index f53f817356db..fe2f87cc6627 100644
> --- a/drivers/gpu/drm/panel/Kconfig
> +++ b/drivers/gpu/drm/panel/Kconfig
> @@ -17,6 +17,17 @@ config DRM_PANEL_ARM_VERSATILE
>   reference designs. The panel is detected using special registers
>   in the Versatile family syscon registers.
>
> +config DRM_PANEL_BOE_HIMAX8279D
> +   tristate "Boe Himax8279d 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 Boe Himax8279d
> + TFT-LCD modules. The panel has a 1200x1920 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_LVDS
> tristate "Generic LVDS panel driver"
> depends on OF
> diff --git a/drivers/gpu/drm/panel/Makefile
> b/drivers/gpu/drm/panel/Makefile
> index 7834947a53b0..c4814b6f069e 100644
> --- a/drivers/gpu/drm/panel/Makefile
> +++ b/drivers/gpu/drm/panel/Makefile
> @@ -1,5 +1,6 @@
>  # SPDX-License-Identifier: GPL-2.0
>  obj-$(CONFIG_DRM_PANEL_ARM_VERSATILE) += panel-arm-versatile.o
> +obj-$(CONFIG_DRM_PANEL_BOE_HIMAX8279D) += panel-boe-himax8279d.o
>  obj-$(CONFIG_DRM_PANEL_LVDS) += panel-lvds.o
>  obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o
>  obj-$(CONFIG_DRM_PANEL_ILITEK_IL9322) += panel-ilitek-i

[PATCH] [v8,2/2] drm/panel: Add Boe Himax8279d MIPI-DSI LCD panel

2019-04-25 Thread Jerry Han
Support Boe Himax8279d 8.0" 1200x1920 TFT LCD panel, it is a MIPI DSI
panel.

V8:
- Modify communication address

V7:
- Add the information of the reviewer
- Remove unnecessary delays, The udelay_range code gracefully returns
without hitting the scheduler on a delay of 0. (Derek)
- Merge the same data structures, like display_mode and off_cmds (Derek)
- Optimize the processing of results returned by
devm_gpiod_get_optional (Derek)

V6:
- Add the information of the reviewer (Sam)
- Delete unnecessary header files #include  (Sam)
- The config DRM_PANEL_BOE_HIMAX8279D appears twice. Drop one of them (Sam)
- ADD static, set_gpios function is not used outside this module (Sam)

V5:
- Added changelog

V4:
- Frefix all function maes with boe_ (Sam)
- Fsed "enable_gpio" replace "reset_gpio", Make it look clearer (Sam)
- Sort include lines alphabetically (Sam)
- Fixed entries in the makefile must be sorted alphabetically (Sam)
- Add send_mipi_cmds function to avoid duplicating the code (Sam)
- Add the necessary delay(reset_delay_t5) between reset and sending
the initialization command (Rock wang)

V3:
- Remove unnecessary delays in sending initialization commands (Jitao Shi)

V2:
- Use SPDX identifier (Sam)
- Use necessary header files replace drmP.h (Sam)
- Delete unnecessary header files #include  (Sam)
- Specifies a GPIOs array to control the reset timing,
instead of reading "dsi-reset-sequence" data from DTS (Sam)
- Delete backlight_disable() function when already disabled (Sam)
- Use devm_of_find_backlight() replace of_find_backlight_by_node() (Sam)
- Move the necessary data in the DTS to the current file,
like porch, display_mode and Init code etc. (Sam)
- Add compatible device "boe,himax8279d10p" (Sam)

Signed-off-by: Jerry Han 
Reviewed-by: Sam Ravnborg 
Reviewed-by: Derek Basehore 
Cc: Jitao Shi 
Cc: Rock wang 
---
 MAINTAINERS  |6 +
 drivers/gpu/drm/panel/Kconfig|   11 +
 drivers/gpu/drm/panel/Makefile   |1 +
 drivers/gpu/drm/panel/panel-boe-himax8279d.c | 1050 ++
 4 files changed, 1068 insertions(+)
 create mode 100644 drivers/gpu/drm/panel/panel-boe-himax8279d.c

diff --git a/MAINTAINERS b/MAINTAINERS
index f8e63bcc4c1c..267468ca72bb 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4816,6 +4816,12 @@ T:   git git://anongit.freedesktop.org/drm/drm-misc
 S: Maintained
 F: drivers/gpu/drm/bochs/
 
+DRM DRIVER FOR BOE HIMAX8279D PANELS
+M: Jerry Han 
+S: Maintained
+F: drivers/gpu/drm/panel/panel-boe-himax8279d.c
+F: Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt
+
 DRM DRIVER FOR FARADAY TVE200 TV ENCODER
 M: Linus Walleij 
 T: git git://anongit.freedesktop.org/drm/drm-misc
diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index f53f817356db..fe2f87cc6627 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -17,6 +17,17 @@ config DRM_PANEL_ARM_VERSATILE
  reference designs. The panel is detected using special registers
  in the Versatile family syscon registers.
 
+config DRM_PANEL_BOE_HIMAX8279D
+   tristate "Boe Himax8279d 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 Boe Himax8279d
+ TFT-LCD modules. The panel has a 1200x1920 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_LVDS
tristate "Generic LVDS panel driver"
depends on OF
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index 7834947a53b0..c4814b6f069e 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -1,5 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 obj-$(CONFIG_DRM_PANEL_ARM_VERSATILE) += panel-arm-versatile.o
+obj-$(CONFIG_DRM_PANEL_BOE_HIMAX8279D) += panel-boe-himax8279d.o
 obj-$(CONFIG_DRM_PANEL_LVDS) += panel-lvds.o
 obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o
 obj-$(CONFIG_DRM_PANEL_ILITEK_IL9322) += panel-ilitek-ili9322.o
diff --git a/drivers/gpu/drm/panel/panel-boe-himax8279d.c 
b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
new file mode 100644
index ..9c8ece4fa30a
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
@@ -0,0 +1,1050 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2019, Huaqin Telecom Technology Co., Ltd
+ *
+ * Author: Jerry Han 
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+struct panel_cmd {
+   size_t len;
+   const char *data;
+};
+
+#define _INIT_CMD(...) { \
+   .len = sizeof((char[]){__VA_ARGS__}), \
+   .data = (c

[PATCH] [v8, 1/2] dt-bindings: panel: Add Boe Himax8279d is 1200x1920, 4-lane MIPI-DSI LCD panel

2019-04-25 Thread Jerry Han
The Boe Himax8279d is a 8.0" panel with a 1200x1920 resolution and
connected to DSI using four lanes.

V8:
- Modify communication address

V7:
- Add the information of the reviewer

V6:
- Add the information of the reviewer

V5:
- Added changelog

V4:
- None

V3:
- None

V2:
- Add compatible device "boe,himax8279d10p" (Sam)
- Add the necessary property descriptions (Sam)

Signed-off-by: Jerry Han 
Reviewed-by: Sam Ravnborg 
Reviewed-by: Derek Basehore 
Cc: Jitao Shi 
Cc: Rock wang 
---
 .../bindings/display/panel/boe,himax8279d.txt | 24 +++
 1 file changed, 24 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt

diff --git a/Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt 
b/Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt
new file mode 100644
index ..3caea2172b1b
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt
@@ -0,0 +1,24 @@
+Boe Himax8279d 1200x1920 TFT LCD panel
+
+Required properties:
+- compatible: should be "boe,himax8279d8p" and one of: "boe,himax8279d10p"
+- reg: DSI virtual channel of the peripheral
+- enable-gpios: panel enable gpio
+- pp33-gpios: a GPIO phandle for the 3.3v pin that provides the supply voltage
+- pp18-gpios: a GPIO phandle for the 1.8v pin that provides the supply voltage
+
+Optional properties:
+- backlight: phandle of the backlight device attached to the panel
+
+Example:
+
+   &mipi_dsi {
+   panel {
+   compatible = "boe,himax8279d8p", "boe,himax8279d10p";
+   reg = <0>;
+   backlight = <&backlight>;
+   enable-gpios = <&gpio 45 GPIO_ACTIVE_HIGH>;
+   pp33-gpios = <&gpio 35 GPIO_ACTIVE_HIGH>;
+   pp18-gpios = <&gpio 36 GPIO_ACTIVE_HIGH>;
+   };
+   };
-- 
2.17.1

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

Re: [PATCH] [v8,1/2] dt-bindings: panel: Add Boe Himax8279d is 1200x1920, 4-lane MIPI-DSI LCD panel

2019-04-25 Thread Jerry Han
Hi Thierry Reding:

*Could you please help to check whether there is any problem with the
sign-off identity**?*


*Thanks*

Jerry Han  于2019年4月25日周四 上午11:18写道:

> The Boe Himax8279d is a 8.0" panel with a 1200x1920 resolution and
> connected to DSI using four lanes.
>
> V8:
> - Modify communication address
>
> V7:
> - Add the information of the reviewer
>
> V6:
> - Add the information of the reviewer
>
> V5:
> - Added changelog
>
> V4:
> - None
>
> V3:
> - None
>
> V2:
> - Add compatible device "boe,himax8279d10p" (Sam)
> - Add the necessary property descriptions (Sam)
>
> Signed-off-by: Jerry Han 
> Reviewed-by: Sam Ravnborg 
> Reviewed-by: Derek Basehore 
> Cc: Jitao Shi 
> Cc: Rock wang 
> ---
>  .../bindings/display/panel/boe,himax8279d.txt | 24 +++
>  1 file changed, 24 insertions(+)
>  create mode 100644
> Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt
>
> diff --git
> a/Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt
> b/Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt
> new file mode 100644
> index ..3caea2172b1b
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt
> @@ -0,0 +1,24 @@
> +Boe Himax8279d 1200x1920 TFT LCD panel
> +
> +Required properties:
> +- compatible: should be "boe,himax8279d8p" and one of: "boe,himax8279d10p"
> +- reg: DSI virtual channel of the peripheral
> +- enable-gpios: panel enable gpio
> +- pp33-gpios: a GPIO phandle for the 3.3v pin that provides the supply
> voltage
> +- pp18-gpios: a GPIO phandle for the 1.8v pin that provides the supply
> voltage
> +
> +Optional properties:
> +- backlight: phandle of the backlight device attached to the panel
> +
> +Example:
> +
> +   &mipi_dsi {
> +   panel {
> +   compatible = "boe,himax8279d8p",
> "boe,himax8279d10p";
> +   reg = <0>;
> +   backlight = <&backlight>;
> +   enable-gpios = <&gpio 45 GPIO_ACTIVE_HIGH>;
> +   pp33-gpios = <&gpio 35 GPIO_ACTIVE_HIGH>;
> +   pp18-gpios = <&gpio 36 GPIO_ACTIVE_HIGH>;
> +   };
> +   };
> --
> 2.17.1
>
>
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH] [v1,2/2] drm/panel:Add Boe Himax8279d MIPI-DSI LCD panel

2019-02-22 Thread Jerry Han
Add panel driver for it.

Signed-off-by: Jerry Han 
---
 MAINTAINERS  |   6 +
 drivers/gpu/drm/panel/Kconfig|  11 +
 drivers/gpu/drm/panel/Makefile   |   1 +
 drivers/gpu/drm/panel/panel-boe-himax8279d.c | 593 +++
 4 files changed, 611 insertions(+)
 create mode 100644 drivers/gpu/drm/panel/panel-boe-himax8279d.c

diff --git a/MAINTAINERS b/MAINTAINERS
index b2f710e..38e2881 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4636,6 +4636,12 @@ S:   Maintained
 F: drivers/gpu/drm/tinydrm/ili9225.c
 F: Documentation/devicetree/bindings/display/ilitek,ili9225.txt
 
+DRM DRIVER FOR BOE HIMAX8279D PANELS
+M: Jerry Han 
+S: Maintained
+F: drivers/gpu/drm/panel/panel-boe-himax8279d.c
+F: Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt
+
 DRM DRIVER FOR INTEL I810 VIDEO CARDS
 S: Orphan / Obsolete
 F: drivers/gpu/drm/i810/
diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index 6020c30..e5dcfd1 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -186,4 +186,15 @@ config DRM_PANEL_SITRONIX_ST7789V
  Say Y here if you want to enable support for the Sitronix
  ST7789V controller for 240x320 LCD panels
 
+config DRM_PANEL_BOE_HIMAX8279D
+   tristate "Boe Himax8279d 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 Same type
+ TFT-LCD modules. The panel has a 1200x1920 resolution and uses
+ 24 bit RGB per pixel. It provides a MIPI DSI interface to
+ the host and has a built-in LED backlight.
+
 endmenu
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index 5ccaaa9..8a36543 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -19,3 +19,4 @@ obj-$(CONFIG_DRM_PANEL_SEIKO_43WVF1G) += panel-seiko-43wvf1g.o
 obj-$(CONFIG_DRM_PANEL_SHARP_LQ101R1SX01) += panel-sharp-lq101r1sx01.o
 obj-$(CONFIG_DRM_PANEL_SHARP_LS043T1LE01) += panel-sharp-ls043t1le01.o
 obj-$(CONFIG_DRM_PANEL_SITRONIX_ST7789V) += panel-sitronix-st7789v.o
+obj-$(CONFIG_DRM_PANEL_BOE_HIMAX8279D) += panel-boe-himax8279d.o
diff --git a/drivers/gpu/drm/panel/panel-boe-himax8279d.c 
b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
new file mode 100644
index 000..2788bdd
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
@@ -0,0 +1,593 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2019, Huaqin Electronics Co., Ltd
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+struct dsi_cmd_desc {
+   char wait;
+   char cmd;
+   char len;
+   char *payload;
+};
+
+struct dsi_panel_cmds {
+   char *buf;
+   int blen;
+   struct dsi_cmd_desc *cmds;
+   int cmd_cnt;
+};
+
+struct panel_info {
+   struct drm_panel base;
+   struct mipi_dsi_device *link;
+
+   struct backlight_device *backlight;
+   struct gpio_desc *reset_gpio;
+   struct gpio_desc *pp33000_gpio;
+   struct gpio_desc *pp18000_gpio;
+
+   u32 rst_seq[10];
+   u32 rst_seq_len;
+
+   struct dsi_panel_cmds *on_cmds;
+   struct dsi_panel_cmds *off_cmds;
+   struct drm_display_mode *panel_display_mode;
+
+   unsigned int panel_width_mm;
+   unsigned int panel_height_mm;
+   unsigned int per_color_channel;
+
+   bool prepared;
+   bool enabled;
+};
+
+static int dsi_parse_reset_seq(struct device_node *np, u32 rst_seq[10],
+   u32 *rst_len, const char *name)
+{
+   int num = 0, i;
+   int rc;
+   struct property *data;
+   u32 tmp[10];
+   *rst_len = 0;
+   data = of_find_property(np, name, &num);
+
+   num /= sizeof(u32);
+   if (!data || !num || num > 10 || num % 2) {
+   pr_err("%s:%d, error reading %s, length found = %d\n",
+   __func__, __LINE__, name, num);
+   return -EINVAL;
+   }
+
+   rc = of_property_read_u32_array(np, name, tmp, num);
+   if (rc) {
+   pr_err("%s:%d, error reading %s, rc = %d\n",
+   __func__, __LINE__, name, rc);
+   return -EINVAL;
+   }
+
+   for (i = 0; i < num; ++i) {
+   rst_seq[i] = tmp[i];
+   *rst_len = num;
+   }
+   return 0;
+}
+
+ssize_t mipi_dsi_dcs_write_delay(struct mipi_dsi_device *dsi, u8 cmd,
+   const void *data, size_t len, size_t time)
+

[[v1, 1/2] dt-bindings:panel:Add Boe Himax MIPI-DSI LCD panel] Boe Himax8279d is 1200x1920, 4-lane MIPI-DSI LCD panel.

2019-02-22 Thread Jerry Han
Add dt-bingings for it.

Signed-off-by: Jerry Han 
---
 .../bindings/display/panel/boe,himax8279d.txt  | 22 ++
 1 file changed, 22 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt

diff --git a/Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt 
b/Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt
new file mode 100644
index 000..68d6dd3
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt
@@ -0,0 +1,22 @@
+Boe Himax8279d 8" 1200x1920 TFT LCD panel
+
+Required properties:
+- compatible: should be "boe,himax8279d"
+- reg: DSI virtual channel of the peripheral
+- power-supply: phandle of the regulator that provides the supply voltage
+- enable-gpios: panel enable gpio
+
+Optional properties:
+- backlight: phandle of the backlight device attached to the panel
+
+Example:
+
+   &mipi_dsi {
+   panel {
+   compatible = "boe,himax8279d";
+   reg = <0>;
+   power-supply = <...>;
+   backlight = <&backlight>;
+   enable-gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>;
+   };
+   };
-- 
1.9.1

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

[PATCH] [v1, 1/2] dt-bindings: panel: Add Boe Himax8279d is 1200x1920, 4-lane MIPI-DSI LCD panel

2019-02-22 Thread Jerry Han
Add dt-bingings for it.

Signed-off-by: Jerry Han 
---
 .../bindings/display/panel/boe,himax8279d.txt  | 22 ++
 1 file changed, 22 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt

diff --git a/Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt 
b/Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt
new file mode 100644
index 000..68d6dd3
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt
@@ -0,0 +1,22 @@
+Boe Himax8279d 8" 1200x1920 TFT LCD panel
+
+Required properties:
+- compatible: should be "boe,himax8279d"
+- reg: DSI virtual channel of the peripheral
+- power-supply: phandle of the regulator that provides the supply voltage
+- enable-gpios: panel enable gpio
+
+Optional properties:
+- backlight: phandle of the backlight device attached to the panel
+
+Example:
+
+   &mipi_dsi {
+   panel {
+   compatible = "boe,himax8279d";
+   reg = <0>;
+   power-supply = <...>;
+   backlight = <&backlight>;
+   enable-gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>;
+   };
+   };
-- 
1.9.1

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

[PATCH] [v2,2/2] drm/panel: Add Boe Himax8279d MIPI-DSI LCD panel

2019-03-03 Thread Jerry Han
Add panel driver for it.

Signed-off-by: Jerry Han 
Cc: Jitao Shi 
Cc: Nick Sanders 
Cc: YH Lin 
Cc: Rock wang 
---
 MAINTAINERS  |6 +
 drivers/gpu/drm/panel/Kconfig|   11 +
 drivers/gpu/drm/panel/Makefile   |1 +
 drivers/gpu/drm/panel/panel-boe-himax8279d.c | 1077 ++
 4 files changed, 1095 insertions(+)
 create mode 100644 drivers/gpu/drm/panel/panel-boe-himax8279d.c

diff --git a/MAINTAINERS b/MAINTAINERS
index b2f710e..38e2881 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4636,6 +4636,12 @@ S:   Maintained
 F: drivers/gpu/drm/tinydrm/ili9225.c
 F: Documentation/devicetree/bindings/display/ilitek,ili9225.txt
 
+DRM DRIVER FOR BOE HIMAX8279D PANELS
+M: Jerry Han 
+S: Maintained
+F: drivers/gpu/drm/panel/panel-boe-himax8279d.c
+F: Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt
+
 DRM DRIVER FOR INTEL I810 VIDEO CARDS
 S: Orphan / Obsolete
 F: drivers/gpu/drm/i810/
diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index 6020c30..e5dcfd1 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -186,4 +186,15 @@ config DRM_PANEL_SITRONIX_ST7789V
  Say Y here if you want to enable support for the Sitronix
  ST7789V controller for 240x320 LCD panels
 
+config DRM_PANEL_BOE_HIMAX8279D
+   tristate "Boe Himax8279d 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 Same type
+ TFT-LCD modules. The panel has a 1200x1920 resolution and uses
+ 24 bit RGB per pixel. It provides a MIPI DSI interface to
+ the host and has a built-in LED backlight.
+
 endmenu
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index 5ccaaa9..8a36543 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -19,3 +19,4 @@ obj-$(CONFIG_DRM_PANEL_SEIKO_43WVF1G) += panel-seiko-43wvf1g.o
 obj-$(CONFIG_DRM_PANEL_SHARP_LQ101R1SX01) += panel-sharp-lq101r1sx01.o
 obj-$(CONFIG_DRM_PANEL_SHARP_LS043T1LE01) += panel-sharp-ls043t1le01.o
 obj-$(CONFIG_DRM_PANEL_SITRONIX_ST7789V) += panel-sitronix-st7789v.o
+obj-$(CONFIG_DRM_PANEL_BOE_HIMAX8279D) += panel-boe-himax8279d.o
diff --git a/drivers/gpu/drm/panel/panel-boe-himax8279d.c 
b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
new file mode 100644
index 000..60f5f8b
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
@@ -0,0 +1,1077 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2019, Huaqin Telecom Technology Co., Ltd
+ *
+ * Author: Jerry Han 
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+struct panel_cmd {
+   size_t len;
+   const char *data;
+};
+
+#define _INIT_CMD(...) { \
+   .len = sizeof((char[]){__VA_ARGS__}), \
+   .data = (char[]){__VA_ARGS__} }
+
+struct panel_desc {
+   const struct drm_display_mode *display_mode;
+   unsigned int bpc;
+   unsigned int width;
+   unsigned int height;
+
+   unsigned int delay_t1;
+   unsigned int reset_delay_t2;
+   unsigned int reset_delay_t3;
+   unsigned int reset_delay_t4;
+
+   unsigned long flags;
+   enum mipi_dsi_pixel_format format;
+   unsigned int lanes;
+   const struct panel_cmd *on_cmds;
+   const struct panel_cmd *off_cmds;
+};
+
+struct panel_info {
+   struct drm_panel base;
+   struct mipi_dsi_device *link;
+   const struct panel_desc *desc;
+
+   struct backlight_device *backlight;
+   struct gpio_desc *reset_gpio;
+   struct gpio_desc *pp33_gpio;
+   struct gpio_desc *pp18_gpio;
+
+   bool prepared;
+   bool enabled;
+};
+
+void set_gpios(struct panel_info *pinfo, int enable)
+{
+   gpiod_set_value(pinfo->reset_gpio, enable);
+   gpiod_set_value(pinfo->pp33_gpio, enable);
+   gpiod_set_value(pinfo->pp18_gpio, enable);
+}
+
+static inline struct panel_info *to_panel_info(struct drm_panel *panel)
+{
+   return container_of(panel, struct panel_info, base);
+}
+
+static int panel_disable(struct drm_panel *panel)
+{
+   struct panel_info *pinfo = to_panel_info(panel);
+
+   backlight_disable(pinfo->backlight);
+
+   pinfo->enabled = false;
+
+   return 0;
+}
+
+static int panel_unprepare(struct drm_panel *panel)
+{
+   struct panel_info *pinfo = to_panel_info(panel);
+   int err;
+
+   if (!pinfo->prepared)
+   return 0;
+
+   /* send off code */
+   if (pinfo->desc->off_cmds) {
+   const struct panel_cmd *cmds = pinfo->desc->off_cmds;
+   unsigned int i;
+
+   for (i = 0; cmds[i].len != 0; i++) {
+

[PATCH] [v2,2/2] drm/panel: Add Boe Himax8279d MIPI-DSI LCD panel

2019-03-03 Thread Jerry Han
Add panel driver for it.

Signed-off-by: Jerry Han 
Cc: Jitao Shi 
Cc: Nick Sanders 
Cc: YH Lin 
Cc: Rock wang 
---
 MAINTAINERS  |6 +
 drivers/gpu/drm/panel/Kconfig|   11 +
 drivers/gpu/drm/panel/Makefile   |1 +
 drivers/gpu/drm/panel/panel-boe-himax8279d.c | 1074 ++
 4 files changed, 1092 insertions(+)
 create mode 100644 drivers/gpu/drm/panel/panel-boe-himax8279d.c

diff --git a/MAINTAINERS b/MAINTAINERS
index b2f710e..38e2881 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4636,6 +4636,12 @@ S:   Maintained
 F: drivers/gpu/drm/tinydrm/ili9225.c
 F: Documentation/devicetree/bindings/display/ilitek,ili9225.txt
 
+DRM DRIVER FOR BOE HIMAX8279D PANELS
+M: Jerry Han 
+S: Maintained
+F: drivers/gpu/drm/panel/panel-boe-himax8279d.c
+F: Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt
+
 DRM DRIVER FOR INTEL I810 VIDEO CARDS
 S: Orphan / Obsolete
 F: drivers/gpu/drm/i810/
diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index 6020c30..e5dcfd1 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -186,4 +186,15 @@ config DRM_PANEL_SITRONIX_ST7789V
  Say Y here if you want to enable support for the Sitronix
  ST7789V controller for 240x320 LCD panels
 
+config DRM_PANEL_BOE_HIMAX8279D
+   tristate "Boe Himax8279d 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 Same type
+ TFT-LCD modules. The panel has a 1200x1920 resolution and uses
+ 24 bit RGB per pixel. It provides a MIPI DSI interface to
+ the host and has a built-in LED backlight.
+
 endmenu
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index 5ccaaa9..8a36543 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -19,3 +19,4 @@ obj-$(CONFIG_DRM_PANEL_SEIKO_43WVF1G) += panel-seiko-43wvf1g.o
 obj-$(CONFIG_DRM_PANEL_SHARP_LQ101R1SX01) += panel-sharp-lq101r1sx01.o
 obj-$(CONFIG_DRM_PANEL_SHARP_LS043T1LE01) += panel-sharp-ls043t1le01.o
 obj-$(CONFIG_DRM_PANEL_SITRONIX_ST7789V) += panel-sitronix-st7789v.o
+obj-$(CONFIG_DRM_PANEL_BOE_HIMAX8279D) += panel-boe-himax8279d.o
diff --git a/drivers/gpu/drm/panel/panel-boe-himax8279d.c 
b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
new file mode 100644
index 000..836a9cb
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
@@ -0,0 +1,1074 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2019, Huaqin Telecom Technology Co., Ltd
+ *
+ * Author: Jerry Han 
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+struct panel_cmd {
+   size_t len;
+   const char *data;
+};
+
+#define _INIT_CMD(...) { \
+   .len = sizeof((char[]){__VA_ARGS__}), \
+   .data = (char[]){__VA_ARGS__} }
+
+struct panel_desc {
+   const struct drm_display_mode *display_mode;
+   unsigned int bpc;
+   unsigned int width;
+   unsigned int height;
+
+   unsigned int delay_t1;
+   unsigned int reset_delay_t2;
+   unsigned int reset_delay_t3;
+   unsigned int reset_delay_t4;
+
+   unsigned long flags;
+   enum mipi_dsi_pixel_format format;
+   unsigned int lanes;
+   const struct panel_cmd *on_cmds;
+   const struct panel_cmd *off_cmds;
+};
+
+struct panel_info {
+   struct drm_panel base;
+   struct mipi_dsi_device *link;
+   const struct panel_desc *desc;
+
+   struct backlight_device *backlight;
+   struct gpio_desc *reset_gpio;
+   struct gpio_desc *pp33_gpio;
+   struct gpio_desc *pp18_gpio;
+
+   bool prepared;
+   bool enabled;
+};
+
+void set_gpios(struct panel_info *pinfo, int enable)
+{
+   gpiod_set_value(pinfo->reset_gpio, enable);
+   gpiod_set_value(pinfo->pp33_gpio, enable);
+   gpiod_set_value(pinfo->pp18_gpio, enable);
+}
+
+static inline struct panel_info *to_panel_info(struct drm_panel *panel)
+{
+   return container_of(panel, struct panel_info, base);
+}
+
+static int panel_disable(struct drm_panel *panel)
+{
+   struct panel_info *pinfo = to_panel_info(panel);
+
+   backlight_disable(pinfo->backlight);
+
+   pinfo->enabled = false;
+
+   return 0;
+}
+
+static int panel_unprepare(struct drm_panel *panel)
+{
+   struct panel_info *pinfo = to_panel_info(panel);
+   int err;
+
+   if (!pinfo->prepared)
+   return 0;
+
+   /* send off code */
+   if (pinfo->desc->off_cmds) {
+   const struct panel_cmd *cmds = pinfo->desc->off_cmds;
+   unsigned int i;
+
+   for (i = 0; cmds[i].len != 0; i++) {
+

[PATCH] [v2, 1/2] dt-bindings: panel: Add Boe Himax8279d is 1200x1920, 4-lane MIPI-DSI LCD panel

2019-03-03 Thread Jerry Han
Add dt-bingings for it.

Signed-off-by: Jerry Han 
Cc: Jitao Shi 
Cc: Nick Sanders 
Cc: YH Lin 
Cc: Rock wang 
---
 .../bindings/display/panel/boe,himax8279d.txt  | 24 ++
 1 file changed, 24 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt

diff --git a/Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt 
b/Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt
new file mode 100644
index 000..3caea21
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt
@@ -0,0 +1,24 @@
+Boe Himax8279d 1200x1920 TFT LCD panel
+
+Required properties:
+- compatible: should be "boe,himax8279d8p" and one of: "boe,himax8279d10p"
+- reg: DSI virtual channel of the peripheral
+- enable-gpios: panel enable gpio
+- pp33-gpios: a GPIO phandle for the 3.3v pin that provides the supply voltage
+- pp18-gpios: a GPIO phandle for the 1.8v pin that provides the supply voltage
+
+Optional properties:
+- backlight: phandle of the backlight device attached to the panel
+
+Example:
+
+   &mipi_dsi {
+   panel {
+   compatible = "boe,himax8279d8p", "boe,himax8279d10p";
+   reg = <0>;
+   backlight = <&backlight>;
+   enable-gpios = <&gpio 45 GPIO_ACTIVE_HIGH>;
+   pp33-gpios = <&gpio 35 GPIO_ACTIVE_HIGH>;
+   pp18-gpios = <&gpio 36 GPIO_ACTIVE_HIGH>;
+   };
+   };
-- 
1.9.1

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

[PATCH] [v2, 1/2] dt-bindings: panel: Add Boe Himax8279d is 1200x1920, 4-lane MIPI-DSI LCD panel

2019-03-03 Thread Jerry Han
Add dt-bingings for it.

Signed-off-by: Jerry Han 
Cc: Jitao Shi 
Cc: Nick Sanders 
Cc: YH Lin 
Cc: Rock wang 
---
 .../bindings/display/panel/boe,himax8279d.txt  | 24 ++
 1 file changed, 24 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt

diff --git a/Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt 
b/Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt
new file mode 100644
index 000..3caea21
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt
@@ -0,0 +1,24 @@
+Boe Himax8279d 1200x1920 TFT LCD panel
+
+Required properties:
+- compatible: should be "boe,himax8279d8p" and one of: "boe,himax8279d10p"
+- reg: DSI virtual channel of the peripheral
+- enable-gpios: panel enable gpio
+- pp33-gpios: a GPIO phandle for the 3.3v pin that provides the supply voltage
+- pp18-gpios: a GPIO phandle for the 1.8v pin that provides the supply voltage
+
+Optional properties:
+- backlight: phandle of the backlight device attached to the panel
+
+Example:
+
+   &mipi_dsi {
+   panel {
+   compatible = "boe,himax8279d8p", "boe,himax8279d10p";
+   reg = <0>;
+   backlight = <&backlight>;
+   enable-gpios = <&gpio 45 GPIO_ACTIVE_HIGH>;
+   pp33-gpios = <&gpio 35 GPIO_ACTIVE_HIGH>;
+   pp18-gpios = <&gpio 36 GPIO_ACTIVE_HIGH>;
+   };
+   };
-- 
1.9.1

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

[PATCH] [v3,2/2] drm/panel: Add Boe Himax8279d MIPI-DSI LCD panel

2019-03-04 Thread Jerry Han
Support Boe Himax8279d 8.0" 1200x1920 TFT LCD panel, it is a MIPI DSI
panel.

Signed-off-by: Jerry Han 
Cc: Jitao Shi 
Cc: Nick Sanders 
Cc: YH Lin 
Cc: Rock wang 
---
 MAINTAINERS  |6 +
 drivers/gpu/drm/panel/Kconfig|   11 +
 drivers/gpu/drm/panel/Makefile   |1 +
 drivers/gpu/drm/panel/panel-boe-himax8279d.c | 1077 ++
 4 files changed, 1095 insertions(+)
 create mode 100644 drivers/gpu/drm/panel/panel-boe-himax8279d.c

diff --git a/MAINTAINERS b/MAINTAINERS
index b2f710e..38e2881 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4636,6 +4636,12 @@ S:   Maintained
 F: drivers/gpu/drm/tinydrm/ili9225.c
 F: Documentation/devicetree/bindings/display/ilitek,ili9225.txt
 
+DRM DRIVER FOR BOE HIMAX8279D PANELS
+M: Jerry Han 
+S: Maintained
+F: drivers/gpu/drm/panel/panel-boe-himax8279d.c
+F: Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt
+
 DRM DRIVER FOR INTEL I810 VIDEO CARDS
 S: Orphan / Obsolete
 F: drivers/gpu/drm/i810/
diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index 6020c30..e5dcfd1 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -186,4 +186,15 @@ config DRM_PANEL_SITRONIX_ST7789V
  Say Y here if you want to enable support for the Sitronix
  ST7789V controller for 240x320 LCD panels
 
+config DRM_PANEL_BOE_HIMAX8279D
+   tristate "Boe Himax8279d 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 Same type
+ TFT-LCD modules. The panel has a 1200x1920 resolution and uses
+ 24 bit RGB per pixel. It provides a MIPI DSI interface to
+ the host and has a built-in LED backlight.
+
 endmenu
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index 5ccaaa9..8a36543 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -19,3 +19,4 @@ obj-$(CONFIG_DRM_PANEL_SEIKO_43WVF1G) += panel-seiko-43wvf1g.o
 obj-$(CONFIG_DRM_PANEL_SHARP_LQ101R1SX01) += panel-sharp-lq101r1sx01.o
 obj-$(CONFIG_DRM_PANEL_SHARP_LS043T1LE01) += panel-sharp-ls043t1le01.o
 obj-$(CONFIG_DRM_PANEL_SITRONIX_ST7789V) += panel-sitronix-st7789v.o
+obj-$(CONFIG_DRM_PANEL_BOE_HIMAX8279D) += panel-boe-himax8279d.o
diff --git a/drivers/gpu/drm/panel/panel-boe-himax8279d.c 
b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
new file mode 100644
index 000..37dd258
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
@@ -0,0 +1,1077 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2019, Huaqin Telecom Technology Co., Ltd
+ *
+ * Author: Jerry Han 
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+struct panel_cmd {
+   size_t len;
+   const char *data;
+};
+
+#define _INIT_CMD(...) { \
+   .len = sizeof((char[]){__VA_ARGS__}), \
+   .data = (char[]){__VA_ARGS__} }
+
+struct panel_desc {
+   const struct drm_display_mode *display_mode;
+   unsigned int bpc;
+   unsigned int width;
+   unsigned int height;
+
+   unsigned int delay_t1;
+   unsigned int reset_delay_t2;
+   unsigned int reset_delay_t3;
+   unsigned int reset_delay_t4;
+
+   unsigned long flags;
+   enum mipi_dsi_pixel_format format;
+   unsigned int lanes;
+   const struct panel_cmd *on_cmds;
+   const struct panel_cmd *off_cmds;
+};
+
+struct panel_info {
+   struct drm_panel base;
+   struct mipi_dsi_device *link;
+   const struct panel_desc *desc;
+
+   struct backlight_device *backlight;
+   struct gpio_desc *enable_gpio;
+   struct gpio_desc *pp33_gpio;
+   struct gpio_desc *pp18_gpio;
+
+   bool prepared;
+   bool enabled;
+};
+
+void set_gpios(struct panel_info *pinfo, int enable)
+{
+   gpiod_set_value(pinfo->enable_gpio, enable);
+   gpiod_set_value(pinfo->pp33_gpio, enable);
+   gpiod_set_value(pinfo->pp18_gpio, enable);
+}
+
+static inline struct panel_info *to_panel_info(struct drm_panel *panel)
+{
+   return container_of(panel, struct panel_info, base);
+}
+
+static int panel_disable(struct drm_panel *panel)
+{
+   struct panel_info *pinfo = to_panel_info(panel);
+
+   backlight_disable(pinfo->backlight);
+
+   pinfo->enabled = false;
+
+   return 0;
+}
+
+static int panel_unprepare(struct drm_panel *panel)
+{
+   struct panel_info *pinfo = to_panel_info(panel);
+   int err;
+
+   if (!pinfo->prepared)
+   return 0;
+
+   /* send off code */
+   if (pinfo->desc->off_cmds) {
+   const struct panel_cmd *cmds = pinfo->desc->off_cmds;
+   unsigned int i;
+
+ 

[PATCH] [v3,2/2] drm/panel: Add Boe Himax8279d MIPI-DSI LCD panel

2019-03-04 Thread Jerry Han
Support Boe Himax8279d 8.0" 1200x1920 TFT LCD panel, it is a MIPI DSI
panel.

Signed-off-by: Jerry Han 
Cc: Jitao Shi 
Cc: Nick Sanders 
Cc: YH Lin 
Cc: Rock wang 
---
 MAINTAINERS  |6 +
 drivers/gpu/drm/panel/Kconfig|   22 +
 drivers/gpu/drm/panel/Makefile   |1 +
 drivers/gpu/drm/panel/panel-boe-himax8279d.c | 1064 ++
 4 files changed, 1093 insertions(+)
 create mode 100644 drivers/gpu/drm/panel/panel-boe-himax8279d.c

diff --git a/MAINTAINERS b/MAINTAINERS
index b2f710e..095fbbe 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4624,6 +4624,12 @@ T:   git git://anongit.freedesktop.org/drm/drm-misc
 S: Maintained
 F: drivers/gpu/drm/bochs/
 
+DRM DRIVER FOR BOE HIMAX8279D PANELS
+M: Jerry Han 
+S: Maintained
+F: drivers/gpu/drm/panel/panel-boe-himax8279d.c
+F: Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt
+
 DRM DRIVER FOR FARADAY TVE200 TV ENCODER
 M: Linus Walleij 
 T: git git://anongit.freedesktop.org/drm/drm-misc
diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index 6020c30..d611424 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -17,6 +17,17 @@ config DRM_PANEL_ARM_VERSATILE
  reference designs. The panel is detected using special registers
  in the Versatile family syscon registers.
 
+config DRM_PANEL_BOE_HIMAX8279D
+   tristate "Boe Himax8279d 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 Boe Himax8279d
+ TFT-LCD modules. The panel has a 1200x1920 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_LVDS
tristate "Generic LVDS panel driver"
depends on OF
@@ -186,4 +197,15 @@ config DRM_PANEL_SITRONIX_ST7789V
  Say Y here if you want to enable support for the Sitronix
  ST7789V controller for 240x320 LCD panels
 
+config DRM_PANEL_BOE_HIMAX8279D
+   tristate "Boe Himax8279d 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 Same type
+ TFT-LCD modules. The panel has a 1200x1920 resolution and uses
+ 24 bit RGB per pixel. It provides a MIPI DSI interface to
+ the host and has a built-in LED backlight.
+
 endmenu
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index 5ccaaa9..7285539 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -1,5 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 obj-$(CONFIG_DRM_PANEL_ARM_VERSATILE) += panel-arm-versatile.o
+obj-$(CONFIG_DRM_PANEL_BOE_HIMAX8279D) += panel-boe-himax8279d.o
 obj-$(CONFIG_DRM_PANEL_LVDS) += panel-lvds.o
 obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o
 obj-$(CONFIG_DRM_PANEL_ILITEK_IL9322) += panel-ilitek-ili9322.o
diff --git a/drivers/gpu/drm/panel/panel-boe-himax8279d.c 
b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
new file mode 100644
index 000..9af382c
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
@@ -0,0 +1,1064 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2019, Huaqin Telecom Technology Co., Ltd
+ *
+ * Author: Jerry Han 
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+struct panel_cmd {
+   size_t len;
+   const char *data;
+};
+
+#define _INIT_CMD(...) { \
+   .len = sizeof((char[]){__VA_ARGS__}), \
+   .data = (char[]){__VA_ARGS__} }
+
+struct panel_desc {
+   const struct drm_display_mode *display_mode;
+   unsigned int bpc;
+   unsigned int width_mm;
+   unsigned int height_mm;
+
+   unsigned int delay_t1;
+   unsigned int reset_delay_t2;
+   unsigned int reset_delay_t3;
+   unsigned int reset_delay_t4;
+
+   unsigned long mode_flags;
+   enum mipi_dsi_pixel_format format;
+   unsigned int lanes;
+   const struct panel_cmd *on_cmds;
+   const struct panel_cmd *off_cmds;
+};
+
+struct panel_info {
+   struct drm_panel base;
+   struct mipi_dsi_device *link;
+   const struct panel_desc *desc;
+
+   struct backlight_device *backlight;
+   struct gpio_desc *enable_gpio;
+   struct gpio_desc *pp33_gpio;
+   struct gpio_desc *pp18_gpio;
+
+   bool prepared;
+   bool enabled;
+};
+
+static inline struct panel_info *to_panel_info(struct drm_panel *panel)
+{
+   return container_of(panel, struct panel_info, base);
+}
+
+void set_gpios(struct panel_info *pinfo, int enable)
+{
+   gpiod_set_value(pinfo->enable_gpio, enable);
+ 

[PATCH] [v3, 1/2] dt-bindings: panel: Add Boe Himax8279d is 1200x1920, 4-lane MIPI-DSI LCD panel

2019-03-04 Thread Jerry Han
The Boe Himax8279d is a 8.0" panel with a 1200x1920 resolution and
connected to DSI using four lanes.

Signed-off-by: Jerry Han 
Cc: Jitao Shi 
Cc: Nick Sanders 
Cc: YH Lin 
Cc: Rock wang 
---
 .../bindings/display/panel/boe,himax8279d.txt  | 24 ++
 1 file changed, 24 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt

diff --git a/Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt 
b/Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt
new file mode 100644
index 000..3caea21
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt
@@ -0,0 +1,24 @@
+Boe Himax8279d 1200x1920 TFT LCD panel
+
+Required properties:
+- compatible: should be "boe,himax8279d8p" and one of: "boe,himax8279d10p"
+- reg: DSI virtual channel of the peripheral
+- enable-gpios: panel enable gpio
+- pp33-gpios: a GPIO phandle for the 3.3v pin that provides the supply voltage
+- pp18-gpios: a GPIO phandle for the 1.8v pin that provides the supply voltage
+
+Optional properties:
+- backlight: phandle of the backlight device attached to the panel
+
+Example:
+
+   &mipi_dsi {
+   panel {
+   compatible = "boe,himax8279d8p", "boe,himax8279d10p";
+   reg = <0>;
+   backlight = <&backlight>;
+   enable-gpios = <&gpio 45 GPIO_ACTIVE_HIGH>;
+   pp33-gpios = <&gpio 35 GPIO_ACTIVE_HIGH>;
+   pp18-gpios = <&gpio 36 GPIO_ACTIVE_HIGH>;
+   };
+   };
-- 
1.9.1

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

[PATCH] [v4,2/2] drm/panel: Add Boe Himax8279d MIPI-DSI LCD panel

2019-03-05 Thread Jerry Han
Support Boe Himax8279d 8.0" 1200x1920 TFT LCD panel, it is a MIPI DSI
panel.

Signed-off-by: Jerry Han 
Cc: Jitao Shi 
Cc: Nick Sanders 
Cc: YH Lin 
Cc: Rock wang 
---
 MAINTAINERS  |6 +
 drivers/gpu/drm/panel/Kconfig|   22 +
 drivers/gpu/drm/panel/Makefile   |1 +
 drivers/gpu/drm/panel/panel-boe-himax8279d.c | 1070 ++
 4 files changed, 1099 insertions(+)
 create mode 100644 drivers/gpu/drm/panel/panel-boe-himax8279d.c

diff --git a/MAINTAINERS b/MAINTAINERS
index b2f710e..095fbbe 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4624,6 +4624,12 @@ T:   git git://anongit.freedesktop.org/drm/drm-misc
 S: Maintained
 F: drivers/gpu/drm/bochs/
 
+DRM DRIVER FOR BOE HIMAX8279D PANELS
+M: Jerry Han 
+S: Maintained
+F: drivers/gpu/drm/panel/panel-boe-himax8279d.c
+F: Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt
+
 DRM DRIVER FOR FARADAY TVE200 TV ENCODER
 M: Linus Walleij 
 T: git git://anongit.freedesktop.org/drm/drm-misc
diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index 6020c30..d611424 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -17,6 +17,17 @@ config DRM_PANEL_ARM_VERSATILE
  reference designs. The panel is detected using special registers
  in the Versatile family syscon registers.
 
+config DRM_PANEL_BOE_HIMAX8279D
+   tristate "Boe Himax8279d 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 Boe Himax8279d
+ TFT-LCD modules. The panel has a 1200x1920 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_LVDS
tristate "Generic LVDS panel driver"
depends on OF
@@ -186,4 +197,15 @@ config DRM_PANEL_SITRONIX_ST7789V
  Say Y here if you want to enable support for the Sitronix
  ST7789V controller for 240x320 LCD panels
 
+config DRM_PANEL_BOE_HIMAX8279D
+   tristate "Boe Himax8279d 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 Same type
+ TFT-LCD modules. The panel has a 1200x1920 resolution and uses
+ 24 bit RGB per pixel. It provides a MIPI DSI interface to
+ the host and has a built-in LED backlight.
+
 endmenu
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index 5ccaaa9..7285539 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -1,5 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 obj-$(CONFIG_DRM_PANEL_ARM_VERSATILE) += panel-arm-versatile.o
+obj-$(CONFIG_DRM_PANEL_BOE_HIMAX8279D) += panel-boe-himax8279d.o
 obj-$(CONFIG_DRM_PANEL_LVDS) += panel-lvds.o
 obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o
 obj-$(CONFIG_DRM_PANEL_ILITEK_IL9322) += panel-ilitek-ili9322.o
diff --git a/drivers/gpu/drm/panel/panel-boe-himax8279d.c 
b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
new file mode 100644
index 000..aa7d912
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
@@ -0,0 +1,1070 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2019, Huaqin Telecom Technology Co., Ltd
+ *
+ * Author: Jerry Han 
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+struct panel_cmd {
+   size_t len;
+   const char *data;
+};
+
+#define _INIT_CMD(...) { \
+   .len = sizeof((char[]){__VA_ARGS__}), \
+   .data = (char[]){__VA_ARGS__} }
+
+struct panel_desc {
+   const struct drm_display_mode *display_mode;
+   unsigned int bpc;
+   unsigned int width_mm;
+   unsigned int height_mm;
+
+   unsigned int delay_t1;
+   unsigned int reset_delay_t2;
+   unsigned int reset_delay_t3;
+   unsigned int reset_delay_t4;
+   unsigned int reset_delay_t5;
+
+   unsigned long mode_flags;
+   enum mipi_dsi_pixel_format format;
+   unsigned int lanes;
+   const struct panel_cmd *on_cmds;
+   const struct panel_cmd *off_cmds;
+};
+
+struct panel_info {
+   struct drm_panel base;
+   struct mipi_dsi_device *link;
+   const struct panel_desc *desc;
+
+   struct backlight_device *backlight;
+   struct gpio_desc *enable_gpio;
+   struct gpio_desc *pp33_gpio;
+   struct gpio_desc *pp18_gpio;
+
+   bool prepared;
+   bool enabled;
+};
+
+static inline struct panel_info *to_panel_info(struct drm_panel *panel)
+{
+   return container_of(panel, struct panel_info, base);
+}
+
+void set_gpios(struct panel_info *pinfo, int enable)
+{
+   gpiod_s

[PATCH] [v3,2/2] drm/panel: Add Boe Himax8279d MIPI-DSI LCD panel

2019-03-05 Thread Jerry Han
Support Boe Himax8279d 8.0" 1200x1920 TFT LCD panel, it is a MIPI DSI
panel.

Signed-off-by: Jerry Han 
Cc: Jitao Shi 
Cc: Nick Sanders 
Cc: YH Lin 
Cc: Rock wang 
---
 MAINTAINERS  |6 +
 drivers/gpu/drm/panel/Kconfig|   22 +
 drivers/gpu/drm/panel/Makefile   |1 +
 drivers/gpu/drm/panel/panel-boe-himax8279d.c | 1070 ++
 4 files changed, 1099 insertions(+)
 create mode 100644 drivers/gpu/drm/panel/panel-boe-himax8279d.c

diff --git a/MAINTAINERS b/MAINTAINERS
index b2f710e..095fbbe 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4624,6 +4624,12 @@ T:   git git://anongit.freedesktop.org/drm/drm-misc
 S: Maintained
 F: drivers/gpu/drm/bochs/
 
+DRM DRIVER FOR BOE HIMAX8279D PANELS
+M: Jerry Han 
+S: Maintained
+F: drivers/gpu/drm/panel/panel-boe-himax8279d.c
+F: Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt
+
 DRM DRIVER FOR FARADAY TVE200 TV ENCODER
 M: Linus Walleij 
 T: git git://anongit.freedesktop.org/drm/drm-misc
diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index 6020c30..d611424 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -17,6 +17,17 @@ config DRM_PANEL_ARM_VERSATILE
  reference designs. The panel is detected using special registers
  in the Versatile family syscon registers.
 
+config DRM_PANEL_BOE_HIMAX8279D
+   tristate "Boe Himax8279d 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 Boe Himax8279d
+ TFT-LCD modules. The panel has a 1200x1920 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_LVDS
tristate "Generic LVDS panel driver"
depends on OF
@@ -186,4 +197,15 @@ config DRM_PANEL_SITRONIX_ST7789V
  Say Y here if you want to enable support for the Sitronix
  ST7789V controller for 240x320 LCD panels
 
+config DRM_PANEL_BOE_HIMAX8279D
+   tristate "Boe Himax8279d 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 Same type
+ TFT-LCD modules. The panel has a 1200x1920 resolution and uses
+ 24 bit RGB per pixel. It provides a MIPI DSI interface to
+ the host and has a built-in LED backlight.
+
 endmenu
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index 5ccaaa9..7285539 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -1,5 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 obj-$(CONFIG_DRM_PANEL_ARM_VERSATILE) += panel-arm-versatile.o
+obj-$(CONFIG_DRM_PANEL_BOE_HIMAX8279D) += panel-boe-himax8279d.o
 obj-$(CONFIG_DRM_PANEL_LVDS) += panel-lvds.o
 obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o
 obj-$(CONFIG_DRM_PANEL_ILITEK_IL9322) += panel-ilitek-ili9322.o
diff --git a/drivers/gpu/drm/panel/panel-boe-himax8279d.c 
b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
new file mode 100644
index 000..aa7d912
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
@@ -0,0 +1,1070 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2019, Huaqin Telecom Technology Co., Ltd
+ *
+ * Author: Jerry Han 
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+struct panel_cmd {
+   size_t len;
+   const char *data;
+};
+
+#define _INIT_CMD(...) { \
+   .len = sizeof((char[]){__VA_ARGS__}), \
+   .data = (char[]){__VA_ARGS__} }
+
+struct panel_desc {
+   const struct drm_display_mode *display_mode;
+   unsigned int bpc;
+   unsigned int width_mm;
+   unsigned int height_mm;
+
+   unsigned int delay_t1;
+   unsigned int reset_delay_t2;
+   unsigned int reset_delay_t3;
+   unsigned int reset_delay_t4;
+   unsigned int reset_delay_t5;
+
+   unsigned long mode_flags;
+   enum mipi_dsi_pixel_format format;
+   unsigned int lanes;
+   const struct panel_cmd *on_cmds;
+   const struct panel_cmd *off_cmds;
+};
+
+struct panel_info {
+   struct drm_panel base;
+   struct mipi_dsi_device *link;
+   const struct panel_desc *desc;
+
+   struct backlight_device *backlight;
+   struct gpio_desc *enable_gpio;
+   struct gpio_desc *pp33_gpio;
+   struct gpio_desc *pp18_gpio;
+
+   bool prepared;
+   bool enabled;
+};
+
+static inline struct panel_info *to_panel_info(struct drm_panel *panel)
+{
+   return container_of(panel, struct panel_info, base);
+}
+
+void set_gpios(struct panel_info *pinfo, int enable)
+{
+   gpiod_s

[PATCH] [v4, 1/2] dt-bindings: panel: Add Boe Himax8279d is 1200x1920, 4-lane MIPI-DSI LCD panel

2019-03-05 Thread Jerry Han
The Boe Himax8279d is a 8.0" panel with a 1200x1920 resolution and
connected to DSI using four lanes.

Signed-off-by: Jerry Han 
Cc: Jitao Shi 
Cc: Nick Sanders 
Cc: YH Lin 
Cc: Rock wang 
---
 .../bindings/display/panel/boe,himax8279d.txt  | 24 ++
 1 file changed, 24 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt

diff --git a/Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt 
b/Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt
new file mode 100644
index 000..3caea21
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt
@@ -0,0 +1,24 @@
+Boe Himax8279d 1200x1920 TFT LCD panel
+
+Required properties:
+- compatible: should be "boe,himax8279d8p" and one of: "boe,himax8279d10p"
+- reg: DSI virtual channel of the peripheral
+- enable-gpios: panel enable gpio
+- pp33-gpios: a GPIO phandle for the 3.3v pin that provides the supply voltage
+- pp18-gpios: a GPIO phandle for the 1.8v pin that provides the supply voltage
+
+Optional properties:
+- backlight: phandle of the backlight device attached to the panel
+
+Example:
+
+   &mipi_dsi {
+   panel {
+   compatible = "boe,himax8279d8p", "boe,himax8279d10p";
+   reg = <0>;
+   backlight = <&backlight>;
+   enable-gpios = <&gpio 45 GPIO_ACTIVE_HIGH>;
+   pp33-gpios = <&gpio 35 GPIO_ACTIVE_HIGH>;
+   pp18-gpios = <&gpio 36 GPIO_ACTIVE_HIGH>;
+   };
+   };
-- 
1.9.1

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

[PATCH] [v4,2/2] drm/panel: Add Boe Himax8279d MIPI-DSI LCD panel

2019-03-05 Thread Jerry Han
Support Boe Himax8279d 8.0" 1200x1920 TFT LCD panel, it is a MIPI DSI
panel.

Signed-off-by: Jerry Han 
Cc: Jitao Shi 
Cc: Derek Basehore 
Cc: Rock wang 
---
 MAINTAINERS  |6 +
 drivers/gpu/drm/panel/Kconfig|   22 +
 drivers/gpu/drm/panel/Makefile   |1 +
 drivers/gpu/drm/panel/panel-boe-himax8279d.c | 1070 ++
 4 files changed, 1099 insertions(+)
 create mode 100644 drivers/gpu/drm/panel/panel-boe-himax8279d.c

diff --git a/MAINTAINERS b/MAINTAINERS
index b2f710e..095fbbe 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4624,6 +4624,12 @@ T:   git git://anongit.freedesktop.org/drm/drm-misc
 S: Maintained
 F: drivers/gpu/drm/bochs/
 
+DRM DRIVER FOR BOE HIMAX8279D PANELS
+M: Jerry Han 
+S: Maintained
+F: drivers/gpu/drm/panel/panel-boe-himax8279d.c
+F: Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt
+
 DRM DRIVER FOR FARADAY TVE200 TV ENCODER
 M: Linus Walleij 
 T: git git://anongit.freedesktop.org/drm/drm-misc
diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index 6020c30..d611424 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -17,6 +17,17 @@ config DRM_PANEL_ARM_VERSATILE
  reference designs. The panel is detected using special registers
  in the Versatile family syscon registers.
 
+config DRM_PANEL_BOE_HIMAX8279D
+   tristate "Boe Himax8279d 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 Boe Himax8279d
+ TFT-LCD modules. The panel has a 1200x1920 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_LVDS
tristate "Generic LVDS panel driver"
depends on OF
@@ -186,4 +197,15 @@ config DRM_PANEL_SITRONIX_ST7789V
  Say Y here if you want to enable support for the Sitronix
  ST7789V controller for 240x320 LCD panels
 
+config DRM_PANEL_BOE_HIMAX8279D
+   tristate "Boe Himax8279d 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 Same type
+ TFT-LCD modules. The panel has a 1200x1920 resolution and uses
+ 24 bit RGB per pixel. It provides a MIPI DSI interface to
+ the host and has a built-in LED backlight.
+
 endmenu
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index 5ccaaa9..7285539 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -1,5 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 obj-$(CONFIG_DRM_PANEL_ARM_VERSATILE) += panel-arm-versatile.o
+obj-$(CONFIG_DRM_PANEL_BOE_HIMAX8279D) += panel-boe-himax8279d.o
 obj-$(CONFIG_DRM_PANEL_LVDS) += panel-lvds.o
 obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o
 obj-$(CONFIG_DRM_PANEL_ILITEK_IL9322) += panel-ilitek-ili9322.o
diff --git a/drivers/gpu/drm/panel/panel-boe-himax8279d.c 
b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
new file mode 100644
index 000..aa7d912
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
@@ -0,0 +1,1070 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2019, Huaqin Telecom Technology Co., Ltd
+ *
+ * Author: Jerry Han 
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+struct panel_cmd {
+   size_t len;
+   const char *data;
+};
+
+#define _INIT_CMD(...) { \
+   .len = sizeof((char[]){__VA_ARGS__}), \
+   .data = (char[]){__VA_ARGS__} }
+
+struct panel_desc {
+   const struct drm_display_mode *display_mode;
+   unsigned int bpc;
+   unsigned int width_mm;
+   unsigned int height_mm;
+
+   unsigned int delay_t1;
+   unsigned int reset_delay_t2;
+   unsigned int reset_delay_t3;
+   unsigned int reset_delay_t4;
+   unsigned int reset_delay_t5;
+
+   unsigned long mode_flags;
+   enum mipi_dsi_pixel_format format;
+   unsigned int lanes;
+   const struct panel_cmd *on_cmds;
+   const struct panel_cmd *off_cmds;
+};
+
+struct panel_info {
+   struct drm_panel base;
+   struct mipi_dsi_device *link;
+   const struct panel_desc *desc;
+
+   struct backlight_device *backlight;
+   struct gpio_desc *enable_gpio;
+   struct gpio_desc *pp33_gpio;
+   struct gpio_desc *pp18_gpio;
+
+   bool prepared;
+   bool enabled;
+};
+
+static inline struct panel_info *to_panel_info(struct drm_panel *panel)
+{
+   return container_of(panel, struct panel_info, base);
+}
+
+void set_gpios(struct panel_info *pinfo, int enable)
+{
+   gpiod_s

[PATCH] [v4, 1/2] dt-bindings: panel: Add Boe Himax8279d is 1200x1920, 4-lane MIPI-DSI LCD panel

2019-03-05 Thread Jerry Han
The Boe Himax8279d is a 8.0" panel with a 1200x1920 resolution and
connected to DSI using four lanes.

Signed-off-by: Jerry Han 
Cc: Jitao Shi 
Cc: Derek Basehore 
Cc: Rock wang 
---
 .../bindings/display/panel/boe,himax8279d.txt  | 24 ++
 1 file changed, 24 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt

diff --git a/Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt 
b/Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt
new file mode 100644
index 000..3caea21
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt
@@ -0,0 +1,24 @@
+Boe Himax8279d 1200x1920 TFT LCD panel
+
+Required properties:
+- compatible: should be "boe,himax8279d8p" and one of: "boe,himax8279d10p"
+- reg: DSI virtual channel of the peripheral
+- enable-gpios: panel enable gpio
+- pp33-gpios: a GPIO phandle for the 3.3v pin that provides the supply voltage
+- pp18-gpios: a GPIO phandle for the 1.8v pin that provides the supply voltage
+
+Optional properties:
+- backlight: phandle of the backlight device attached to the panel
+
+Example:
+
+   &mipi_dsi {
+   panel {
+   compatible = "boe,himax8279d8p", "boe,himax8279d10p";
+   reg = <0>;
+   backlight = <&backlight>;
+   enable-gpios = <&gpio 45 GPIO_ACTIVE_HIGH>;
+   pp33-gpios = <&gpio 35 GPIO_ACTIVE_HIGH>;
+   pp18-gpios = <&gpio 36 GPIO_ACTIVE_HIGH>;
+   };
+   };
-- 
1.9.1

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

[PATCH] [v5,2/2] drm/panel: Add Boe Himax8279d MIPI-DSI LCD panel

2019-03-09 Thread Jerry Han
Support Boe Himax8279d 8.0" 1200x1920 TFT LCD panel, it is a MIPI DSI
panel.

v5:
- Added changelog

v4:
- Frefix all function maes with boe_ (Sam)
- Fsed "enable_gpio" replace "reset_gpio", Make it look clearer (Sam)
- Sort include lines alphabetically (Sam)
- Fixed entries in the makefile must be sorted alphabetically (Sam)
- Add send_mipi_cmds function to avoid duplicating the code (Sam)
- Add the necessary delay(reset_delay_t5) between reset and sending
the initialization command (Rock wang)

v3:
- Remove unnecessary delays in sending initialization commands (Jitao Shi)

V2:
- Use SPDX identifier (Sam)
- Use necessary header files replace drmP.h (Sam)
- Delete unnecessary header files #include  (Sam)
- Specifies a GPIOs array to control the reset timing,
instead of reading "dsi-reset-sequence" data from DTS (Sam)
- Delete backlight_disable() function when already disabled (Sam)
- Use devm_of_find_backlight() replace of_find_backlight_by_node() (Sam)
- Move the necessary data in the DTS to the current file,
like porch, display_mode and Init code etc. (Sam)
- Add compatible device "boe,himax8279d10p" (Sam)

Signed-off-by: Jerry Han 
Cc: Jitao Shi 
Cc: Derek Basehore 
Cc: Rock wang 
---
 MAINTAINERS  |6 +
 drivers/gpu/drm/panel/Kconfig|   22 +
 drivers/gpu/drm/panel/Makefile   |1 +
 drivers/gpu/drm/panel/panel-boe-himax8279d.c | 1070 ++
 4 files changed, 1099 insertions(+)
 create mode 100644 drivers/gpu/drm/panel/panel-boe-himax8279d.c

diff --git a/MAINTAINERS b/MAINTAINERS
index b2f710e..095fbbe 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4624,6 +4624,12 @@ T:   git git://anongit.freedesktop.org/drm/drm-misc
 S: Maintained
 F: drivers/gpu/drm/bochs/
 
+DRM DRIVER FOR BOE HIMAX8279D PANELS
+M: Jerry Han 
+S: Maintained
+F: drivers/gpu/drm/panel/panel-boe-himax8279d.c
+F: Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt
+
 DRM DRIVER FOR FARADAY TVE200 TV ENCODER
 M: Linus Walleij 
 T: git git://anongit.freedesktop.org/drm/drm-misc
diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index 6020c30..d611424 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -17,6 +17,17 @@ config DRM_PANEL_ARM_VERSATILE
  reference designs. The panel is detected using special registers
  in the Versatile family syscon registers.
 
+config DRM_PANEL_BOE_HIMAX8279D
+   tristate "Boe Himax8279d 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 Boe Himax8279d
+ TFT-LCD modules. The panel has a 1200x1920 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_LVDS
tristate "Generic LVDS panel driver"
depends on OF
@@ -186,4 +197,15 @@ config DRM_PANEL_SITRONIX_ST7789V
  Say Y here if you want to enable support for the Sitronix
  ST7789V controller for 240x320 LCD panels
 
+config DRM_PANEL_BOE_HIMAX8279D
+   tristate "Boe Himax8279d 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 Same type
+ TFT-LCD modules. The panel has a 1200x1920 resolution and uses
+ 24 bit RGB per pixel. It provides a MIPI DSI interface to
+ the host and has a built-in LED backlight.
+
 endmenu
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index 5ccaaa9..7285539 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -1,5 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 obj-$(CONFIG_DRM_PANEL_ARM_VERSATILE) += panel-arm-versatile.o
+obj-$(CONFIG_DRM_PANEL_BOE_HIMAX8279D) += panel-boe-himax8279d.o
 obj-$(CONFIG_DRM_PANEL_LVDS) += panel-lvds.o
 obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o
 obj-$(CONFIG_DRM_PANEL_ILITEK_IL9322) += panel-ilitek-ili9322.o
diff --git a/drivers/gpu/drm/panel/panel-boe-himax8279d.c 
b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
new file mode 100644
index 000..aa7d912
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
@@ -0,0 +1,1070 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2019, Huaqin Telecom Technology Co., Ltd
+ *
+ * Author: Jerry Han 
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+struct panel_cmd {
+   size_t len;
+   const char *data;
+};
+
+#define _INIT_CMD(...) { \
+   .len = sizeof((char[]){__VA_ARGS__}), \
+   .data = (char[]){__VA_ARGS__} }

[PATCH] [v5, 1/2] dt-bindings: panel: Add Boe Himax8279d is 1200x1920, 4-lane MIPI-DSI LCD panel

2019-03-09 Thread Jerry Han
The Boe Himax8279d is a 8.0" panel with a 1200x1920 resolution and
connected to DSI using four lanes.

V5:
- Added changelog

V4:
- None

V3:
- None

V2:
- Add compatible device "boe,himax8279d10p" (Sam)
- Add the necessary property descriptions (Sam)

Signed-off-by: Jerry Han 
Cc: Jitao Shi 
Cc: Derek Basehore 
Cc: Rock wang 
---
 .../bindings/display/panel/boe,himax8279d.txt  | 24 ++
 1 file changed, 24 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt

diff --git a/Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt 
b/Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt
new file mode 100644
index 000..3caea21
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt
@@ -0,0 +1,24 @@
+Boe Himax8279d 1200x1920 TFT LCD panel
+
+Required properties:
+- compatible: should be "boe,himax8279d8p" and one of: "boe,himax8279d10p"
+- reg: DSI virtual channel of the peripheral
+- enable-gpios: panel enable gpio
+- pp33-gpios: a GPIO phandle for the 3.3v pin that provides the supply voltage
+- pp18-gpios: a GPIO phandle for the 1.8v pin that provides the supply voltage
+
+Optional properties:
+- backlight: phandle of the backlight device attached to the panel
+
+Example:
+
+   &mipi_dsi {
+   panel {
+   compatible = "boe,himax8279d8p", "boe,himax8279d10p";
+   reg = <0>;
+   backlight = <&backlight>;
+   enable-gpios = <&gpio 45 GPIO_ACTIVE_HIGH>;
+   pp33-gpios = <&gpio 35 GPIO_ACTIVE_HIGH>;
+   pp18-gpios = <&gpio 36 GPIO_ACTIVE_HIGH>;
+   };
+   };
-- 
1.9.1

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

[PATCH] [v6, 1/2] dt-bindings: panel: Add Boe Himax8279d is 1200x1920, 4-lane MIPI-DSI LCD panel

2019-03-12 Thread Jerry Han
The Boe Himax8279d is a 8.0" panel with a 1200x1920 resolution and
connected to DSI using four lanes.

V6:
- Add the information of the reviewer

V5:
- Added changelog

V4:
- None

V3:
- None

V2:
- Add compatible device "boe,himax8279d10p" (Sam)
- Add the necessary property descriptions (Sam)

Signed-off-by: Jerry Han 
Reviewed-by: Sam Ravnborg 
Cc: Jitao Shi 
Cc: Derek Basehore 
Cc: Rock wang 
---
 .../bindings/display/panel/boe,himax8279d.txt  | 24 ++
 1 file changed, 24 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt

diff --git a/Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt 
b/Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt
new file mode 100644
index 000..3caea21
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt
@@ -0,0 +1,24 @@
+Boe Himax8279d 1200x1920 TFT LCD panel
+
+Required properties:
+- compatible: should be "boe,himax8279d8p" and one of: "boe,himax8279d10p"
+- reg: DSI virtual channel of the peripheral
+- enable-gpios: panel enable gpio
+- pp33-gpios: a GPIO phandle for the 3.3v pin that provides the supply voltage
+- pp18-gpios: a GPIO phandle for the 1.8v pin that provides the supply voltage
+
+Optional properties:
+- backlight: phandle of the backlight device attached to the panel
+
+Example:
+
+   &mipi_dsi {
+   panel {
+   compatible = "boe,himax8279d8p", "boe,himax8279d10p";
+   reg = <0>;
+   backlight = <&backlight>;
+   enable-gpios = <&gpio 45 GPIO_ACTIVE_HIGH>;
+   pp33-gpios = <&gpio 35 GPIO_ACTIVE_HIGH>;
+   pp18-gpios = <&gpio 36 GPIO_ACTIVE_HIGH>;
+   };
+   };
-- 
1.9.1

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

[PATCH] [v6,2/2] drm/panel: Add Boe Himax8279d MIPI-DSI LCD panel

2019-03-12 Thread Jerry Han
Support Boe Himax8279d 8.0" 1200x1920 TFT LCD panel, it is a MIPI DSI
panel.

V6:
- Add the information of the reviewer (Sam)
- Delete unnecessary header files #include  (Sam)
- The config DRM_PANEL_BOE_HIMAX8279D appears twice. Drop one of them (Sam)
- ADD static, set_gpios function is not used outside this module (Sam)

v5:
- Added changelog

v4:
- Frefix all function maes with boe_ (Sam)
- Fsed "enable_gpio" replace "reset_gpio", Make it look clearer (Sam)
- Sort include lines alphabetically (Sam)
- Fixed entries in the makefile must be sorted alphabetically (Sam)
- Add send_mipi_cmds function to avoid duplicating the code (Sam)
- Add the necessary delay(reset_delay_t5) between reset and sending
the initialization command (Rock wang)

v3:
- Remove unnecessary delays in sending initialization commands (Jitao Shi)

V2:
- Use SPDX identifier (Sam)
- Use necessary header files replace drmP.h (Sam)
- Delete unnecessary header files #include  (Sam)
- Specifies a GPIOs array to control the reset timing,
instead of reading "dsi-reset-sequence" data from DTS (Sam)
- Delete backlight_disable() function when already disabled (Sam)
- Use devm_of_find_backlight() replace of_find_backlight_by_node() (Sam)
- Move the necessary data in the DTS to the current file,
like porch, display_mode and Init code etc. (Sam)
- Add compatible device "boe,himax8279d10p" (Sam)

Signed-off-by: Jerry Han 
Reviewed-by: Sam Ravnborg 
Cc: Jitao Shi 
Cc: Derek Basehore 
Cc: Rock wang 
---
 MAINTAINERS  |6 +
 drivers/gpu/drm/panel/Kconfig|   11 +
 drivers/gpu/drm/panel/Makefile   |1 +
 drivers/gpu/drm/panel/panel-boe-himax8279d.c | 1069 ++
 4 files changed, 1087 insertions(+)
 create mode 100644 drivers/gpu/drm/panel/panel-boe-himax8279d.c

diff --git a/MAINTAINERS b/MAINTAINERS
index b2f710e..095fbbe 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4624,6 +4624,12 @@ T:   git git://anongit.freedesktop.org/drm/drm-misc
 S: Maintained
 F: drivers/gpu/drm/bochs/
 
+DRM DRIVER FOR BOE HIMAX8279D PANELS
+M: Jerry Han 
+S: Maintained
+F: drivers/gpu/drm/panel/panel-boe-himax8279d.c
+F: Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt
+
 DRM DRIVER FOR FARADAY TVE200 TV ENCODER
 M: Linus Walleij 
 T: git git://anongit.freedesktop.org/drm/drm-misc
diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index 6020c30..4aae4a7 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -17,6 +17,17 @@ config DRM_PANEL_ARM_VERSATILE
  reference designs. The panel is detected using special registers
  in the Versatile family syscon registers.
 
+config DRM_PANEL_BOE_HIMAX8279D
+   tristate "Boe Himax8279d 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 Boe Himax8279d
+ TFT-LCD modules. The panel has a 1200x1920 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_LVDS
tristate "Generic LVDS panel driver"
depends on OF
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index 5ccaaa9..7285539 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -1,5 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 obj-$(CONFIG_DRM_PANEL_ARM_VERSATILE) += panel-arm-versatile.o
+obj-$(CONFIG_DRM_PANEL_BOE_HIMAX8279D) += panel-boe-himax8279d.o
 obj-$(CONFIG_DRM_PANEL_LVDS) += panel-lvds.o
 obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o
 obj-$(CONFIG_DRM_PANEL_ILITEK_IL9322) += panel-ilitek-ili9322.o
diff --git a/drivers/gpu/drm/panel/panel-boe-himax8279d.c 
b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
new file mode 100644
index 000..c050a48
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
@@ -0,0 +1,1069 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2019, Huaqin Telecom Technology Co., Ltd
+ *
+ * Author: Jerry Han 
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+struct panel_cmd {
+   size_t len;
+   const char *data;
+};
+
+#define _INIT_CMD(...) { \
+   .len = sizeof((char[]){__VA_ARGS__}), \
+   .data = (char[]){__VA_ARGS__} }
+
+struct panel_desc {
+   const struct drm_display_mode *display_mode;
+   unsigned int bpc;
+   unsigned int width_mm;
+   unsigned int height_mm;
+
+   unsigned int delay_t1;
+   unsigned int reset_delay_t2;
+   unsigned int reset_delay_t3;
+   unsigned int reset_delay_t4;
+   unsigned int reset_delay_t5;
+
+   unsigned long mode_flags;
+   

[PATCH] [v7, 1/2] dt-bindings: panel: Add Boe Himax8279d is 1200x1920, 4-lane MIPI-DSI LCD panel

2019-03-26 Thread Jerry Han
The Boe Himax8279d is a 8.0" panel with a 1200x1920 resolution and
connected to DSI using four lanes.

V7:
- Add the information of the reviewer

V6:
- Add the information of the reviewer

V5:
- Added changelog

V4:
- None

V3:
- None

V2:
- Add compatible device "boe,himax8279d10p" (Sam)
- Add the necessary property descriptions (Sam)

Signed-off-by: Jerry Han 
Reviewed-by: Sam Ravnborg 
Reviewed-by: Derek Basehore 
Cc: Jitao Shi 
Cc: Rock wang 
---
 .../bindings/display/panel/boe,himax8279d.txt | 24 +++
 1 file changed, 24 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt

diff --git a/Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt 
b/Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt
new file mode 100644
index ..3caea2172b1b
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt
@@ -0,0 +1,24 @@
+Boe Himax8279d 1200x1920 TFT LCD panel
+
+Required properties:
+- compatible: should be "boe,himax8279d8p" and one of: "boe,himax8279d10p"
+- reg: DSI virtual channel of the peripheral
+- enable-gpios: panel enable gpio
+- pp33-gpios: a GPIO phandle for the 3.3v pin that provides the supply voltage
+- pp18-gpios: a GPIO phandle for the 1.8v pin that provides the supply voltage
+
+Optional properties:
+- backlight: phandle of the backlight device attached to the panel
+
+Example:
+
+   &mipi_dsi {
+   panel {
+   compatible = "boe,himax8279d8p", "boe,himax8279d10p";
+   reg = <0>;
+   backlight = <&backlight>;
+   enable-gpios = <&gpio 45 GPIO_ACTIVE_HIGH>;
+   pp33-gpios = <&gpio 35 GPIO_ACTIVE_HIGH>;
+   pp18-gpios = <&gpio 36 GPIO_ACTIVE_HIGH>;
+   };
+   };
-- 
2.17.1

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

[PATCH] [v7,2/2] drm/panel: Add Boe Himax8279d MIPI-DSI LCD panel

2019-03-26 Thread Jerry Han
Support Boe Himax8279d 8.0" 1200x1920 TFT LCD panel, it is a MIPI DSI
panel.

V7:
- Add the information of the reviewer
- Remove unnecessary delays, The udelay_range code gracefully returns
without hitting the scheduler on a delay of 0. (Derek)
- Merge the same data structures, like display_mode and off_cmds (Derek)
- Optimize the processing of results returned by
devm_gpiod_get_optional (Derek)

V6:
- Add the information of the reviewer (Sam)
- Delete unnecessary header files #include  (Sam)
- The config DRM_PANEL_BOE_HIMAX8279D appears twice. Drop one of them (Sam)
- ADD static, set_gpios function is not used outside this module (Sam)

V5:
- Added changelog

V4:
- Frefix all function maes with boe_ (Sam)
- Fsed "enable_gpio" replace "reset_gpio", Make it look clearer (Sam)
- Sort include lines alphabetically (Sam)
- Fixed entries in the makefile must be sorted alphabetically (Sam)
- Add send_mipi_cmds function to avoid duplicating the code (Sam)
- Add the necessary delay(reset_delay_t5) between reset and sending
the initialization command (Rock wang)

V3:
- Remove unnecessary delays in sending initialization commands (Jitao Shi)

V2:
- Use SPDX identifier (Sam)
- Use necessary header files replace drmP.h (Sam)
- Delete unnecessary header files #include  (Sam)
- Specifies a GPIOs array to control the reset timing,
instead of reading "dsi-reset-sequence" data from DTS (Sam)
- Delete backlight_disable() function when already disabled (Sam)
- Use devm_of_find_backlight() replace of_find_backlight_by_node() (Sam)
- Move the necessary data in the DTS to the current file,
like porch, display_mode and Init code etc. (Sam)
- Add compatible device "boe,himax8279d10p" (Sam)

Signed-off-by: Jerry Han 
Reviewed-by: Sam Ravnborg 
Reviewed-by: Derek Basehore 
Cc: Jitao Shi 
Cc: Rock wang 
---
 MAINTAINERS  |6 +
 drivers/gpu/drm/panel/Kconfig|   11 +
 drivers/gpu/drm/panel/Makefile   |1 +
 drivers/gpu/drm/panel/panel-boe-himax8279d.c | 1050 ++
 4 files changed, 1068 insertions(+)
 create mode 100644 drivers/gpu/drm/panel/panel-boe-himax8279d.c

diff --git a/MAINTAINERS b/MAINTAINERS
index f8e63bcc4c1c..267468ca72bb 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4816,6 +4816,12 @@ T:   git git://anongit.freedesktop.org/drm/drm-misc
 S: Maintained
 F: drivers/gpu/drm/bochs/
 
+DRM DRIVER FOR BOE HIMAX8279D PANELS
+M: Jerry Han 
+S: Maintained
+F: drivers/gpu/drm/panel/panel-boe-himax8279d.c
+F: Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt
+
 DRM DRIVER FOR FARADAY TVE200 TV ENCODER
 M: Linus Walleij 
 T: git git://anongit.freedesktop.org/drm/drm-misc
diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index f53f817356db..fe2f87cc6627 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -17,6 +17,17 @@ config DRM_PANEL_ARM_VERSATILE
  reference designs. The panel is detected using special registers
  in the Versatile family syscon registers.
 
+config DRM_PANEL_BOE_HIMAX8279D
+   tristate "Boe Himax8279d 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 Boe Himax8279d
+ TFT-LCD modules. The panel has a 1200x1920 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_LVDS
tristate "Generic LVDS panel driver"
depends on OF
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index 7834947a53b0..c4814b6f069e 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -1,5 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 obj-$(CONFIG_DRM_PANEL_ARM_VERSATILE) += panel-arm-versatile.o
+obj-$(CONFIG_DRM_PANEL_BOE_HIMAX8279D) += panel-boe-himax8279d.o
 obj-$(CONFIG_DRM_PANEL_LVDS) += panel-lvds.o
 obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o
 obj-$(CONFIG_DRM_PANEL_ILITEK_IL9322) += panel-ilitek-ili9322.o
diff --git a/drivers/gpu/drm/panel/panel-boe-himax8279d.c 
b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
new file mode 100644
index ..ff5a89e38fd7
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
@@ -0,0 +1,1050 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2019, Huaqin Telecom Technology Co., Ltd
+ *
+ * Author: Jerry Han 
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+struct panel_cmd {
+   size_t len;
+   const char *data;
+};
+
+#define _INIT_CMD(...) { \
+   .len = sizeof((char[]){__VA_ARGS__}), \
+   .data = (char[]){__VA_ARGS__} }
+
+struct

Re: [PATCH] [v8, 2/2] drm/panel: Add Boe Himax8279d MIPI-DSI LCD panel

2019-07-26 Thread Jerry Han
Hi Emil Velikov:

First of all, thank you for your comments.

> +   struct gpio_desc *enable_gpio;
> +   struct gpio_desc *pp33_gpio;
> +   struct gpio_desc *pp18_gpio;
DT claims that these gpios are required, yet one is using the optional gpio
API.
Is the code off, or does the DT need fixing?

Thank you for your advice , I will  fix code.

static int send_mipi_cmds(struct drm_panel *panel, const struct panel_cmd
*cmds)
This format seems semi-magical. Any particular reason why you're not
using the helpers?
In particular, enter/exit sleep mode and set display on/off.

Normally, we only need to download 0x28 0x10 commands to power-key down.
I noticed that helper func (mipi_dsi_dcs_set_display_off,
mipi_dsi_dcs_enter_sleep_mode) help me send this commands(0x28 0x10).

But based on previous debugging experience, Some vendors are special and
may send other commands after sending cmd 0x28 0x10 or before send cmd 0x28
0x10.
this problem may also occur in our vendor,
so i think this above approach helps me manage code better.

Thanks.


Emil Velikov  于2019年7月1日周一 下午9:41写道:

> Hi Jerry,
>
> On Thu, 25 Apr 2019 at 08:40, Jerry Han  wrote:
> >
> > Support Boe Himax8279d 8.0" 1200x1920 TFT LCD panel, it is a MIPI DSI
> > panel.
> >
> > V8:
> > - Modify communication address
> >
> > V7:
> > - Add the information of the reviewer
> > - Remove unnecessary delays, The udelay_range code gracefully returns
> > without hitting the scheduler on a delay of 0. (Derek)
> > - Merge the same data structures, like display_mode and off_cmds (Derek)
> > - Optimize the processing of results returned by
> > devm_gpiod_get_optional (Derek)
> >
> > V6:
> > - Add the information of the reviewer (Sam)
> > - Delete unnecessary header files #include  (Sam)
> > - The config DRM_PANEL_BOE_HIMAX8279D appears twice. Drop one of them
> (Sam)
> > - ADD static, set_gpios function is not used outside this module (Sam)
> >
> > V5:
> > - Added changelog
> >
> > V4:
> > - Frefix all function maes with boe_ (Sam)
> > - Fsed "enable_gpio" replace "reset_gpio", Make it look clearer (Sam)
> > - Sort include lines alphabetically (Sam)
> > - Fixed entries in the makefile must be sorted alphabetically (Sam)
> > - Add send_mipi_cmds function to avoid duplicating the code (Sam)
> > - Add the necessary delay(reset_delay_t5) between reset and sending
> > the initialization command (Rock wang)
> >
> > V3:
> > - Remove unnecessary delays in sending initialization commands (Jitao
> Shi)
> >
> > V2:
> > - Use SPDX identifier (Sam)
> > - Use necessary header files replace drmP.h (Sam)
> > - Delete unnecessary header files #include  (Sam)
> > - Specifies a GPIOs array to control the reset timing,
> > instead of reading "dsi-reset-sequence" data from DTS (Sam)
> > - Delete backlight_disable() function when already disabled (Sam)
> > - Use devm_of_find_backlight() replace of_find_backlight_by_node() (Sam)
> > - Move the necessary data in the DTS to the current file,
> > like porch, display_mode and Init code etc. (Sam)
> > - Add compatible device "boe,himax8279d10p" (Sam)
> >
> > Signed-off-by: Jerry Han 
> > Reviewed-by: Sam Ravnborg 
> > Reviewed-by: Derek Basehore 
> > Cc: Jitao Shi 
> > Cc: Rock wang 
> > ---
> While the DT has landed, this patch is not merged it seems.
> I think that Sam is waiting for a version which does not trigger so
> many check-patch warnings.
>
> That said, a couple of comments if I may.
>
> > +   struct gpio_desc *enable_gpio;
> > +   struct gpio_desc *pp33_gpio;
> > +   struct gpio_desc *pp18_gpio;
> DT claims that these gpios are required, yet one is using the optional
> gpio API.
> Is the code off, or does the DT need fixing?
>
>
> > +static int send_mipi_cmds(struct drm_panel *panel, const struct
> panel_cmd *cmds)
> > +{
> > +   struct panel_info *pinfo = to_panel_info(panel);
> > +   unsigned int i = 0;
> > +   int err;
> > +
> > +   if (!cmds)
> > +   return -EFAULT;
> > +
> > +   for (i = 0; cmds[i].len != 0; i++) {
> > +   const struct panel_cmd *cmd = &cmds[i];
> > +
> > +   if (cmd->len == 2)
> > +   err = mipi_dsi_dcs_write(pinfo->link,
> > +   cmd->data[1], NULL,
> 0);
> > +   else
> > +   err = mipi_dsi_dcs_write(pinfo->link,
> > + 

[PATCH] [v9] drm/panel: Add Boe Himax8279d MIPI-DSI LCD panel

2019-07-30 Thread Jerry Han

From 9c63ed65469e075430a07f89012cd116c427bd6f Mon Sep 17 00:00:00 2001
From: Jerry Han 
Date: Mon, 29 Jul 2019 11:30:48 +0800
Subject: [PATCH] [v9] drm/panel: Add Boe Himax8279d MIPI-DSI LCD panel

Support Boe Himax8279d 8.0" 1200x1920 TFT LCD panel, it is a MIPI DSI
panel.

V9:
- modify PARENTHESIS_ALIGNMENT format (Sam)
- use gpios are required API replace optional gpio API (Emil)

V8:
- Modify communication address

V7:
- Add the information of the reviewer
- Remove unnecessary delays, The udelay_range code gracefully returns
without hitting the scheduler on a delay of 0. (Derek)
- Merge the same data structures, like display_mode and off_cmds (Derek)
- Optimize the processing of results returned by
devm_gpiod_get_optional (Derek)

V6:
- Add the information of the reviewer (Sam)
- Delete unnecessary header files #include  (Sam)
- The config DRM_PANEL_BOE_HIMAX8279D appears twice. Drop one of
them (Sam)
- ADD static, set_gpios function is not used outside this module (Sam)

V5:
- Added changelog

V4:
- Frefix all function maes with boe_ (Sam)
- Fsed "enable_gpio" replace "reset_gpio", Make it look clearer (Sam)
- Sort include lines alphabetically (Sam)
- Fixed entries in the makefile must be sorted alphabetically (Sam)
- Add send_mipi_cmds function to avoid duplicating the code (Sam)
- Add the necessary delay(reset_delay_t5) between reset and sending
the initialization command (Rock wang)

V3:
- Remove unnecessary delays in sending initialization commands (Jitao Shi)

V2:
- Use SPDX identifier (Sam)
- Use necessary header files replace drmP.h (Sam)
- Delete unnecessary header files #include  (Sam)
- Specifies a GPIOs array to control the reset timing,
instead of reading "dsi-reset-sequence" data from DTS (Sam)
- Delete backlight_disable() function when already disabled (Sam)
- Use devm_of_find_backlight() replace of_find_backlight_by_node() (Sam)
- Move the necessary data in the DTS to the current file,
like porch, display_mode and Init code etc. (Sam)
- Add compatible device "boe,himax8279d10p" (Sam)

Signed-off-by: Jerry Han 
Reviewed-by: Sam Ravnborg 
Reviewed-by: Derek Basehore 
Cc: Jitao Shi 
Cc: Rock wang 
---
 MAINTAINERS  |6 +
 drivers/gpu/drm/panel/Kconfig|   11 +
 drivers/gpu/drm/panel/Makefile   |1 +
 drivers/gpu/drm/panel/panel-boe-himax8279d.c | 1049 ++
 4 files changed, 1067 insertions(+)
 create mode 100644 drivers/gpu/drm/panel/panel-boe-himax8279d.c

diff --git a/MAINTAINERS b/MAINTAINERS
index 0a76716874bd..eece774bdf08 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -5003,6 +5003,12 @@ T:	git git://anongit.freedesktop.org/drm/drm-misc
 S:	Maintained
 F:	drivers/gpu/drm/bochs/
 
+DRM DRIVER FOR BOE HIMAX8279D PANELS
+M:	Jerry Han 
+S:	Maintained
+F:	drivers/gpu/drm/panel/panel-boe-himax8279d.c
+F:	Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt
+
 DRM DRIVER FOR FARADAY TVE200 TV ENCODER
 M:	Linus Walleij 
 T:	git git://anongit.freedesktop.org/drm/drm-misc
diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index eaecd40cc32e..257094a16a7d 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -18,6 +18,17 @@ config DRM_PANEL_ARM_VERSATILE
 	  reference designs. The panel is detected using special registers
 	  in the Versatile family syscon registers.
 
+config DRM_PANEL_BOE_HIMAX8279D
+	tristate "Boe Himax8279d 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 Boe Himax8279d
+	  TFT-LCD modules. The panel has a 1200x1920 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_LVDS
 	tristate "Generic LVDS panel driver"
 	depends on OF
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index 62dae45f8f74..29c57e915ee6 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -1,5 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 obj-$(CONFIG_DRM_PANEL_ARM_VERSATILE) += panel-arm-versatile.o
+obj-$(CONFIG_DRM_PANEL_BOE_HIMAX8279D) += panel-boe-himax8279d.o
 obj-$(CONFIG_DRM_PANEL_LVDS) += panel-lvds.o
 obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o
 obj-$(CONFIG_DRM_PANEL_FEIYANG_FY07024DI26A30D) += panel-feiyang-fy07024di26a30d.o
diff --git a/drivers/gpu/drm/panel/panel-boe-himax8279d.c b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
new file mode 100644
index ..7790f76d3ce7
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
@@ -0,0 +1,1049 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2019, Huaqin Telecom Technology Co., Ltd
+ *
+ * Author: Jerry Han 
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+

[PATCH] drm/panel: boe-himax8279d: use drm_panel backlight support

2019-12-12 Thread Jerry Han
Use the backlight support in drm_panel to simplify the driver

Signed-off-by: Jerry Han 
Reviewed-by: Sam Ravnborg 
---
 drivers/gpu/drm/panel/panel-boe-himax8279d.c | 17 +++--
 1 file changed, 3 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-boe-himax8279d.c 
b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
index 65ea6f673cdb..3a6ee2069158 100644
--- a/drivers/gpu/drm/panel/panel-boe-himax8279d.c
+++ b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
@@ -6,7 +6,6 @@
  *
  */
 
-#include 
 #include 
 #include 
 #include 
@@ -47,7 +46,6 @@ struct panel_info {
struct mipi_dsi_device *link;
const struct panel_desc *desc;
 
-   struct backlight_device *backlight;
struct gpio_desc *enable_gpio;
struct gpio_desc *pp33_gpio;
struct gpio_desc *pp18_gpio;
@@ -93,8 +91,6 @@ static int boe_panel_disable(struct drm_panel *panel)
if (!pinfo->enabled)
return 0;
 
-   backlight_disable(pinfo->backlight);
-
err = mipi_dsi_dcs_set_display_off(pinfo->link);
if (err < 0) {
DRM_DEV_ERROR(panel->dev, "failed to set display off: %d\n",
@@ -218,13 +214,6 @@ static int boe_panel_enable(struct drm_panel *panel)
return ret;
}
 
-   ret = backlight_enable(pinfo->backlight);
-   if (ret) {
-   DRM_DEV_ERROR(panel->drm->dev,
- "Failed to enable backlight %d\n", ret);
-   return ret;
-   }
-
pinfo->enabled = true;
 
return 0;
@@ -899,9 +888,9 @@ static int panel_add(struct panel_info *pinfo)
return ret;
}
 
-   pinfo->backlight = devm_of_find_backlight(dev);
-   if (IS_ERR(pinfo->backlight))
-   return PTR_ERR(pinfo->backlight);
+   ret = drm_panel_of_backlight(&pinfo->base);
+   if (ret)
+   return ret;
 
drm_panel_init(&pinfo->base, dev, &panel_funcs,
   DRM_MODE_CONNECTOR_DSI);
-- 
2.17.1

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


Re: [PATCH] drm/panel: Add Boe Himax8279d MIPI-DSI LCD panel

2019-12-12 Thread Jerry Han
>
> Hi Jerry.
>
>
> > Support Boe Himax8279d 8.0" 1200x1920 TFT LCD panel, it is a MIPI DSI
> > panel.
>
> Thanks for your persistence with this driver.
>
>
> Unfortunately the driver no longer builds after the drm_panel
> work we committed earlier this week to drm-misc-next.
>
> >
> > V9:
> > - Adjust init code, make the format more concise
> > - kill off default_off_cmds (Emil)
> > - use mipi_dsi_dcs_set_display_{on,off} in their enable/disable
> > callbacks. (Emil)
> > - Adjusting the delay function (Emil)
>
> ...
> > +
> > +struct panel_info {
> > + struct drm_panel base;
> > + struct mipi_dsi_device *link;
> > + const struct panel_desc *desc;
> > +
> > + struct backlight_device *backlight;
>
> We have included backlight support in drm_panel.
> Can you please introduce this and post a patch updating the driver to
> use this.
> See other panle patches what is required to use it.
> (Mostly deleting code)
>
> I took a look at the rest of the driver and everything looks good.
>
> Sorry for causing you this extra trouble due to the drm_panel changes.
>
> Sam
Hi sam:

I'm happy to change the code for consistency.
I have provided the corresponding patch.

Thanks
Jerry
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH] drm/panel: Add Boe Himax8279d MIPI-DSI LCD panel

2019-12-13 Thread Jerry Han
Support Boe Himax8279d 8.0" 1200x1920 TFT LCD panel, it is a MIPI DSI
panel.

V11:
- Use the backlight support in drm_panel to simplify the driver (Sam)

V10:
- Adjust init code, make the format more concise (Emil)

V9:
- kill off default_off_cmds (Emil)
- use mipi_dsi_dcs_set_display_{on,off} in their enable/disable
callbacks. (Emil)
- Adjusting the delay function (Emil)

V8:
- modify PARENTHESIS_ALIGNMENT format (Sam)
- use gpios are required API replace optional gpio API (Emil)

V7:
- Modify communication address

V6:
- Add the information of the reviewer
- Remove unnecessary delays, The udelay_range code gracefully returns
without hitting the scheduler on a delay of 0. (Derek)
- Merge the same data structures, like display_mode and off_cmds (Derek)
- Optimize the processing of results returned by
devm_gpiod_get_optional (Derek)

V5:
- Add the information of the reviewer (Sam)
- Delete unnecessary header files #include  (Sam)
- The config DRM_PANEL_BOE_HIMAX8279D appears twice. Drop one of them (Sam)
- ADD static, set_gpios function is not used outside this module (Sam)

V4:
- Frefix all function maes with boe_ (Sam)
- Fsed "enable_gpio" replace "reset_gpio", Make it look clearer (Sam)
- Sort include lines alphabetically (Sam)
- Fixed entries in the makefile must be sorted alphabetically (Sam)
- Add send_mipi_cmds function to avoid duplicating the code (Sam)
- Add the necessary delay(reset_delay_t5) between reset and sending
the initialization command (Rock wang)

V3:
- Remove unnecessary delays in sending initialization commands (Jitao Shi)

V2:
- Use SPDX identifier (Sam)
- Use necessary header files replace drmP.h (Sam)
- Delete unnecessary header files #include  (Sam)
- Specifies a GPIOs array to control the reset timing,
instead of reading "dsi-reset-sequence" data from DTS (Sam)
- Delete backlight_disable() function when already disabled (Sam)
- Use devm_of_find_backlight() replace of_find_backlight_by_node() (Sam)
- Move the necessary data in the DTS to the current file,
like porch, display_mode and Init code etc. (Sam)
- Add compatible device "boe,himax8279d10p" (Sam)

V1:
- Support Boe Himax8279d 8.0" 1200x1920 TFT LCD panel, it is a MIPI DSI
panel.

Signed-off-by: Jerry Han 
Reviewed-by: Sam Ravnborg 
Reviewed-by: Derek Basehore 
Reviewed-by: Emil Velikov 
Reported-by: kbuild test robot 
Cc: Jitao Shi 
Cc: Rock wang 
---
 MAINTAINERS  |   6 +
 drivers/gpu/drm/panel/Kconfig|  11 +
 drivers/gpu/drm/panel/Makefile   |   1 +
 drivers/gpu/drm/panel/panel-boe-himax8279d.c | 977 +++
 4 files changed, 995 insertions(+)
 create mode 100644 drivers/gpu/drm/panel/panel-boe-himax8279d.c

diff --git a/MAINTAINERS b/MAINTAINERS
index 248938405c01..8b2e6c68832d 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -5153,6 +5153,12 @@ T:   git git://anongit.freedesktop.org/drm/drm-misc
 S: Maintained
 F: drivers/gpu/drm/bochs/
 
+DRM DRIVER FOR BOE HIMAX8279D PANELS
+M: Jerry Han 
+S: Maintained
+F: drivers/gpu/drm/panel/panel-boe-himax8279d.c
+F: Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt
+
 DRM DRIVER FOR FARADAY TVE200 TV ENCODER
 M: Linus Walleij 
 T: git git://anongit.freedesktop.org/drm/drm-misc
diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index f152bc4eeb53..683ff77a3733 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -18,6 +18,17 @@ config DRM_PANEL_ARM_VERSATILE
  reference designs. The panel is detected using special registers
  in the Versatile family syscon registers.
 
+config DRM_PANEL_BOE_HIMAX8279D
+   tristate "Boe Himax8279d 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 Boe Himax8279d
+ TFT-LCD modules. The panel has a 1200x1920 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_LVDS
tristate "Generic LVDS panel driver"
depends on OF
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index b6cd39fe0f20..8783476110a3 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -1,5 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 obj-$(CONFIG_DRM_PANEL_ARM_VERSATILE) += panel-arm-versatile.o
+obj-$(CONFIG_DRM_PANEL_BOE_HIMAX8279D) += panel-boe-himax8279d.o
 obj-$(CONFIG_DRM_PANEL_LVDS) += panel-lvds.o
 obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o
 obj-$(CONFIG_DRM_PANEL_FEIYANG_FY07024DI26A30D) += 
panel-feiyang-fy07024di26a30d.o
diff --git a/drivers/gpu/drm/panel/panel-boe-himax8279d.c 
b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
new file mode 100644
index ..3a6ee20

[PATCH] drm/panel: Add Boe Himax8279d MIPI-DSI LCD panel

2019-12-14 Thread Jerry Han
Support Boe Himax8279d 8.0" 1200x1920 TFT LCD panel, it is a MIPI DSI
panel.

V12:
- fix build in boe_panel_modes() (sam)
- fix backlight - drm_panel_of_backlight() must be called after
  drm_panel_init() (sam)

V11:
- Use the backlight support in drm_panel to simplify the driver (Sam)

V10:
- Adjust init code, make the format more concise (Emil)

V9:
- kill off default_off_cmds (Emil)
- use mipi_dsi_dcs_set_display_{on,off} in their enable/disable
callbacks. (Emil)
- Adjusting the delay function (Emil)

V8:
- modify PARENTHESIS_ALIGNMENT format (Sam)
- use gpios are required API replace optional gpio API (Emil)

V7:
- Modify communication address

V6:
- Add the information of the reviewer
- Remove unnecessary delays, The udelay_range code gracefully returns
without hitting the scheduler on a delay of 0. (Derek)
- Merge the same data structures, like display_mode and off_cmds (Derek)
- Optimize the processing of results returned by
devm_gpiod_get_optional (Derek)

V5:
- Add the information of the reviewer (Sam)
- Delete unnecessary header files #include  (Sam)
- The config DRM_PANEL_BOE_HIMAX8279D appears twice. Drop one of them (Sam)
- ADD static, set_gpios function is not used outside this module (Sam)

V4:
- Frefix all function maes with boe_ (Sam)
- Fsed "enable_gpio" replace "reset_gpio", Make it look clearer (Sam)
- Sort include lines alphabetically (Sam)
- Fixed entries in the makefile must be sorted alphabetically (Sam)
- Add send_mipi_cmds function to avoid duplicating the code (Sam)
- Add the necessary delay(reset_delay_t5) between reset and sending
the initialization command (Rock wang)

V3:
- Remove unnecessary delays in sending initialization commands (Jitao Shi)

V2:
- Use SPDX identifier (Sam)
- Use necessary header files replace drmP.h (Sam)
- Delete unnecessary header files #include  (Sam)
- Specifies a GPIOs array to control the reset timing,
instead of reading "dsi-reset-sequence" data from DTS (Sam)
- Delete backlight_disable() function when already disabled (Sam)
- Use devm_of_find_backlight() replace of_find_backlight_by_node() (Sam)
- Move the necessary data in the DTS to the current file,
like porch, display_mode and Init code etc. (Sam)
- Add compatible device "boe,himax8279d10p" (Sam)

V1:
- Support Boe Himax8279d 8.0" 1200x1920 TFT LCD panel, it is a MIPI DSI
panel.

Signed-off-by: Jerry Han 
Reviewed-by: Sam Ravnborg 
Reviewed-by: Derek Basehore 
Reviewed-by: Emil Velikov 
Reported-by: kbuild test robot 
Cc: Jitao Shi 
Cc: Rock wang 
---
 MAINTAINERS  |   6 +
 drivers/gpu/drm/panel/Kconfig|  11 +
 drivers/gpu/drm/panel/Makefile   |   1 +
 drivers/gpu/drm/panel/panel-boe-himax8279d.c | 978 +++
 4 files changed, 996 insertions(+)
 create mode 100644 drivers/gpu/drm/panel/panel-boe-himax8279d.c

diff --git a/MAINTAINERS b/MAINTAINERS
index 248938405c01..8b2e6c68832d 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -5153,6 +5153,12 @@ T:   git git://anongit.freedesktop.org/drm/drm-misc
 S: Maintained
 F: drivers/gpu/drm/bochs/
 
+DRM DRIVER FOR BOE HIMAX8279D PANELS
+M: Jerry Han 
+S: Maintained
+F: drivers/gpu/drm/panel/panel-boe-himax8279d.c
+F: Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt
+
 DRM DRIVER FOR FARADAY TVE200 TV ENCODER
 M: Linus Walleij 
 T: git git://anongit.freedesktop.org/drm/drm-misc
diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index f152bc4eeb53..683ff77a3733 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -18,6 +18,17 @@ config DRM_PANEL_ARM_VERSATILE
  reference designs. The panel is detected using special registers
  in the Versatile family syscon registers.
 
+config DRM_PANEL_BOE_HIMAX8279D
+   tristate "Boe Himax8279d 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 Boe Himax8279d
+ TFT-LCD modules. The panel has a 1200x1920 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_LVDS
tristate "Generic LVDS panel driver"
depends on OF
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index b6cd39fe0f20..8783476110a3 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -1,5 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 obj-$(CONFIG_DRM_PANEL_ARM_VERSATILE) += panel-arm-versatile.o
+obj-$(CONFIG_DRM_PANEL_BOE_HIMAX8279D) += panel-boe-himax8279d.o
 obj-$(CONFIG_DRM_PANEL_LVDS) += panel-lvds.o
 obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o
 obj-$(CONFIG_DRM_PANEL_FEIYANG_FY07024DI26A30D) += 
panel-feiyang-fy07024di26a30d.o
diff --git a/drivers/g

[PATCH 4/9] [v10, 4/9] drm/panel:Add Boe Himax8279d MIPI-DSI LCD panel

2019-09-17 Thread Jerry Han



0004-v10-4-9-drm-panel-Add-Boe-Himax8279d-MIPI-DSI-LCD-pa.patch
Description: Binary data
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH 3/9] [v10, 3/9] drm/panel:Add Boe Himax8279d MIPI-DSI LCD panel

2019-09-17 Thread Jerry Han



0003-v10-3-9-drm-panel-Add-Boe-Himax8279d-MIPI-DSI-LCD-pa.patch
Description: Binary data
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH 7/9] [v10, 7/9] drm/panel:Add Boe Himax8279d MIPI-DSI LCD panel

2019-09-17 Thread Jerry Han



0007-v10-7-9-drm-panel-Add-Boe-Himax8279d-MIPI-DSI-LCD-pa.patch
Description: Binary data
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH 2/9] [v10, 2/9] drm/panel:Add Boe Himax8279d MIPI-DSI LCD panel

2019-09-17 Thread Jerry Han



0002-v10-2-9-drm-panel-Add-Boe-Himax8279d-MIPI-DSI-LCD-pa.patch
Description: Binary data
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH 1/9] [v10, 1/9] drm/panel:Add Boe Himax8279d MIPI-DSI LCD panel

2019-09-17 Thread Jerry Han



0001-v10-1-9-drm-panel-Add-Boe-Himax8279d-MIPI-DSI-LCD-pa.patch
Description: Binary data
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH 9/9] [v10, 9/9] drm/panel:Add Boe Himax8279d MIPI-DSI LCD panel

2019-09-17 Thread Jerry Han



0009-v10-9-9-drm-panel-Add-Boe-Himax8279d-MIPI-DSI-LCD-pa.patch
Description: Binary data
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH 6/9] [v10, 6/9] drm/panel:Add Boe Himax8279d MIPI-DSI LCD panel

2019-09-17 Thread Jerry Han



0006-v10-6-9-drm-panel-Add-Boe-Himax8279d-MIPI-DSI-LCD-pa.patch
Description: Binary data
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH 8/9] [v10, 8/9] drm/panel:Add Boe Himax8279d MIPI-DSI LCD panel

2019-09-17 Thread Jerry Han



0008-v10-8-9-drm-panel-Add-Boe-Himax8279d-MIPI-DSI-LCD-pa.patch
Description: Binary data
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH 5/9] [v10, 5/9] drm/panel:Add Boe Himax8279d MIPI-DSI LCD panel

2019-09-17 Thread Jerry Han



0005-v10-5-9-drm-panel-Add-Boe-Himax8279d-MIPI-DSI-LCD-pa.patch
Description: Binary data
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH 5/9] [v10, 5/9] drm/panel: Add Boe Himax8279d MIPI-DSI LCD panel

2019-09-19 Thread Jerry Han
Support Boe Himax8279d 8.0" 1200x1920 TFT LCD panel, it is a MIPI DSI
panel.

V5:
- Add the information of the reviewer (Sam)
- Delete unnecessary header files #include  (Sam)
- The config DRM_PANEL_BOE_HIMAX8279D appears twice. Drop one of them (Sam)
- ADD static, set_gpios function is not used outside this module (Sam)

V4:
- Frefix all function maes with boe_ (Sam)
- Fsed "enable_gpio" replace "reset_gpio", Make it look clearer (Sam)
- Sort include lines alphabetically (Sam)
- Fixed entries in the makefile must be sorted alphabetically (Sam)
- Add send_mipi_cmds function to avoid duplicating the code (Sam)
- Add the necessary delay(reset_delay_t5) between reset and sending
the initialization command (Rock wang)

V3:
- Remove unnecessary delays in sending initialization commands (Jitao Shi)

V2:
- Use SPDX identifier (Sam)
- Use necessary header files replace drmP.h (Sam)
- Delete unnecessary header files #include  (Sam)
- Specifies a GPIOs array to control the reset timing,
instead of reading "dsi-reset-sequence" data from DTS (Sam)
- Delete backlight_disable() function when already disabled (Sam)
- Use devm_of_find_backlight() replace of_find_backlight_by_node() (Sam)
- Move the necessary data in the DTS to the current file,
like porch, display_mode and Init code etc. (Sam)
- Add compatible device "boe,himax8279d10p" (Sam)

V1:
- Support Boe Himax8279d 8.0" 1200x1920 TFT LCD panel, it is a MIPI DSI
panel.

Signed-off-by: Jerry Han 
Reviewed-by: Sam Ravnborg 
Cc: Jitao Shi 
Cc: Derek Basehore 
Cc: Rock wang 
---
 drivers/gpu/drm/panel/panel-boe-himax8279d.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-boe-himax8279d.c 
b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
index aa7d91279819..c050a48487a2 100644
--- a/drivers/gpu/drm/panel/panel-boe-himax8279d.c
+++ b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
@@ -8,7 +8,6 @@
 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -72,7 +71,7 @@ static inline struct panel_info *to_panel_info(struct 
drm_panel *panel)
return container_of(panel, struct panel_info, base);
 }
 
-void set_gpios(struct panel_info *pinfo, int enable)
+static void set_gpios(struct panel_info *pinfo, int enable)
 {
gpiod_set_value(pinfo->enable_gpio, enable);
gpiod_set_value(pinfo->pp33_gpio, enable);
-- 
2.17.1

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

[PATCH 1/9] [v10, 1/9] drm/panel:Add Boe Himax8279d MIPI-DSI LCD panel

2019-09-19 Thread Jerry Han
Add panel driver for it.

Signed-off-by: Jerry Han 
---
 MAINTAINERS  |   6 +
 drivers/gpu/drm/panel/Kconfig|  11 +
 drivers/gpu/drm/panel/Makefile   |   1 +
 drivers/gpu/drm/panel/panel-boe-himax8279d.c | 593 +++
 4 files changed, 611 insertions(+)
 create mode 100644 drivers/gpu/drm/panel/panel-boe-himax8279d.c

diff --git a/MAINTAINERS b/MAINTAINERS
index 28f4a20940cb..7c6ac18b922e 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -5110,6 +5110,12 @@ S:   Maintained
 F: drivers/gpu/drm/tiny/ili9225.c
 F: Documentation/devicetree/bindings/display/ilitek,ili9225.txt
 
+DRM DRIVER FOR BOE HIMAX8279D PANELS
+M: Jerry Han 
+S: Maintained
+F: drivers/gpu/drm/panel/panel-boe-himax8279d.c
+F: Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt
+
 DRM DRIVER FOR HX8357D PANELS
 M: Eric Anholt 
 T: git git://anongit.freedesktop.org/drm/drm-misc
diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index f152bc4eeb53..cfd8c886fff7 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -339,6 +339,17 @@ config DRM_PANEL_TPO_TD043MTEA1
  Say Y here if you want to enable support for TPO TD043MTEA1 800x480
  4.3" panel (found on the OMAP3 Pandora board).
 
+config DRM_PANEL_BOE_HIMAX8279D
+   tristate "Boe Himax8279d 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 Same type
+ TFT-LCD modules. The panel has a 1200x1920 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_TPO_TPG110
tristate "TPO TPG 800x400 panel"
depends on OF && SPI && GPIOLIB
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index b6cd39fe0f20..a771c92f880a 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -36,5 +36,6 @@ obj-$(CONFIG_DRM_PANEL_SITRONIX_ST7789V) += 
panel-sitronix-st7789v.o
 obj-$(CONFIG_DRM_PANEL_SONY_ACX565AKM) += panel-sony-acx565akm.o
 obj-$(CONFIG_DRM_PANEL_TPO_TD028TTEC1) += panel-tpo-td028ttec1.o
 obj-$(CONFIG_DRM_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o
+obj-$(CONFIG_DRM_PANEL_BOE_HIMAX8279D) += panel-boe-himax8279d.o
 obj-$(CONFIG_DRM_PANEL_TPO_TPG110) += panel-tpo-tpg110.o
 obj-$(CONFIG_DRM_PANEL_TRULY_NT35597_WQXGA) += panel-truly-nt35597.o
diff --git a/drivers/gpu/drm/panel/panel-boe-himax8279d.c 
b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
new file mode 100644
index ..2788bdda69ec
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
@@ -0,0 +1,593 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2019, Huaqin Electronics Co., Ltd
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+struct dsi_cmd_desc {
+   char wait;
+   char cmd;
+   char len;
+   char *payload;
+};
+
+struct dsi_panel_cmds {
+   char *buf;
+   int blen;
+   struct dsi_cmd_desc *cmds;
+   int cmd_cnt;
+};
+
+struct panel_info {
+   struct drm_panel base;
+   struct mipi_dsi_device *link;
+
+   struct backlight_device *backlight;
+   struct gpio_desc *reset_gpio;
+   struct gpio_desc *pp33000_gpio;
+   struct gpio_desc *pp18000_gpio;
+
+   u32 rst_seq[10];
+   u32 rst_seq_len;
+
+   struct dsi_panel_cmds *on_cmds;
+   struct dsi_panel_cmds *off_cmds;
+   struct drm_display_mode *panel_display_mode;
+
+   unsigned int panel_width_mm;
+   unsigned int panel_height_mm;
+   unsigned int per_color_channel;
+
+   bool prepared;
+   bool enabled;
+};
+
+static int dsi_parse_reset_seq(struct device_node *np, u32 rst_seq[10],
+   u32 *rst_len, const char *name)
+{
+   int num = 0, i;
+   int rc;
+   struct property *data;
+   u32 tmp[10];
+   *rst_len = 0;
+   data = of_find_property(np, name, &num);
+
+   num /= sizeof(u32);
+   if (!data || !num || num > 10 || num % 2) {
+   pr_err("%s:%d, error reading %s, length found = %d\n",
+   __func__, __LINE__, name, num);
+   return -EINVAL;
+   }
+
+   rc = of_property_read_u32_array(np, name, tmp, num);
+   if (rc) {
+   pr_err("%s:%d, error reading %s, rc = %d\n",
+   __func__, __LINE__, name, rc);
+   

[PATCH 2/9] [v10, 2/9] drm/panel: Add Boe Himax8279d MIPI-DSI LCD panel

2019-09-19 Thread Jerry Han
Support Boe Himax8279d 8.0" 1200x1920 TFT LCD panel, it is a MIPI DSI
panel.

V2:
- Use SPDX identifier (Sam)
- Use necessary header files replace drmP.h (Sam)
- Delete unnecessary header files #include  (Sam)
- Specifies a GPIOs array to control the reset timing,
instead of reading "dsi-reset-sequence" data from DTS (Sam)
- Delete backlight_disable() function when already disabled (Sam)
- Use devm_of_find_backlight() replace of_find_backlight_by_node() (Sam)
- Move the necessary data in the DTS to the current file,
like porch, display_mode and Init code etc. (Sam)
- Add compatible device "boe,himax8279d10p" (Sam)

V1:
- Support Boe Himax8279d 8.0" 1200x1920 TFT LCD panel, it is a MIPI DSI
    panel.

Signed-off-by: Jerry Han 
Cc: Jitao Shi 
Cc: Nick Sanders 
Cc: YH Lin 
Cc: Rock wang 
---
 drivers/gpu/drm/panel/Makefile   |1 +
 drivers/gpu/drm/panel/panel-boe-himax8279d.c | 1201 --
 2 files changed, 842 insertions(+), 360 deletions(-)

diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index a771c92f880a..4beae2ab427f 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -1,5 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 obj-$(CONFIG_DRM_PANEL_ARM_VERSATILE) += panel-arm-versatile.o
+obj-$(CONFIG_DRM_PANEL_BOE_HIMAX8279D) += panel-boe-himax8279d.o
 obj-$(CONFIG_DRM_PANEL_LVDS) += panel-lvds.o
 obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o
 obj-$(CONFIG_DRM_PANEL_FEIYANG_FY07024DI26A30D) += 
panel-feiyang-fy07024di26a30d.o
diff --git a/drivers/gpu/drm/panel/panel-boe-himax8279d.c 
b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
index 2788bdda69ec..836a9cbc5891 100644
--- a/drivers/gpu/drm/panel/panel-boe-himax8279d.c
+++ b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
@@ -1,319 +1,76 @@
 // SPDX-License-Identifier: GPL-2.0
 /*
- * Copyright (c) 2019, Huaqin Electronics Co., Ltd
+ * Copyright (c) 2019, Huaqin Telecom Technology Co., Ltd
+ *
+ * Author: Jerry Han 
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
  */
 
 #include 
-#include 
+#include 
+#include 
+#include 
 #include 
 #include 
 #include 
+
+#include 
 #include 
 
-#include 
-#include 
+#include 
 #include 
 #include 
+#include 
+#include 
 
 #include 
-#include 
 
-struct dsi_cmd_desc {
-   char wait;
-   char cmd;
-   char len;
-   char *payload;
+struct panel_cmd {
+   size_t len;
+   const char *data;
 };
 
-struct dsi_panel_cmds {
-   char *buf;
-   int blen;
-   struct dsi_cmd_desc *cmds;
-   int cmd_cnt;
+#define _INIT_CMD(...) { \
+   .len = sizeof((char[]){__VA_ARGS__}), \
+   .data = (char[]){__VA_ARGS__} }
+
+struct panel_desc {
+   const struct drm_display_mode *display_mode;
+   unsigned int bpc;
+   unsigned int width;
+   unsigned int height;
+
+   unsigned int delay_t1;
+   unsigned int reset_delay_t2;
+   unsigned int reset_delay_t3;
+   unsigned int reset_delay_t4;
+
+   unsigned long flags;
+   enum mipi_dsi_pixel_format format;
+   unsigned int lanes;
+   const struct panel_cmd *on_cmds;
+   const struct panel_cmd *off_cmds;
 };
 
 struct panel_info {
struct drm_panel base;
struct mipi_dsi_device *link;
+   const struct panel_desc *desc;
 
struct backlight_device *backlight;
struct gpio_desc *reset_gpio;
-   struct gpio_desc *pp33000_gpio;
-   struct gpio_desc *pp18000_gpio;
-
-   u32 rst_seq[10];
-   u32 rst_seq_len;
-
-   struct dsi_panel_cmds *on_cmds;
-   struct dsi_panel_cmds *off_cmds;
-   struct drm_display_mode *panel_display_mode;
-
-   unsigned int panel_width_mm;
-   unsigned int panel_height_mm;
-   unsigned int per_color_channel;
+   struct gpio_desc *pp33_gpio;
+   struct gpio_desc *pp18_gpio;
 
bool prepared;
bool enabled;
 };
 
-static int dsi_parse_reset_seq(struct device_node *np, u32 rst_seq[10],
-   u32 *rst_len, const char *name)
-{
-   int num = 0, i;
-   int rc;
-   struct property *data;
-   u32 tmp[10];
-   *rst_len = 0;
-   data = of_find_property(np, name, &num);
-
-   num /= sizeof(u32);
-   if (!data || !num || num > 10 || num % 2) {
-   pr_err("%s:%d, error reading %s, length found = %d\n",
-   __func__, __LINE__, name, num);
-   return -EINVAL;
-   }
-
-   rc = of_property_read_u32_array(np, name, tmp, num);
-   if (rc) {
-   pr_err("%s:%d, error reading %s, rc = %d\n",
-   __func__, __LINE__, name, rc);
-   return -EINVAL;
-   }
-
-   for (

[PATCH 4/9] [v10, 4/9] drm/panel: Add Boe Himax8279d MIPI-DSI LCD panel

2019-09-19 Thread Jerry Han
Support Boe Himax8279d 8.0" 1200x1920 TFT LCD panel, it is a MIPI DSI
panel.

V4:
- Frefix all function maes with boe_ (Sam)
- Fsed "enable_gpio" replace "reset_gpio", Make it look clearer (Sam)
- Sort include lines alphabetically (Sam)
- Fixed entries in the makefile must be sorted alphabetically (Sam)
- Add send_mipi_cmds function to avoid duplicating the code (Sam)
- Add the necessary delay(reset_delay_t5) between reset and sending
the initialization command (Rock wang)

V3:
- Remove unnecessary delays in sending initialization commands (Jitao Shi)

V2:
- Use SPDX identifier (Sam)
- Use necessary header files replace drmP.h (Sam)
- Delete unnecessary header files #include  (Sam)
- Specifies a GPIOs array to control the reset timing,
instead of reading "dsi-reset-sequence" data from DTS (Sam)
- Delete backlight_disable() function when already disabled (Sam)
- Use devm_of_find_backlight() replace of_find_backlight_by_node() (Sam)
- Move the necessary data in the DTS to the current file,
like porch, display_mode and Init code etc. (Sam)
- Add compatible device "boe,himax8279d10p" (Sam)

V1:
- Support Boe Himax8279d 8.0" 1200x1920 TFT LCD panel, it is a MIPI DSI
panel.

Signed-off-by: Jerry Han 
Cc: Jitao Shi 
Cc: Derek Basehore 
Cc: Rock wang 
---
 MAINTAINERS  |  12 +-
 drivers/gpu/drm/panel/Kconfig|  22 +-
 drivers/gpu/drm/panel/panel-boe-himax8279d.c | 201 +--
 3 files changed, 114 insertions(+), 121 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 7c6ac18b922e..bd0fadb9ea18 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -5085,6 +5085,12 @@ T:   git git://anongit.freedesktop.org/drm/drm-misc
 S: Maintained
 F: drivers/gpu/drm/bochs/
 
+DRM DRIVER FOR BOE HIMAX8279D PANELS
+M: Jerry Han 
+S: Maintained
+F: drivers/gpu/drm/panel/panel-boe-himax8279d.c
+F: Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt
+
 DRM DRIVER FOR FARADAY TVE200 TV ENCODER
 M: Linus Walleij 
 T: git git://anongit.freedesktop.org/drm/drm-misc
@@ -5110,12 +5116,6 @@ S:   Maintained
 F: drivers/gpu/drm/tiny/ili9225.c
 F: Documentation/devicetree/bindings/display/ilitek,ili9225.txt
 
-DRM DRIVER FOR BOE HIMAX8279D PANELS
-M: Jerry Han 
-S: Maintained
-F: drivers/gpu/drm/panel/panel-boe-himax8279d.c
-F: Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt
-
 DRM DRIVER FOR HX8357D PANELS
 M: Eric Anholt 
 T: git git://anongit.freedesktop.org/drm/drm-misc
diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index cfd8c886fff7..683ff77a3733 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -18,6 +18,17 @@ config DRM_PANEL_ARM_VERSATILE
  reference designs. The panel is detected using special registers
  in the Versatile family syscon registers.
 
+config DRM_PANEL_BOE_HIMAX8279D
+   tristate "Boe Himax8279d 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 Boe Himax8279d
+ TFT-LCD modules. The panel has a 1200x1920 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_LVDS
tristate "Generic LVDS panel driver"
depends on OF
@@ -339,17 +350,6 @@ config DRM_PANEL_TPO_TD043MTEA1
  Say Y here if you want to enable support for TPO TD043MTEA1 800x480
  4.3" panel (found on the OMAP3 Pandora board).
 
-config DRM_PANEL_BOE_HIMAX8279D
-   tristate "Boe Himax8279d 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 Same type
- TFT-LCD modules. The panel has a 1200x1920 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_TPO_TPG110
tristate "TPO TPG 800x400 panel"
depends on OF && SPI && GPIOLIB
diff --git a/drivers/gpu/drm/panel/panel-boe-himax8279d.c 
b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
index 60f5f8bf2e14..aa7d91279819 100644
--- a/drivers/gpu/drm/panel/panel-boe-himax8279d.c
+++ b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
@@ -17,10 +17,10 @@
 #include 
 #include 
 
-#include 
+#include 
 #include 
+#include 
 #include 
-#include 
 #include 
 
 #include 
@@ -37,15 +37,16 @@ struct panel_cmd {
 struct panel_desc {
const struct drm_display_mode *display_mode;
unsigned int bpc;
-   unsigned int width;
-   unsigned int height;
+   unsigned int width_mm;
+   unsigned int height_mm;
 
unsigned int delay_t1

[PATCH 6/9] [v10, 6/9] drm/panel: Add Boe Himax8279d MIPI-DSI LCD panel

2019-09-19 Thread Jerry Han
Support Boe Himax8279d 8.0" 1200x1920 TFT LCD panel, it is a MIPI DSI
panel.

V6:
- Add the information of the reviewer
- Remove unnecessary delays, The udelay_range code gracefully returns
without hitting the scheduler on a delay of 0. (Derek)
- Merge the same data structures, like display_mode and off_cmds (Derek)
- Optimize the processing of results returned by
devm_gpiod_get_optional (Derek)

V5:
- Add the information of the reviewer (Sam)
- Delete unnecessary header files #include  (Sam)
- The config DRM_PANEL_BOE_HIMAX8279D appears twice. Drop one of them (Sam)
- ADD static, set_gpios function is not used outside this module (Sam)

V4:
- Frefix all function maes with boe_ (Sam)
- Fsed "enable_gpio" replace "reset_gpio", Make it look clearer (Sam)
- Sort include lines alphabetically (Sam)
- Fixed entries in the makefile must be sorted alphabetically (Sam)
- Add send_mipi_cmds function to avoid duplicating the code (Sam)
- Add the necessary delay(reset_delay_t5) between reset and sending
the initialization command (Rock wang)

V3:
- Remove unnecessary delays in sending initialization commands (Jitao Shi)

V2:
- Use SPDX identifier (Sam)
- Use necessary header files replace drmP.h (Sam)
- Delete unnecessary header files #include  (Sam)
- Specifies a GPIOs array to control the reset timing,
instead of reading "dsi-reset-sequence" data from DTS (Sam)
- Delete backlight_disable() function when already disabled (Sam)
- Use devm_of_find_backlight() replace of_find_backlight_by_node() (Sam)
- Move the necessary data in the DTS to the current file,
like porch, display_mode and Init code etc. (Sam)
- Add compatible device "boe,himax8279d10p" (Sam)

V1:
- Support Boe Himax8279d 8.0" 1200x1920 TFT LCD panel, it is a MIPI DSI
panel.

Signed-off-by: Jerry Han 
Reviewed-by: Sam Ravnborg 
Reviewed-by: Derek Basehore 
Cc: Jitao Shi 
Cc: Rock wang 
---
 drivers/gpu/drm/panel/panel-boe-himax8279d.c | 109 ---
 1 file changed, 45 insertions(+), 64 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-boe-himax8279d.c 
b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
index c050a48487a2..ff5a89e38fd7 100644
--- a/drivers/gpu/drm/panel/panel-boe-himax8279d.c
+++ b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
@@ -130,9 +130,8 @@ static int boe_panel_unprepare(struct drm_panel *panel)
/* send off code */
err = send_mipi_cmds(panel, pinfo->desc->off_cmds);
if (err < 0) {
-   dev_err(panel->dev,
-   "failed to send DCS Off Code: %d\n",
-   err);
+   DRM_DEV_ERROR(panel->dev,
+   "failed to send DCS Off Code: %d\n", err);
goto poweroff;
}
 
@@ -164,24 +163,20 @@ static int boe_panel_prepare(struct drm_panel *panel)
/* reset sequence */
usleep_range(desc->reset_delay_t2, 1000 + desc->reset_delay_t2);
 
-   if (desc->reset_delay_t3) {
-   gpiod_set_value(pinfo->enable_gpio, 1);
-   usleep_range(desc->reset_delay_t3, 1000 + desc->reset_delay_t3);
-   gpiod_set_value(pinfo->enable_gpio, 0);
-   }
+   gpiod_set_value(pinfo->enable_gpio, 1);
+   usleep_range(desc->reset_delay_t3, 1000 + desc->reset_delay_t3);
+   gpiod_set_value(pinfo->enable_gpio, 0);
 
usleep_range(desc->reset_delay_t4, 1000 + desc->reset_delay_t4);
gpiod_set_value(pinfo->enable_gpio, 1);
 
-   if (desc->reset_delay_t5)
-   usleep_range(desc->reset_delay_t5, 1000 + desc->reset_delay_t5);
+   usleep_range(desc->reset_delay_t5, 1000 + desc->reset_delay_t5);
 
/* send init code */
err = send_mipi_cmds(panel, pinfo->desc->on_cmds);
if (err < 0) {
-   dev_err(panel->dev,
-   "failed to send DCS Init Code: %d\n",
-   err);
+   DRM_DEV_ERROR(panel->dev,
+   "failed to send DCS Init Code: %d\n", err);
goto poweroff;
}
 
@@ -246,8 +241,7 @@ static const struct drm_panel_funcs panel_funcs = {
.get_modes = boe_panel_get_modes,
 };
 
-/* 8 inch */
-static const struct drm_display_mode boe_himax8279d8p_display_mode = {
+static const struct drm_display_mode default_display_mode = {
.clock = 159420,
.hdisplay = 1200,
.hsync_start = 1200 + 80,
@@ -260,6 +254,14 @@ static const struct drm_display_mode 
boe_himax8279d8p_display_mode = {
.vrefresh = 60,
 };
 
+static const struct panel_cmd default_off_cmds[] = {
+   _INIT_CMD(0x00, 0x28),
+   _INIT_CMD(0x01, 0x10),
+
+   {},
+};
+
+/* 8 inch */
 static const struct panel_cmd boe_himax8279d8p_on_cmds[] = {
_INIT_CMD(0x22, 0x10),
_INIT_CMD(0x00, 0xB0, 0x05),
@@ -567,15 +569

[PATCH 7/9] [v10, 7/9] drm/panel: Add Boe Himax8279d MIPI-DSI LCD panel

2019-09-19 Thread Jerry Han
Support Boe Himax8279d 8.0" 1200x1920 TFT LCD panel, it is a MIPI DSI
panel.

V7:
- Modify communication address

V6:
- Add the information of the reviewer
- Remove unnecessary delays, The udelay_range code gracefully returns
without hitting the scheduler on a delay of 0. (Derek)
- Merge the same data structures, like display_mode and off_cmds (Derek)
- Optimize the processing of results returned by
devm_gpiod_get_optional (Derek)

V5:
- Add the information of the reviewer (Sam)
- Delete unnecessary header files #include  (Sam)
- The config DRM_PANEL_BOE_HIMAX8279D appears twice. Drop one of them (Sam)
- ADD static, set_gpios function is not used outside this module (Sam)

V4:
- Frefix all function maes with boe_ (Sam)
- Fsed "enable_gpio" replace "reset_gpio", Make it look clearer (Sam)
- Sort include lines alphabetically (Sam)
- Fixed entries in the makefile must be sorted alphabetically (Sam)
- Add send_mipi_cmds function to avoid duplicating the code (Sam)
- Add the necessary delay(reset_delay_t5) between reset and sending
the initialization command (Rock wang)

V3:
- Remove unnecessary delays in sending initialization commands (Jitao Shi)

V2:
- Use SPDX identifier (Sam)
- Use necessary header files replace drmP.h (Sam)
- Delete unnecessary header files #include  (Sam)
- Specifies a GPIOs array to control the reset timing,
instead of reading "dsi-reset-sequence" data from DTS (Sam)
- Delete backlight_disable() function when already disabled (Sam)
- Use devm_of_find_backlight() replace of_find_backlight_by_node() (Sam)
- Move the necessary data in the DTS to the current file,
like porch, display_mode and Init code etc. (Sam)
- Add compatible device "boe,himax8279d10p" (Sam)

V1:
- Support Boe Himax8279d 8.0" 1200x1920 TFT LCD panel, it is a MIPI DSI
panel.

Signed-off-by: Jerry Han 
Reviewed-by: Sam Ravnborg 
Reviewed-by: Derek Basehore 
Cc: Jitao Shi 
Cc: Rock wang 
---
 drivers/gpu/drm/panel/panel-boe-himax8279d.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-boe-himax8279d.c 
b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
index ff5a89e38fd7..9c8ece4fa30a 100644
--- a/drivers/gpu/drm/panel/panel-boe-himax8279d.c
+++ b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
@@ -2,7 +2,7 @@
 /*
  * Copyright (c) 2019, Huaqin Telecom Technology Co., Ltd
  *
- * Author: Jerry Han 
+ * Author: Jerry Han 
  *
  */
 
@@ -1045,6 +1045,6 @@ static struct mipi_dsi_driver panel_driver = {
 };
 module_mipi_dsi_driver(panel_driver);
 
-MODULE_AUTHOR("Jerry Han ");
+MODULE_AUTHOR("Jerry Han ");
 MODULE_DESCRIPTION("Boe Himax8279d driver");
 MODULE_LICENSE("GPL v2");
-- 
2.17.1

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

[PATCH 3/9] [v10, 3/9] drm/panel: Add Boe Himax8279d MIPI-DSI LCD panel

2019-09-19 Thread Jerry Han
Support Boe Himax8279d 8.0" 1200x1920 TFT LCD panel, it is a MIPI DSI
panel.

V3:
- Remove unnecessary delays in sending initialization commands (Jitao Shi)

V2:
- Use SPDX identifier (Sam)
- Use necessary header files replace drmP.h (Sam)
- Delete unnecessary header files #include  (Sam)
- Specifies a GPIOs array to control the reset timing,
instead of reading "dsi-reset-sequence" data from DTS (Sam)
- Delete backlight_disable() function when already disabled (Sam)
- Use devm_of_find_backlight() replace of_find_backlight_by_node() (Sam)
- Move the necessary data in the DTS to the current file,
like porch, display_mode and Init code etc. (Sam)
- Add compatible device "boe,himax8279d10p" (Sam)

V1:
- Support Boe Himax8279d 8.0" 1200x1920 TFT LCD panel, it is a MIPI DSI
    panel.

Signed-off-by: Jerry Han 
Cc: Jitao Shi 
Cc: Nick Sanders 
Cc: YH Lin 
Cc: Rock wang 
---
 drivers/gpu/drm/panel/panel-boe-himax8279d.c | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-boe-himax8279d.c 
b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
index 836a9cbc5891..60f5f8bf2e14 100644
--- a/drivers/gpu/drm/panel/panel-boe-himax8279d.c
+++ b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
@@ -119,8 +119,9 @@ static int panel_unprepare(struct drm_panel *panel)
err);
goto poweroff;
}
-   usleep_range((cmd->data[0]) * 1000,
-   (1 + cmd->data[0]) * 1000);
+   if (cmd->data[0])
+   usleep_range((cmd->data[0]) * 1000,
+   (1 + cmd->data[0]) * 1000);
}
}
 
@@ -187,8 +188,10 @@ static int panel_prepare(struct drm_panel *panel)
err);
goto poweroff;
}
-   usleep_range(cmd->data[0] * 1000,
-   (1 + cmd->data[0]) * 1000);
+
+   if (cmd->data[0])
+   usleep_range(cmd->data[0] * 1000,
+   (1 + cmd->data[0]) * 1000);
}
}
 
-- 
2.17.1

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

[PATCH 9/9] [v10, 9/9] drm/panel: Add Boe Himax8279d MIPI-DSI LCD panel

2019-09-19 Thread Jerry Han
Support Boe Himax8279d 8.0" 1200x1920 TFT LCD panel, it is a MIPI DSI
panel.

V9:
- Adjust init code, make the format more concise
- kill off default_off_cmds (Emil)
- use mipi_dsi_dcs_set_display_{on,off} in their enable/disable
callbacks. (Emil)
- Adjusting the delay function (Emil)

V8:
- modify PARENTHESIS_ALIGNMENT format (Sam)
- use gpios are required API replace optional gpio API (Emil)

V7:
- Modify communication address

V6:
- Add the information of the reviewer
- Remove unnecessary delays, The udelay_range code gracefully returns
without hitting the scheduler on a delay of 0. (Derek)
- Merge the same data structures, like display_mode and off_cmds (Derek)
- Optimize the processing of results returned by
devm_gpiod_get_optional (Derek)

V5:
- Add the information of the reviewer (Sam)
- Delete unnecessary header files #include  (Sam)
- The config DRM_PANEL_BOE_HIMAX8279D appears twice. Drop one of them (Sam)
- ADD static, set_gpios function is not used outside this module (Sam)

V4:
- Frefix all function maes with boe_ (Sam)
- Fsed "enable_gpio" replace "reset_gpio", Make it look clearer (Sam)
- Sort include lines alphabetically (Sam)
- Fixed entries in the makefile must be sorted alphabetically (Sam)
- Add send_mipi_cmds function to avoid duplicating the code (Sam)
- Add the necessary delay(reset_delay_t5) between reset and sending
the initialization command (Rock wang)

V3:
- Remove unnecessary delays in sending initialization commands (Jitao Shi)

V2:
- Use SPDX identifier (Sam)
- Use necessary header files replace drmP.h (Sam)
- Delete unnecessary header files #include  (Sam)
- Specifies a GPIOs array to control the reset timing,
instead of reading "dsi-reset-sequence" data from DTS (Sam)
- Delete backlight_disable() function when already disabled (Sam)
- Use devm_of_find_backlight() replace of_find_backlight_by_node() (Sam)
- Move the necessary data in the DTS to the current file,
like porch, display_mode and Init code etc. (Sam)
- Add compatible device "boe,himax8279d10p" (Sam)

V1:
- Support Boe Himax8279d 8.0" 1200x1920 TFT LCD panel, it is a MIPI DSI
panel.

Signed-off-by: Jerry Han 
Reviewed-by: Sam Ravnborg 
Reviewed-by: Derek Basehore 
Reviewed-by: Emil Velikov 
Cc: Jitao Shi 
Cc: Rock wang 
---
 drivers/gpu/drm/panel/panel-boe-himax8279d.c | 1235 +-
 1 file changed, 588 insertions(+), 647 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-boe-himax8279d.c 
b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
index 7790f76d3ce7..6265bf975365 100644
--- a/drivers/gpu/drm/panel/panel-boe-himax8279d.c
+++ b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
@@ -39,17 +39,10 @@ struct panel_desc {
unsigned int width_mm;
unsigned int height_mm;
 
-   unsigned int delay_t1;
-   unsigned int reset_delay_t2;
-   unsigned int reset_delay_t3;
-   unsigned int reset_delay_t4;
-   unsigned int reset_delay_t5;
-
unsigned long mode_flags;
enum mipi_dsi_pixel_format format;
unsigned int lanes;
const struct panel_cmd *on_cmds;
-   const struct panel_cmd *off_cmds;
 };
 
 struct panel_info {
@@ -90,18 +83,11 @@ static int send_mipi_cmds(struct drm_panel *panel, const 
struct panel_cmd *cmds)
for (i = 0; cmds[i].len != 0; i++) {
const struct panel_cmd *cmd = &cmds[i];
 
-   if (cmd->len == 2)
-   err = mipi_dsi_dcs_write(pinfo->link, cmd->data[1],
-NULL, 0);
-   else
-   err = mipi_dsi_dcs_write(pinfo->link, cmd->data[1],
-cmd->data + 2,
-cmd->len - 2);
+   err = mipi_dsi_dcs_write(pinfo->link, cmd->data[0],
+cmd->data + 1, 1);
 
if (err < 0)
return err;
-
-   usleep_range((cmd->data[0]) * 1000, (1 + cmd->data[0]) * 1000);
}
 
return 0;
@@ -126,14 +112,23 @@ static int boe_panel_unprepare(struct drm_panel *panel)
if (!pinfo->prepared)
return 0;
 
-   /* send off code */
-   err = send_mipi_cmds(panel, pinfo->desc->off_cmds);
+   err = mipi_dsi_dcs_set_display_off(pinfo->link);
+   if (err < 0) {
+   DRM_DEV_ERROR(panel->dev, "failed to set display off: %d\n",
+ err);
+   goto poweroff;
+   }
+
+   err = mipi_dsi_dcs_enter_sleep_mode(pinfo->link);
if (err < 0) {
-   DRM_DEV_ERROR(panel->dev, "failed to send DCS Off Code: %d\n",
+   DRM_DEV_ERROR(panel->dev, "failed to enter sleep mode: %d\n",
  err);
goto poweroff;
}
 

[PATCH 8/9] [v10, 8/9] drm/panel: Add Boe Himax8279d MIPI-DSI LCD panel

2019-09-19 Thread Jerry Han
Support Boe Himax8279d 8.0" 1200x1920 TFT LCD panel, it is a MIPI DSI
panel.

V8:
- modify PARENTHESIS_ALIGNMENT format (Sam)
- use gpios are required API replace optional gpio API (Emil)

V7:
- Modify communication address

V6:
- Add the information of the reviewer
- Remove unnecessary delays, The udelay_range code gracefully returns
without hitting the scheduler on a delay of 0. (Derek)
- Merge the same data structures, like display_mode and off_cmds (Derek)
- Optimize the processing of results returned by
devm_gpiod_get_optional (Derek)

V5:
- Add the information of the reviewer (Sam)
- Delete unnecessary header files #include  (Sam)
- The config DRM_PANEL_BOE_HIMAX8279D appears twice. Drop one of them (Sam)
- ADD static, set_gpios function is not used outside this module (Sam)

V4:
- Frefix all function maes with boe_ (Sam)
- Fsed "enable_gpio" replace "reset_gpio", Make it look clearer (Sam)
- Sort include lines alphabetically (Sam)
- Fixed entries in the makefile must be sorted alphabetically (Sam)
- Add send_mipi_cmds function to avoid duplicating the code (Sam)
- Add the necessary delay(reset_delay_t5) between reset and sending
the initialization command (Rock wang)

V3:
- Remove unnecessary delays in sending initialization commands (Jitao Shi)

V2:
- Use SPDX identifier (Sam)
- Use necessary header files replace drmP.h (Sam)
- Delete unnecessary header files #include  (Sam)
- Specifies a GPIOs array to control the reset timing,
instead of reading "dsi-reset-sequence" data from DTS (Sam)
- Delete backlight_disable() function when already disabled (Sam)
- Use devm_of_find_backlight() replace of_find_backlight_by_node() (Sam)
- Move the necessary data in the DTS to the current file,
like porch, display_mode and Init code etc. (Sam)
- Add compatible device "boe,himax8279d10p" (Sam)

V1:
- Support Boe Himax8279d 8.0" 1200x1920 TFT LCD panel, it is a MIPI DSI
panel.

Signed-off-by: Jerry Han 
Reviewed-by: Sam Ravnborg 
Reviewed-by: Derek Basehore 
Reviewed-by: Emil Velikov 
Cc: Jitao Shi 
---
 drivers/gpu/drm/panel/panel-boe-himax8279d.c | 45 ++--
 1 file changed, 22 insertions(+), 23 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-boe-himax8279d.c 
b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
index 9c8ece4fa30a..7790f76d3ce7 100644
--- a/drivers/gpu/drm/panel/panel-boe-himax8279d.c
+++ b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
@@ -91,18 +91,17 @@ static int send_mipi_cmds(struct drm_panel *panel, const 
struct panel_cmd *cmds)
const struct panel_cmd *cmd = &cmds[i];
 
if (cmd->len == 2)
-   err = mipi_dsi_dcs_write(pinfo->link,
-   cmd->data[1], NULL, 0);
+   err = mipi_dsi_dcs_write(pinfo->link, cmd->data[1],
+NULL, 0);
else
-   err = mipi_dsi_dcs_write(pinfo->link,
-   cmd->data[1], cmd->data + 2,
-   cmd->len - 2);
+   err = mipi_dsi_dcs_write(pinfo->link, cmd->data[1],
+cmd->data + 2,
+cmd->len - 2);
 
if (err < 0)
return err;
 
-   usleep_range((cmd->data[0]) * 1000,
-   (1 + cmd->data[0]) * 1000);
+   usleep_range((cmd->data[0]) * 1000, (1 + cmd->data[0]) * 1000);
}
 
return 0;
@@ -130,8 +129,8 @@ static int boe_panel_unprepare(struct drm_panel *panel)
/* send off code */
err = send_mipi_cmds(panel, pinfo->desc->off_cmds);
if (err < 0) {
-   DRM_DEV_ERROR(panel->dev,
-   "failed to send DCS Off Code: %d\n", err);
+   DRM_DEV_ERROR(panel->dev, "failed to send DCS Off Code: %d\n",
+ err);
goto poweroff;
}
 
@@ -175,8 +174,8 @@ static int boe_panel_prepare(struct drm_panel *panel)
/* send init code */
err = send_mipi_cmds(panel, pinfo->desc->on_cmds);
if (err < 0) {
-   DRM_DEV_ERROR(panel->dev,
-   "failed to send DCS Init Code: %d\n", err);
+   DRM_DEV_ERROR(panel->dev, "failed to send DCS Init Code: %d\n",
+ err);
goto poweroff;
}
 
@@ -200,7 +199,7 @@ static int boe_panel_enable(struct drm_panel *panel)
ret = backlight_enable(pinfo->backlight);
if (ret) {
DRM_DEV_ERROR(panel->drm->dev,
-   "Failed to enable backlight %d\n&q

[PATCH] drm/panel: Add Boe Himax8279d MIPI-DSI LCD panel

2019-11-26 Thread Jerry Han
Support Boe Himax8279d 8.0" 1200x1920 TFT LCD panel, it is a MIPI DSI
panel.

V9:
- Adjust init code, make the format more concise
- kill off default_off_cmds (Emil)
- use mipi_dsi_dcs_set_display_{on,off} in their enable/disable
callbacks. (Emil)
- Adjusting the delay function (Emil)

V8:
- modify PARENTHESIS_ALIGNMENT format (Sam)
- use gpios are required API replace optional gpio API (Emil)

V7:
- Modify communication address

V6:
- Add the information of the reviewer
- Remove unnecessary delays, The udelay_range code gracefully returns
without hitting the scheduler on a delay of 0. (Derek)
- Merge the same data structures, like display_mode and off_cmds (Derek)
- Optimize the processing of results returned by
devm_gpiod_get_optional (Derek)

V5:
- Add the information of the reviewer (Sam)
- Delete unnecessary header files #include  (Sam)
- The config DRM_PANEL_BOE_HIMAX8279D appears twice. Drop one of them (Sam)
- ADD static, set_gpios function is not used outside this module (Sam)

V4:
- Frefix all function maes with boe_ (Sam)
- Fsed "enable_gpio" replace "reset_gpio", Make it look clearer (Sam)
- Sort include lines alphabetically (Sam)
- Fixed entries in the makefile must be sorted alphabetically (Sam)
- Add send_mipi_cmds function to avoid duplicating the code (Sam)
- Add the necessary delay(reset_delay_t5) between reset and sending
the initialization command (Rock wang)

V3:
- Remove unnecessary delays in sending initialization commands (Jitao Shi)

V2:
- Use SPDX identifier (Sam)
- Use necessary header files replace drmP.h (Sam)
- Delete unnecessary header files #include  (Sam)
- Specifies a GPIOs array to control the reset timing,
instead of reading "dsi-reset-sequence" data from DTS (Sam)
- Delete backlight_disable() function when already disabled (Sam)
- Use devm_of_find_backlight() replace of_find_backlight_by_node() (Sam)
- Move the necessary data in the DTS to the current file,
like porch, display_mode and Init code etc. (Sam)
- Add compatible device "boe,himax8279d10p" (Sam)

V1:
- Support Boe Himax8279d 8.0" 1200x1920 TFT LCD panel, it is a MIPI DSI
panel.

Signed-off-by: Jerry Han 
Reviewed-by: Sam Ravnborg 
Reviewed-by: Derek Basehore 
Reviewed-by: Emil Velikov 
Cc: Jitao Shi 
Cc: Rock wang 
---
 MAINTAINERS  |   6 +
 drivers/gpu/drm/panel/Kconfig|  11 +
 drivers/gpu/drm/panel/Makefile   |   2 +
 drivers/gpu/drm/panel/panel-boe-himax8279d.c | 990 +++
 4 files changed, 1009 insertions(+)
 create mode 100644 drivers/gpu/drm/panel/panel-boe-himax8279d.c

diff --git a/MAINTAINERS b/MAINTAINERS
index c2b89453805f..295cb214834c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -5135,6 +5135,12 @@ T:   git git://anongit.freedesktop.org/drm/drm-misc
 S: Maintained
 F: drivers/gpu/drm/bochs/
 
+DRM DRIVER FOR BOE HIMAX8279D PANELS
+M: Jerry Han 
+S: Maintained
+F: drivers/gpu/drm/panel/panel-boe-himax8279d.c
+F: Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt
+
 DRM DRIVER FOR FARADAY TVE200 TV ENCODER
 M: Linus Walleij 
 T: git git://anongit.freedesktop.org/drm/drm-misc
diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index f152bc4eeb53..683ff77a3733 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -18,6 +18,17 @@ config DRM_PANEL_ARM_VERSATILE
  reference designs. The panel is detected using special registers
  in the Versatile family syscon registers.
 
+config DRM_PANEL_BOE_HIMAX8279D
+   tristate "Boe Himax8279d 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 Boe Himax8279d
+ TFT-LCD modules. The panel has a 1200x1920 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_LVDS
tristate "Generic LVDS panel driver"
depends on OF
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index b6cd39fe0f20..4beae2ab427f 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -1,5 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 obj-$(CONFIG_DRM_PANEL_ARM_VERSATILE) += panel-arm-versatile.o
+obj-$(CONFIG_DRM_PANEL_BOE_HIMAX8279D) += panel-boe-himax8279d.o
 obj-$(CONFIG_DRM_PANEL_LVDS) += panel-lvds.o
 obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o
 obj-$(CONFIG_DRM_PANEL_FEIYANG_FY07024DI26A30D) += 
panel-feiyang-fy07024di26a30d.o
@@ -36,5 +37,6 @@ obj-$(CONFIG_DRM_PANEL_SITRONIX_ST7789V) += 
panel-sitronix-st7789v.o
 obj-$(CONFIG_DRM_PANEL_SONY_ACX565AKM) += panel-sony-acx565akm.o
 obj-$(CONFIG_DRM_PANEL_TPO_TD028TTEC1) += panel-tpo-td028ttec1.o
 obj-$(CONFIG_DRM_PANEL_TPO_TD043MTEA1) += panel

Re: [PATCH] drm/panel: Add Boe Himax8279d MIPI-DSI LCD panel

2019-12-06 Thread Jerry Han
>
> Hi Jerry,
>
> On Tue, 26 Nov 2019 at 08:14, Jerry Han  wrote:
> >
> > Support Boe Himax8279d 8.0" 1200x1920 TFT LCD panel, it is a MIPI DSI
> > panel.
> >
> > V9:
> > - Adjust init code, make the format more concise
> > - kill off default_off_cmds (Emil)
> > - use mipi_dsi_dcs_set_display_{on,off} in their enable/disable
> > callbacks. (Emil)
> > - Adjusting the delay function (Emil)
> >
> > V8:
> > - modify PARENTHESIS_ALIGNMENT format (Sam)
> > - use gpios are required API replace optional gpio API (Emil)
> >
> > V7:
> > - Modify communication address
> >
> > V6:
> > - Add the information of the reviewer
> > - Remove unnecessary delays, The udelay_range code gracefully returns
> > without hitting the scheduler on a delay of 0. (Derek)
> > - Merge the same data structures, like display_mode and off_cmds (Derek)
> > - Optimize the processing of results returned by
> > devm_gpiod_get_optional (Derek)
> >
> > V5:
> > - Add the information of the reviewer (Sam)
> > - Delete unnecessary header files #include  (Sam)
> > - The config DRM_PANEL_BOE_HIMAX8279D appears twice. Drop one of them (Sam)
> > - ADD static, set_gpios function is not used outside this module (Sam)
> >
> > V4:
> > - Frefix all function maes with boe_ (Sam)
> > - Fsed "enable_gpio" replace "reset_gpio", Make it look clearer (Sam)
> > - Sort include lines alphabetically (Sam)
> > - Fixed entries in the makefile must be sorted alphabetically (Sam)
> > - Add send_mipi_cmds function to avoid duplicating the code (Sam)
> > - Add the necessary delay(reset_delay_t5) between reset and sending
> > the initialization command (Rock wang)
> >
> > V3:
> > - Remove unnecessary delays in sending initialization commands (Jitao Shi)
> >
> > V2:
> > - Use SPDX identifier (Sam)
> > - Use necessary header files replace drmP.h (Sam)
> > - Delete unnecessary header files #include  (Sam)
> > - Specifies a GPIOs array to control the reset timing,
> > instead of reading "dsi-reset-sequence" data from DTS (Sam)
> > - Delete backlight_disable() function when already disabled (Sam)
> > - Use devm_of_find_backlight() replace of_find_backlight_by_node() (Sam)
> > - Move the necessary data in the DTS to the current file,
> > like porch, display_mode and Init code etc. (Sam)
> > - Add compatible device "boe,himax8279d10p" (Sam)
> >
> > V1:
> > - Support Boe Himax8279d 8.0" 1200x1920 TFT LCD panel, it is a MIPI DSI
> > panel.
> >
> > Signed-off-by: Jerry Han 
> > Reviewed-by: Sam Ravnborg 
> > Reviewed-by: Derek Basehore 
> > Reviewed-by: Emil Velikov 
> Please don't add tags unless they are explicitly provided by the individual.
> Namely you're just sending this revision, so I'm yet to review it.
>
> > Cc: Jitao Shi 
> > Cc: Rock wang 
> > ---
> >  MAINTAINERS  |   6 +
> >  drivers/gpu/drm/panel/Kconfig|  11 +
> >  drivers/gpu/drm/panel/Makefile   |   2 +
> >  drivers/gpu/drm/panel/panel-boe-himax8279d.c | 990 +++
> >  4 files changed, 1009 insertions(+)
> >  create mode 100644 drivers/gpu/drm/panel/panel-boe-himax8279d.c
> >
> > diff --git a/MAINTAINERS b/MAINTAINERS
> > index c2b89453805f..295cb214834c 100644
> > --- a/MAINTAINERS
> > +++ b/MAINTAINERS
> > @@ -5135,6 +5135,12 @@ T:   git 
> > git://anongit.freedesktop.org/drm/drm-misc
> >  S: Maintained
> >  F: drivers/gpu/drm/bochs/
> >
> > +DRM DRIVER FOR BOE HIMAX8279D PANELS
> > +M: Jerry Han 
> > +S: Maintained
> > +F: drivers/gpu/drm/panel/panel-boe-himax8279d.c
> > +F: Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt
> > +
> >  DRM DRIVER FOR FARADAY TVE200 TV ENCODER
> >  M: Linus Walleij 
> >  T: git git://anongit.freedesktop.org/drm/drm-misc
> > diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
> > index f152bc4eeb53..683ff77a3733 100644
> > --- a/drivers/gpu/drm/panel/Kconfig
> > +++ b/drivers/gpu/drm/panel/Kconfig
> > @@ -18,6 +18,17 @@ config DRM_PANEL_ARM_VERSATILE
> >   reference designs. The panel is detected using special registers
> >   in the Versatile family syscon registers.
> >
> > +config DRM_PANEL_BOE_HIMAX8279D
> > +   tristate "Boe Himax8279d panel"
> > +   depends on OF
> > +

[PATCH] drm/panel: Add Boe Himax8279d MIPI-DSI LCD panel

2019-12-06 Thread Jerry Han
Support Boe Himax8279d 8.0" 1200x1920 TFT LCD panel, it is a MIPI DSI
panel.

V9:
- Adjust init code, make the format more concise
- kill off default_off_cmds (Emil)
- use mipi_dsi_dcs_set_display_{on,off} in their enable/disable
callbacks. (Emil)
- Adjusting the delay function (Emil)

V8:
- modify PARENTHESIS_ALIGNMENT format (Sam)
- use gpios are required API replace optional gpio API (Emil)

V7:
- Modify communication address

V6:
- Add the information of the reviewer
- Remove unnecessary delays, The udelay_range code gracefully returns
without hitting the scheduler on a delay of 0. (Derek)
- Merge the same data structures, like display_mode and off_cmds (Derek)
- Optimize the processing of results returned by
devm_gpiod_get_optional (Derek)

V5:
- Add the information of the reviewer (Sam)
- Delete unnecessary header files #include  (Sam)
- The config DRM_PANEL_BOE_HIMAX8279D appears twice. Drop one of them (Sam)
- ADD static, set_gpios function is not used outside this module (Sam)

V4:
- Frefix all function maes with boe_ (Sam)
- Fsed "enable_gpio" replace "reset_gpio", Make it look clearer (Sam)
- Sort include lines alphabetically (Sam)
- Fixed entries in the makefile must be sorted alphabetically (Sam)
- Add send_mipi_cmds function to avoid duplicating the code (Sam)
- Add the necessary delay(reset_delay_t5) between reset and sending
the initialization command (Rock wang)

V3:
- Remove unnecessary delays in sending initialization commands (Jitao Shi)

V2:
- Use SPDX identifier (Sam)
- Use necessary header files replace drmP.h (Sam)
- Delete unnecessary header files #include  (Sam)
- Specifies a GPIOs array to control the reset timing,
instead of reading "dsi-reset-sequence" data from DTS (Sam)
- Delete backlight_disable() function when already disabled (Sam)
- Use devm_of_find_backlight() replace of_find_backlight_by_node() (Sam)
- Move the necessary data in the DTS to the current file,
like porch, display_mode and Init code etc. (Sam)
- Add compatible device "boe,himax8279d10p" (Sam)

V1:
- Support Boe Himax8279d 8.0" 1200x1920 TFT LCD panel, it is a MIPI DSI
panel.

Signed-off-by: Jerry Han 
Reviewed-by: Sam Ravnborg 
Reviewed-by: Derek Basehore 
Reviewed-by: Emil Velikov 
Cc: Jitao Shi 
Cc: Rock wang 
---
 MAINTAINERS  |   6 +
 drivers/gpu/drm/panel/Kconfig|  11 +
 drivers/gpu/drm/panel/Makefile   |   1 +
 drivers/gpu/drm/panel/panel-boe-himax8279d.c | 989 +++
 4 files changed, 1007 insertions(+)
 create mode 100644 drivers/gpu/drm/panel/panel-boe-himax8279d.c

diff --git a/MAINTAINERS b/MAINTAINERS
index c2b89453805f..295cb214834c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -5135,6 +5135,12 @@ T:   git git://anongit.freedesktop.org/drm/drm-misc
 S: Maintained
 F: drivers/gpu/drm/bochs/
 
+DRM DRIVER FOR BOE HIMAX8279D PANELS
+M: Jerry Han 
+S: Maintained
+F: drivers/gpu/drm/panel/panel-boe-himax8279d.c
+F: Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt
+
 DRM DRIVER FOR FARADAY TVE200 TV ENCODER
 M: Linus Walleij 
 T: git git://anongit.freedesktop.org/drm/drm-misc
diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index f152bc4eeb53..683ff77a3733 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -18,6 +18,17 @@ config DRM_PANEL_ARM_VERSATILE
  reference designs. The panel is detected using special registers
  in the Versatile family syscon registers.
 
+config DRM_PANEL_BOE_HIMAX8279D
+   tristate "Boe Himax8279d 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 Boe Himax8279d
+ TFT-LCD modules. The panel has a 1200x1920 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_LVDS
tristate "Generic LVDS panel driver"
depends on OF
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index b6cd39fe0f20..8783476110a3 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -1,5 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 obj-$(CONFIG_DRM_PANEL_ARM_VERSATILE) += panel-arm-versatile.o
+obj-$(CONFIG_DRM_PANEL_BOE_HIMAX8279D) += panel-boe-himax8279d.o
 obj-$(CONFIG_DRM_PANEL_LVDS) += panel-lvds.o
 obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o
 obj-$(CONFIG_DRM_PANEL_FEIYANG_FY07024DI26A30D) += 
panel-feiyang-fy07024di26a30d.o
diff --git a/drivers/gpu/drm/panel/panel-boe-himax8279d.c 
b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
new file mode 100644
index ..5fcf69b18563
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
@@ -0,0 +1,989 @@
+// SPDX-License-Identifier: 

Re: [PATCH] drm/panel: Add Boe Himax8279d MIPI-DSI LCD panel

2019-12-09 Thread Jerry Han
>
> Hi Jerry,
>
> I love your patch! Yet something to improve:
>
> [auto build test ERROR on drm-exynos/exynos-drm-next]
> [also build test ERROR on drm-intel/for-linux-next linus/master v5.4 
> next-20191202]
> [if your patch is applied to the wrong git tree, please drop us a note to help
> improve the system. BTW, we also suggest to use '--base' option to specify the
> base tree in git format-patch, please see 
> https://stackoverflow.com/a/37406982]
>
> url:    
> https://github.com/0day-ci/linux/commits/Jerry-Han/drm-panel-Add-Boe-Himax8279d-MIPI-DSI-LCD-panel/20191208-014258
> base:   
> https://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos.git 
> exynos-drm-next
> config: c6x-allyesconfig (attached as .config)
> compiler: c6x-elf-gcc (GCC) 7.5.0
> reproduce:
> wget 
> https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
> ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # save the attached .config to linux build tree
> GCC_VERSION=7.5.0 make.cross ARCH=c6x
>
> If you fix the issue, kindly add following tag
> Reported-by: kbuild test robot 
>
> All errors (new ones prefixed by >>):
>
> >> drivers/gpu/drm/panel/panel-boe-himax8279d.c:32:1: error: expected ';', 
> >> identifier or '(' before 'struct'
> struct panel_desc {
> ^~
>drivers/gpu/drm/panel/panel-boe-himax8279d.c: In function 'panel_add':
> >> drivers/gpu/drm/panel/panel-boe-himax8279d.c:906:2: error: too few 
> >> arguments to function 'drm_panel_init'
>  drm_panel_init(&pinfo->base);
>  ^~
>In file included from drivers/gpu/drm/panel/panel-boe-himax8279d.c:22:0:
>include/drm/drm_panel.h:159:6: note: declared here
> void drm_panel_init(struct drm_panel *panel, struct device *dev,
>  ^~
>
> vim +32 drivers/gpu/drm/panel/panel-boe-himax8279d.c
>
> 31
>   > 32  struct panel_desc {
> 33  const struct drm_display_mode *display_mode;
> 34  unsigned int bpc;
> 35  unsigned int width_mm;
> 36  unsigned int height_mm;
> 37
> 38  unsigned long mode_flags;
> 39  enum mipi_dsi_pixel_format format;
> 40  unsigned int lanes;
> 41  const struct panel_cmd *on_cmds;
> 42  unsigned int on_cmds_num;
> 43  };
> 44
>
> ---
> 0-DAY kernel test infrastructure Open Source Technology Center
> https://lists.01.org/hyperkitty/list/kbuild-...@lists.01.org Intel Corporation
OK, Thanks,
I have synchronized to the latest branch.
and I have fixed it.
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH] drm/panel: Add Boe Himax8279d MIPI-DSI LCD panel

2019-12-09 Thread Jerry Han
Support Boe Himax8279d 8.0" 1200x1920 TFT LCD panel, it is a MIPI DSI
panel.

V9:
- Adjust init code, make the format more concise
- kill off default_off_cmds (Emil)
- use mipi_dsi_dcs_set_display_{on,off} in their enable/disable
callbacks. (Emil)
- Adjusting the delay function (Emil)

V8:
- modify PARENTHESIS_ALIGNMENT format (Sam)
- use gpios are required API replace optional gpio API (Emil)

V7:
- Modify communication address

V6:
- Add the information of the reviewer
- Remove unnecessary delays, The udelay_range code gracefully returns
without hitting the scheduler on a delay of 0. (Derek)
- Merge the same data structures, like display_mode and off_cmds (Derek)
- Optimize the processing of results returned by
devm_gpiod_get_optional (Derek)

V5:
- Add the information of the reviewer (Sam)
- Delete unnecessary header files #include  (Sam)
- The config DRM_PANEL_BOE_HIMAX8279D appears twice. Drop one of them (Sam)
- ADD static, set_gpios function is not used outside this module (Sam)

V4:
- Frefix all function maes with boe_ (Sam)
- Fsed "enable_gpio" replace "reset_gpio", Make it look clearer (Sam)
- Sort include lines alphabetically (Sam)
- Fixed entries in the makefile must be sorted alphabetically (Sam)
- Add send_mipi_cmds function to avoid duplicating the code (Sam)
- Add the necessary delay(reset_delay_t5) between reset and sending
the initialization command (Rock wang)

V3:
- Remove unnecessary delays in sending initialization commands (Jitao Shi)

V2:
- Use SPDX identifier (Sam)
- Use necessary header files replace drmP.h (Sam)
- Delete unnecessary header files #include  (Sam)
- Specifies a GPIOs array to control the reset timing,
instead of reading "dsi-reset-sequence" data from DTS (Sam)
- Delete backlight_disable() function when already disabled (Sam)
- Use devm_of_find_backlight() replace of_find_backlight_by_node() (Sam)
- Move the necessary data in the DTS to the current file,
like porch, display_mode and Init code etc. (Sam)
- Add compatible device "boe,himax8279d10p" (Sam)

V1:
- Support Boe Himax8279d 8.0" 1200x1920 TFT LCD panel, it is a MIPI DSI
panel.

Signed-off-by: Jerry Han 
Reviewed-by: Sam Ravnborg 
Reviewed-by: Derek Basehore 
Reviewed-by: Emil Velikov 
Reported-by: kbuild test robot 
Cc: Jitao Shi 
Cc: Rock wang 
---
 MAINTAINERS  |   6 +
 drivers/gpu/drm/panel/Kconfig|  11 +
 drivers/gpu/drm/panel/Makefile   |   1 +
 drivers/gpu/drm/panel/panel-boe-himax8279d.c | 988 +++
 4 files changed, 1006 insertions(+)
 create mode 100644 drivers/gpu/drm/panel/panel-boe-himax8279d.c

diff --git a/MAINTAINERS b/MAINTAINERS
index c2b89453805f..295cb214834c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -5135,6 +5135,12 @@ T:   git git://anongit.freedesktop.org/drm/drm-misc
 S: Maintained
 F: drivers/gpu/drm/bochs/
 
+DRM DRIVER FOR BOE HIMAX8279D PANELS
+M: Jerry Han 
+S: Maintained
+F: drivers/gpu/drm/panel/panel-boe-himax8279d.c
+F: Documentation/devicetree/bindings/display/panel/boe,himax8279d.txt
+
 DRM DRIVER FOR FARADAY TVE200 TV ENCODER
 M: Linus Walleij 
 T: git git://anongit.freedesktop.org/drm/drm-misc
diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index f152bc4eeb53..683ff77a3733 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -18,6 +18,17 @@ config DRM_PANEL_ARM_VERSATILE
  reference designs. The panel is detected using special registers
  in the Versatile family syscon registers.
 
+config DRM_PANEL_BOE_HIMAX8279D
+   tristate "Boe Himax8279d 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 Boe Himax8279d
+ TFT-LCD modules. The panel has a 1200x1920 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_LVDS
tristate "Generic LVDS panel driver"
depends on OF
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index b6cd39fe0f20..8783476110a3 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -1,5 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 obj-$(CONFIG_DRM_PANEL_ARM_VERSATILE) += panel-arm-versatile.o
+obj-$(CONFIG_DRM_PANEL_BOE_HIMAX8279D) += panel-boe-himax8279d.o
 obj-$(CONFIG_DRM_PANEL_LVDS) += panel-lvds.o
 obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o
 obj-$(CONFIG_DRM_PANEL_FEIYANG_FY07024DI26A30D) += 
panel-feiyang-fy07024di26a30d.o
diff --git a/drivers/gpu/drm/panel/panel-boe-himax8279d.c 
b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
new file mode 100644
index ..65ea6f673cdb
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
@@ -0,0 +1,988 @@
+

Re: [PATCH 10/10] [v10] drm/panel: Add Boe Himax8279d MIPI-DSI LCD panel

2019-09-04 Thread Jerry Han
Hi Sam:
sorry,My reply was late.

I commited to the following commit (d6781e490179 - (HEAD -> tmp, tag:
drm-misc-next-2019-08-03) drm/pl111: Drop special pads config check (3
weeks ago) )

I don't know why you executed the error.
- Can you paste your mistakes?

I used the following command to join patch.
0005-v5-2-2-drm-panel-Add-Boe-Himax8279d-MIPI-DSI-LCD-pan.patch did
not change the code.
I just adjusted the form of commit according to your suggestions.
so you can skip this patch.

Thank you for your guidance. If there are any questions. I hope you
can point them out. I will modify it very quickly.

Thanks.

Sam Ravnborg  于2019年8月3日周六 下午10:37写道:
>
> Hi Jerry.
>
> On Sat, Aug 03, 2019 at 10:40:44AM +0800, Jerry Han wrote:
> > V1: https://patchwork.freedesktop.org/patch/287425/
> > V2: https://patchwork.freedesktop.org/patch/289843/
> > V3: https://patchwork.freedesktop.org/patch/290393/
> > V4: https://patchwork.freedesktop.org/patch/290396/
> > V5: https://patchwork.freedesktop.org/patch/291131/   (only modify
> > commit message Added changelog, no files modified)
> > V6: https://patchwork.freedesktop.org/patch/291650/
> > V7: https://patchwork.freedesktop.org/patch/294141/
> > V8: https://patchwork.freedesktop.org/patch/301925/
> > V9: https://patchwork.freedesktop.org/patch/320514/
>
> > From 63bcc4f1e72713eca14c4b08e62bc3c07e67904a Mon Sep 17 00:00:00 2001
> > From: Jerry Han 
> > Date: Thu, 1 Aug 2019 15:52:35 +0800
> > Subject: [PATCH 02/10] [v2,2/2] drm/panel: Add Boe Himax8279d MIPI-DSI LCD
> >  panel
> >
> > Support Boe Himax8279d 8.0" 1200x1920 TFT LCD panel, it is a MIPI DSI
> > panel.
> >
> > V2:
> > - Use SPDX identifier (Sam)
> > - Use necessary header files replace drmP.h (Sam)
> > - Delete unnecessary header files #include  (Sam)
> > - Specifies a GPIOs array to control the reset timing,
> > instead of reading "dsi-reset-sequence" data from DTS (Sam)
> > - Delete backlight_disable() function when already disabled (Sam)
> > - Use devm_of_find_backlight() replace of_find_backlight_by_node()
> > (Sam)
> > - Move the necessary data in the DTS to the current file,
> > like porch, display_mode and Init code etc. (Sam)
> > - Add compatible device "boe,himax8279d10p" (Sam)
> >
> > V1:
> > - Support Boe Himax8279d 8.0" 1200x1920 TFT LCD panel, it is a MIPI DSI
> > panel.
>
> Something went wrong when you tried to submit v10.
> Please try again.
>
> Sam
>
>
> >
> > Signed-off-by: Jerry Han 
> > Cc: Jitao Shi 
> > Cc: Nick Sanders 
> > Cc: YH Lin 
> > Cc: Rock wang 
> > ---
> >  drivers/gpu/drm/panel/Makefile   |2 +-
> >  drivers/gpu/drm/panel/panel-boe-himax8279d.c | 1201 --
> >  2 files changed, 842 insertions(+), 361 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
> > index 1aef9d72c7a6..29c57e915ee6 100644
> > --- a/drivers/gpu/drm/panel/Makefile
> > +++ b/drivers/gpu/drm/panel/Makefile
> > @@ -1,5 +1,6 @@
> >  # SPDX-License-Identifier: GPL-2.0
> >  obj-$(CONFIG_DRM_PANEL_ARM_VERSATILE) += panel-arm-versatile.o
> > +obj-$(CONFIG_DRM_PANEL_BOE_HIMAX8279D) += panel-boe-himax8279d.o
> >  obj-$(CONFIG_DRM_PANEL_LVDS) += panel-lvds.o
> >  obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o
> >  obj-$(CONFIG_DRM_PANEL_FEIYANG_FY07024DI26A30D) += 
> > panel-feiyang-fy07024di26a30d.o
> > @@ -30,6 +31,5 @@ obj-$(CONFIG_DRM_PANEL_SHARP_LQ101R1SX01) += 
> > panel-sharp-lq101r1sx01.o
> >  obj-$(CONFIG_DRM_PANEL_SHARP_LS043T1LE01) += panel-sharp-ls043t1le01.o
> >  obj-$(CONFIG_DRM_PANEL_SITRONIX_ST7701) += panel-sitronix-st7701.o
> >  obj-$(CONFIG_DRM_PANEL_SITRONIX_ST7789V) += panel-sitronix-st7789v.o
> > -obj-$(CONFIG_DRM_PANEL_BOE_HIMAX8279D) += panel-boe-himax8279d.o
> >  obj-$(CONFIG_DRM_PANEL_TPO_TPG110) += panel-tpo-tpg110.o
> >  obj-$(CONFIG_DRM_PANEL_TRULY_NT35597_WQXGA) += panel-truly-nt35597.o
> > diff --git a/drivers/gpu/drm/panel/panel-boe-himax8279d.c 
> > b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
> > index 2788bdda69ec..836a9cbc5891 100644
> > --- a/drivers/gpu/drm/panel/panel-boe-himax8279d.c
> > +++ b/drivers/gpu/drm/panel/panel-boe-himax8279d.c
> > @@ -1,319 +1,76 @@
> >  // SPDX-License-Identifier: GPL-2.0
> >  /*
> > - * Copyright (c) 2019, Huaqin Electronics Co., Ltd
> > + * Copyright (c) 2019, Huaqin Telecom Technology Co., Ltd
> > + *
> > + * Author: Jerry Han 
> >   *
> > - * This program is free software; you can redistribut

Re: [PATCH] [v9] drm/panel: Add Boe Himax8279d MIPI-DSI LCD panel

2019-08-05 Thread Jerry Han
Add Patch~5

Jerry Han  于2019年8月3日周六 上午10:10写道:
>
> Hi Emil:
>
> thanks for you advice.
>
> V1: https://patchwork.freedesktop.org/patch/287425/
> V2: https://patchwork.freedesktop.org/patch/289843/
> V3: https://patchwork.freedesktop.org/patch/290393/
> V4: https://patchwork.freedesktop.org/patch/290396/
> V5: https://patchwork.freedesktop.org/patch/291131/   (only modify
> commit message Added changelog, no files modified)
> V6: https://patchwork.freedesktop.org/patch/291650/
> V7: https://patchwork.freedesktop.org/patch/294141/
> V8: https://patchwork.freedesktop.org/patch/301925/
> V9: https://patchwork.freedesktop.org/patch/320514/
>
> Emil Velikov  于2019年7月31日周三 上午12:35写道:
>
> >
> > Hi Jerry,
> >
> > On 2019/07/29, Jerry Han wrote:
> > >
> > > From 9c63ed65469e075430a07f89012cd116c427bd6f Mon Sep 17 00:00:00 2001
> > > From: Jerry Han 
> > > Date: Mon, 29 Jul 2019 11:30:48 +0800
> > > Subject: [PATCH] [v9] drm/panel: Add Boe Himax8279d MIPI-DSI LCD panel
> > >
> > Please submit patches as outlined in the documentation [1].
> >
> > As a non native English speaker to another, I would suggest carefully
> > reading through the instructions. I found them very useful.
> >
> > HTH
> > Emil
> >
> > [1] Documentation/process/submitting-patches.rst
From 124d802854a3b9d6fba9d6a5ceed6d6f820f Mon Sep 17 00:00:00 2001
From: Jerry Han 
Date: Thu, 1 Aug 2019 16:06:22 +0800
Subject: [PATCH 05/10] [v5,2/2] drm/panel: Add Boe Himax8279d MIPI-DSI LCD
 panel

Support Boe Himax8279d 8.0" 1200x1920 TFT LCD panel, it is a MIPI DSI
panel.

v5:
- Added changelog

v4:
- Frefix all function maes with boe_ (Sam)
- Fsed "enable_gpio" replace "reset_gpio", Make it look clearer (Sam)
- Sort include lines alphabetically (Sam)
- Fixed entries in the makefile must be sorted alphabetically (Sam)
- Add send_mipi_cmds function to avoid duplicating the code (Sam)
- Add the necessary delay(reset_delay_t5) between reset and sending
the initialization command (Rock wang)

v3:
- Remove unnecessary delays in sending initialization commands (Jitao Shi)

V2:
- Use SPDX identifier (Sam)
- Use necessary header files replace drmP.h (Sam)
- Delete unnecessary header files #include  (Sam)
- Specifies a GPIOs array to control the reset timing,
instead of reading "dsi-reset-sequence" data from DTS (Sam)
- Delete backlight_disable() function when already disabled (Sam)
- Use devm_of_find_backlight() replace of_find_backlight_by_node() (Sam)
- Move the necessary data in the DTS to the current file,
like porch, display_mode and Init code etc. (Sam)
- Add compatible device "boe,himax8279d10p" (Sam)

V1:
- Support Boe Himax8279d 8.0" 1200x1920 TFT LCD panel, it is a MIPI DSI
panel.

Signed-off-by: Jerry Han 
Cc: Jitao Shi 
Cc: Derek Basehore 
Cc: Rock wang 
-- 
2.17.1

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

Re: [PATCH] [v8, 2/2] drm/panel: Add Boe Himax8279d MIPI-DSI LCD panel

2019-08-05 Thread Jerry Han
Hi Emil:

Thank you for your advice ,
After careful thinking, I decided to modify the code.

Tanks

Emil Velikov  于2019年7月31日周三 上午12:26写道:
>
> Hi Jerry,
>
> Can you please disable HTML emails for the Gmail web client and reply
> inline. There are multiple articles how to do that.
>
> On 2019/07/26, Jerry Han wrote:
> > Hi Emil Velikov:
> >
> > First of all, thank you for your comments.
> >
> > > Hi Jerry,
> > >
> > > On Thu, 25 Apr 2019 at 08:40, Jerry Han  wrote:
> > > >
> > > > Support Boe Himax8279d 8.0" 1200x1920 TFT LCD panel, it is a MIPI DSI
> > > > panel.
> > > >
> > > > V8:
> > > > - Modify communication address
> > > >
> > > > V7:
> > > > - Add the information of the reviewer
> > > > - Remove unnecessary delays, The udelay_range code gracefully returns
> > > > without hitting the scheduler on a delay of 0. (Derek)
> > > > - Merge the same data structures, like display_mode and off_cmds (Derek)
> > > > - Optimize the processing of results returned by
> > > > devm_gpiod_get_optional (Derek)
> > > >
> > > > V6:
> > > > - Add the information of the reviewer (Sam)
> > > > - Delete unnecessary header files #include  (Sam)
> > > > - The config DRM_PANEL_BOE_HIMAX8279D appears twice. Drop one of them
> > > (Sam)
> > > > - ADD static, set_gpios function is not used outside this module (Sam)
> > > >
> > > > V5:
> > > > - Added changelog
> > > >
> > > > V4:
> > > > - Frefix all function maes with boe_ (Sam)
> > > > - Fsed "enable_gpio" replace "reset_gpio", Make it look clearer (Sam)
> > > > - Sort include lines alphabetically (Sam)
> > > > - Fixed entries in the makefile must be sorted alphabetically (Sam)
> > > > - Add send_mipi_cmds function to avoid duplicating the code (Sam)
> > > > - Add the necessary delay(reset_delay_t5) between reset and sending
> > > > the initialization command (Rock wang)
> > > >
> > > > V3:
> > > > - Remove unnecessary delays in sending initialization commands (Jitao
> > > Shi)
> > > >
> > > > V2:
> > > > - Use SPDX identifier (Sam)
> > > > - Use necessary header files replace drmP.h (Sam)
> > > > - Delete unnecessary header files #include  (Sam)
> > > > - Specifies a GPIOs array to control the reset timing,
> > > > instead of reading "dsi-reset-sequence" data from DTS (Sam)
> > > > - Delete backlight_disable() function when already disabled (Sam)
> > > > - Use devm_of_find_backlight() replace of_find_backlight_by_node() (Sam)
> > > > - Move the necessary data in the DTS to the current file,
> > > > like porch, display_mode and Init code etc. (Sam)
> > > > - Add compatible device "boe,himax8279d10p" (Sam)
> > > >
> > > > Signed-off-by: Jerry Han 
> > > > Reviewed-by: Sam Ravnborg 
> > > > Reviewed-by: Derek Basehore 
> > > > Cc: Jitao Shi 
> > > > Cc: Rock wang 
> > > > ---
> > > While the DT has landed, this patch is not merged it seems.
> > > I think that Sam is waiting for a version which does not trigger so
> > > many check-patch warnings.
> > >
> > > That said, a couple of comments if I may.
> > >
> > > > +   struct gpio_desc *enable_gpio;
> > > > +   struct gpio_desc *pp33_gpio;
> > > > +   struct gpio_desc *pp18_gpio;
> > > DT claims that these gpios are required, yet one is using the optional
> > > gpio API.
> > > Is the code off, or does the DT need fixing?
> > >
> > >
> > Thank you for your advice , I will  fix code.
> >
> > > > +static int send_mipi_cmds(struct drm_panel *panel, const struct
> > > panel_cmd *cmds)
> > > > +{
> > > > +   struct panel_info *pinfo = to_panel_info(panel);
> > > > +   unsigned int i = 0;
> > > > +   int err;
> > > > +
> > > > +   if (!cmds)
> > > > +   return -EFAULT;
> > > > +
> > > > +   for (i = 0; cmds[i].len != 0; i++) {
> > > > +   const struct panel_cmd *cmd = &cmds[i];
> > > > +
> > > > +   if (cmd->len == 2)
> > > > +   err = mi

Re: [PATCH 10/10] [v10] drm/panel: Add Boe Himax8279d MIPI-DSI LCD panel

2019-08-15 Thread Jerry Han
Hi Emil:

These changes are not due to previous bugs.
The init code changes for a couple of reasons:
During the development of the project,
1: Suppliers of LCDS keep changing the process, optimizing the
circuitry, and changing the values of certain registers.
2: Changing display effects, such as color temperature, white balance,
gamma values, will also change the values of some registers.
3: 8 and 10 inch devices are different. As they continue to optimize
their init code there will be big differences.

And we're going to continue to provide an optimized init code.

Thanks.

Emil Velikov  于2019年8月5日周一 下午6:17写道:
>
> On Sat, 3 Aug 2019 at 15:37, Sam Ravnborg  wrote:
> >
> > Hi Jerry.
> >
> > On Sat, Aug 03, 2019 at 10:40:44AM +0800, Jerry Han wrote:
> > > V1: https://patchwork.freedesktop.org/patch/287425/
> > > V2: https://patchwork.freedesktop.org/patch/289843/
> > > V3: https://patchwork.freedesktop.org/patch/290393/
> > > V4: https://patchwork.freedesktop.org/patch/290396/
> > > V5: https://patchwork.freedesktop.org/patch/291131/   (only modify
> > > commit message Added changelog, no files modified)
> > > V6: https://patchwork.freedesktop.org/patch/291650/
> > > V7: https://patchwork.freedesktop.org/patch/294141/
> > > V8: https://patchwork.freedesktop.org/patch/301925/
> > > V9: https://patchwork.freedesktop.org/patch/320514/
> >
> > > From 63bcc4f1e72713eca14c4b08e62bc3c07e67904a Mon Sep 17 00:00:00 2001
> > > From: Jerry Han 
> > > Date: Thu, 1 Aug 2019 15:52:35 +0800
> > > Subject: [PATCH 02/10] [v2,2/2] drm/panel: Add Boe Himax8279d MIPI-DSI LCD
> > >  panel
> > >
> > > Support Boe Himax8279d 8.0" 1200x1920 TFT LCD panel, it is a MIPI DSI
> > > panel.
> > >
> > > V2:
> > > - Use SPDX identifier (Sam)
> > > - Use necessary header files replace drmP.h (Sam)
> > > - Delete unnecessary header files #include  (Sam)
> > > - Specifies a GPIOs array to control the reset timing,
> > > instead of reading "dsi-reset-sequence" data from DTS (Sam)
> > > - Delete backlight_disable() function when already disabled (Sam)
> > > - Use devm_of_find_backlight() replace of_find_backlight_by_node()
> > > (Sam)
> > > - Move the necessary data in the DTS to the current file,
> > > like porch, display_mode and Init code etc. (Sam)
> > > - Add compatible device "boe,himax8279d10p" (Sam)
> > >
> > > V1:
> > > - Support Boe Himax8279d 8.0" 1200x1920 TFT LCD panel, it is a MIPI DSI
> > > panel.
> >
> > Something went wrong when you tried to submit v10.
> > Please try again.
> >
> Apart from that, seems like the init sequence has changed drastically.
>
> What is the reason behind this? Was there a bug with previous patches?
>
> For reference in v8 the sequence was nearly identical for 8 and 10
> inch devices - 8-10 line difference.
> Now we're looking at ~250 ...
>
> -Emil
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel