drivers: mipi_dbi: reduce the RAM overhead

Constify the config and reorder the data fields for better packing.
This reduces the RAM usage of `mipi_dbi_spi` by 20 bytes.

Signed-off-by: Michael Hope <mlhx@google.com>
This commit is contained in:
Michael Hope 2024-07-21 12:50:37 +00:00 committed by Anas Nashif
parent a5781547d6
commit aab5730d0f
3 changed files with 4 additions and 4 deletions

View file

@ -660,7 +660,7 @@ static int mipi_dbi_lcdic_init(const struct device *dev)
return 0;
}
static struct mipi_dbi_driver_api mipi_dbi_lcdic_driver_api = {
static const struct mipi_dbi_driver_api mipi_dbi_lcdic_driver_api = {
.command_write = mipi_dbi_lcdic_write_cmd,
.write_display = mipi_dbi_lcdic_write_display,
.reset = mipi_dbi_lcdic_reset,

View file

@ -536,7 +536,7 @@ static int mipi_dbi_smartbond_init(const struct device *dev)
return ret;
}
static struct mipi_dbi_driver_api mipi_dbi_smartbond_driver_api = {
static const struct mipi_dbi_driver_api mipi_dbi_smartbond_driver_api = {
#if MIPI_DBI_SMARTBOND_IS_RESET_AVAILABLE
.reset = mipi_dbi_smartbond_reset,
#endif

View file

@ -23,9 +23,9 @@ struct mipi_dbi_spi_config {
};
struct mipi_dbi_spi_data {
struct k_mutex lock;
/* Used for 3 wire mode */
uint16_t spi_byte;
struct k_mutex lock;
};
/* Expands to 1 if the node does not have the `write-only` property */
@ -313,7 +313,7 @@ static int mipi_dbi_spi_init(const struct device *dev)
return 0;
}
static struct mipi_dbi_driver_api mipi_dbi_spi_driver_api = {
static const struct mipi_dbi_driver_api mipi_dbi_spi_driver_api = {
.reset = mipi_dbi_spi_reset,
.command_write = mipi_dbi_spi_command_write,
.write_display = mipi_dbi_spi_write_display,