Add support for hx83102-based Holitech HTF065H045 panel
Subsystems (4)
cover Add support for hx83102-based Holitech HTF065H045 panel
This 720x1600 panel is found in several Motorola/Lenovo smartphones. It will be used in the device tree for the Moto G9 Play (sm6115-motorola-guamp). Fully tested on it, including brightness adjustment.
The initialization sequence is based on leaked documentation found online :) as the sequence included in downstream Android DTS was near-empty (I think it relies on the bootloader to do the bulk of the initialization). That documentation is also the source for the exact model number (as it's the same vendor, same controller IC, same resolution, and made for Motorola).
Thanks,
~val
Val Packett (4):
dt-bindings: vendor-prefixes: Add Holitech
dt-bindings: display: panel: Add compatible for Holitech HTF065H045 drm/panel: himax-hx83102: Add support for Holitech HTF065H045 drm/panel: himax-hx83102: Add support for DSI DCS backlight control
.../bindings/display/panel/himax,hx83102.yaml | 2 + .../devicetree/bindings/vendor-prefixes.yaml | 2 + drivers/gpu/drm/panel/panel-himax-hx83102.c | 151 ++++++++++++++++++ 3 files changed, 155 insertions(+)
Signature · 1 line
2.52.0
PATCH 1/4 dt-bindings: vendor-prefixes: Add Holitech
Jiangxi Holitech Technology Co., Ltd. is a manufacturer of display panels.
--- Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
@@ -711,6 +711,8 @@ patternProperties: description: Hitex Development Tools "^hitron,.*": description: HiTRON Electronics Corporation + "^holitech,.*": + description: Jiangxi Holitech Technology Co., Ltd. "^holt,.*": description: Holt Integrated Circuits, Inc. "^holtek,.*":
Signature · 1 line
2.52.0
Re: [PATCH 1/4] dt-bindings: vendor-prefixes: Add Holitech
Quoted 6 lines · Val Packett
Jiangxi Holitech Technology Co., Ltd. is a manufacturer of display panels.
Signed-off-by Val Packett <[email protected]>--- Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+)
Best regards,
Krzysztof
PATCH 2/4 dt-bindings: display: panel: Add compatible for Holitech HTF065H045
In reply to Val PackettAdd a new compatible for the Holitech HTF065H045 panel that uses the Himax HX83102 controller IC.
--- .../devicetree/bindings/display/panel/himax,hx83102.yaml | 2 ++ 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/display/panel/himax,hx83102.yaml +2 -0
@@ -20,6 +20,8 @@ properties: - boe,nv110wum-l60 # CSOT pna957qt1-1 10.95" WUXGA TFT LCD panel - csot,pna957qt1-1 + # Holitech HTF065H045 6.517" 720x1600 TFT LCD panel + - holitech,htf065h045 # IVO t109nw41 11.0" WUXGA TFT LCD panel - ivo,t109nw41 # KINGDISPLAY KD110N11-51IE 10.95" WUXGA TFT LCD panel
Signature · 1 line
2.52.0
Re: [PATCH 2/4] dt-bindings: display: panel: Add compatible for Holitech HTF065H045
Quoted 7 lines · Val Packett
Add a new compatible for the Holitech HTF065H045 panel that uses the Himax HX83102 controller IC.
Signed-off-by Val Packett <[email protected]>--- .../devicetree/bindings/display/panel/himax,hx83102.yaml | 2 ++ 1 file changed, 2 insertions(+)
Best regards,
Krzysztof
PATCH 3/4 drm/panel: himax-hx83102: Add support for Holitech HTF065H045
In reply to Val PackettThis 720x1600 panel is found in several Motorola/Lenovo smartphones like the Moto G9 Play (guamp). The initialization sequence is based on the datasheet. Add it to the existing HX83102 panel driver.
--- drivers/gpu/drm/panel/panel-himax-hx83102.c | 86 +++++++++++++++++++++ 1 file changed, 86 insertions(+)
drivers/gpu/drm/panel/panel-himax-hx83102.c +86 -0
@@ -701,6 +701,67 @@ static int starry_2082109qfh040022_50e_init(struct hx83102 *ctx)return dsi_ctx.accum_err; } +static int holitech_htf065h045_init (struct hx83102 *ctx) +{ +struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi }; + +msleep (50 ); + +hx83102_enable_extended_cmds (&dsi_ctx, true); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETPOWER ,0x22 ,0x44 ,0x27 ,0x27 ,0x32 , +0x52 ,0x57 ,0x39 ,0x08 ,0x08 ,0x08 ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETDISP ,0x00 ,0x00 ,0x06 ,0x40 ,0x00 , +0x0e ,0xae ,0x38 ,0x00 ,0x00 ,0x00 ,0x00 ,0xf4 ,0xa0 ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETCYC ,0x01 ,0x58 ,0x01 ,0x58 ,0x01 , +0x58 ,0x03 ,0x58 ,0x03 ,0xff ,0x01 ,0x20 ,0x00 ,0xff ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETPANEL ,0x02 ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETGIP0 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 , +0x10 ,0x00 ,0x17 ,0x00 ,0x63 ,0x37 ,0x0e ,0x0e ,0x00 ,0x00 , +0x32 ,0x10 ,0x08 ,0x00 ,0x08 ,0x32 ,0x16 ,0x4e ,0x06 ,0x4e ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETPWM ,0x04 ,0x0c ,0xb2 ,0x01 ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETGIP1 ,0x24 ,0x25 ,0x18 ,0x18 ,0x19 , +0x19 ,0x18 ,0x18 ,0x18 ,0x18 ,0x18 ,0x18 ,0x18 ,0x18 ,0x18 , +0x18 ,0x18 ,0x18 ,0x06 ,0x07 ,0x04 ,0x05 ,0x18 ,0x18 ,0x18 , +0x18 ,0x02 ,0x03 ,0x00 ,0x01 ,0x20 ,0x21 ,0x18 ,0x18 ,0x18 , +0x18 ,0x18 ,0x18 ,0x18 ,0x18 ,0x18 ,0x18 ,0x18 ,0x18 ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETGIP2 ,0x00 ,0x09 ,0x16 ,0x1f ,0x28 , +0x4b ,0x65 ,0x6d ,0x74 ,0x70 ,0x89 ,0x8d ,0x91 ,0xa0 ,0x9e , +0xa8 ,0xb2 ,0xc8 ,0xc9 ,0x65 ,0x6d ,0x78 ,0x7f ,0x00 ,0x09 , +0x16 ,0x1f ,0x28 ,0x4b ,0x65 ,0x6d ,0x74 ,0x70 ,0x89 ,0x8d , +0x91 ,0xa0 ,0x9e ,0xa8 ,0xb2 ,0xc8 ,0xc9 ,0x65 ,0x6d ,0x78 , +0x7f ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETTP1 ,0xff ,0x14 ,0x00 ,0x00 ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETBANK ,0x01 ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETTP1 ,0x01 ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETBANK ,0x02 ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETGIP3 ,0xff ,0xff ,0xff ,0xff ,0xff , +0xf0 ,0xff ,0xff ,0xff ,0xff ,0xff ,0xf0 ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETBANK ,0x03 ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETGIP3 ,0xaa ,0xaa ,0xaa ,0xaa ,0xaa , +0xa0 ,0xaa ,0xaa ,0xaa ,0xaa ,0xaa ,0xa0 ,0xaa ,0xaa ,0xaa , +0xaa ,0xaa ,0xa0 ,0xaa ,0xaa ,0xaa ,0xaa ,0xaa ,0xa0 ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETBANK ,0x00 ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETMIPI ,0x70 ,0x23 ,0xa8 ,0x93 ,0xb2 , +0xc0 ,0xc0 ,0x01 ,0x10 ,0x00 ,0x00 ,0x00 ,0x0d ,0x3d ,0x82 , +0x77 ,0x04 ,0x01 ,0x04 ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETBANK ,0x01 ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETCLOCK ,0x01 ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETBANK ,0x00 ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETCLOCK ,0x00 ,0x53 ,0x00 ,0x02 ,0x59 ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETPTBA ,0xfc ,0x00 ,0x04 ,0x9e ,0xf6 , +0x00 ,0x5d ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETBANK ,0x02 ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETCYC ,0x42 ,0x00 ,0x33 ,0x00 ,0x33 , +0x88 ,0xb3 ,0x00 ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETBANK ,0x00 ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETPCTRL ,0x20 ,0x01 ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETBANK ,0x02 ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETPOWER ,0x7f ,0x03 ,0xf5 ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETBANK ,0x00 ); + +return dsi_ctx.accum_err; +} +static const struct drm_display_mode starry_mode = { .clock =162680 , .hdisplay =1200 ,
@@ -833,6 +894,28 @@ static const struct hx83102_panel_desc starry_2082109qfh040022_50e_desc = { .init = starry_2082109qfh040022_50e_init, }; +static const struct drm_display_mode holitech_htf065h045_default_mode = { + .clock =90720 , + .hdisplay =720 , + .hsync_start =720 +40 , + .hsync_end =720 +40 +40 , + .htotal =720 +40 +40 +40 , + .vdisplay =1600 , + .vsync_start =1600 +186 , + .vsync_end =1600 +186 +2 , + .vtotal =1600 +186 +2 +12 , + .type =DRM_MODE_TYPE_DRIVER |DRM_MODE_TYPE_PREFERRED , +}; + +static const struct hx83102_panel_desc holitech_htf065h045_desc = { + .modes = &holitech_htf065h045_default_mode, + .size = { + .width_mm =68 , + .height_mm =151 , + }, + .init = holitech_htf065h045_init, +}; +static int hx83102_enable (struct drm_panel *panel) {msleep (130 );
@@ -1069,6 +1152,9 @@ static const struct of_device_id hx83102_of_match[] = { { .compatible = "starry,himax83102-j02", .data = &starry_desc }, + { .compatible = "holitech,htf065h045", + .data = &holitech_htf065h045_desc + }, {/* sentinel */ } };MODULE_DEVICE_TABLE (of, hx83102_of_match);
Signature · 1 line
2.52.0
Re: [PATCH 3/4] drm/panel: himax-hx83102: Add support for Holitech HTF065H045
Quoted 111 lines · Val Packett
This 720x1600 panel is found in several Motorola/Lenovo smartphones like the Moto G9 Play (guamp). The initialization sequence is based on the datasheet. Add it to the existing HX83102 panel driver.
Signed-off-by Val Packett <[email protected]>--- drivers/gpu/drm/panel/panel-himax-hx83102.c | 86 +++++++++++++++++++++ 1 file changed, 86 insertions(+)drivers/gpu/drm/panel/panel-himax-hx83102.c +83
-0@@ -701,6 +701,67 @@ static int starry_2082109qfh040022_50e_init(struct hx83102 *ctx)return dsi_ctx.accum_err; } +static int holitech_htf065h045_init (struct hx83102 *ctx) +{ +struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi }; + +msleep (50 ); + +hx83102_enable_extended_cmds (&dsi_ctx, true); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETPOWER ,0x22 ,0x44 ,0x27 ,0x27 ,0x32 , +0x52 ,0x57 ,0x39 ,0x08 ,0x08 ,0x08 ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETDISP ,0x00 ,0x00 ,0x06 ,0x40 ,0x00 , +0x0e ,0xae ,0x38 ,0x00 ,0x00 ,0x00 ,0x00 ,0xf4 ,0xa0 ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETCYC ,0x01 ,0x58 ,0x01 ,0x58 ,0x01 , +0x58 ,0x03 ,0x58 ,0x03 ,0xff ,0x01 ,0x20 ,0x00 ,0xff ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETPANEL ,0x02 ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETGIP0 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 , +0x10 ,0x00 ,0x17 ,0x00 ,0x63 ,0x37 ,0x0e ,0x0e ,0x00 ,0x00 , +0x32 ,0x10 ,0x08 ,0x00 ,0x08 ,0x32 ,0x16 ,0x4e ,0x06 ,0x4e ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETPWM ,0x04 ,0x0c ,0xb2 ,0x01 ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETGIP1 ,0x24 ,0x25 ,0x18 ,0x18 ,0x19 , +0x19 ,0x18 ,0x18 ,0x18 ,0x18 ,0x18 ,0x18 ,0x18 ,0x18 ,0x18 , +0x18 ,0x18 ,0x18 ,0x06 ,0x07 ,0x04 ,0x05 ,0x18 ,0x18 ,0x18 , +0x18 ,0x02 ,0x03 ,0x00 ,0x01 ,0x20 ,0x21 ,0x18 ,0x18 ,0x18 , +0x18 ,0x18 ,0x18 ,0x18 ,0x18 ,0x18 ,0x18 ,0x18 ,0x18 ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETGIP2 ,0x00 ,0x09 ,0x16 ,0x1f ,0x28 , +0x4b ,0x65 ,0x6d ,0x74 ,0x70 ,0x89 ,0x8d ,0x91 ,0xa0 ,0x9e , +0xa8 ,0xb2 ,0xc8 ,0xc9 ,0x65 ,0x6d ,0x78 ,0x7f ,0x00 ,0x09 , +0x16 ,0x1f ,0x28 ,0x4b ,0x65 ,0x6d ,0x74 ,0x70 ,0x89 ,0x8d , +0x91 ,0xa0 ,0x9e ,0xa8 ,0xb2 ,0xc8 ,0xc9 ,0x65 ,0x6d ,0x78 , +0x7f ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETTP1 ,0xff ,0x14 ,0x00 ,0x00 ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETBANK ,0x01 ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETTP1 ,0x01 ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETBANK ,0x02 ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETGIP3 ,0xff ,0xff ,0xff ,0xff ,0xff , +0xf0 ,0xff ,0xff ,0xff ,0xff ,0xff ,0xf0 ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETBANK ,0x03 ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETGIP3 ,0xaa ,0xaa ,0xaa ,0xaa ,0xaa , +0xa0 ,0xaa ,0xaa ,0xaa ,0xaa ,0xaa ,0xa0 ,0xaa ,0xaa ,0xaa , +0xaa ,0xaa ,0xa0 ,0xaa ,0xaa ,0xaa ,0xaa ,0xaa ,0xa0 ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETBANK ,0x00 ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETMIPI ,0x70 ,0x23 ,0xa8 ,0x93 ,0xb2 , +0xc0 ,0xc0 ,0x01 ,0x10 ,0x00 ,0x00 ,0x00 ,0x0d ,0x3d ,0x82 , +0x77 ,0x04 ,0x01 ,0x04 ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETBANK ,0x01 ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETCLOCK ,0x01 ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETBANK ,0x00 ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETCLOCK ,0x00 ,0x53 ,0x00 ,0x02 ,0x59 ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETPTBA ,0xfc ,0x00 ,0x04 ,0x9e ,0xf6 , +0x00 ,0x5d ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETBANK ,0x02 ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETCYC ,0x42 ,0x00 ,0x33 ,0x00 ,0x33 , +0x88 ,0xb3 ,0x00 ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETBANK ,0x00 ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETPCTRL ,0x20 ,0x01 ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETBANK ,0x02 ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETPOWER ,0x7f ,0x03 ,0xf5 ); +mipi_dsi_dcs_write_seq_multi (&dsi_ctx,HX83102_SETBANK ,0x00 ); + +return dsi_ctx.accum_err; +} +static const struct drm_display_mode starry_mode = { .clock =162680 , .hdisplay =1200 ,@@ -833,6 +894,28 @@ static const struct hx83102_panel_desc starry_2082109qfh040022_50e_desc = { .init = starry_2082109qfh040022_50e_init, }; +static const struct drm_display_mode holitech_htf065h045_default_mode = { + .clock =90720 , + .hdisplay =720 , + .hsync_start =720 +40 , + .hsync_end =720 +40 +40 , + .htotal =720 +40 +40 +40 , + .vdisplay =1600 , + .vsync_start =1600 +186 , + .vsync_end =1600 +186 +2 , + .vtotal =1600 +186 +2 +12 , + .type =DRM_MODE_TYPE_DRIVER |DRM_MODE_TYPE_PREFERRED , +}; + +static const struct hx83102_panel_desc holitech_htf065h045_desc = { + .modes = &holitech_htf065h045_default_mode, + .size = { + .width_mm =68 , + .height_mm =151 , + }, + .init = holitech_htf065h045_init, +}; +static int hx83102_enable (struct drm_panel *panel) {msleep (130 );
drivers/gpu/drm/panel/panel-himax-hx83102.c static const struct of_device_id hx83102_of_match[] = { · line 1160
Quoted 9 lines
drivers/gpu/drm/panel/panel-himax-hx83102.c +3
-0@@ -1069,6 +1152,9 @@ static const struct of_device_id hx83102_of_match[] = { { .compatible = "starry,himax83102-j02", .data = &starry_desc }, + { .compatible = "holitech,htf065h045", + .data = &holitech_htf065h045_desc + }, {/* sentinel */ } };MODULE_DEVICE_TABLE (of, hx83102_of_match);
Thanks,
Neil
Re: [PATCH 3/4] drm/panel: himax-hx83102: Add support for Holitech HTF065H045
Quoted 10 lines · Neil Armstrong
Quoted 9 lines · Val Packett
This 720x1600 panel is found in several Motorola/Lenovo smartphones like the Moto G9 Play (guamp). The initialization sequence is based on the datasheet. Add it to the existing HX83102 panel driver.
Signed-off-by Val Packett <[email protected]>---
drivers/gpu/drm/panel/panel-himax-hx83102.c| 86 +++++++++++++++++++++1 file changed, 86 insertions(+)
Quoted 15 lines
Quoted 5 lines
drivers/gpu/drm/panel/panel-himax-hx83102.c +0
-0drivers/gpu/drm/panel/panel-himax-hx83102.c static int · line 710
Quoted 10 lines
drivers/gpu/drm/panel/panel-himax-hx83102.c +6
-0@@ -701,6 +701,67 @@ static int starry_2082109qfh040022_50e_init(struct hx83102 *ctx) return dsi_ctx.accum_err; } +static int holitech_htf065h045_init(struct hx83102 *ctx) +{ + struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi }; + + msleep(50); + + hx83102_enable_extended_cmds(&dsi_ctx, true);
BTW I have noticed since that the enable-extended "password" command in the doc mentions the model of the IC: {83, 10, 2D} for 83102D, not {83, 10, 21, 55, 00}.
Works fine either way, can't say I'm really noticing any visible changes from the init sequence, but I'll adjust it to be accurate for v2, can I keep the R-b?
Thanks,
~val
PATCH 4/4 drm/panel: himax-hx83102: Add support for DSI DCS backlight control
In reply to Val PackettThe HTF065H045 panel based on the HX83102 controller does use DCS commands for controlling backlight brightness. Make the driver fall back to DCS when no external backlight has been defined in the device tree, like many other drivers do.
--- drivers/gpu/drm/panel/panel-himax-hx83102.c | 65 +++++++++++++++++++++ 1 file changed, 65 insertions(+)
drivers/gpu/drm/panel/panel-himax-hx83102.c +65 -0
@@ -7,6 +7,7 @@* Based on drivers/gpu/drm/panel/panel-himax-hx8394.c */ +#include <linux/backlight.h> #include <linux/delay.h> #include <linux/gpio/consumer.h> #include <linux/module.h>
@@ -76,6 +77,8 @@ struct hx83102_panel_desc {unsigned int height_mm; } size; +bool has_backlight; +int (*init)(struct hx83102 *ctx); };
@@ -913,6 +916,7 @@ static const struct hx83102_panel_desc holitech_htf065h045_desc = { .width_mm = 68, .height_mm = 151, }, + .has_backlight = true, .init = holitech_htf065h045_init, };
@@ -1049,6 +1053,59 @@ static const struct drm_panel_funcs hx83102_drm_funcs = { .get_orientation = hx83102_get_orientation, }; +static int hx83102_bl_update_status (struct backlight_device *bl) +{ +struct mipi_dsi_device *dsi =bl_get_data (bl); +u16 brightness =backlight_get_brightness (bl); +int ret; + + dsi->mode_flags &= ~MIPI_DSI_MODE_LPM ; + + ret =mipi_dsi_dcs_set_display_brightness_large (dsi, brightness); +if (ret <0 ) +return ret; + + dsi->mode_flags |=MIPI_DSI_MODE_LPM ; + +return 0 ; +} + +static int hx83102_bl_get_brightness (struct backlight_device *bl) +{ +struct mipi_dsi_device *dsi =bl_get_data (bl); +u16 brightness; +int ret; + + dsi->mode_flags &= ~MIPI_DSI_MODE_LPM ; + + ret =mipi_dsi_dcs_get_display_brightness_large (dsi, &brightness); +if (ret <0 ) +return ret; + + dsi->mode_flags |=MIPI_DSI_MODE_LPM ; + +return brightness; +} + +static const struct backlight_ops hx83102_bl_ops = { + .update_status = hx83102_bl_update_status, + .get_brightness = hx83102_bl_get_brightness, +}; + +static struct backlight_device * +hx83102_create_dcs_backlight (struct mipi_dsi_device *dsi) +{ +struct device *dev = &dsi->dev; +const struct backlight_properties props = { + .type =BACKLIGHT_RAW , + .brightness =4095 , + .max_brightness =4095 , + }; + +return devm_backlight_device_register (dev,dev_name (dev), dev, dsi, + &hx83102_bl_ops, &props); +} +static int hx83102_panel_add (struct hx83102 *ctx) {struct device *dev = &ctx->dsi->dev;
@@ -1080,6 +1137,14 @@ static int hx83102_panel_add(struct hx83102 *ctx)if (err)return err; +/* Use DSI-based backlight as fallback if available */ +if (ctx->desc->has_backlight && !ctx->base.backlight) { + ctx->base.backlight =hx83102_create_dcs_backlight (ctx->dsi); +if (IS_ERR (ctx->base.backlight)) +return dev_err_probe (dev,PTR_ERR (ctx->base.backlight), +"Failed to create backlight\n" ); + } + ctx->base.funcs = &hx83102_drm_funcs; ctx->base.dev = &ctx->dsi->dev;
Signature · 1 line
2.52.0
Re: [PATCH 4/4] drm/panel: himax-hx83102: Add support for DSI DCS backlight control
Quoted 80 lines · Val Packett
The HTF065H045 panel based on the HX83102 controller does use DCS commands for controlling backlight brightness. Make the driver fall back to DCS when no external backlight has been defined in the device tree, like many other drivers do.
Signed-off-by Val Packett <[email protected]>--- drivers/gpu/drm/panel/panel-himax-hx83102.c | 65 +++++++++++++++++++++ 1 file changed, 65 insertions(+)drivers/gpu/drm/panel/panel-himax-hx83102.c +41
-0@@ -7,6 +7,7 @@* Based on drivers/gpu/drm/panel/panel-himax-hx8394.c */ +#include <linux/backlight.h> #include <linux/delay.h> #include <linux/gpio/consumer.h> #include <linux/module.h> @@ -76,6 +77,8 @@ struct hx83102_panel_desc {unsigned int height_mm; } size; +bool has_backlight; +int (*init)(struct hx83102 *ctx); };@@ -913,6 +916,7 @@ static const struct hx83102_panel_desc holitech_htf065h045_desc = { .width_mm = 68, .height_mm = 151, }, + .has_backlight = true, .init = holitech_htf065h045_init, };@@ -1049,6 +1053,59 @@ static const struct drm_panel_funcs hx83102_drm_funcs = { .get_orientation = hx83102_get_orientation, }; +static int hx83102_bl_update_status (struct backlight_device *bl) +{ +struct mipi_dsi_device *dsi =bl_get_data (bl); +u16 brightness =backlight_get_brightness (bl); +int ret; + + dsi->mode_flags &= ~MIPI_DSI_MODE_LPM ; + + ret =mipi_dsi_dcs_set_display_brightness_large (dsi, brightness); +if (ret <0 ) +return ret; + + dsi->mode_flags |=MIPI_DSI_MODE_LPM ; + +return 0 ; +} + +static int hx83102_bl_get_brightness (struct backlight_device *bl) +{ +struct mipi_dsi_device *dsi =bl_get_data (bl); +u16 brightness; +int ret; + + dsi->mode_flags &= ~MIPI_DSI_MODE_LPM ; + + ret =mipi_dsi_dcs_get_display_brightness_large (dsi, &brightness); +if (ret <0 ) +return ret; + + dsi->mode_flags |=MIPI_DSI_MODE_LPM ; + +return brightness; +} + +static const struct backlight_ops hx83102_bl_ops = { + .update_status = hx83102_bl_update_status, + .get_brightness = hx83102_bl_get_brightness,
drivers/gpu/drm/panel/panel-himax-hx83102.c static const struct drm_panel_funcs hx83102_drm_funcs = { · line 1102
Quoted 10 lines
drivers/gpu/drm/panel/panel-himax-hx83102.c +10
-0+}; + +static struct backlight_device * +hx83102_create_dcs_backlight (struct mipi_dsi_device *dsi) +{ +struct device *dev = &dsi->dev; +const struct backlight_properties props = { + .type =BACKLIGHT_RAW , + .brightness =4095 , + .max_brightness =4095 ,
I guess those values could be in the hx83102_panel_desc.
Anyway:
Thanks,
Neil
Quoted 24 lines
drivers/gpu/drm/panel/panel-himax-hx83102.c +14
-0+ }; + +return devm_backlight_device_register (dev,dev_name (dev), dev, dsi, + &hx83102_bl_ops, &props); +} +static int hx83102_panel_add (struct hx83102 *ctx) {struct device *dev = &ctx->dsi->dev;@@ -1080,6 +1137,14 @@ static int hx83102_panel_add(struct hx83102 *ctx)if (err)return err; +/* Use DSI-based backlight as fallback if available */ +if (ctx->desc->has_backlight && !ctx->base.backlight) { + ctx->base.backlight =hx83102_create_dcs_backlight (ctx->dsi); +if (IS_ERR (ctx->base.backlight)) +return dev_err_probe (dev,PTR_ERR (ctx->base.backlight), +"Failed to create backlight\n" ); + } + ctx->base.funcs = &hx83102_drm_funcs; ctx->base.dev = &ctx->dsi->dev;
Re: [PATCH 4/4] drm/panel: himax-hx83102: Add support for DSI DCS backlight control
In reply to Val PackettOn 17/02/2026 08:00, Val Packett wrote:
[...]
drivers/gpu/drm/panel/panel-himax-hx83102.c static const struct drm_panel_funcs hx83102_drm_funcs = { · line 1101
Quoted 8 lines
drivers/gpu/drm/panel/panel-himax-hx83102.c +8
-0+ +static struct backlight_device * +hx83102_create_dcs_backlight (struct mipi_dsi_device *dsi) +{ +struct device *dev = &dsi->dev; +const struct backlight_properties props = { + .type =BACKLIGHT_RAW , + .brightness =4095 ,
Series looks good, just nitpick here.
While this is not OLED, where full brightness reduces the lifetime of display a lot, are you sure you want to bring the display backlight up to 100% by default?
Usually I've and others put ~ 50%. It's important to keep display well readable until userspace takes over, but not have to be full-throttle :)
David
[...]
Signature · 1 line
David Heidelberg
Quoted 7 lines · Val Packett
This 720x1600 panel is found in several Motorola/Lenovo smartphones. It will be used in the device tree for the Moto G9 Play (sm6115-motorola-guamp). Fully tested on it, including brightness adjustment.
The initialization sequence is based on leaked documentation found online :) as the sequence included in downstream Android DTS was near-empty (I think it relies on the bootloader to do the bulk of the initialization).
Depends how bad is the driver in Android, but generally when panel is powered down (not with DSI command, but regulator-wise) it needs full sequence to power-on. This implies the Android driver should (but maybe doesn't?) do full initialization.
You can also extract the sequence from the EFI bootloader firmware image (it's XML file) and verify (if you want to).
Quoted 17 lines
That documentation is also the source for the exact model number (as it's the same vendor, same controller IC, same resolution, and made for Motorola).
Thanks,
~valVal Packett (4):
dt-bindings: vendor-prefixes: Add Holitech
dt-bindings: display: panel: Add compatible for Holitech HTF065H045 drm/panel: himax-hx83102: Add support for Holitech HTF065H045 drm/panel: himax-hx83102: Add support for DSI DCS backlight control.../bindings/display/panel/himax,hx83102.yaml | 2 + .../devicetree/bindings/vendor-prefixes.yaml | 2 + drivers/gpu/drm/panel/panel-himax-hx83102.c | 151 ++++++++++++++++++ 3 files changed, 155 insertions(+)
Signature · 1 line
David Heidelberg
Re: (subset) [PATCH 0/4] Add support for hx83102-based Holitech HTF065H045 panel
In reply to Val PackettHi,
Quoted 11 lines · Val Packett
This 720x1600 panel is found in several Motorola/Lenovo smartphones. It will be used in the device tree for the Moto G9 Play (sm6115-motorola-guamp). Fully tested on it, including brightness adjustment.
The initialization sequence is based on leaked documentation found online :) as the sequence included in downstream Android DTS was near-empty (I think it relies on the bootloader to do the bulk of the initialization). That documentation is also the source for the exact model number (as it's the same vendor, same controller IC, same resolution, and made for Motorola).
[...]
Thanks, Applied to https://gitlab.freedesktop.org/drm/misc/kernel.git (drm-misc-next)
[1/4] dt-bindings: vendor-prefixes: Add Holitech
https://gitlab.freedesktop.org/drm/misc/kernel/-/commit/c122ddd573a90363d18d5f08aefc48f98b40c3d4 [2/4] dt-bindings: display: panel: Add compatible for Holitech HTF065H045 https://gitlab.freedesktop.org/drm/misc/kernel/-/commit/896e7b8c1780734833abaa795fad7eec0cae8125 [3/4] drm/panel: himax-hx83102: Add support for Holitech HTF065H045 https://gitlab.freedesktop.org/drm/misc/kernel/-/commit/cc72a4734829648465d52484620951199d2ab1e7 [4/4] drm/panel: himax-hx83102: Add support for DSI DCS backlight control https://gitlab.freedesktop.org/drm/misc/kernel/-/commit/987170d0b8da06a399d867c609b5689f3e8dfdb0
Signature · 1 line
Neil