Lines Matching +full:panel +full:- +full:dsi

1 // SPDX-License-Identifier: GPL-2.0-only
7 * Based on AUO panel driver by Rob Clark <robdclark@gmail.com>
23 * When power is turned off to this panel a minimum off time of 500ms has to be
31 struct mipi_dsi_device *dsi; member
40 static inline struct wuxga_nt_panel *to_wuxga_nt_panel(struct drm_panel *panel) in to_wuxga_nt_panel() argument
42 return container_of(panel, struct wuxga_nt_panel, base); in to_wuxga_nt_panel()
47 return mipi_dsi_turn_on_peripheral(wuxga_nt->dsi); in wuxga_nt_panel_on()
50 static int wuxga_nt_panel_disable(struct drm_panel *panel) in wuxga_nt_panel_disable() argument
52 struct wuxga_nt_panel *wuxga_nt = to_wuxga_nt_panel(panel); in wuxga_nt_panel_disable()
54 return mipi_dsi_shutdown_peripheral(wuxga_nt->dsi); in wuxga_nt_panel_disable()
57 static int wuxga_nt_panel_unprepare(struct drm_panel *panel) in wuxga_nt_panel_unprepare() argument
59 struct wuxga_nt_panel *wuxga_nt = to_wuxga_nt_panel(panel); in wuxga_nt_panel_unprepare()
61 regulator_disable(wuxga_nt->supply); in wuxga_nt_panel_unprepare()
62 wuxga_nt->earliest_wake = ktime_add_ms(ktime_get_real(), MIN_POFF_MS); in wuxga_nt_panel_unprepare()
67 static int wuxga_nt_panel_prepare(struct drm_panel *panel) in wuxga_nt_panel_prepare() argument
69 struct wuxga_nt_panel *wuxga_nt = to_wuxga_nt_panel(panel); in wuxga_nt_panel_prepare()
74 * If the user re-enabled the panel before the required off-time then in wuxga_nt_panel_prepare()
75 * we need to wait the remaining period before re-enabling regulator in wuxga_nt_panel_prepare()
77 enablewait = ktime_ms_delta(wuxga_nt->earliest_wake, ktime_get_real()); in wuxga_nt_panel_prepare()
86 ret = regulator_enable(wuxga_nt->supply); in wuxga_nt_panel_prepare()
91 * A minimum delay of 250ms is required after power-up until commands in wuxga_nt_panel_prepare()
98 dev_err(panel->dev, "failed to set panel on: %d\n", ret); in wuxga_nt_panel_prepare()
105 regulator_disable(wuxga_nt->supply); in wuxga_nt_panel_prepare()
122 static int wuxga_nt_panel_get_modes(struct drm_panel *panel, in wuxga_nt_panel_get_modes() argument
127 mode = drm_mode_duplicate(connector->dev, &default_mode); in wuxga_nt_panel_get_modes()
129 dev_err(panel->dev, "failed to add mode %ux%u@%u\n", in wuxga_nt_panel_get_modes()
132 return -ENOMEM; in wuxga_nt_panel_get_modes()
139 connector->display_info.width_mm = 217; in wuxga_nt_panel_get_modes()
140 connector->display_info.height_mm = 136; in wuxga_nt_panel_get_modes()
160 struct device *dev = &wuxga_nt->dsi->dev; in wuxga_nt_panel_add()
163 wuxga_nt->mode = &default_mode; in wuxga_nt_panel_add()
165 wuxga_nt->supply = devm_regulator_get(dev, "power"); in wuxga_nt_panel_add()
166 if (IS_ERR(wuxga_nt->supply)) in wuxga_nt_panel_add()
167 return PTR_ERR(wuxga_nt->supply); in wuxga_nt_panel_add()
169 drm_panel_init(&wuxga_nt->base, &wuxga_nt->dsi->dev, in wuxga_nt_panel_add()
172 ret = drm_panel_of_backlight(&wuxga_nt->base); in wuxga_nt_panel_add()
176 drm_panel_add(&wuxga_nt->base); in wuxga_nt_panel_add()
183 if (wuxga_nt->base.dev) in wuxga_nt_panel_del()
184 drm_panel_remove(&wuxga_nt->base); in wuxga_nt_panel_del()
187 static int wuxga_nt_panel_probe(struct mipi_dsi_device *dsi) in wuxga_nt_panel_probe() argument
192 dsi->lanes = 4; in wuxga_nt_panel_probe()
193 dsi->format = MIPI_DSI_FMT_RGB888; in wuxga_nt_panel_probe()
194 dsi->mode_flags = MIPI_DSI_MODE_VIDEO | in wuxga_nt_panel_probe()
199 wuxga_nt = devm_kzalloc(&dsi->dev, sizeof(*wuxga_nt), GFP_KERNEL); in wuxga_nt_panel_probe()
201 return -ENOMEM; in wuxga_nt_panel_probe()
203 mipi_dsi_set_drvdata(dsi, wuxga_nt); in wuxga_nt_panel_probe()
205 wuxga_nt->dsi = dsi; in wuxga_nt_panel_probe()
211 ret = mipi_dsi_attach(dsi); in wuxga_nt_panel_probe()
220 static void wuxga_nt_panel_remove(struct mipi_dsi_device *dsi) in wuxga_nt_panel_remove() argument
222 struct wuxga_nt_panel *wuxga_nt = mipi_dsi_get_drvdata(dsi); in wuxga_nt_panel_remove()
225 ret = mipi_dsi_detach(dsi); in wuxga_nt_panel_remove()
227 dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", ret); in wuxga_nt_panel_remove()
234 .name = "panel-panasonic-vvx10f034n00",
243 MODULE_DESCRIPTION("Panasonic VVX10F034N00 Novatek NT1397-based WUXGA (1920x1200) video mode panel