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

1 // SPDX-License-Identifier: GPL-2.0
3 * Elida kd35t133 5.5" MIPI-DSI panel driver
8 * Rockteck jh057n00900 5.5" MIPI-DSI panel driver
14 #include <linux/media-bus-format.h>
44 struct regulator *iovcc; member
63 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in kd35t133_init_sequence()
64 struct device *dev = ctx->dev; in kd35t133_init_sequence()
98 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in kd35t133_unprepare()
101 if (!ctx->prepared) in kd35t133_unprepare()
106 dev_err(ctx->dev, "failed to set display off: %d\n", ret); in kd35t133_unprepare()
110 dev_err(ctx->dev, "failed to enter sleep mode: %d\n", ret); in kd35t133_unprepare()
114 regulator_disable(ctx->iovcc); in kd35t133_unprepare()
115 regulator_disable(ctx->vdd); in kd35t133_unprepare()
117 ctx->prepared = false; in kd35t133_unprepare()
125 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in kd35t133_prepare()
128 if (ctx->prepared) in kd35t133_prepare()
131 dev_dbg(ctx->dev, "Resetting the panel\n"); in kd35t133_prepare()
132 ret = regulator_enable(ctx->vdd); in kd35t133_prepare()
134 dev_err(ctx->dev, "Failed to enable vdd supply: %d\n", ret); in kd35t133_prepare()
138 ret = regulator_enable(ctx->iovcc); in kd35t133_prepare()
140 dev_err(ctx->dev, "Failed to enable iovcc supply: %d\n", ret); in kd35t133_prepare()
146 gpiod_set_value_cansleep(ctx->reset_gpio, 1); in kd35t133_prepare()
148 gpiod_set_value_cansleep(ctx->reset_gpio, 0); in kd35t133_prepare()
154 dev_err(ctx->dev, "Failed to exit sleep mode: %d\n", ret); in kd35t133_prepare()
162 dev_err(ctx->dev, "Panel init sequence failed: %d\n", ret); in kd35t133_prepare()
168 dev_err(ctx->dev, "Failed to set display on: %d\n", ret); in kd35t133_prepare()
174 ctx->prepared = true; in kd35t133_prepare()
179 regulator_disable(ctx->iovcc); in kd35t133_prepare()
181 regulator_disable(ctx->vdd); in kd35t133_prepare()
205 mode = drm_mode_duplicate(connector->dev, &default_mode); in kd35t133_get_modes()
207 dev_err(ctx->dev, "Failed to add mode %ux%u@%u\n", in kd35t133_get_modes()
210 return -ENOMEM; in kd35t133_get_modes()
215 mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; in kd35t133_get_modes()
216 connector->display_info.width_mm = mode->width_mm; in kd35t133_get_modes()
217 connector->display_info.height_mm = mode->height_mm; in kd35t133_get_modes()
231 struct device *dev = &dsi->dev; in kd35t133_probe()
237 return -ENOMEM; in kd35t133_probe()
239 ctx->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); in kd35t133_probe()
240 if (IS_ERR(ctx->reset_gpio)) { in kd35t133_probe()
242 return PTR_ERR(ctx->reset_gpio); in kd35t133_probe()
245 ctx->vdd = devm_regulator_get(dev, "vdd"); in kd35t133_probe()
246 if (IS_ERR(ctx->vdd)) { in kd35t133_probe()
247 ret = PTR_ERR(ctx->vdd); in kd35t133_probe()
248 if (ret != -EPROBE_DEFER) in kd35t133_probe()
253 ctx->iovcc = devm_regulator_get(dev, "iovcc"); in kd35t133_probe()
254 if (IS_ERR(ctx->iovcc)) { in kd35t133_probe()
255 ret = PTR_ERR(ctx->iovcc); in kd35t133_probe()
256 if (ret != -EPROBE_DEFER) in kd35t133_probe()
257 dev_err(dev, "Failed to request iovcc regulator: %d\n", ret); in kd35t133_probe()
263 ctx->dev = dev; in kd35t133_probe()
265 dsi->lanes = 1; in kd35t133_probe()
266 dsi->format = MIPI_DSI_FMT_RGB888; in kd35t133_probe()
267 dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | in kd35t133_probe()
270 drm_panel_init(&ctx->panel, &dsi->dev, &kd35t133_funcs, in kd35t133_probe()
273 ret = drm_panel_of_backlight(&ctx->panel); in kd35t133_probe()
277 drm_panel_add(&ctx->panel); in kd35t133_probe()
282 drm_panel_remove(&ctx->panel); in kd35t133_probe()
294 ret = drm_panel_unprepare(&ctx->panel); in kd35t133_shutdown()
296 dev_err(&dsi->dev, "Failed to unprepare panel: %d\n", ret); in kd35t133_shutdown()
298 ret = drm_panel_disable(&ctx->panel); in kd35t133_shutdown()
300 dev_err(&dsi->dev, "Failed to disable panel: %d\n", ret); in kd35t133_shutdown()
312 dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret); in kd35t133_remove()
314 drm_panel_remove(&ctx->panel); in kd35t133_remove()
327 .name = "panel-elida-kd35t133",
336 MODULE_AUTHOR("Heiko Stuebner <heiko.stuebner@theobroma-systems.com>");