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
65 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in xpp055c272_init_sequence()
66 struct device *dev = ctx->dev; in xpp055c272_init_sequence()
136 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in xpp055c272_unprepare()
139 if (!ctx->prepared) in xpp055c272_unprepare()
144 dev_err(ctx->dev, "failed to set display off: %d\n", ret); in xpp055c272_unprepare()
148 dev_err(ctx->dev, "failed to enter sleep mode: %d\n", ret); in xpp055c272_unprepare()
152 regulator_disable(ctx->iovcc); in xpp055c272_unprepare()
153 regulator_disable(ctx->vci); in xpp055c272_unprepare()
155 ctx->prepared = false; in xpp055c272_unprepare()
163 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in xpp055c272_prepare()
166 if (ctx->prepared) in xpp055c272_prepare()
169 dev_dbg(ctx->dev, "Resetting the panel\n"); in xpp055c272_prepare()
170 ret = regulator_enable(ctx->vci); in xpp055c272_prepare()
172 dev_err(ctx->dev, "Failed to enable vci supply: %d\n", ret); in xpp055c272_prepare()
175 ret = regulator_enable(ctx->iovcc); in xpp055c272_prepare()
177 dev_err(ctx->dev, "Failed to enable iovcc supply: %d\n", ret); in xpp055c272_prepare()
181 gpiod_set_value_cansleep(ctx->reset_gpio, 1); in xpp055c272_prepare()
184 gpiod_set_value_cansleep(ctx->reset_gpio, 0); in xpp055c272_prepare()
191 dev_err(ctx->dev, "Panel init sequence failed: %d\n", ret); in xpp055c272_prepare()
197 dev_err(ctx->dev, "Failed to exit sleep mode: %d\n", ret); in xpp055c272_prepare()
206 dev_err(ctx->dev, "Failed to set display on: %d\n", ret); in xpp055c272_prepare()
212 ctx->prepared = true; in xpp055c272_prepare()
217 regulator_disable(ctx->iovcc); in xpp055c272_prepare()
219 regulator_disable(ctx->vci); in xpp055c272_prepare()
243 mode = drm_mode_duplicate(connector->dev, &default_mode); in xpp055c272_get_modes()
245 dev_err(ctx->dev, "Failed to add mode %ux%u@%u\n", in xpp055c272_get_modes()
248 return -ENOMEM; in xpp055c272_get_modes()
253 mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; in xpp055c272_get_modes()
254 connector->display_info.width_mm = mode->width_mm; in xpp055c272_get_modes()
255 connector->display_info.height_mm = mode->height_mm; in xpp055c272_get_modes()
269 struct device *dev = &dsi->dev; in xpp055c272_probe()
275 return -ENOMEM; in xpp055c272_probe()
277 ctx->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); in xpp055c272_probe()
278 if (IS_ERR(ctx->reset_gpio)) in xpp055c272_probe()
279 return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio), in xpp055c272_probe()
282 ctx->vci = devm_regulator_get(dev, "vci"); in xpp055c272_probe()
283 if (IS_ERR(ctx->vci)) in xpp055c272_probe()
284 return dev_err_probe(dev, PTR_ERR(ctx->vci), in xpp055c272_probe()
287 ctx->iovcc = devm_regulator_get(dev, "iovcc"); in xpp055c272_probe()
288 if (IS_ERR(ctx->iovcc)) in xpp055c272_probe()
289 return dev_err_probe(dev, PTR_ERR(ctx->iovcc), in xpp055c272_probe()
290 "Failed to request iovcc regulator\n"); in xpp055c272_probe()
294 ctx->dev = dev; in xpp055c272_probe()
296 dsi->lanes = 4; in xpp055c272_probe()
297 dsi->format = MIPI_DSI_FMT_RGB888; in xpp055c272_probe()
298 dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | in xpp055c272_probe()
301 drm_panel_init(&ctx->panel, &dsi->dev, &xpp055c272_funcs, in xpp055c272_probe()
304 ret = drm_panel_of_backlight(&ctx->panel); in xpp055c272_probe()
308 drm_panel_add(&ctx->panel); in xpp055c272_probe()
313 drm_panel_remove(&ctx->panel); in xpp055c272_probe()
325 ret = drm_panel_unprepare(&ctx->panel); in xpp055c272_shutdown()
327 dev_err(&dsi->dev, "Failed to unprepare panel: %d\n", ret); in xpp055c272_shutdown()
329 ret = drm_panel_disable(&ctx->panel); in xpp055c272_shutdown()
331 dev_err(&dsi->dev, "Failed to disable panel: %d\n", ret); in xpp055c272_shutdown()
343 dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret); in xpp055c272_remove()
345 drm_panel_remove(&ctx->panel); in xpp055c272_remove()
356 .name = "panel-xinpeng-xpp055c272",
365 MODULE_AUTHOR("Heiko Stuebner <heiko.stuebner@theobroma-systems.com>");