Skip to content

Commit afde659

Browse files
ryan-wannermanikandan-m11
authored andcommitted
drm/panel: himax-hx8394: Add Support for Microchip AC40T08A MIPI Display Panel
Add support for the Microchip AC40T08A MIPI Display panel. This panel uses a Himax HX8394 display controller and requires a vendor provided init sequence. The display resolution is 720x1280@60Hz with width and height of 76mm and 132mm respectively. Signed-off-by: Ryan Wanner <Ryan.Wanner@microchip.com> [manikandan.m@microchip.com: add new compatible string to handle the init sequence] Signed-off-by: Manikandan Muralidharan <manikandan.m@microchip.com>
1 parent 88405a7 commit afde659

1 file changed

Lines changed: 152 additions & 0 deletions

File tree

drivers/gpu/drm/panel/panel-himax-hx8394.c

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
#define HX8394_CMD_SETGIP1 0xd5
5353
#define HX8394_CMD_SETGIP2 0xd6
5454
#define HX8394_CMD_SETGPO 0xd6
55+
#define HX8394_CMD_SETGIP3 0xd8
5556
#define HX8394_CMD_SETSCALING 0xdd
5657
#define HX8394_CMD_SETIDLE 0xdf
5758
#define HX8394_CMD_SETGAMMA 0xe0
@@ -203,6 +204,156 @@ static const struct hx8394_panel_desc hsd060bhw4_desc = {
203204
.init_sequence = hsd060bhw4_init_sequence,
204205
};
205206

207+
static int mchp_ac40t08a_init_sequence(struct hx8394 *ctx)
208+
{
209+
struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
210+
211+
/* DCS commands do not seem to be sent correclty with out this delay */
212+
msleep(20);
213+
214+
/* 5.19.8 SETEXTC: Set extension command (B9h) */
215+
mipi_dsi_dcs_write_seq(dsi, HX8394_CMD_SETEXTC,
216+
0xff, 0x83, 0x94);
217+
218+
/* 5.19.9 SETMIPI: Set MIPI control (BAh) */
219+
mipi_dsi_dcs_write_seq(dsi, HX8394_CMD_SETMIPI,
220+
0x63, 0x03, 0x68, 0x6b, 0xb2, 0xc0);
221+
222+
/* 5.19.2 SETPOWER: Set power (B1h) */
223+
mipi_dsi_dcs_write_seq(dsi, HX8394_CMD_SETPOWER,
224+
0x48, 0x12, 0x72, 0x09, 0x32, 0x54,
225+
0x71, 0x71, 0x57, 0x47);
226+
227+
/* 5.19.3 SETDISP: Set display related register (B2h) */
228+
mipi_dsi_dcs_write_seq(dsi, HX8394_CMD_SETDISP,
229+
0x00, 0x80, 0x64, 0x0c, 0x0d, 0x2f);
230+
231+
/* 5.19.4 SETCYC: Set display waveform cycles (B4h) */
232+
mipi_dsi_dcs_write_seq(dsi, HX8394_CMD_SETCYC,
233+
0x73, 0x74, 0x73, 0x74, 0x73, 0x74,
234+
0x01, 0x0C, 0x86, 0x75, 0x00, 0x3F,
235+
0x73, 0x74, 0x73, 0x74, 0x73, 0x74,
236+
0x01, 0x0C, 0x86);
237+
238+
/* 5.19.5 SETVCOM: Set VCOM voltage (B6h) */
239+
mipi_dsi_dcs_write_seq(dsi, HX8394_CMD_SETVCOM,
240+
0x6e, 0x6e);
241+
242+
/* 5.19.19 SETGIP0: Set GIP Option0 (D3h) */
243+
mipi_dsi_dcs_write_seq(dsi, HX8394_CMD_SETGIP0,
244+
0x00, 0x00, 0x07, 0x07, 0x40, 0x07,
245+
0x0c, 0x00, 0x08, 0x10, 0x08, 0x00,
246+
0x08, 0x54, 0x15, 0x0a, 0x05, 0x0a,
247+
0x02, 0x15, 0x06, 0x05, 0x06, 0x47,
248+
0x44, 0x0a, 0x0a, 0x4b, 0x10, 0x07,
249+
0x07, 0x0c, 0x40);
250+
251+
/* 5.19.20 Set GIP Option1 (D5h) */
252+
mipi_dsi_dcs_write_seq(dsi, HX8394_CMD_SETGIP1,
253+
0x1C, 0x1C, 0x1D, 0x1D, 0x00, 0x01,
254+
0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
255+
0x08, 0x09, 0x0A, 0x0B, 0x24, 0x25,
256+
0x18, 0x18, 0x26, 0x27, 0x18, 0x18,
257+
0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
258+
0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
259+
0x18, 0x18, 0x20, 0x21, 0x18, 0x18,
260+
0x18, 0x18);
261+
262+
/* 5.19.21 Set GIP Option2 (D6h) */
263+
mipi_dsi_dcs_write_seq(dsi, HX8394_CMD_SETGIP2,
264+
0x1C, 0x1C, 0x1D, 0x1D, 0x07, 0x06,
265+
0x05, 0x04, 0x03, 0x02, 0x01, 0x00,
266+
0x0B, 0x0A, 0x09, 0x08, 0x21, 0x20,
267+
0x18, 0x18, 0x27, 0x26, 0x18, 0x18,
268+
0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
269+
0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
270+
0x18, 0x18, 0x25, 0x24, 0x18, 0x18,
271+
0x18, 0x18);
272+
273+
/* 5.19.25 SETGAMMA: Set gamma curve related setting (E0h) */
274+
mipi_dsi_dcs_write_seq(dsi, HX8394_CMD_SETGAMMA,
275+
0x00, 0x0A, 0x15, 0x1B, 0x1E, 0x21,
276+
0x24, 0x22, 0x47, 0x56, 0x65, 0x66,
277+
0x6E, 0x82, 0x88, 0x8B, 0x9A, 0x9D,
278+
0x98, 0xA8, 0xB9, 0x5D, 0x5C, 0x61,
279+
0x66, 0x6A, 0x6F, 0x7F, 0x7F, 0x00,
280+
0x0A, 0x15, 0x1B, 0x1E, 0x21, 0x24,
281+
0x22, 0x47, 0x56, 0x65, 0x65, 0x6E,
282+
0x81, 0x87, 0x8B, 0x98, 0x9D, 0x99,
283+
0xA8, 0xBA, 0x5D, 0x5D, 0x62, 0x67,
284+
0x6B, 0x72, 0x7F, 0x7F);
285+
286+
/* Unknown command, not listed in the HX8394-F datasheet (C0H) */
287+
mipi_dsi_dcs_write_seq(dsi, HX8394_CMD_UNKNOWN1,
288+
0x1f, 0x73);
289+
290+
/* Set CABC control (C9h)*/
291+
mipi_dsi_dcs_write_seq(dsi, HX8394_CMD_SETCABC,
292+
0x76, 0x00, 0x30);
293+
294+
/* 5.19.17 SETPANEL (CCh) */
295+
mipi_dsi_dcs_write_seq(dsi, HX8394_CMD_SETPANEL,
296+
0x0b);
297+
298+
/* Unknown command, not listed in the HX8394-F datasheet (D4h) */
299+
mipi_dsi_dcs_write_seq(dsi, HX8394_CMD_UNKNOWN3,
300+
0x02);
301+
302+
/* 5.19.11 Set register bank (BDh) */
303+
mipi_dsi_dcs_write_seq(dsi, HX8394_CMD_SETREGBANK,
304+
0x02);
305+
306+
/* 5.19.11 Set register bank (D8h) */
307+
mipi_dsi_dcs_write_seq(dsi, HX8394_CMD_SETGIP3,
308+
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
309+
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF);
310+
311+
/* 5.19.11 Set register bank (BDh) */
312+
mipi_dsi_dcs_write_seq(dsi, HX8394_CMD_SETREGBANK,
313+
0x00);
314+
315+
/* 5.19.11 Set register bank (BDh) */
316+
mipi_dsi_dcs_write_seq(dsi, HX8394_CMD_SETREGBANK,
317+
0x01);
318+
319+
/* 5.19.2 SETPOWER: Set power (B1h) */
320+
mipi_dsi_dcs_write_seq(dsi, HX8394_CMD_SETPOWER,
321+
0x00);
322+
323+
/* 5.19.11 Set register bank (BDh) */
324+
mipi_dsi_dcs_write_seq(dsi, HX8394_CMD_SETREGBANK,
325+
0x00);
326+
327+
/* Unknown command, not listed in the HX8394-F datasheet (C6h) */
328+
mipi_dsi_dcs_write_seq(dsi, HX8394_CMD_UNKNOWN2,
329+
0xed);
330+
331+
return 0;
332+
}
333+
334+
static const struct drm_display_mode mchp_ac40t08a_mode = {
335+
.hdisplay = 720,
336+
.hsync_start = 720 + 12,
337+
.hsync_end = 720 + 12 + 24,
338+
.htotal = 720 + 12 + 12 + 24,
339+
.vdisplay = 1280,
340+
.vsync_start = 1280 + 13,
341+
.vsync_end = 1280 + 14,
342+
.vtotal = 1280 + 14 + 13,
343+
.clock = 60226,
344+
.flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
345+
.width_mm = 76,
346+
.height_mm = 132,
347+
};
348+
349+
static const struct hx8394_panel_desc mchp_ac40t08a_desc = {
350+
.mode = &mchp_ac40t08a_mode,
351+
.lanes = 4,
352+
.mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST,
353+
.format = MIPI_DSI_FMT_RGB888,
354+
.init_sequence = mchp_ac40t08a_init_sequence,
355+
};
356+
206357
static int hx8394_enable(struct drm_panel *panel)
207358
{
208359
struct hx8394 *ctx = panel_to_hx8394(panel);
@@ -431,6 +582,7 @@ static void hx8394_remove(struct mipi_dsi_device *dsi)
431582

432583
static const struct of_device_id hx8394_of_match[] = {
433584
{ .compatible = "hannstar,hsd060bhw4", .data = &hsd060bhw4_desc },
585+
{ .compatible = "microchip,ac40t08a-mipi-panel", .data = &mchp_ac40t08a_desc },
434586
{ /* sentinel */ }
435587
};
436588
MODULE_DEVICE_TABLE(of, hx8394_of_match);

0 commit comments

Comments
 (0)