Lines Matching +full:scan +full:- +full:interval +full:- +full:ms
1 // SPDX-License-Identifier: GPL-2.0-only
6 * - 16-bit parallel RGB interface
7 * - 18-bit parallel RGB interface
8 * - 4-line serial spi interface
13 * Derived from drivers/drm/gpu/panel/panel-ilitek-ili9322.c
17 * For only-dbi part, copy from David's code (drm/tiny/ili9341.c)
117 /* struct ili9341_config - the system specific ILI9341 configuration */
190 * The Stm32f429-disco board has a panel ili9341 connected to ltdc controller
219 * 0x0a Interval scan, AGND AGND AGND AGND
220 * 0xa2 Normally white, G1 -> G320, S720 -> S1,
221 * Scan Cycle 5 frames,85ms
226 /* 0x10 AVDD=vci*2, VGH=vci*7, VGL=-vci*4 */
228 /* 0x45 VCOMH 4.425v, 0x15 VCOML -1.975*/
230 /* 0x90 offset voltage, VMH-48, VML-48 */
249 * Gate outputs in non-display area: Interval scan
250 * Determine source/VCOM output in a non-display area in the partial
254 * Scan Cycle: 15 frames
255 * fFLM = 60Hz: 255ms
257 * Gate Output Scan Direction: G1 -> G320
258 * Source Output Scan Direction: S720 -> S1
275 * (EC-SC+1)*(EP-SP+1), the column and page number will be
280 * 16- bit RGB interface (1 transfer/pixel)
303 struct device *dev = (&ili->panel)->dev; in ili9341_dpi_init()
304 struct mipi_dbi *dbi = ili->dbi; in ili9341_dpi_init()
305 struct ili9341_config *cfg = (struct ili9341_config *)ili->conf; in ili9341_dpi_init()
308 mipi_dbi_command_stackbuf(dbi, 0xca, cfg->ca, ILI9341_CA_LEN); in ili9341_dpi_init()
309 mipi_dbi_command_stackbuf(dbi, ILI9341_POWERB, cfg->power_b, in ili9341_dpi_init()
311 mipi_dbi_command_stackbuf(dbi, ILI9341_POWER_SEQ, cfg->power_seq, in ili9341_dpi_init()
313 mipi_dbi_command_stackbuf(dbi, ILI9341_DTCA, cfg->dtca, in ili9341_dpi_init()
315 mipi_dbi_command_stackbuf(dbi, ILI9341_POWERA, cfg->power_a, in ili9341_dpi_init()
317 mipi_dbi_command(ili->dbi, ILI9341_PRC, cfg->prc); in ili9341_dpi_init()
318 mipi_dbi_command_stackbuf(dbi, ILI9341_DTCB, cfg->dtcb, in ili9341_dpi_init()
320 mipi_dbi_command_stackbuf(dbi, ILI9341_FRC, cfg->frc, ILI9341_FRC_LEN); in ili9341_dpi_init()
321 mipi_dbi_command_stackbuf(dbi, ILI9341_DFC, cfg->dfc_1, in ili9341_dpi_init()
323 mipi_dbi_command(dbi, ILI9341_POWER1, cfg->power_1); in ili9341_dpi_init()
324 mipi_dbi_command(dbi, ILI9341_POWER2, cfg->power_2); in ili9341_dpi_init()
327 mipi_dbi_command_stackbuf(dbi, ILI9341_VCOM1, cfg->vcom_1, in ili9341_dpi_init()
329 mipi_dbi_command(dbi, ILI9341_VCOM2, cfg->vcom_2); in ili9341_dpi_init()
330 mipi_dbi_command(dbi, MIPI_DCS_SET_ADDRESS_MODE, cfg->address_mode); in ili9341_dpi_init()
333 mipi_dbi_command(dbi, ILI9341_3GAMMA_EN, cfg->g3amma_en); in ili9341_dpi_init()
334 mipi_dbi_command(dbi, ILI9341_RGB_INTERFACE, cfg->rgb_interface); in ili9341_dpi_init()
335 mipi_dbi_command_stackbuf(dbi, ILI9341_DFC, cfg->dfc_2, in ili9341_dpi_init()
340 cfg->column_addr, ILI9341_COLUMN_ADDR_LEN); in ili9341_dpi_init()
344 cfg->page_addr, ILI9341_PAGE_ADDR_LEN); in ili9341_dpi_init()
345 mipi_dbi_command_stackbuf(dbi, ILI9341_INTERFACE, cfg->interface, in ili9341_dpi_init()
349 mipi_dbi_command(dbi, MIPI_DCS_SET_PIXEL_FORMAT, cfg->pixel_format); in ili9341_dpi_init()
352 mipi_dbi_command(dbi, MIPI_DCS_SET_GAMMA_CURVE, cfg->gamma_curve); in ili9341_dpi_init()
353 mipi_dbi_command_stackbuf(dbi, ILI9341_PGAMMA, cfg->pgamma, in ili9341_dpi_init()
355 mipi_dbi_command_stackbuf(dbi, ILI9341_NGAMMA, cfg->ngamma, in ili9341_dpi_init()
367 struct device *dev = (&ili->panel)->dev; in ili9341_dpi_power_on()
371 gpiod_set_value(ili->reset_gpio, 1); in ili9341_dpi_power_on()
374 ret = regulator_bulk_enable(ARRAY_SIZE(ili->supplies), in ili9341_dpi_power_on()
375 ili->supplies); in ili9341_dpi_power_on()
382 /* De-assert RESET */ in ili9341_dpi_power_on()
383 gpiod_set_value(ili->reset_gpio, 0); in ili9341_dpi_power_on()
392 gpiod_set_value(ili->reset_gpio, 1); in ili9341_dpi_power_off()
395 return regulator_bulk_disable(ARRAY_SIZE(ili->supplies), in ili9341_dpi_power_off()
396 ili->supplies); in ili9341_dpi_power_off()
403 mipi_dbi_command(ili->dbi, MIPI_DCS_SET_DISPLAY_OFF); in ili9341_dpi_disable()
432 mipi_dbi_command(ili->dbi, MIPI_DCS_SET_DISPLAY_ON); in ili9341_dpi_enable()
440 struct drm_device *drm = connector->dev; in ili9341_dpi_get_modes()
444 info = &connector->display_info; in ili9341_dpi_get_modes()
445 info->width_mm = ili->conf->mode.width_mm; in ili9341_dpi_get_modes()
446 info->height_mm = ili->conf->mode.height_mm; in ili9341_dpi_get_modes()
448 if (ili->conf->rgb_interface & ILI9341_RGB_DPL) in ili9341_dpi_get_modes()
449 info->bus_flags |= DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE; in ili9341_dpi_get_modes()
451 info->bus_flags |= DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE; in ili9341_dpi_get_modes()
453 if (ili->conf->rgb_interface & ILI9341_RGB_EPL) in ili9341_dpi_get_modes()
454 info->bus_flags |= DRM_BUS_FLAG_DE_LOW; in ili9341_dpi_get_modes()
456 info->bus_flags |= DRM_BUS_FLAG_DE_HIGH; in ili9341_dpi_get_modes()
458 mode = drm_mode_duplicate(drm, &ili->conf->mode); in ili9341_dpi_get_modes()
461 return -EINVAL; in ili9341_dpi_get_modes()
466 if (ili->conf->rgb_interface & ILI9341_RGB_HSPL) in ili9341_dpi_get_modes()
467 mode->flags |= DRM_MODE_FLAG_PHSYNC; in ili9341_dpi_get_modes()
469 mode->flags |= DRM_MODE_FLAG_NHSYNC; in ili9341_dpi_get_modes()
471 if (ili->conf->rgb_interface & ILI9341_RGB_VSPL) in ili9341_dpi_get_modes()
472 mode->flags |= DRM_MODE_FLAG_PVSYNC; in ili9341_dpi_get_modes()
474 mode->flags |= DRM_MODE_FLAG_NVSYNC; in ili9341_dpi_get_modes()
493 struct mipi_dbi_dev *dbidev = drm_to_mipi_dbi_dev(pipe->crtc.dev); in ili9341_dbi_enable()
494 struct mipi_dbi *dbi = &dbidev->dbi; in ili9341_dbi_enable()
498 if (!drm_dev_enter(pipe->crtc.dev, &idx)) in ili9341_dbi_enable()
556 switch (dbidev->rotation) { in ili9341_dbi_enable()
575 drm_info(&dbidev->drm, "Initialized display serial interface\n"); in ili9341_dbi_enable()
605 struct device *dev = &spi->dev; in ili9341_dbi_probe()
624 dbi = &dbidev->dbi; in ili9341_dbi_probe()
625 drm = &dbidev->drm; in ili9341_dbi_probe()
626 dbi->reset = reset; in ili9341_dbi_probe()
627 dbidev->regulator = vcc; in ili9341_dbi_probe()
631 dbidev->backlight = devm_of_find_backlight(dev); in ili9341_dbi_probe()
632 if (IS_ERR(dbidev->backlight)) in ili9341_dbi_probe()
633 return PTR_ERR(dbidev->backlight); in ili9341_dbi_probe()
662 struct device *dev = &spi->dev; in ili9341_dpi_probe()
668 return -ENOMEM; in ili9341_dpi_probe()
670 ili->dbi = devm_kzalloc(dev, sizeof(struct mipi_dbi), in ili9341_dpi_probe()
672 if (!ili->dbi) in ili9341_dpi_probe()
673 return -ENOMEM; in ili9341_dpi_probe()
675 ili->supplies[0].supply = "vci"; in ili9341_dpi_probe()
676 ili->supplies[1].supply = "vddi"; in ili9341_dpi_probe()
677 ili->supplies[2].supply = "vddi-led"; in ili9341_dpi_probe()
678 ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(ili->supplies), in ili9341_dpi_probe()
679 ili->supplies); in ili9341_dpi_probe()
685 ret = mipi_dbi_spi_init(spi, ili->dbi, dc); in ili9341_dpi_probe()
690 ili->reset_gpio = reset; in ili9341_dpi_probe()
695 ili->conf = device_get_match_data(dev); in ili9341_dpi_probe()
696 if (!ili->conf) { in ili9341_dpi_probe()
698 return -ENODEV; in ili9341_dpi_probe()
701 ili->max_spi_speed = ili->conf->max_spi_speed; in ili9341_dpi_probe()
702 drm_panel_init(&ili->panel, dev, &ili9341_dpi_funcs, in ili9341_dpi_probe()
704 drm_panel_add(&ili->panel); in ili9341_dpi_probe()
711 struct device *dev = &spi->dev; in ili9341_probe()
724 if (!strcmp(id->name, "sf-tc240t-9370-t")) in ili9341_probe()
727 if (!strcmp(id->name, "yx240qv29")) in ili9341_probe()
730 return -ENODEV; in ili9341_probe()
739 if (!strcmp(id->name, "sf-tc240t-9370-t")) { in ili9341_remove()
741 drm_panel_remove(&ili->panel); in ili9341_remove()
742 } else if (!strcmp(id->name, "yx240qv29")) { in ili9341_remove()
752 if (!strcmp(id->name, "yx240qv29")) in ili9341_shutdown()
758 .compatible = "st,sf-tc240t-9370-t",
774 { "sf-tc240t-9370-t", 0 },
785 .name = "panel-ilitek-ili9341",