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

4  * SPDX-License-Identifier: Apache-2.0
24 * Manufacture command set pages are not described in the datasheet
30 /* CMD Mode switch, select manufacture command set page 0 */
77 /* VGMP/VGSP Voltage Control (select manufacture command set page 1 ) */
83 /* VGMP/VGSP Voltage Control (select manufacture command set page 2 ) */
89 /* VSR Command (select manufacture command set page 3 ) */
93 /* VSR1 Timing Set (select manufacture command set page 3 ) */
105 /* VSR2 Timing Set (select manufacture command set page 3 ) */
117 /* VSR3 Timing Set (select manufacture command set page 3 ) */
129 /* VSR4 Timing Set (select manufacture command set page 3 ) */
141 /* VSR5 Timing Set (select manufacture command set page 3 ) */
153 /* VSR6 Timing Set (select manufacture command set page 3 ) */
165 /* VSR Marping command (select manufacture command set page 3 ) */
173 /* Select manufacture command set page 4 */
174 /* ELVSS -2.4V(RT4723). 0x15: RT4723. 0x01: RT4723B. 0x17: STAM1332. */
180 /* Select user command set */
182 /* Set tearing effect signal to only output at V-blank*/
210 k_sem_give(&data->te_sem); in rm67162_te_isr_handler()
215 const struct rm67162_config *config = dev->config; in rm67162_init()
216 struct rm67162_data *data = dev->data; in rm67162_init()
223 mdev.data_lanes = config->num_of_lanes; in rm67162_init()
224 mdev.pixfmt = data->pixel_format; in rm67162_init()
226 ret = mipi_dsi_attach(config->mipi_dsi, config->channel, &mdev); in rm67162_init()
228 LOG_ERR("Could not attach to MIPI-DSI host"); in rm67162_init()
232 if (config->reset_gpio.port != NULL) { in rm67162_init()
233 ret = gpio_pin_configure_dt(&config->reset_gpio, GPIO_OUTPUT_INACTIVE); in rm67162_init()
241 * regulator init. Per datasheet, we must wait at least 10ms before in rm67162_init()
246 ret = gpio_pin_set_dt(&config->reset_gpio, 0); in rm67162_init()
253 gpio_pin_set_dt(&config->reset_gpio, 1); in rm67162_init()
260 * before sending additional commands. This delay can be 5msec in rm67162_init()
271 ret = mipi_dsi_dcs_write(config->mipi_dsi, config->channel, in rm67162_init()
279 if (data->pixel_format == MIPI_DSI_PIXFMT_RGB888) { in rm67162_init()
281 data->bytes_per_pixel = 3; in rm67162_init()
282 } else if (data->pixel_format == MIPI_DSI_PIXFMT_RGB565) { in rm67162_init()
284 data->bytes_per_pixel = 2; in rm67162_init()
288 return -ENOTSUP; in rm67162_init()
290 ret = mipi_dsi_dcs_write(config->mipi_dsi, config->channel, in rm67162_init()
296 /* Delay 50 ms before exiting sleep mode */ in rm67162_init()
298 ret = mipi_dsi_dcs_write(config->mipi_dsi, config->channel, in rm67162_init()
304 * We must wait 5 ms after exiting sleep mode before sending additional in rm67162_init()
305 * commands. If we intend to enter sleep mode, we must delay in rm67162_init()
306 * 120 ms before sending that command. To be safe, delay 150ms in rm67162_init()
311 if (config->bl_gpio.port != NULL) { in rm67162_init()
312 ret = gpio_pin_configure_dt(&config->bl_gpio, GPIO_OUTPUT_ACTIVE); in rm67162_init()
319 if (config->te_gpio.port != NULL) { in rm67162_init()
321 ret = gpio_pin_configure_dt(&config->te_gpio, GPIO_INPUT); in rm67162_init()
327 ret = gpio_pin_interrupt_configure_dt(&config->te_gpio, in rm67162_init()
335 gpio_init_callback(&data->te_gpio_cb, rm67162_te_isr_handler, in rm67162_init()
336 BIT(config->te_gpio.pin)); in rm67162_init()
337 ret = gpio_add_callback(config->te_gpio.port, &data->te_gpio_cb); in rm67162_init()
344 k_sem_init(&data->te_sem, 0, 1); in rm67162_init()
348 return mipi_dsi_dcs_write(config->mipi_dsi, config->channel, in rm67162_init()
356 const struct rm67162_config *config = dev->config; in rm67162_write_fb()
360 /* Note- we need to set custom flags on the DCS message, in rm67162_write_fb()
373 wlen = mipi_dsi_transfer(config->mipi_dsi, config->channel, &msg); in rm67162_write_fb()
379 len -= wlen; in rm67162_write_fb()
391 const struct rm67162_config *config = dev->config; in rm67162_write()
392 struct rm67162_data *data = dev->data; in rm67162_write()
399 LOG_DBG("W=%d, H=%d @%d,%d", desc->width, desc->height, x, y); in rm67162_write()
402 * RM67162 runs in MIPI DBI mode. This means we can use command mode in rm67162_write()
410 end = x + desc->width - 1; in rm67162_write()
414 ret = mipi_dsi_dcs_write(config->mipi_dsi, config->channel, in rm67162_write()
424 end = y + desc->height - 1; in rm67162_write()
428 ret = mipi_dsi_dcs_write(config->mipi_dsi, config->channel, in rm67162_write()
440 if (config->te_gpio.port != NULL) { in rm67162_write()
446 k_sem_take(&data->te_sem, K_FOREVER); in rm67162_write()
453 if (desc->pitch == desc->width) { in rm67162_write()
456 desc->height * desc->width * data->bytes_per_pixel); in rm67162_write()
459 for (h_idx = 0; h_idx < desc->height; h_idx++) { in rm67162_write()
461 desc->width * data->bytes_per_pixel); in rm67162_write()
464 src += data->bytes_per_pixel * (desc->pitch - desc->width); in rm67162_write()
474 const struct rm67162_config *config = dev->config; in rm67162_get_capabilities()
475 const struct rm67162_data *data = dev->data; in rm67162_get_capabilities()
478 capabilities->x_resolution = config->panel_width; in rm67162_get_capabilities()
479 capabilities->y_resolution = config->panel_height; in rm67162_get_capabilities()
480 capabilities->supported_pixel_formats = PIXEL_FORMAT_RGB_565 | in rm67162_get_capabilities()
482 switch (data->pixel_format) { in rm67162_get_capabilities()
484 capabilities->current_pixel_format = PIXEL_FORMAT_RGB_565; in rm67162_get_capabilities()
487 capabilities->current_pixel_format = PIXEL_FORMAT_RGB_888; in rm67162_get_capabilities()
494 capabilities->current_orientation = DISPLAY_ORIENTATION_ROTATED_90; in rm67162_get_capabilities()
499 const struct rm67162_config *config = dev->config; in rm67162_blanking_off()
501 if (config->bl_gpio.port != NULL) { in rm67162_blanking_off()
502 return gpio_pin_set_dt(&config->bl_gpio, 1); in rm67162_blanking_off()
504 return -ENOTSUP; in rm67162_blanking_off()
510 const struct rm67162_config *config = dev->config; in rm67162_blanking_on()
512 if (config->bl_gpio.port != NULL) { in rm67162_blanking_on()
513 return gpio_pin_set_dt(&config->bl_gpio, 0); in rm67162_blanking_on()
515 return -ENOTSUP; in rm67162_blanking_on()
522 const struct rm67162_config *config = dev->config; in rm67162_set_pixel_format()
523 struct rm67162_data *data = dev->data; in rm67162_set_pixel_format()
528 data->pixel_format = MIPI_DSI_PIXFMT_RGB565; in rm67162_set_pixel_format()
530 data->bytes_per_pixel = 2; in rm67162_set_pixel_format()
533 data->pixel_format = MIPI_DSI_PIXFMT_RGB888; in rm67162_set_pixel_format()
535 data->bytes_per_pixel = 3; in rm67162_set_pixel_format()
539 return -ENOTSUP; in rm67162_set_pixel_format()
541 return mipi_dsi_dcs_write(config->mipi_dsi, config->channel, in rm67162_set_pixel_format()
552 return -ENOTSUP; in rm67162_set_orientation()
560 const struct rm67162_config *config = dev->config; in rm67162_pm_action()
561 struct rm67162_data *data = dev->data; in rm67162_pm_action()
564 mdev.data_lanes = config->num_of_lanes; in rm67162_pm_action()
565 mdev.pixfmt = data->pixel_format; in rm67162_pm_action()
570 return mipi_dsi_detach(config->mipi_dsi, config->channel, &mdev); in rm67162_pm_action()
572 return mipi_dsi_attach(config->mipi_dsi, config->channel, &mdev); in rm67162_pm_action()
574 return -ENOTSUP; in rm67162_pm_action()