Lines Matching +full:vsn +full:- +full:supply
1 // SPDX-License-Identifier: GPL-2.0+
24 struct regulator *supply; member
54 /* VSN setting */
185 err = mipi_dsi_dcs_set_display_off(kingdisplay->link); in kingdisplay_panel_disable()
187 dev_err(panel->dev, "failed to set display off: %d\n", err); in kingdisplay_panel_disable()
197 err = mipi_dsi_dcs_enter_sleep_mode(kingdisplay->link); in kingdisplay_panel_unprepare()
199 dev_err(panel->dev, "failed to enter sleep mode: %d\n", err); in kingdisplay_panel_unprepare()
206 gpiod_set_value_cansleep(kingdisplay->enable_gpio, 0); in kingdisplay_panel_unprepare()
208 err = regulator_disable(kingdisplay->supply); in kingdisplay_panel_unprepare()
221 gpiod_set_value_cansleep(kingdisplay->enable_gpio, 0); in kingdisplay_panel_prepare()
223 err = regulator_enable(kingdisplay->supply); in kingdisplay_panel_prepare()
230 gpiod_set_value_cansleep(kingdisplay->enable_gpio, 1); in kingdisplay_panel_prepare()
236 err = mipi_dsi_generic_write(kingdisplay->link, &init_code[i], in kingdisplay_panel_prepare()
239 dev_err(panel->dev, "failed write init cmds: %d\n", err); in kingdisplay_panel_prepare()
244 err = mipi_dsi_dcs_exit_sleep_mode(kingdisplay->link); in kingdisplay_panel_prepare()
246 dev_err(panel->dev, "failed to exit sleep mode: %d\n", err); in kingdisplay_panel_prepare()
253 err = mipi_dsi_dcs_set_display_on(kingdisplay->link); in kingdisplay_panel_prepare()
255 dev_err(panel->dev, "failed to set display on: %d\n", err); in kingdisplay_panel_prepare()
265 gpiod_set_value_cansleep(kingdisplay->enable_gpio, 0); in kingdisplay_panel_prepare()
267 regulator_err = regulator_disable(kingdisplay->supply); in kingdisplay_panel_prepare()
269 dev_err(panel->dev, "failed to disable regulator: %d\n", regulator_err); in kingdisplay_panel_prepare()
291 mode = drm_mode_duplicate(connector->dev, &default_mode); in kingdisplay_panel_get_modes()
293 dev_err(panel->dev, "failed to add mode %ux%u@%u\n", in kingdisplay_panel_get_modes()
296 return -ENOMEM; in kingdisplay_panel_get_modes()
303 connector->display_info.width_mm = 147; in kingdisplay_panel_get_modes()
304 connector->display_info.height_mm = 196; in kingdisplay_panel_get_modes()
305 connector->display_info.bpc = 8; in kingdisplay_panel_get_modes()
325 struct device *dev = &kingdisplay->link->dev; in kingdisplay_panel_add()
328 kingdisplay->supply = devm_regulator_get(dev, "power"); in kingdisplay_panel_add()
329 if (IS_ERR(kingdisplay->supply)) in kingdisplay_panel_add()
330 return PTR_ERR(kingdisplay->supply); in kingdisplay_panel_add()
332 kingdisplay->enable_gpio = devm_gpiod_get_optional(dev, "enable", in kingdisplay_panel_add()
334 if (IS_ERR(kingdisplay->enable_gpio)) { in kingdisplay_panel_add()
335 err = PTR_ERR(kingdisplay->enable_gpio); in kingdisplay_panel_add()
337 kingdisplay->enable_gpio = NULL; in kingdisplay_panel_add()
340 drm_panel_init(&kingdisplay->base, &kingdisplay->link->dev, in kingdisplay_panel_add()
343 err = drm_panel_of_backlight(&kingdisplay->base); in kingdisplay_panel_add()
347 drm_panel_add(&kingdisplay->base); in kingdisplay_panel_add()
354 drm_panel_remove(&kingdisplay->base); in kingdisplay_panel_del()
362 dsi->lanes = 4; in kingdisplay_panel_probe()
363 dsi->format = MIPI_DSI_FMT_RGB888; in kingdisplay_panel_probe()
364 dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | in kingdisplay_panel_probe()
367 kingdisplay = devm_kzalloc(&dsi->dev, sizeof(*kingdisplay), GFP_KERNEL); in kingdisplay_panel_probe()
369 return -ENOMEM; in kingdisplay_panel_probe()
372 kingdisplay->link = dsi; in kingdisplay_panel_probe()
394 dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", err); in kingdisplay_panel_remove()
401 .name = "panel-kingdisplay-kd097d04",
409 MODULE_AUTHOR("Chris Zhong <zyw@rock-chips.com>");
410 MODULE_AUTHOR("Nickey Yang <nickey.yang@rock-chips.com>");