Lines Matching +full:avee +full:- +full:supply

1 // SPDX-License-Identifier: GPL-2.0-or-later
69 if (!innolux->enabled) in innolux_panel_disable()
72 innolux->enabled = false; in innolux_panel_disable()
82 if (!innolux->prepared) in innolux_panel_unprepare()
85 err = mipi_dsi_dcs_set_display_off(innolux->link); in innolux_panel_unprepare()
87 dev_err(panel->dev, "failed to set display off: %d\n", err); in innolux_panel_unprepare()
89 err = mipi_dsi_dcs_enter_sleep_mode(innolux->link); in innolux_panel_unprepare()
91 dev_err(panel->dev, "failed to enter sleep mode: %d\n", err); in innolux_panel_unprepare()
95 if (innolux->desc->sleep_mode_delay) in innolux_panel_unprepare()
96 msleep(innolux->desc->sleep_mode_delay); in innolux_panel_unprepare()
98 gpiod_set_value_cansleep(innolux->enable_gpio, 0); in innolux_panel_unprepare()
100 if (innolux->desc->power_down_delay) in innolux_panel_unprepare()
101 msleep(innolux->desc->power_down_delay); in innolux_panel_unprepare()
103 err = regulator_bulk_disable(innolux->desc->num_supplies, in innolux_panel_unprepare()
104 innolux->supplies); in innolux_panel_unprepare()
108 innolux->prepared = false; in innolux_panel_unprepare()
118 if (innolux->prepared) in innolux_panel_prepare()
121 gpiod_set_value_cansleep(innolux->enable_gpio, 0); in innolux_panel_prepare()
123 err = regulator_bulk_enable(innolux->desc->num_supplies, in innolux_panel_prepare()
124 innolux->supplies); in innolux_panel_prepare()
131 gpiod_set_value_cansleep(innolux->enable_gpio, 1); in innolux_panel_prepare()
136 if (innolux->desc->init_cmds) { in innolux_panel_prepare()
138 innolux->desc->init_cmds; in innolux_panel_prepare()
144 err = mipi_dsi_generic_write(innolux->link, cmd->data, in innolux_panel_prepare()
145 cmd->len); in innolux_panel_prepare()
147 dev_err(panel->dev, "failed to write command %u\n", i); in innolux_panel_prepare()
156 err = mipi_dsi_dcs_nop(innolux->link); in innolux_panel_prepare()
158 dev_err(panel->dev, "failed to send DCS nop: %d\n", err); in innolux_panel_prepare()
164 err = mipi_dsi_dcs_exit_sleep_mode(innolux->link); in innolux_panel_prepare()
166 dev_err(panel->dev, "failed to exit sleep mode: %d\n", err); in innolux_panel_prepare()
170 /* T6: 120ms - 1000ms*/ in innolux_panel_prepare()
173 err = mipi_dsi_dcs_set_display_on(innolux->link); in innolux_panel_prepare()
175 dev_err(panel->dev, "failed to set display on: %d\n", err); in innolux_panel_prepare()
182 innolux->prepared = true; in innolux_panel_prepare()
187 gpiod_set_value_cansleep(innolux->enable_gpio, 0); in innolux_panel_prepare()
188 regulator_bulk_disable(innolux->desc->num_supplies, innolux->supplies); in innolux_panel_prepare()
197 if (innolux->enabled) in innolux_panel_enable()
200 innolux->enabled = true; in innolux_panel_enable()
234 .power_down_delay = 80, /* T8: 80ms - 1000ms */
239 "avee",
256 * https://chromium-review.googlesource.com/c/chromiumos/third_party/coreboot/+/892065/
389 const struct drm_display_mode *m = innolux->desc->mode; in innolux_panel_get_modes()
392 mode = drm_mode_duplicate(connector->dev, m); in innolux_panel_get_modes()
394 dev_err(panel->dev, "failed to add mode %ux%u@%u\n", in innolux_panel_get_modes()
395 m->hdisplay, m->vdisplay, drm_mode_vrefresh(m)); in innolux_panel_get_modes()
396 return -ENOMEM; in innolux_panel_get_modes()
403 connector->display_info.width_mm = innolux->desc->size.width; in innolux_panel_get_modes()
404 connector->display_info.height_mm = innolux->desc->size.height; in innolux_panel_get_modes()
405 connector->display_info.bpc = innolux->desc->bpc; in innolux_panel_get_modes()
433 struct device *dev = &dsi->dev; in innolux_panel_add()
438 return -ENOMEM; in innolux_panel_add()
440 innolux->desc = desc; in innolux_panel_add()
442 innolux->supplies = devm_kcalloc(dev, desc->num_supplies, in innolux_panel_add()
443 sizeof(*innolux->supplies), in innolux_panel_add()
445 if (!innolux->supplies) in innolux_panel_add()
446 return -ENOMEM; in innolux_panel_add()
448 for (i = 0; i < desc->num_supplies; i++) in innolux_panel_add()
449 innolux->supplies[i].supply = desc->supply_names[i]; in innolux_panel_add()
451 err = devm_regulator_bulk_get(dev, desc->num_supplies, in innolux_panel_add()
452 innolux->supplies); in innolux_panel_add()
456 innolux->enable_gpio = devm_gpiod_get_optional(dev, "enable", in innolux_panel_add()
458 if (IS_ERR(innolux->enable_gpio)) { in innolux_panel_add()
459 err = PTR_ERR(innolux->enable_gpio); in innolux_panel_add()
461 innolux->enable_gpio = NULL; in innolux_panel_add()
464 drm_panel_init(&innolux->base, dev, &innolux_panel_funcs, in innolux_panel_add()
467 err = drm_panel_of_backlight(&innolux->base); in innolux_panel_add()
471 drm_panel_add(&innolux->base); in innolux_panel_add()
474 innolux->link = dsi; in innolux_panel_add()
481 drm_panel_remove(&innolux->base); in innolux_panel_del()
489 desc = of_device_get_match_data(&dsi->dev); in innolux_panel_probe()
490 dsi->mode_flags = desc->flags; in innolux_panel_probe()
491 dsi->format = desc->format; in innolux_panel_probe()
492 dsi->lanes = desc->lanes; in innolux_panel_probe()
506 err = drm_panel_unprepare(&innolux->base); in innolux_panel_remove()
508 dev_err(&dsi->dev, "failed to unprepare panel: %d\n", err); in innolux_panel_remove()
510 err = drm_panel_disable(&innolux->base); in innolux_panel_remove()
512 dev_err(&dsi->dev, "failed to disable panel: %d\n", err); in innolux_panel_remove()
516 dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", err); in innolux_panel_remove()
527 drm_panel_unprepare(&innolux->base); in innolux_panel_shutdown()
528 drm_panel_disable(&innolux->base); in innolux_panel_shutdown()
533 .name = "panel-innolux-p079zca",
542 MODULE_AUTHOR("Chris Zhong <zyw@rock-chips.com>");
543 MODULE_AUTHOR("Lin Huang <hl@rock-chips.com>");