Lines Matching +full:iovcc +full:- +full:supply
1 // SPDX-License-Identifier: GPL-2.0
5 * - HannStar HSD060BHW4 5.99" MIPI-DSI panel
9 * Based on drivers/gpu/drm/panel/panel-sitronix-st7703.c
15 #include <linux/media-bus-format.h>
27 #define DRV_NAME "panel-himax-hx8394"
29 /* Manufacturer specific commands sent via DSI, listed in HX8394-F datasheet */
70 struct regulator *iovcc; member
91 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in hsd060bhw4_init_sequence()
152 /* Unknown command, not listed in the HX8394-F datasheet */ in hsd060bhw4_init_sequence()
160 /* Unknown command, not listed in the HX8394-F datasheet */ in hsd060bhw4_init_sequence()
176 /* Unknown command, not listed in the HX8394-F datasheet */ in hsd060bhw4_init_sequence()
209 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in hx8394_enable()
212 ret = ctx->desc->init_sequence(ctx); in hx8394_enable()
214 dev_err(ctx->dev, "Panel init sequence failed: %d\n", ret); in hx8394_enable()
220 dev_err(ctx->dev, "Failed to exit sleep mode: %d\n", ret); in hx8394_enable()
229 dev_err(ctx->dev, "Failed to turn on the display: %d\n", ret); in hx8394_enable()
246 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in hx8394_disable()
251 dev_err(ctx->dev, "Failed to enter sleep mode: %d\n", ret); in hx8394_disable()
264 if (!ctx->prepared) in hx8394_unprepare()
267 gpiod_set_value_cansleep(ctx->reset_gpio, 1); in hx8394_unprepare()
269 regulator_disable(ctx->iovcc); in hx8394_unprepare()
270 regulator_disable(ctx->vcc); in hx8394_unprepare()
272 ctx->prepared = false; in hx8394_unprepare()
282 if (ctx->prepared) in hx8394_prepare()
285 gpiod_set_value_cansleep(ctx->reset_gpio, 1); in hx8394_prepare()
287 ret = regulator_enable(ctx->vcc); in hx8394_prepare()
289 dev_err(ctx->dev, "Failed to enable vcc supply: %d\n", ret); in hx8394_prepare()
293 ret = regulator_enable(ctx->iovcc); in hx8394_prepare()
295 dev_err(ctx->dev, "Failed to enable iovcc supply: %d\n", ret); in hx8394_prepare()
299 gpiod_set_value_cansleep(ctx->reset_gpio, 0); in hx8394_prepare()
303 ctx->prepared = true; in hx8394_prepare()
308 gpiod_set_value_cansleep(ctx->reset_gpio, 1); in hx8394_prepare()
309 regulator_disable(ctx->vcc); in hx8394_prepare()
319 mode = drm_mode_duplicate(connector->dev, ctx->desc->mode); in hx8394_get_modes()
321 dev_err(ctx->dev, "Failed to add mode %ux%u@%u\n", in hx8394_get_modes()
322 ctx->desc->mode->hdisplay, ctx->desc->mode->vdisplay, in hx8394_get_modes()
323 drm_mode_vrefresh(ctx->desc->mode)); in hx8394_get_modes()
324 return -ENOMEM; in hx8394_get_modes()
329 mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; in hx8394_get_modes()
330 connector->display_info.width_mm = mode->width_mm; in hx8394_get_modes()
331 connector->display_info.height_mm = mode->height_mm; in hx8394_get_modes()
347 struct device *dev = &dsi->dev; in hx8394_probe()
353 return -ENOMEM; in hx8394_probe()
355 ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH); in hx8394_probe()
356 if (IS_ERR(ctx->reset_gpio)) in hx8394_probe()
357 return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio), in hx8394_probe()
362 ctx->dev = dev; in hx8394_probe()
363 ctx->desc = of_device_get_match_data(dev); in hx8394_probe()
365 dsi->mode_flags = ctx->desc->mode_flags; in hx8394_probe()
366 dsi->format = ctx->desc->format; in hx8394_probe()
367 dsi->lanes = ctx->desc->lanes; in hx8394_probe()
369 ctx->vcc = devm_regulator_get(dev, "vcc"); in hx8394_probe()
370 if (IS_ERR(ctx->vcc)) in hx8394_probe()
371 return dev_err_probe(dev, PTR_ERR(ctx->vcc), in hx8394_probe()
374 ctx->iovcc = devm_regulator_get(dev, "iovcc"); in hx8394_probe()
375 if (IS_ERR(ctx->iovcc)) in hx8394_probe()
376 return dev_err_probe(dev, PTR_ERR(ctx->iovcc), in hx8394_probe()
377 "Failed to request iovcc regulator\n"); in hx8394_probe()
379 drm_panel_init(&ctx->panel, dev, &hx8394_drm_funcs, in hx8394_probe()
382 ret = drm_panel_of_backlight(&ctx->panel); in hx8394_probe()
386 drm_panel_add(&ctx->panel); in hx8394_probe()
391 drm_panel_remove(&ctx->panel); in hx8394_probe()
395 dev_dbg(dev, "%ux%u@%u %ubpp dsi %udl - ready\n", in hx8394_probe()
396 ctx->desc->mode->hdisplay, ctx->desc->mode->vdisplay, in hx8394_probe()
397 drm_mode_vrefresh(ctx->desc->mode), in hx8394_probe()
398 mipi_dsi_pixel_format_to_bpp(dsi->format), dsi->lanes); in hx8394_probe()
408 ret = drm_panel_disable(&ctx->panel); in hx8394_shutdown()
410 dev_err(&dsi->dev, "Failed to disable panel: %d\n", ret); in hx8394_shutdown()
412 ret = drm_panel_unprepare(&ctx->panel); in hx8394_shutdown()
414 dev_err(&dsi->dev, "Failed to unprepare panel: %d\n", ret); in hx8394_shutdown()
426 dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret); in hx8394_remove()
428 drm_panel_remove(&ctx->panel); in hx8394_remove()