Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers: display: fix ili9xxx write size #68378

Merged
merged 3 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions drivers/display/display_ili9xxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ static void ili9xxx_hw_reset(const struct device *dev)
{
const struct ili9xxx_config *config = dev->config;

mipi_dbi_reset(config->mipi_dev, ILI9XXX_RESET_PULSE_TIME);
if (mipi_dbi_reset(config->mipi_dev, ILI9XXX_RESET_PULSE_TIME) < 0) {
return;
};
k_sleep(K_MSEC(ILI9XXX_RESET_WAIT_TIME));
}

Expand Down Expand Up @@ -111,12 +113,11 @@ static int ili9xxx_write(const struct device *dev, const uint16_t x,
} else {
write_h = desc->height;
mipi_desc.height = desc->height;
mipi_desc.buf_size = desc->buf_size;
mipi_desc.buf_size = desc->width * data->bytes_per_pixel * write_h;
nbr_of_writes = 1U;
}

mipi_desc.width = desc->width;
mipi_desc.height = desc->height;
/* Per MIPI API, pitch must always match width */
mipi_desc.pitch = desc->width;

Expand Down
3 changes: 2 additions & 1 deletion include/zephyr/drivers/mipi_dbi.h
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,8 @@ static inline int mipi_dbi_command_read(const struct device *dev,
* @param config MIPI DBI configuration
* @param framebuf: framebuffer to write to display
* @param desc: descriptor of framebuffer to write. Note that the pitch must
* be equal to width.
* be equal to width. "buf_size" field determines how many bytes will be
* written.
* @param pixfmt: pixel format of framebuffer data
* @retval 0 buffer write succeeded.
* @retval -EIO I/O error
Expand Down
Loading