Lines Matching +full:init +full:- +full:delay
1 // SPDX-License-Identifier: GPL-2.0
6 #include <linux/delay.h>
29 .delay = (_delay), \
37 u32 delay; member
42 const struct ili9805_instr *init; member
126 struct mipi_dsi_device *dsi = ctx->dsi; in ili9805_power_on()
127 struct device *dev = &dsi->dev; in ili9805_power_on()
130 ret = regulator_enable(ctx->avdd); in ili9805_power_on()
136 ret = regulator_enable(ctx->dvdd); in ili9805_power_on()
139 regulator_disable(ctx->avdd); in ili9805_power_on()
143 gpiod_set_value(ctx->reset_gpio, 0); in ili9805_power_on()
145 gpiod_set_value(ctx->reset_gpio, 1); in ili9805_power_on()
153 gpiod_set_value(ctx->reset_gpio, 0); in ili9805_power_off()
154 regulator_disable(ctx->dvdd); in ili9805_power_off()
155 regulator_disable(ctx->avdd); in ili9805_power_off()
162 struct mipi_dsi_device *dsi = ctx->dsi; in ili9805_activate()
163 struct device *dev = &dsi->dev; in ili9805_activate()
166 for (i = 0; i < ctx->desc->init_length; i++) { in ili9805_activate()
167 const struct ili9805_instr *instr = &ctx->desc->init[i]; in ili9805_activate()
169 ret = mipi_dsi_dcs_write_buffer(ctx->dsi, instr->data, instr->len); in ili9805_activate()
173 if (instr->delay > 0) in ili9805_activate()
174 msleep(instr->delay); in ili9805_activate()
177 ret = mipi_dsi_dcs_exit_sleep_mode(ctx->dsi); in ili9805_activate()
185 ret = mipi_dsi_dcs_set_display_on(ctx->dsi); in ili9805_activate()
214 struct mipi_dsi_device *dsi = ctx->dsi; in ili9805_deactivate()
215 struct device *dev = &dsi->dev; in ili9805_deactivate()
218 ret = mipi_dsi_dcs_set_display_off(ctx->dsi); in ili9805_deactivate()
226 ret = mipi_dsi_dcs_enter_sleep_mode(ctx->dsi); in ili9805_deactivate()
279 mode = drm_mode_duplicate(connector->dev, ctx->desc->mode); in ili9805_get_modes()
281 dev_err(&ctx->dsi->dev, "failed to add mode %ux%ux@%u\n", in ili9805_get_modes()
282 ctx->desc->mode->hdisplay, in ili9805_get_modes()
283 ctx->desc->mode->vdisplay, in ili9805_get_modes()
284 drm_mode_vrefresh(ctx->desc->mode)); in ili9805_get_modes()
285 return -ENOMEM; in ili9805_get_modes()
290 mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; in ili9805_get_modes()
293 connector->display_info.width_mm = mode->width_mm; in ili9805_get_modes()
294 connector->display_info.height_mm = mode->height_mm; in ili9805_get_modes()
310 ctx = devm_kzalloc(&dsi->dev, sizeof(*ctx), GFP_KERNEL); in ili9805_dsi_probe()
312 return -ENOMEM; in ili9805_dsi_probe()
314 ctx->dsi = dsi; in ili9805_dsi_probe()
315 ctx->desc = of_device_get_match_data(&dsi->dev); in ili9805_dsi_probe()
317 dsi->format = MIPI_DSI_FMT_RGB888; in ili9805_dsi_probe()
318 dsi->mode_flags = MIPI_DSI_MODE_VIDEO_HSE | MIPI_DSI_MODE_VIDEO | in ili9805_dsi_probe()
321 dsi->lanes = 2; in ili9805_dsi_probe()
323 drm_panel_init(&ctx->panel, &dsi->dev, &ili9805_funcs, in ili9805_dsi_probe()
326 ctx->dvdd = devm_regulator_get(&dsi->dev, "dvdd"); in ili9805_dsi_probe()
327 if (IS_ERR(ctx->dvdd)) in ili9805_dsi_probe()
328 return PTR_ERR(ctx->dvdd); in ili9805_dsi_probe()
329 ctx->avdd = devm_regulator_get(&dsi->dev, "avdd"); in ili9805_dsi_probe()
330 if (IS_ERR(ctx->avdd)) in ili9805_dsi_probe()
331 return PTR_ERR(ctx->avdd); in ili9805_dsi_probe()
333 ctx->reset_gpio = devm_gpiod_get(&dsi->dev, "reset", GPIOD_OUT_LOW); in ili9805_dsi_probe()
334 if (IS_ERR(ctx->reset_gpio)) { in ili9805_dsi_probe()
335 dev_err(&dsi->dev, "Couldn't get our reset GPIO\n"); in ili9805_dsi_probe()
336 return PTR_ERR(ctx->reset_gpio); in ili9805_dsi_probe()
339 ctx->panel.prepare_prev_first = true; in ili9805_dsi_probe()
340 ret = drm_panel_of_backlight(&ctx->panel); in ili9805_dsi_probe()
344 drm_panel_add(&ctx->panel); in ili9805_dsi_probe()
348 dev_err(&dsi->dev, "mipi_dsi_attach failed: %d\n", ret); in ili9805_dsi_probe()
349 drm_panel_remove(&ctx->panel); in ili9805_dsi_probe()
363 dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", in ili9805_dsi_remove()
366 drm_panel_remove(&ctx->panel); in ili9805_dsi_remove()
370 .init = gpm1780a0_init,
378 .init = tm041xdhg01_init,
396 .name = "ili9805-dsi",