Lines Matching +full:reset +full:- +full:delay +full:- +full:ms

1 // SPDX-License-Identifier: GPL-2.0
6 #include <linux/delay.h>
34 ret = regulator_bulk_enable(ARRAY_SIZE(ctx->supplies), ctx->supplies); in visionox_rm69299_power_on()
39 * Reset sequence of visionox panel requires the panel to be in visionox_rm69299_power_on()
40 * out of reset for 10ms, followed by being held in reset in visionox_rm69299_power_on()
41 * for 10ms and then out again in visionox_rm69299_power_on()
43 gpiod_set_value(ctx->reset_gpio, 1); in visionox_rm69299_power_on()
45 gpiod_set_value(ctx->reset_gpio, 0); in visionox_rm69299_power_on()
47 gpiod_set_value(ctx->reset_gpio, 1); in visionox_rm69299_power_on()
55 gpiod_set_value(ctx->reset_gpio, 0); in visionox_rm69299_power_off()
57 return regulator_bulk_disable(ARRAY_SIZE(ctx->supplies), ctx->supplies); in visionox_rm69299_power_off()
65 ctx->dsi->mode_flags = 0; in visionox_rm69299_unprepare()
67 ret = mipi_dsi_dcs_write(ctx->dsi, MIPI_DCS_SET_DISPLAY_OFF, NULL, 0); in visionox_rm69299_unprepare()
69 dev_err(ctx->panel.dev, "set_display_off cmd failed ret = %d\n", ret); in visionox_rm69299_unprepare()
71 /* 120ms delay required here as per DCS spec */ in visionox_rm69299_unprepare()
74 ret = mipi_dsi_dcs_write(ctx->dsi, MIPI_DCS_ENTER_SLEEP_MODE, NULL, 0); in visionox_rm69299_unprepare()
76 dev_err(ctx->panel.dev, "enter_sleep cmd failed ret = %d\n", ret); in visionox_rm69299_unprepare()
93 ctx->dsi->mode_flags |= MIPI_DSI_MODE_LPM; in visionox_rm69299_prepare()
95 ret = mipi_dsi_dcs_write_buffer(ctx->dsi, (u8[]) { 0xfe, 0x00 }, 2); in visionox_rm69299_prepare()
97 dev_err(ctx->panel.dev, "cmd set tx 0 failed, ret = %d\n", ret); in visionox_rm69299_prepare()
101 ret = mipi_dsi_dcs_write_buffer(ctx->dsi, (u8[]) { 0xc2, 0x08 }, 2); in visionox_rm69299_prepare()
103 dev_err(ctx->panel.dev, "cmd set tx 1 failed, ret = %d\n", ret); in visionox_rm69299_prepare()
107 ret = mipi_dsi_dcs_write_buffer(ctx->dsi, (u8[]) { 0x35, 0x00 }, 2); in visionox_rm69299_prepare()
109 dev_err(ctx->panel.dev, "cmd set tx 2 failed, ret = %d\n", ret); in visionox_rm69299_prepare()
113 ret = mipi_dsi_dcs_write_buffer(ctx->dsi, (u8[]) { 0x51, 0xff }, 2); in visionox_rm69299_prepare()
115 dev_err(ctx->panel.dev, "cmd set tx 3 failed, ret = %d\n", ret); in visionox_rm69299_prepare()
119 ret = mipi_dsi_dcs_write(ctx->dsi, MIPI_DCS_EXIT_SLEEP_MODE, NULL, 0); in visionox_rm69299_prepare()
121 dev_err(ctx->panel.dev, "exit_sleep_mode cmd failed ret = %d\n", ret); in visionox_rm69299_prepare()
125 /* Per DSI spec wait 120ms after sending exit sleep DCS command */ in visionox_rm69299_prepare()
128 ret = mipi_dsi_dcs_write(ctx->dsi, MIPI_DCS_SET_DISPLAY_ON, NULL, 0); in visionox_rm69299_prepare()
130 dev_err(ctx->panel.dev, "set_display_on cmd failed ret = %d\n", ret); in visionox_rm69299_prepare()
134 /* Per DSI spec wait 120ms after sending set_display_on DCS command */ in visionox_rm69299_prepare()
163 mode = drm_mode_duplicate(connector->dev, in visionox_rm69299_get_modes()
166 dev_err(ctx->panel.dev, "failed to create a new display mode\n"); in visionox_rm69299_get_modes()
170 connector->display_info.width_mm = 74; in visionox_rm69299_get_modes()
171 connector->display_info.height_mm = 131; in visionox_rm69299_get_modes()
172 mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; in visionox_rm69299_get_modes()
186 struct device *dev = &dsi->dev; in visionox_rm69299_probe()
192 return -ENOMEM; in visionox_rm69299_probe()
196 ctx->panel.dev = dev; in visionox_rm69299_probe()
197 ctx->dsi = dsi; in visionox_rm69299_probe()
199 ctx->supplies[0].supply = "vdda"; in visionox_rm69299_probe()
200 ctx->supplies[0].init_load_uA = 32000; in visionox_rm69299_probe()
201 ctx->supplies[1].supply = "vdd3p3"; in visionox_rm69299_probe()
202 ctx->supplies[1].init_load_uA = 13200; in visionox_rm69299_probe()
204 ret = devm_regulator_bulk_get(ctx->panel.dev, ARRAY_SIZE(ctx->supplies), in visionox_rm69299_probe()
205 ctx->supplies); in visionox_rm69299_probe()
209 ctx->reset_gpio = devm_gpiod_get(ctx->panel.dev, in visionox_rm69299_probe()
210 "reset", GPIOD_OUT_LOW); in visionox_rm69299_probe()
211 if (IS_ERR(ctx->reset_gpio)) { in visionox_rm69299_probe()
212 dev_err(dev, "cannot get reset gpio %ld\n", PTR_ERR(ctx->reset_gpio)); in visionox_rm69299_probe()
213 return PTR_ERR(ctx->reset_gpio); in visionox_rm69299_probe()
216 drm_panel_init(&ctx->panel, dev, &visionox_rm69299_drm_funcs, in visionox_rm69299_probe()
218 ctx->panel.dev = dev; in visionox_rm69299_probe()
219 ctx->panel.funcs = &visionox_rm69299_drm_funcs; in visionox_rm69299_probe()
220 drm_panel_add(&ctx->panel); in visionox_rm69299_probe()
222 dsi->lanes = 4; in visionox_rm69299_probe()
223 dsi->format = MIPI_DSI_FMT_RGB888; in visionox_rm69299_probe()
224 dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_LPM | in visionox_rm69299_probe()
235 drm_panel_remove(&ctx->panel); in visionox_rm69299_probe()
243 mipi_dsi_detach(ctx->dsi); in visionox_rm69299_remove()
244 drm_panel_remove(&ctx->panel); in visionox_rm69299_remove()
248 { .compatible = "visionox,rm69299-1080p-display", },
255 .name = "panel-visionox-rm69299",