drivers/auxdisplay: format jhd1313 driver.

Format jhd1313 driver to comply with CI rules.

Signed-off-by: Leon Mariotto <leon2mariotto@gmail.com>
This commit is contained in:
Leon Mariotto 2025-05-08 13:38:08 +02:00 committed by Benjamin Cabé
commit f411f48d37

View file

@ -75,18 +75,18 @@ struct auxdisplay_jhd1313_config {
};
static const uint8_t colour_define[][4] = {
{ 0, 0, 0 }, /* Off */
{ 255, 255, 255 }, /* White */
{ 255, 0, 0 }, /* Red */
{ 0, 255, 0 }, /* Green */
{ 0, 0, 255 }, /* Blue */
{0, 0, 0}, /* Off */
{255, 255, 255}, /* White */
{255, 0, 0}, /* Red */
{0, 255, 0}, /* Green */
{0, 0, 255}, /* Blue */
};
static void auxdisplay_jhd1313_reg_set(const struct device *dev, uint8_t addr, uint8_t data)
{
const struct auxdisplay_jhd1313_config *config = dev->config;
const struct device *i2c = config->bus.bus;
uint8_t command[2] = { addr, data };
uint8_t command[2] = {addr, data};
i2c_write(i2c, command, sizeof(command), config->backlight_addr);
}
@ -94,7 +94,7 @@ static void auxdisplay_jhd1313_reg_set(const struct device *dev, uint8_t addr, u
static int auxdisplay_jhd1313_print(const struct device *dev, const uint8_t *data, uint16_t size)
{
const struct auxdisplay_jhd1313_config *config = dev->config;
uint8_t buf[] = { JHD1313_CMD_SET_CGRAM_ADDR, 0 };
uint8_t buf[] = {JHD1313_CMD_SET_CGRAM_ADDR, 0};
int rc = 0;
int16_t i;
@ -133,7 +133,7 @@ static int auxdisplay_jhd1313_clear(const struct device *dev)
{
int rc;
const struct auxdisplay_jhd1313_config *config = dev->config;
uint8_t clear[] = { 0, JHD1313_CMD_SCREEN_CLEAR };
uint8_t clear[] = {0, JHD1313_CMD_SCREEN_CLEAR};
rc = i2c_write_dt(&config->bus, clear, sizeof(clear));
LOG_DBG("Clear, delay 20 ms");
@ -143,12 +143,11 @@ static int auxdisplay_jhd1313_clear(const struct device *dev)
return rc;
}
static int auxdisplay_jhd1313_update_display_state(
const struct auxdisplay_jhd1313_config *config,
static int auxdisplay_jhd1313_update_display_state(const struct auxdisplay_jhd1313_config *config,
struct auxdisplay_jhd1313_data *data)
{
int rc;
uint8_t buf[] = { 0, JHD1313_CMD_DISPLAY_SWITCH };
uint8_t buf[] = {0, JHD1313_CMD_DISPLAY_SWITCH};
if (data->power) {
buf[1] |= JHD1313_DS_DISPLAY_ON;
@ -192,7 +191,7 @@ static void auxdisplay_jhd1313_input_state_set(const struct device *dev, uint8_t
{
const struct auxdisplay_jhd1313_config *config = dev->config;
struct auxdisplay_jhd1313_data *data = dev->data;
uint8_t buf[] = { 0, 0 };
uint8_t buf[] = {0, 0};
data->input_set = opt;
buf[1] = (opt | JHD1313_CMD_INPUT_SET);
@ -232,7 +231,7 @@ static void auxdisplay_jhd1313_function_set(const struct device *dev, uint8_t op
{
const struct auxdisplay_jhd1313_config *config = dev->config;
struct auxdisplay_jhd1313_data *data = dev->data;
uint8_t buf[] = { 0, 0 };
uint8_t buf[] = {0, 0};
data->function = opt;
buf[1] = (opt | JHD1313_CMD_FUNCTION_SET);
@ -350,7 +349,8 @@ static DEVICE_API(auxdisplay, auxdisplay_jhd1313_auxdisplay_api) = {
#define AUXDISPLAY_JHD1313_DEVICE(inst) \
static const struct auxdisplay_jhd1313_config auxdisplay_jhd1313_config_##inst = { \
.capabilities = { \
.capabilities = \
{ \
.columns = 16, \
.rows = 2, \
.mode = 0, \
@ -368,13 +368,9 @@ static DEVICE_API(auxdisplay, auxdisplay_jhd1313_auxdisplay_api) = {
.cursor = false, \
.blinking = false, \
}; \
DEVICE_DT_INST_DEFINE(inst, \
&auxdisplay_jhd1313_initialize, \
NULL, \
&auxdisplay_jhd1313_data_##inst, \
&auxdisplay_jhd1313_config_##inst, \
POST_KERNEL, \
CONFIG_AUXDISPLAY_INIT_PRIORITY, \
DEVICE_DT_INST_DEFINE(inst, &auxdisplay_jhd1313_initialize, NULL, \
&auxdisplay_jhd1313_data_##inst, &auxdisplay_jhd1313_config_##inst, \
POST_KERNEL, CONFIG_AUXDISPLAY_INIT_PRIORITY, \
&auxdisplay_jhd1313_auxdisplay_api);
DT_INST_FOREACH_STATUS_OKAY(AUXDISPLAY_JHD1313_DEVICE)