Lines Matching +full:iovcc +full:- +full:supply

1 // SPDX-License-Identifier: GPL-2.0
3 * Xinpeng xpp055c272 5.5" MIPI-DSI panel driver
8 * Rockteck jh057n00900 5.5" MIPI-DSI panel driver
21 #include <linux/media-bus-format.h>
54 struct regulator *iovcc; member
73 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in xpp055c272_init_sequence()
74 struct device *dev = ctx->dev; in xpp055c272_init_sequence()
144 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in xpp055c272_unprepare()
147 if (!ctx->prepared) in xpp055c272_unprepare()
152 dev_err(ctx->dev, "failed to set display off: %d\n", ret); in xpp055c272_unprepare()
156 dev_err(ctx->dev, "failed to enter sleep mode: %d\n", ret); in xpp055c272_unprepare()
160 regulator_disable(ctx->iovcc); in xpp055c272_unprepare()
161 regulator_disable(ctx->vci); in xpp055c272_unprepare()
163 ctx->prepared = false; in xpp055c272_unprepare()
171 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in xpp055c272_prepare()
174 if (ctx->prepared) in xpp055c272_prepare()
177 dev_dbg(ctx->dev, "Resetting the panel\n"); in xpp055c272_prepare()
178 ret = regulator_enable(ctx->vci); in xpp055c272_prepare()
180 dev_err(ctx->dev, "Failed to enable vci supply: %d\n", ret); in xpp055c272_prepare()
183 ret = regulator_enable(ctx->iovcc); in xpp055c272_prepare()
185 dev_err(ctx->dev, "Failed to enable iovcc supply: %d\n", ret); in xpp055c272_prepare()
189 gpiod_set_value_cansleep(ctx->reset_gpio, 1); in xpp055c272_prepare()
192 gpiod_set_value_cansleep(ctx->reset_gpio, 0); in xpp055c272_prepare()
199 dev_err(ctx->dev, "Panel init sequence failed: %d\n", ret); in xpp055c272_prepare()
205 dev_err(ctx->dev, "Failed to exit sleep mode: %d\n", ret); in xpp055c272_prepare()
214 dev_err(ctx->dev, "Failed to set display on: %d\n", ret); in xpp055c272_prepare()
220 ctx->prepared = true; in xpp055c272_prepare()
225 regulator_disable(ctx->iovcc); in xpp055c272_prepare()
227 regulator_disable(ctx->vci); in xpp055c272_prepare()
251 mode = drm_mode_duplicate(connector->dev, &default_mode); in xpp055c272_get_modes()
253 dev_err(ctx->dev, "Failed to add mode %ux%u@%u\n", in xpp055c272_get_modes()
256 return -ENOMEM; in xpp055c272_get_modes()
261 mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; in xpp055c272_get_modes()
262 connector->display_info.width_mm = mode->width_mm; in xpp055c272_get_modes()
263 connector->display_info.height_mm = mode->height_mm; in xpp055c272_get_modes()
277 struct device *dev = &dsi->dev; in xpp055c272_probe()
283 return -ENOMEM; in xpp055c272_probe()
285 ctx->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); in xpp055c272_probe()
286 if (IS_ERR(ctx->reset_gpio)) { in xpp055c272_probe()
288 return PTR_ERR(ctx->reset_gpio); in xpp055c272_probe()
291 ctx->vci = devm_regulator_get(dev, "vci"); in xpp055c272_probe()
292 if (IS_ERR(ctx->vci)) { in xpp055c272_probe()
293 ret = PTR_ERR(ctx->vci); in xpp055c272_probe()
294 if (ret != -EPROBE_DEFER) in xpp055c272_probe()
299 ctx->iovcc = devm_regulator_get(dev, "iovcc"); in xpp055c272_probe()
300 if (IS_ERR(ctx->iovcc)) { in xpp055c272_probe()
301 ret = PTR_ERR(ctx->iovcc); in xpp055c272_probe()
302 if (ret != -EPROBE_DEFER) in xpp055c272_probe()
303 dev_err(dev, "Failed to request iovcc regulator: %d\n", ret); in xpp055c272_probe()
309 ctx->dev = dev; in xpp055c272_probe()
311 dsi->lanes = 4; in xpp055c272_probe()
312 dsi->format = MIPI_DSI_FMT_RGB888; in xpp055c272_probe()
313 dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | in xpp055c272_probe()
316 drm_panel_init(&ctx->panel, &dsi->dev, &xpp055c272_funcs, in xpp055c272_probe()
319 ret = drm_panel_of_backlight(&ctx->panel); in xpp055c272_probe()
323 drm_panel_add(&ctx->panel); in xpp055c272_probe()
328 drm_panel_remove(&ctx->panel); in xpp055c272_probe()
340 ret = drm_panel_unprepare(&ctx->panel); in xpp055c272_shutdown()
342 dev_err(&dsi->dev, "Failed to unprepare panel: %d\n", ret); in xpp055c272_shutdown()
344 ret = drm_panel_disable(&ctx->panel); in xpp055c272_shutdown()
346 dev_err(&dsi->dev, "Failed to disable panel: %d\n", ret); in xpp055c272_shutdown()
358 dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret); in xpp055c272_remove()
360 drm_panel_remove(&ctx->panel); in xpp055c272_remove()
373 .name = "panel-xinpeng-xpp055c272",
382 MODULE_AUTHOR("Heiko Stuebner <heiko.stuebner@theobroma-systems.com>");