Lines Matching +full:rm69299 +full:- +full:1080 +full:p +full:- +full:display

1 // SPDX-License-Identifier: GPL-2.0
36 ret = regulator_bulk_enable(ARRAY_SIZE(ctx->supplies), ctx->supplies); in visionox_rm69299_power_on()
45 gpiod_set_value(ctx->reset_gpio, 1); in visionox_rm69299_power_on()
47 gpiod_set_value(ctx->reset_gpio, 0); in visionox_rm69299_power_on()
49 gpiod_set_value(ctx->reset_gpio, 1); in visionox_rm69299_power_on()
57 gpiod_set_value(ctx->reset_gpio, 0); in visionox_rm69299_power_off()
59 return regulator_bulk_disable(ARRAY_SIZE(ctx->supplies), ctx->supplies); in visionox_rm69299_power_off()
67 ctx->dsi->mode_flags = 0; in visionox_rm69299_unprepare()
69 ret = mipi_dsi_dcs_write(ctx->dsi, MIPI_DCS_SET_DISPLAY_OFF, NULL, 0); in visionox_rm69299_unprepare()
71 dev_err(ctx->panel.dev, "set_display_off cmd failed ret = %d\n", ret); in visionox_rm69299_unprepare()
76 ret = mipi_dsi_dcs_write(ctx->dsi, MIPI_DCS_ENTER_SLEEP_MODE, NULL, 0); in visionox_rm69299_unprepare()
78 dev_err(ctx->panel.dev, "enter_sleep cmd failed ret = %d\n", ret); in visionox_rm69299_unprepare()
83 ctx->prepared = false; in visionox_rm69299_unprepare()
92 if (ctx->prepared) in visionox_rm69299_prepare()
99 ctx->dsi->mode_flags |= MIPI_DSI_MODE_LPM; in visionox_rm69299_prepare()
101 ret = mipi_dsi_dcs_write_buffer(ctx->dsi, (u8[]) { 0xfe, 0x00 }, 2); in visionox_rm69299_prepare()
103 dev_err(ctx->panel.dev, "cmd set tx 0 failed, ret = %d\n", ret); in visionox_rm69299_prepare()
107 ret = mipi_dsi_dcs_write_buffer(ctx->dsi, (u8[]) { 0xc2, 0x08 }, 2); in visionox_rm69299_prepare()
109 dev_err(ctx->panel.dev, "cmd set tx 1 failed, ret = %d\n", ret); in visionox_rm69299_prepare()
113 ret = mipi_dsi_dcs_write_buffer(ctx->dsi, (u8[]) { 0x35, 0x00 }, 2); in visionox_rm69299_prepare()
115 dev_err(ctx->panel.dev, "cmd set tx 2 failed, ret = %d\n", ret); in visionox_rm69299_prepare()
119 ret = mipi_dsi_dcs_write_buffer(ctx->dsi, (u8[]) { 0x51, 0xff }, 2); in visionox_rm69299_prepare()
121 dev_err(ctx->panel.dev, "cmd set tx 3 failed, ret = %d\n", ret); in visionox_rm69299_prepare()
125 ret = mipi_dsi_dcs_write(ctx->dsi, MIPI_DCS_EXIT_SLEEP_MODE, NULL, 0); in visionox_rm69299_prepare()
127 dev_err(ctx->panel.dev, "exit_sleep_mode cmd failed ret = %d\n", ret); in visionox_rm69299_prepare()
134 ret = mipi_dsi_dcs_write(ctx->dsi, MIPI_DCS_SET_DISPLAY_ON, NULL, 0); in visionox_rm69299_prepare()
136 dev_err(ctx->panel.dev, "set_display_on cmd failed ret = %d\n", ret); in visionox_rm69299_prepare()
143 ctx->prepared = true; in visionox_rm69299_prepare()
152 .name = "1080x2248",
154 .hdisplay = 1080,
155 .hsync_start = 1080 + 26,
156 .hsync_end = 1080 + 26 + 2,
157 .htotal = 1080 + 26 + 2 + 36,
171 mode = drm_mode_create(connector->dev); in visionox_rm69299_get_modes()
173 dev_err(ctx->panel.dev, "failed to create a new display mode\n"); in visionox_rm69299_get_modes()
177 connector->display_info.width_mm = 74; in visionox_rm69299_get_modes()
178 connector->display_info.height_mm = 131; in visionox_rm69299_get_modes()
180 mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; in visionox_rm69299_get_modes()
194 struct device *dev = &dsi->dev; in visionox_rm69299_probe()
200 return -ENOMEM; in visionox_rm69299_probe()
204 ctx->panel.dev = dev; in visionox_rm69299_probe()
205 ctx->dsi = dsi; in visionox_rm69299_probe()
207 ctx->supplies[0].supply = "vdda"; in visionox_rm69299_probe()
208 ctx->supplies[1].supply = "vdd3p3"; in visionox_rm69299_probe()
210 ret = devm_regulator_bulk_get(ctx->panel.dev, ARRAY_SIZE(ctx->supplies), in visionox_rm69299_probe()
211 ctx->supplies); in visionox_rm69299_probe()
215 ctx->reset_gpio = devm_gpiod_get(ctx->panel.dev, in visionox_rm69299_probe()
217 if (IS_ERR(ctx->reset_gpio)) { in visionox_rm69299_probe()
218 dev_err(dev, "cannot get reset gpio %ld\n", PTR_ERR(ctx->reset_gpio)); in visionox_rm69299_probe()
219 return PTR_ERR(ctx->reset_gpio); in visionox_rm69299_probe()
222 drm_panel_init(&ctx->panel, dev, &visionox_rm69299_drm_funcs, in visionox_rm69299_probe()
224 ctx->panel.dev = dev; in visionox_rm69299_probe()
225 ctx->panel.funcs = &visionox_rm69299_drm_funcs; in visionox_rm69299_probe()
226 drm_panel_add(&ctx->panel); in visionox_rm69299_probe()
228 dsi->lanes = 4; in visionox_rm69299_probe()
229 dsi->format = MIPI_DSI_FMT_RGB888; in visionox_rm69299_probe()
230 dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_LPM | in visionox_rm69299_probe()
238 ret = regulator_set_load(ctx->supplies[0].consumer, 32000); in visionox_rm69299_probe()
244 ret = regulator_set_load(ctx->supplies[1].consumer, 13200); in visionox_rm69299_probe()
255 drm_panel_remove(&ctx->panel); in visionox_rm69299_probe()
263 mipi_dsi_detach(ctx->dsi); in visionox_rm69299_remove()
264 mipi_dsi_device_unregister(ctx->dsi); in visionox_rm69299_remove()
266 drm_panel_remove(&ctx->panel); in visionox_rm69299_remove()
271 { .compatible = "visionox,rm69299-1080p-display", },
278 .name = "panel-visionox-rm69299",
286 MODULE_DESCRIPTION("Visionox RM69299 DSI Panel Driver");