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>
31 struct mipi_dsi_device *dsi; member
50 return mipi_dsi_turn_on_peripheral(wuxga_nt->dsi); in wuxga_nt_panel_on()
58 if (!wuxga_nt->enabled) in wuxga_nt_panel_disable()
61 mipi_ret = mipi_dsi_shutdown_peripheral(wuxga_nt->dsi); in wuxga_nt_panel_disable()
63 wuxga_nt->enabled = false; in wuxga_nt_panel_disable()
72 if (!wuxga_nt->prepared) in wuxga_nt_panel_unprepare()
75 regulator_disable(wuxga_nt->supply); in wuxga_nt_panel_unprepare()
76 wuxga_nt->earliest_wake = ktime_add_ms(ktime_get_real(), MIN_POFF_MS); in wuxga_nt_panel_unprepare()
77 wuxga_nt->prepared = false; in wuxga_nt_panel_unprepare()
88 if (wuxga_nt->prepared) in wuxga_nt_panel_prepare()
92 * If the user re-enabled the panel before the required off-time then in wuxga_nt_panel_prepare()
93 * we need to wait the remaining period before re-enabling regulator in wuxga_nt_panel_prepare()
95 enablewait = ktime_ms_delta(wuxga_nt->earliest_wake, ktime_get_real()); in wuxga_nt_panel_prepare()
104 ret = regulator_enable(wuxga_nt->supply); in wuxga_nt_panel_prepare()
109 * A minimum delay of 250ms is required after power-up until commands in wuxga_nt_panel_prepare()
116 dev_err(panel->dev, "failed to set panel on: %d\n", ret); in wuxga_nt_panel_prepare()
120 wuxga_nt->prepared = true; in wuxga_nt_panel_prepare()
125 regulator_disable(wuxga_nt->supply); in wuxga_nt_panel_prepare()
134 if (wuxga_nt->enabled) in wuxga_nt_panel_enable()
137 wuxga_nt->enabled = true; in wuxga_nt_panel_enable()
159 mode = drm_mode_duplicate(connector->dev, &default_mode); in wuxga_nt_panel_get_modes()
161 dev_err(panel->dev, "failed to add mode %ux%u@%u\n", in wuxga_nt_panel_get_modes()
164 return -ENOMEM; in wuxga_nt_panel_get_modes()
171 connector->display_info.width_mm = 217; in wuxga_nt_panel_get_modes()
172 connector->display_info.height_mm = 136; in wuxga_nt_panel_get_modes()
193 struct device *dev = &wuxga_nt->dsi->dev; in wuxga_nt_panel_add()
196 wuxga_nt->mode = &default_mode; in wuxga_nt_panel_add()
198 wuxga_nt->supply = devm_regulator_get(dev, "power"); in wuxga_nt_panel_add()
199 if (IS_ERR(wuxga_nt->supply)) in wuxga_nt_panel_add()
200 return PTR_ERR(wuxga_nt->supply); in wuxga_nt_panel_add()
202 drm_panel_init(&wuxga_nt->base, &wuxga_nt->dsi->dev, in wuxga_nt_panel_add()
205 ret = drm_panel_of_backlight(&wuxga_nt->base); in wuxga_nt_panel_add()
209 drm_panel_add(&wuxga_nt->base); in wuxga_nt_panel_add()
216 if (wuxga_nt->base.dev) in wuxga_nt_panel_del()
217 drm_panel_remove(&wuxga_nt->base); in wuxga_nt_panel_del()
220 static int wuxga_nt_panel_probe(struct mipi_dsi_device *dsi) in wuxga_nt_panel_probe() argument
225 dsi->lanes = 4; in wuxga_nt_panel_probe()
226 dsi->format = MIPI_DSI_FMT_RGB888; in wuxga_nt_panel_probe()
227 dsi->mode_flags = MIPI_DSI_MODE_VIDEO | in wuxga_nt_panel_probe()
232 wuxga_nt = devm_kzalloc(&dsi->dev, sizeof(*wuxga_nt), GFP_KERNEL); in wuxga_nt_panel_probe()
234 return -ENOMEM; in wuxga_nt_panel_probe()
236 mipi_dsi_set_drvdata(dsi, wuxga_nt); in wuxga_nt_panel_probe()
238 wuxga_nt->dsi = dsi; in wuxga_nt_panel_probe()
244 ret = mipi_dsi_attach(dsi); in wuxga_nt_panel_probe()
253 static void wuxga_nt_panel_remove(struct mipi_dsi_device *dsi) in wuxga_nt_panel_remove() argument
255 struct wuxga_nt_panel *wuxga_nt = mipi_dsi_get_drvdata(dsi); in wuxga_nt_panel_remove()
258 ret = drm_panel_disable(&wuxga_nt->base); in wuxga_nt_panel_remove()
260 dev_err(&dsi->dev, "failed to disable panel: %d\n", ret); in wuxga_nt_panel_remove()
262 ret = mipi_dsi_detach(dsi); in wuxga_nt_panel_remove()
264 dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", ret); in wuxga_nt_panel_remove()
269 static void wuxga_nt_panel_shutdown(struct mipi_dsi_device *dsi) in wuxga_nt_panel_shutdown() argument
271 struct wuxga_nt_panel *wuxga_nt = mipi_dsi_get_drvdata(dsi); in wuxga_nt_panel_shutdown()
273 drm_panel_disable(&wuxga_nt->base); in wuxga_nt_panel_shutdown()
278 .name = "panel-panasonic-vvx10f034n00",
288 MODULE_DESCRIPTION("Panasonic VVX10F034N00 Novatek NT1397-based WUXGA (1920x1200) video mode panel …