Skip to content

Commit d7c9c45

Browse files
danieldegrassekartben
authored andcommitted
drivers: display: display_rm67162: fix dead code for pixel format
Fix dead code within the set_pixel_format() function for the RM67162. This function should set the relevant data fields for the driver, then send the MIPI DCS command to change pixel format. Fixes #81945 Signed-off-by: Daniel DeGrasse <[email protected]>
1 parent dd75fc3 commit d7c9c45

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

drivers/display/display_rm67162.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -522,21 +522,18 @@ static int rm67162_set_pixel_format(const struct device *dev,
522522
switch (pixel_format) {
523523
case PIXEL_FORMAT_RGB_565:
524524
data->pixel_format = MIPI_DSI_PIXFMT_RGB565;
525-
return 0;
525+
param = MIPI_DCS_PIXEL_FORMAT_16BIT;
526+
data->bytes_per_pixel = 2;
527+
break;
526528
case PIXEL_FORMAT_RGB_888:
527529
data->pixel_format = MIPI_DSI_PIXFMT_RGB888;
528-
return 0;
530+
param = MIPI_DCS_PIXEL_FORMAT_24BIT;
531+
data->bytes_per_pixel = 3;
532+
break;
529533
default:
530534
/* Other display formats not implemented */
531535
return -ENOTSUP;
532536
}
533-
if (data->pixel_format == MIPI_DSI_PIXFMT_RGB888) {
534-
param = MIPI_DCS_PIXEL_FORMAT_24BIT;
535-
data->bytes_per_pixel = 3;
536-
} else if (data->pixel_format == MIPI_DSI_PIXFMT_RGB565) {
537-
param = MIPI_DCS_PIXEL_FORMAT_16BIT;
538-
data->bytes_per_pixel = 2;
539-
}
540537
return mipi_dsi_dcs_write(config->mipi_dsi, config->channel,
541538
MIPI_DCS_SET_PIXEL_FORMAT, &param, 1);
542539
}

0 commit comments

Comments
 (0)