Lines Matching +full:mipi +full:- +full:cpol
4 * SPDX-License-Identifier: Apache-2.0
100 struct mipi_dbi_smartbond_data *data = dev->data; in mipi_dbi_smartbond_send_single_frame()
108 k_sem_take(&data->sync_sem, K_FOREVER); in mipi_dbi_smartbond_send_single_frame()
111 LCDC->LCDC_INTERRUPT_REG |= LCDC_LCDC_INTERRUPT_REG_LCDC_VSYNC_IRQ_EN_Msk; in mipi_dbi_smartbond_send_single_frame()
114 LCDC->LCDC_MODE_REG |= LCDC_LCDC_MODE_REG_LCDC_SFRAME_UPD_Msk; in mipi_dbi_smartbond_send_single_frame()
117 k_sem_take(&data->sync_sem, K_FOREVER); in mipi_dbi_smartbond_send_single_frame()
119 if (data->underflow_flag) { in mipi_dbi_smartbond_send_single_frame()
121 data->underflow_flag = false; in mipi_dbi_smartbond_send_single_frame()
128 const struct mipi_dbi_smartbond_config *config = dev->config; in mipi_dbi_smartbond_reset()
131 if (!gpio_is_ready_dt(&config->reset)) { in mipi_dbi_smartbond_reset()
133 return -ENODEV; in mipi_dbi_smartbond_reset()
136 ret = gpio_pin_set_dt(&config->reset, 1); in mipi_dbi_smartbond_reset()
143 return gpio_pin_set_dt(&config->reset, 0); in mipi_dbi_smartbond_reset()
193 mipi_dbi_cfg->cpha = dbi_config->config.operation & SPI_MODE_CPHA; in lcdc_smartbond_mipi_dbi_translation()
194 mipi_dbi_cfg->cpol = dbi_config->config.operation & SPI_MODE_CPOL; in lcdc_smartbond_mipi_dbi_translation()
195 mipi_dbi_cfg->cs_active_high = dbi_config->config.operation & SPI_CS_ACTIVE_HIGH; in lcdc_smartbond_mipi_dbi_translation()
196 mipi_dbi_cfg->line_mode = lcdc_smartbond_line_mode_translation(dbi_config->mode); in lcdc_smartbond_mipi_dbi_translation()
197 mipi_dbi_cfg->color_mode = lcdc_smartbond_pixel_to_ocm(pixfmt); in lcdc_smartbond_mipi_dbi_translation()
206 struct mipi_dbi_smartbond_data *data = dev->data; in mipi_dbi_smartbond_command_read()
207 const struct mipi_dbi_smartbond_config *config = dev->config; in mipi_dbi_smartbond_command_read()
211 k_sem_take(&data->device_sem, K_FOREVER); in mipi_dbi_smartbond_command_read()
216 * Add an arbitrary valid color format to satisfy subroutine. The MIPI DBI command/data in mipi_dbi_smartbond_command_read()
227 LOG_WRN("MIPI DBI host is busy"); in mipi_dbi_smartbond_command_read()
228 ret = -EBUSY; in mipi_dbi_smartbond_command_read()
251 ret = -ENODEV; in mipi_dbi_smartbond_command_read()
256 ret = pinctrl_apply_state(config->pcfg, PINCTRL_STATE_READ); in mipi_dbi_smartbond_command_read()
258 LOG_ERR("Could not apply MIPI DBI pins' SPI read state (%d)", ret); in mipi_dbi_smartbond_command_read()
263 ret = spi_read(spi_dev, &dbi_config->config, &buf_set); in mipi_dbi_smartbond_command_read()
276 ret = pinctrl_apply_state(config->pcfg, PINCTRL_STATE_DEFAULT); in mipi_dbi_smartbond_command_read()
278 LOG_ERR("Could not apply MIPI DBI pins' default state (%d)", ret); in mipi_dbi_smartbond_command_read()
283 k_sem_give(&data->device_sem); in mipi_dbi_smartbond_command_read()
294 struct mipi_dbi_smartbond_data *data = dev->data; in mipi_dbi_smartbond_command_write()
298 k_sem_take(&data->device_sem, K_FOREVER); in mipi_dbi_smartbond_command_write()
303 * Add an arbitrary valid color format to satisfy subroutine. The MIPI DBI command/data in mipi_dbi_smartbond_command_write()
323 k_sem_give(&data->device_sem); in mipi_dbi_smartbond_command_write()
334 struct mipi_dbi_smartbond_data *data = dev->data; in mipi_dbi_smartbond_write_display()
335 const struct mipi_dbi_smartbond_config *config = dev->config; in mipi_dbi_smartbond_write_display()
336 lcdc_smartbond_layer_cfg *layer = &data->layer; in mipi_dbi_smartbond_write_display()
341 if (desc->width * desc->height * (DISPLAY_BITS_PER_PIXEL(pixfmt) / BITS_PER_BYTE) != in mipi_dbi_smartbond_write_display()
342 desc->buf_size) { in mipi_dbi_smartbond_write_display()
344 return -EINVAL; in mipi_dbi_smartbond_write_display()
347 k_sem_take(&data->device_sem, K_FOREVER); in mipi_dbi_smartbond_write_display()
358 LOG_WRN("MIPI DBI host is busy"); in mipi_dbi_smartbond_write_display()
359 ret = -EBUSY; in mipi_dbi_smartbond_write_display()
369 ret = da1469x_lcdc_timings_configure(desc->width, desc->height, in mipi_dbi_smartbond_write_display()
370 (lcdc_smartbond_timing_cfg *)&config->timing_cfg); in mipi_dbi_smartbond_write_display()
375 LCDC_SMARTBOND_LAYER_CONFIG(layer, framebuf, 0, 0, desc->width, desc->height, in mipi_dbi_smartbond_write_display()
377 da1469x_lcdc_stride_calculation(layer_color, desc->width)); in mipi_dbi_smartbond_write_display()
383 /* Trigger single frame update via the LCDC-DMA engine */ in mipi_dbi_smartbond_write_display()
390 k_sem_give(&data->device_sem); in mipi_dbi_smartbond_write_display()
399 const struct mipi_dbi_smartbond_config *config = dev->config; in mipi_dbi_smartbond_configure()
411 return -EINVAL; in mipi_dbi_smartbond_configure()
416 da1469x_lcdc_bgcolor_configure((lcdc_smartbond_bgcolor_cfg *)&config->bgcolor_cfg); in mipi_dbi_smartbond_configure()
419 LCDC->LCDC_LAYER0_OFFSETX_REG, MIPI_DBI_SMARTBOND_IS_DMA_PREFETCH_ENABLED); in mipi_dbi_smartbond_configure()
426 struct mipi_dbi_smartbond_data *data = ((const struct device *)arg)->data; in smartbond_mipi_dbi_isr()
432 data->underflow_flag = LCDC_STATUS_REG_GET_FIELD(LCDC_STICKY_UNDERFLOW); in smartbond_mipi_dbi_isr()
437 k_sem_give(&data->sync_sem); in smartbond_mipi_dbi_isr()
442 const struct mipi_dbi_smartbond_config *config = dev->config; in mipi_dbi_smartbond_resume()
446 ret = pinctrl_apply_state(config->pcfg, PINCTRL_STATE_DEFAULT); in mipi_dbi_smartbond_resume()
449 return -EIO; in mipi_dbi_smartbond_resume()
471 const struct mipi_dbi_smartbond_config *config = dev->config; in mipi_dbi_smartbond_suspend()
475 ret = pinctrl_apply_state(config->pcfg, PINCTRL_STATE_SLEEP); in mipi_dbi_smartbond_suspend()
477 LOG_WRN("Could not apply MIPI DBI pins' sleep state"); in mipi_dbi_smartbond_suspend()
492 /* A non-zero value should not affect sleep */ in mipi_dbi_smartbond_pm_action()
503 return -ENOTSUP; in mipi_dbi_smartbond_pm_action()
512 __unused const struct mipi_dbi_smartbond_config *config = dev->config; in mipi_dbi_smartbond_init()
513 struct mipi_dbi_smartbond_data *data = dev->data; in mipi_dbi_smartbond_init()
517 k_sem_init(&data->device_sem, 1, 1); in mipi_dbi_smartbond_init()
519 k_sem_init(&data->sync_sem, 0, 1); in mipi_dbi_smartbond_init()
522 if (gpio_is_ready_dt(&config->reset)) { in mipi_dbi_smartbond_init()
523 ret = gpio_pin_configure_dt(&config->reset, GPIO_OUTPUT_INACTIVE); in mipi_dbi_smartbond_init()
526 return -EIO; in mipi_dbi_smartbond_init()