• Home
  • Raw
  • Download

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

6  * Based on AUO panel driver by Rob Clark <robdclark@gmail.com>
34 * When power is turned off to this panel a minimum off time of 500ms has to be
42 struct mipi_dsi_device *dsi; member
55 static inline struct wuxga_nt_panel *to_wuxga_nt_panel(struct drm_panel *panel) in to_wuxga_nt_panel() argument
57 return container_of(panel, struct wuxga_nt_panel, base); in to_wuxga_nt_panel()
62 return mipi_dsi_turn_on_peripheral(wuxga_nt->dsi); in wuxga_nt_panel_on()
65 static int wuxga_nt_panel_disable(struct drm_panel *panel) in wuxga_nt_panel_disable() argument
67 struct wuxga_nt_panel *wuxga_nt = to_wuxga_nt_panel(panel); in wuxga_nt_panel_disable()
70 if (!wuxga_nt->enabled) in wuxga_nt_panel_disable()
73 mipi_ret = mipi_dsi_shutdown_peripheral(wuxga_nt->dsi); in wuxga_nt_panel_disable()
75 if (wuxga_nt->backlight) { in wuxga_nt_panel_disable()
76 wuxga_nt->backlight->props.power = FB_BLANK_POWERDOWN; in wuxga_nt_panel_disable()
77 wuxga_nt->backlight->props.state |= BL_CORE_FBBLANK; in wuxga_nt_panel_disable()
78 bl_ret = backlight_update_status(wuxga_nt->backlight); in wuxga_nt_panel_disable()
81 wuxga_nt->enabled = false; in wuxga_nt_panel_disable()
86 static int wuxga_nt_panel_unprepare(struct drm_panel *panel) in wuxga_nt_panel_unprepare() argument
88 struct wuxga_nt_panel *wuxga_nt = to_wuxga_nt_panel(panel); in wuxga_nt_panel_unprepare()
90 if (!wuxga_nt->prepared) in wuxga_nt_panel_unprepare()
93 regulator_disable(wuxga_nt->supply); in wuxga_nt_panel_unprepare()
94 wuxga_nt->earliest_wake = ktime_add_ms(ktime_get_real(), MIN_POFF_MS); in wuxga_nt_panel_unprepare()
95 wuxga_nt->prepared = false; in wuxga_nt_panel_unprepare()
100 static int wuxga_nt_panel_prepare(struct drm_panel *panel) in wuxga_nt_panel_prepare() argument
102 struct wuxga_nt_panel *wuxga_nt = to_wuxga_nt_panel(panel); in wuxga_nt_panel_prepare()
106 if (wuxga_nt->prepared) in wuxga_nt_panel_prepare()
110 * If the user re-enabled the panel before the required off-time then in wuxga_nt_panel_prepare()
111 * we need to wait the remaining period before re-enabling regulator in wuxga_nt_panel_prepare()
113 enablewait = ktime_ms_delta(wuxga_nt->earliest_wake, ktime_get_real()); in wuxga_nt_panel_prepare()
122 ret = regulator_enable(wuxga_nt->supply); in wuxga_nt_panel_prepare()
127 * A minimum delay of 250ms is required after power-up until commands in wuxga_nt_panel_prepare()
134 dev_err(panel->dev, "failed to set panel on: %d\n", ret); in wuxga_nt_panel_prepare()
138 wuxga_nt->prepared = true; in wuxga_nt_panel_prepare()
143 regulator_disable(wuxga_nt->supply); in wuxga_nt_panel_prepare()
148 static int wuxga_nt_panel_enable(struct drm_panel *panel) in wuxga_nt_panel_enable() argument
150 struct wuxga_nt_panel *wuxga_nt = to_wuxga_nt_panel(panel); in wuxga_nt_panel_enable()
152 if (wuxga_nt->enabled) in wuxga_nt_panel_enable()
155 if (wuxga_nt->backlight) { in wuxga_nt_panel_enable()
156 wuxga_nt->backlight->props.power = FB_BLANK_UNBLANK; in wuxga_nt_panel_enable()
157 wuxga_nt->backlight->props.state &= ~BL_CORE_FBBLANK; in wuxga_nt_panel_enable()
158 backlight_update_status(wuxga_nt->backlight); in wuxga_nt_panel_enable()
161 wuxga_nt->enabled = true; in wuxga_nt_panel_enable()
179 static int wuxga_nt_panel_get_modes(struct drm_panel *panel) in wuxga_nt_panel_get_modes() argument
183 mode = drm_mode_duplicate(panel->drm, &default_mode); in wuxga_nt_panel_get_modes()
185 dev_err(panel->drm->dev, "failed to add mode %ux%ux@%u\n", in wuxga_nt_panel_get_modes()
188 return -ENOMEM; in wuxga_nt_panel_get_modes()
193 drm_mode_probed_add(panel->connector, mode); in wuxga_nt_panel_get_modes()
195 panel->connector->display_info.width_mm = 217; in wuxga_nt_panel_get_modes()
196 panel->connector->display_info.height_mm = 136; in wuxga_nt_panel_get_modes()
217 struct device *dev = &wuxga_nt->dsi->dev; in wuxga_nt_panel_add()
221 wuxga_nt->mode = &default_mode; in wuxga_nt_panel_add()
223 wuxga_nt->supply = devm_regulator_get(dev, "power"); in wuxga_nt_panel_add()
224 if (IS_ERR(wuxga_nt->supply)) in wuxga_nt_panel_add()
225 return PTR_ERR(wuxga_nt->supply); in wuxga_nt_panel_add()
227 np = of_parse_phandle(dev->of_node, "backlight", 0); in wuxga_nt_panel_add()
229 wuxga_nt->backlight = of_find_backlight_by_node(np); in wuxga_nt_panel_add()
232 if (!wuxga_nt->backlight) in wuxga_nt_panel_add()
233 return -EPROBE_DEFER; in wuxga_nt_panel_add()
236 drm_panel_init(&wuxga_nt->base); in wuxga_nt_panel_add()
237 wuxga_nt->base.funcs = &wuxga_nt_panel_funcs; in wuxga_nt_panel_add()
238 wuxga_nt->base.dev = &wuxga_nt->dsi->dev; in wuxga_nt_panel_add()
240 ret = drm_panel_add(&wuxga_nt->base); in wuxga_nt_panel_add()
247 if (wuxga_nt->backlight) in wuxga_nt_panel_add()
248 put_device(&wuxga_nt->backlight->dev); in wuxga_nt_panel_add()
255 if (wuxga_nt->base.dev) in wuxga_nt_panel_del()
256 drm_panel_remove(&wuxga_nt->base); in wuxga_nt_panel_del()
258 if (wuxga_nt->backlight) in wuxga_nt_panel_del()
259 put_device(&wuxga_nt->backlight->dev); in wuxga_nt_panel_del()
262 static int wuxga_nt_panel_probe(struct mipi_dsi_device *dsi) in wuxga_nt_panel_probe() argument
267 dsi->lanes = 4; in wuxga_nt_panel_probe()
268 dsi->format = MIPI_DSI_FMT_RGB888; in wuxga_nt_panel_probe()
269 dsi->mode_flags = MIPI_DSI_MODE_VIDEO | in wuxga_nt_panel_probe()
274 wuxga_nt = devm_kzalloc(&dsi->dev, sizeof(*wuxga_nt), GFP_KERNEL); in wuxga_nt_panel_probe()
276 return -ENOMEM; in wuxga_nt_panel_probe()
278 mipi_dsi_set_drvdata(dsi, wuxga_nt); in wuxga_nt_panel_probe()
280 wuxga_nt->dsi = dsi; in wuxga_nt_panel_probe()
286 return mipi_dsi_attach(dsi); in wuxga_nt_panel_probe()
289 static int wuxga_nt_panel_remove(struct mipi_dsi_device *dsi) in wuxga_nt_panel_remove() argument
291 struct wuxga_nt_panel *wuxga_nt = mipi_dsi_get_drvdata(dsi); in wuxga_nt_panel_remove()
294 ret = wuxga_nt_panel_disable(&wuxga_nt->base); in wuxga_nt_panel_remove()
296 dev_err(&dsi->dev, "failed to disable panel: %d\n", ret); in wuxga_nt_panel_remove()
298 ret = mipi_dsi_detach(dsi); in wuxga_nt_panel_remove()
300 dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", ret); in wuxga_nt_panel_remove()
307 static void wuxga_nt_panel_shutdown(struct mipi_dsi_device *dsi) in wuxga_nt_panel_shutdown() argument
309 struct wuxga_nt_panel *wuxga_nt = mipi_dsi_get_drvdata(dsi); in wuxga_nt_panel_shutdown()
311 wuxga_nt_panel_disable(&wuxga_nt->base); in wuxga_nt_panel_shutdown()
316 .name = "panel-panasonic-vvx10f034n00",
326 MODULE_DESCRIPTION("Panasonic VVX10F034N00 Novatek NT1397-based WUXGA (1920x1200) video mode panel