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
56 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in kd35t133_init_sequence()
57 struct device *dev = ctx->dev; in kd35t133_init_sequence()
91 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in kd35t133_unprepare()
94 if (!ctx->prepared) in kd35t133_unprepare()
99 dev_err(ctx->dev, "failed to set display off: %d\n", ret); in kd35t133_unprepare()
103 dev_err(ctx->dev, "failed to enter sleep mode: %d\n", ret); in kd35t133_unprepare()
107 gpiod_set_value_cansleep(ctx->reset_gpio, 1); in kd35t133_unprepare()
109 regulator_disable(ctx->iovcc); in kd35t133_unprepare()
110 regulator_disable(ctx->vdd); in kd35t133_unprepare()
112 ctx->prepared = false; in kd35t133_unprepare()
120 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in kd35t133_prepare()
123 if (ctx->prepared) in kd35t133_prepare()
126 dev_dbg(ctx->dev, "Resetting the panel\n"); in kd35t133_prepare()
127 ret = regulator_enable(ctx->vdd); in kd35t133_prepare()
129 dev_err(ctx->dev, "Failed to enable vdd supply: %d\n", ret); in kd35t133_prepare()
133 ret = regulator_enable(ctx->iovcc); in kd35t133_prepare()
135 dev_err(ctx->dev, "Failed to enable iovcc supply: %d\n", ret); in kd35t133_prepare()
141 gpiod_set_value_cansleep(ctx->reset_gpio, 1); in kd35t133_prepare()
143 gpiod_set_value_cansleep(ctx->reset_gpio, 0); in kd35t133_prepare()
149 dev_err(ctx->dev, "Failed to exit sleep mode: %d\n", ret); in kd35t133_prepare()
157 dev_err(ctx->dev, "Panel init sequence failed: %d\n", ret); in kd35t133_prepare()
163 dev_err(ctx->dev, "Failed to set display on: %d\n", ret); in kd35t133_prepare()
169 ctx->prepared = true; in kd35t133_prepare()
174 regulator_disable(ctx->iovcc); in kd35t133_prepare()
176 regulator_disable(ctx->vdd); in kd35t133_prepare()
200 mode = drm_mode_duplicate(connector->dev, &default_mode); in kd35t133_get_modes()
202 dev_err(ctx->dev, "Failed to add mode %ux%u@%u\n", in kd35t133_get_modes()
205 return -ENOMEM; in kd35t133_get_modes()
210 mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; in kd35t133_get_modes()
211 connector->display_info.width_mm = mode->width_mm; in kd35t133_get_modes()
212 connector->display_info.height_mm = mode->height_mm; in kd35t133_get_modes()
218 drm_connector_set_panel_orientation(connector, ctx->orientation); in kd35t133_get_modes()
227 return ctx->orientation; in kd35t133_get_orientation()
239 struct device *dev = &dsi->dev; in kd35t133_probe()
245 return -ENOMEM; in kd35t133_probe()
247 ctx->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); in kd35t133_probe()
248 if (IS_ERR(ctx->reset_gpio)) { in kd35t133_probe()
250 return PTR_ERR(ctx->reset_gpio); in kd35t133_probe()
253 ctx->vdd = devm_regulator_get(dev, "vdd"); in kd35t133_probe()
254 if (IS_ERR(ctx->vdd)) { in kd35t133_probe()
255 ret = PTR_ERR(ctx->vdd); in kd35t133_probe()
256 if (ret != -EPROBE_DEFER) in kd35t133_probe()
261 ctx->iovcc = devm_regulator_get(dev, "iovcc"); in kd35t133_probe()
262 if (IS_ERR(ctx->iovcc)) { in kd35t133_probe()
263 ret = PTR_ERR(ctx->iovcc); in kd35t133_probe()
264 if (ret != -EPROBE_DEFER) in kd35t133_probe()
265 dev_err(dev, "Failed to request iovcc regulator: %d\n", ret); in kd35t133_probe()
269 ret = of_drm_get_panel_orientation(dev->of_node, &ctx->orientation); in kd35t133_probe()
271 dev_err(dev, "%pOF: failed to get orientation %d\n", dev->of_node, ret); in kd35t133_probe()
277 ctx->dev = dev; in kd35t133_probe()
279 dsi->lanes = 1; in kd35t133_probe()
280 dsi->format = MIPI_DSI_FMT_RGB888; in kd35t133_probe()
281 dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | in kd35t133_probe()
285 drm_panel_init(&ctx->panel, &dsi->dev, &kd35t133_funcs, in kd35t133_probe()
288 ret = drm_panel_of_backlight(&ctx->panel); in kd35t133_probe()
292 drm_panel_add(&ctx->panel); in kd35t133_probe()
297 drm_panel_remove(&ctx->panel); in kd35t133_probe()
309 ret = drm_panel_unprepare(&ctx->panel); in kd35t133_shutdown()
311 dev_err(&dsi->dev, "Failed to unprepare panel: %d\n", ret); in kd35t133_shutdown()
313 ret = drm_panel_disable(&ctx->panel); in kd35t133_shutdown()
315 dev_err(&dsi->dev, "Failed to disable panel: %d\n", ret); in kd35t133_shutdown()
327 dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret); in kd35t133_remove()
329 drm_panel_remove(&ctx->panel); in kd35t133_remove()
340 .name = "panel-elida-kd35t133",
349 MODULE_AUTHOR("Heiko Stuebner <heiko.stuebner@theobroma-systems.com>");