Lines Matching +full:dsi +full:- +full:based
1 // SPDX-License-Identifier: GPL-2.0-only
7 * Based on AUO panel driver by Rob Clark <robdclark@gmail.com>
25 struct mipi_dsi_device *dsi; member
38 struct mipi_dsi_device *dsi = sharp_nt->dsi; in sharp_nt_panel_init() local
41 dsi->mode_flags |= MIPI_DSI_MODE_LPM; in sharp_nt_panel_init()
43 ret = mipi_dsi_dcs_exit_sleep_mode(dsi); in sharp_nt_panel_init()
49 /* Novatek two-lane operation */ in sharp_nt_panel_init()
50 ret = mipi_dsi_dcs_write(dsi, 0xae, (u8[]){ 0x03 }, 1); in sharp_nt_panel_init()
55 ret = mipi_dsi_dcs_set_pixel_format(dsi, MIPI_DCS_PIXEL_FMT_24BIT | in sharp_nt_panel_init()
65 struct mipi_dsi_device *dsi = sharp_nt->dsi; in sharp_nt_panel_on() local
68 dsi->mode_flags |= MIPI_DSI_MODE_LPM; in sharp_nt_panel_on()
70 ret = mipi_dsi_dcs_set_display_on(dsi); in sharp_nt_panel_on()
79 struct mipi_dsi_device *dsi = sharp_nt->dsi; in sharp_nt_panel_off() local
82 dsi->mode_flags &= ~MIPI_DSI_MODE_LPM; in sharp_nt_panel_off()
84 ret = mipi_dsi_dcs_set_display_off(dsi); in sharp_nt_panel_off()
88 ret = mipi_dsi_dcs_enter_sleep_mode(dsi); in sharp_nt_panel_off()
102 dev_err(panel->dev, "failed to set panel off: %d\n", ret); in sharp_nt_panel_unprepare()
106 regulator_disable(sharp_nt->supply); in sharp_nt_panel_unprepare()
107 if (sharp_nt->reset_gpio) in sharp_nt_panel_unprepare()
108 gpiod_set_value(sharp_nt->reset_gpio, 0); in sharp_nt_panel_unprepare()
118 ret = regulator_enable(sharp_nt->supply); in sharp_nt_panel_prepare()
124 if (sharp_nt->reset_gpio) { in sharp_nt_panel_prepare()
125 gpiod_set_value(sharp_nt->reset_gpio, 1); in sharp_nt_panel_prepare()
127 gpiod_set_value(sharp_nt->reset_gpio, 0); in sharp_nt_panel_prepare()
129 gpiod_set_value(sharp_nt->reset_gpio, 1); in sharp_nt_panel_prepare()
135 dev_err(panel->dev, "failed to init panel: %d\n", ret); in sharp_nt_panel_prepare()
141 dev_err(panel->dev, "failed to set panel on: %d\n", ret); in sharp_nt_panel_prepare()
148 regulator_disable(sharp_nt->supply); in sharp_nt_panel_prepare()
149 if (sharp_nt->reset_gpio) in sharp_nt_panel_prepare()
150 gpiod_set_value(sharp_nt->reset_gpio, 0); in sharp_nt_panel_prepare()
171 mode = drm_mode_duplicate(connector->dev, &default_mode); in sharp_nt_panel_get_modes()
173 dev_err(panel->dev, "failed to add mode %ux%u@%u\n", in sharp_nt_panel_get_modes()
176 return -ENOMEM; in sharp_nt_panel_get_modes()
183 connector->display_info.width_mm = 54; in sharp_nt_panel_get_modes()
184 connector->display_info.height_mm = 95; in sharp_nt_panel_get_modes()
197 struct device *dev = &sharp_nt->dsi->dev; in sharp_nt_panel_add()
200 sharp_nt->supply = devm_regulator_get(dev, "avdd"); in sharp_nt_panel_add()
201 if (IS_ERR(sharp_nt->supply)) in sharp_nt_panel_add()
202 return PTR_ERR(sharp_nt->supply); in sharp_nt_panel_add()
204 sharp_nt->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW); in sharp_nt_panel_add()
205 if (IS_ERR(sharp_nt->reset_gpio)) { in sharp_nt_panel_add()
206 dev_err(dev, "cannot get reset-gpios %ld\n", in sharp_nt_panel_add()
207 PTR_ERR(sharp_nt->reset_gpio)); in sharp_nt_panel_add()
208 sharp_nt->reset_gpio = NULL; in sharp_nt_panel_add()
210 gpiod_set_value(sharp_nt->reset_gpio, 0); in sharp_nt_panel_add()
213 drm_panel_init(&sharp_nt->base, &sharp_nt->dsi->dev, in sharp_nt_panel_add()
216 ret = drm_panel_of_backlight(&sharp_nt->base); in sharp_nt_panel_add()
220 drm_panel_add(&sharp_nt->base); in sharp_nt_panel_add()
227 if (sharp_nt->base.dev) in sharp_nt_panel_del()
228 drm_panel_remove(&sharp_nt->base); in sharp_nt_panel_del()
231 static int sharp_nt_panel_probe(struct mipi_dsi_device *dsi) in sharp_nt_panel_probe() argument
236 dsi->lanes = 2; in sharp_nt_panel_probe()
237 dsi->format = MIPI_DSI_FMT_RGB888; in sharp_nt_panel_probe()
238 dsi->mode_flags = MIPI_DSI_MODE_VIDEO | in sharp_nt_panel_probe()
244 sharp_nt = devm_kzalloc(&dsi->dev, sizeof(*sharp_nt), GFP_KERNEL); in sharp_nt_panel_probe()
246 return -ENOMEM; in sharp_nt_panel_probe()
248 mipi_dsi_set_drvdata(dsi, sharp_nt); in sharp_nt_panel_probe()
250 sharp_nt->dsi = dsi; in sharp_nt_panel_probe()
256 ret = mipi_dsi_attach(dsi); in sharp_nt_panel_probe()
265 static void sharp_nt_panel_remove(struct mipi_dsi_device *dsi) in sharp_nt_panel_remove() argument
267 struct sharp_nt_panel *sharp_nt = mipi_dsi_get_drvdata(dsi); in sharp_nt_panel_remove()
270 ret = mipi_dsi_detach(dsi); in sharp_nt_panel_remove()
272 dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", ret); in sharp_nt_panel_remove()
278 { .compatible = "sharp,ls043t1le01-qhd", },
285 .name = "panel-sharp-ls043t1le01-qhd",
294 MODULE_DESCRIPTION("Sharp LS043T1LE01 NT35565-based qHD (540x960) video mode panel driver");