Lines Matching +full:fhd +full:- +full:video

1 // SPDX-License-Identifier: GPL-2.0+
8 * Currently supported are the Tianma FHD+ panels found in some Xiaomi phones, including
11 * Panels using the Novatek NT37762A IC should add appropriate configuration per-panel and
29 #include <video/mipi_display.h>
92 err = mipi_dsi_dcs_write(pinfo->link, cmd->data[0], cmd->data + 1, 1); in nt36672a_send_cmds()
106 gpiod_set_value(pinfo->reset_gpio, 1); in nt36672a_panel_power_off()
108 ret = regulator_bulk_disable(ARRAY_SIZE(pinfo->supplies), pinfo->supplies); in nt36672a_panel_power_off()
110 dev_err(panel->dev, "regulator_bulk_disable failed %d\n", ret); in nt36672a_panel_power_off()
121 ret = nt36672a_send_cmds(panel, pinfo->desc->off_cmds, in nt36672a_panel_unprepare()
122 pinfo->desc->num_off_cmds); in nt36672a_panel_unprepare()
125 dev_err(panel->dev, "failed to send DCS off cmds: %d\n", ret); in nt36672a_panel_unprepare()
127 ret = mipi_dsi_dcs_set_display_off(pinfo->link); in nt36672a_panel_unprepare()
129 dev_err(panel->dev, "set_display_off cmd failed ret = %d\n", ret); in nt36672a_panel_unprepare()
134 ret = mipi_dsi_dcs_enter_sleep_mode(pinfo->link); in nt36672a_panel_unprepare()
136 dev_err(panel->dev, "enter_sleep cmd failed ret = %d\n", ret); in nt36672a_panel_unprepare()
143 dev_err(panel->dev, "power_off failed ret = %d\n", ret); in nt36672a_panel_unprepare()
152 ret = regulator_bulk_enable(ARRAY_SIZE(pinfo->supplies), pinfo->supplies); in nt36672a_panel_power_on()
157 * As per downstream kernel, Reset sequence of Tianma FHD panel requires the panel to in nt36672a_panel_power_on()
162 gpiod_set_value(pinfo->reset_gpio, 1); in nt36672a_panel_power_on()
164 gpiod_set_value(pinfo->reset_gpio, 0); in nt36672a_panel_power_on()
180 err = nt36672a_send_cmds(panel, pinfo->desc->on_cmds_1, in nt36672a_panel_prepare()
181 pinfo->desc->num_on_cmds_1); in nt36672a_panel_prepare()
184 dev_err(panel->dev, "failed to send DCS Init 1st Code: %d\n", err); in nt36672a_panel_prepare()
188 err = mipi_dsi_dcs_exit_sleep_mode(pinfo->link); in nt36672a_panel_prepare()
190 dev_err(panel->dev, "failed to exit sleep mode: %d\n", err); in nt36672a_panel_prepare()
197 err = mipi_dsi_dcs_set_display_on(pinfo->link); in nt36672a_panel_prepare()
199 dev_err(panel->dev, "failed to Set Display ON: %d\n", err); in nt36672a_panel_prepare()
204 err = nt36672a_send_cmds(panel, pinfo->desc->on_cmds_2, in nt36672a_panel_prepare()
205 pinfo->desc->num_on_cmds_2); in nt36672a_panel_prepare()
208 dev_err(panel->dev, "failed to send DCS Init 2nd Code: %d\n", err); in nt36672a_panel_prepare()
217 gpiod_set_value(pinfo->reset_gpio, 0); in nt36672a_panel_prepare()
225 const struct drm_display_mode *m = pinfo->desc->display_mode; in nt36672a_panel_get_modes()
228 mode = drm_mode_duplicate(connector->dev, m); in nt36672a_panel_get_modes()
230 dev_err(panel->dev, "failed to add mode %ux%u@%u\n", m->hdisplay, in nt36672a_panel_get_modes()
231 m->vdisplay, drm_mode_vrefresh(m)); in nt36672a_panel_get_modes()
232 return -ENOMEM; in nt36672a_panel_get_modes()
235 connector->display_info.width_mm = pinfo->desc->width_mm; in nt36672a_panel_get_modes()
236 connector->display_info.height_mm = pinfo->desc->height_mm; in nt36672a_panel_get_modes()
593 struct device *dev = &pinfo->link->dev; in nt36672a_panel_add()
596 for (i = 0; i < ARRAY_SIZE(pinfo->supplies); i++) { in nt36672a_panel_add()
597 pinfo->supplies[i].supply = nt36672a_regulator_names[i]; in nt36672a_panel_add()
598 pinfo->supplies[i].init_load_uA = nt36672a_regulator_enable_loads[i]; in nt36672a_panel_add()
601 ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(pinfo->supplies), in nt36672a_panel_add()
602 pinfo->supplies); in nt36672a_panel_add()
606 pinfo->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW); in nt36672a_panel_add()
607 if (IS_ERR(pinfo->reset_gpio)) in nt36672a_panel_add()
608 return dev_err_probe(dev, PTR_ERR(pinfo->reset_gpio), in nt36672a_panel_add()
611 drm_panel_init(&pinfo->base, dev, &panel_funcs, DRM_MODE_CONNECTOR_DSI); in nt36672a_panel_add()
613 ret = drm_panel_of_backlight(&pinfo->base); in nt36672a_panel_add()
617 drm_panel_add(&pinfo->base); in nt36672a_panel_add()
628 pinfo = devm_kzalloc(&dsi->dev, sizeof(*pinfo), GFP_KERNEL); in nt36672a_panel_probe()
630 return -ENOMEM; in nt36672a_panel_probe()
632 desc = of_device_get_match_data(&dsi->dev); in nt36672a_panel_probe()
633 dsi->mode_flags = desc->mode_flags; in nt36672a_panel_probe()
634 dsi->format = desc->format; in nt36672a_panel_probe()
635 dsi->lanes = desc->lanes; in nt36672a_panel_probe()
636 pinfo->desc = desc; in nt36672a_panel_probe()
637 pinfo->link = dsi; in nt36672a_panel_probe()
647 drm_panel_remove(&pinfo->base); in nt36672a_panel_probe()
661 dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", err); in nt36672a_panel_remove()
663 drm_panel_remove(&pinfo->base); in nt36672a_panel_remove()
667 { .compatible = "tianma,fhd-video", .data = &tianma_fhd_video_panel_desc },
674 .name = "panel-tianma-nt36672a",
683 MODULE_DESCRIPTION("NOVATEK NT36672A based MIPI-DSI LCD panel driver");