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
64 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in kd35t133_init_sequence()
65 struct device *dev = ctx->dev; in kd35t133_init_sequence()
99 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in kd35t133_unprepare()
102 if (!ctx->prepared) in kd35t133_unprepare()
107 dev_err(ctx->dev, "failed to set display off: %d\n", ret); in kd35t133_unprepare()
111 dev_err(ctx->dev, "failed to enter sleep mode: %d\n", ret); in kd35t133_unprepare()
115 regulator_disable(ctx->iovcc); in kd35t133_unprepare()
116 regulator_disable(ctx->vdd); in kd35t133_unprepare()
118 ctx->prepared = false; in kd35t133_unprepare()
126 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in kd35t133_prepare()
129 if (ctx->prepared) in kd35t133_prepare()
132 dev_dbg(ctx->dev, "Resetting the panel\n"); in kd35t133_prepare()
133 ret = regulator_enable(ctx->vdd); in kd35t133_prepare()
135 dev_err(ctx->dev, "Failed to enable vdd supply: %d\n", ret); in kd35t133_prepare()
139 ret = regulator_enable(ctx->iovcc); in kd35t133_prepare()
141 dev_err(ctx->dev, "Failed to enable iovcc supply: %d\n", ret); in kd35t133_prepare()
147 gpiod_set_value_cansleep(ctx->reset_gpio, 1); in kd35t133_prepare()
149 gpiod_set_value_cansleep(ctx->reset_gpio, 0); in kd35t133_prepare()
155 dev_err(ctx->dev, "Failed to exit sleep mode: %d\n", ret); in kd35t133_prepare()
163 dev_err(ctx->dev, "Panel init sequence failed: %d\n", ret); in kd35t133_prepare()
169 dev_err(ctx->dev, "Failed to set display on: %d\n", ret); in kd35t133_prepare()
175 ctx->prepared = true; in kd35t133_prepare()
180 regulator_disable(ctx->iovcc); in kd35t133_prepare()
182 regulator_disable(ctx->vdd); in kd35t133_prepare()
206 mode = drm_mode_duplicate(connector->dev, &default_mode); in kd35t133_get_modes()
208 dev_err(ctx->dev, "Failed to add mode %ux%u@%u\n", in kd35t133_get_modes()
211 return -ENOMEM; in kd35t133_get_modes()
216 mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; in kd35t133_get_modes()
217 connector->display_info.width_mm = mode->width_mm; in kd35t133_get_modes()
218 connector->display_info.height_mm = mode->height_mm; in kd35t133_get_modes()
224 drm_connector_set_panel_orientation(connector, ctx->orientation); in kd35t133_get_modes()
233 return ctx->orientation; in kd35t133_get_orientation()
245 struct device *dev = &dsi->dev; in kd35t133_probe()
251 return -ENOMEM; in kd35t133_probe()
253 ctx->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); in kd35t133_probe()
254 if (IS_ERR(ctx->reset_gpio)) { in kd35t133_probe()
256 return PTR_ERR(ctx->reset_gpio); in kd35t133_probe()
259 ctx->vdd = devm_regulator_get(dev, "vdd"); in kd35t133_probe()
260 if (IS_ERR(ctx->vdd)) { in kd35t133_probe()
261 ret = PTR_ERR(ctx->vdd); in kd35t133_probe()
262 if (ret != -EPROBE_DEFER) in kd35t133_probe()
267 ctx->iovcc = devm_regulator_get(dev, "iovcc"); in kd35t133_probe()
268 if (IS_ERR(ctx->iovcc)) { in kd35t133_probe()
269 ret = PTR_ERR(ctx->iovcc); in kd35t133_probe()
270 if (ret != -EPROBE_DEFER) in kd35t133_probe()
271 dev_err(dev, "Failed to request iovcc regulator: %d\n", ret); in kd35t133_probe()
275 ret = of_drm_get_panel_orientation(dev->of_node, &ctx->orientation); in kd35t133_probe()
277 dev_err(dev, "%pOF: failed to get orientation %d\n", dev->of_node, ret); in kd35t133_probe()
283 ctx->dev = dev; in kd35t133_probe()
285 dsi->lanes = 1; in kd35t133_probe()
286 dsi->format = MIPI_DSI_FMT_RGB888; in kd35t133_probe()
287 dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | in kd35t133_probe()
291 drm_panel_init(&ctx->panel, &dsi->dev, &kd35t133_funcs, in kd35t133_probe()
294 ret = drm_panel_of_backlight(&ctx->panel); in kd35t133_probe()
298 drm_panel_add(&ctx->panel); in kd35t133_probe()
303 drm_panel_remove(&ctx->panel); in kd35t133_probe()
315 ret = drm_panel_unprepare(&ctx->panel); in kd35t133_shutdown()
317 dev_err(&dsi->dev, "Failed to unprepare panel: %d\n", ret); in kd35t133_shutdown()
319 ret = drm_panel_disable(&ctx->panel); in kd35t133_shutdown()
321 dev_err(&dsi->dev, "Failed to disable panel: %d\n", ret); in kd35t133_shutdown()
333 dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret); in kd35t133_remove()
335 drm_panel_remove(&ctx->panel); in kd35t133_remove()
346 .name = "panel-elida-kd35t133",
355 MODULE_AUTHOR("Heiko Stuebner <heiko.stuebner@theobroma-systems.com>");