Skip to content
Closed
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
30 changes: 30 additions & 0 deletions drivers/display/ssd16xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ struct ssd16xx_config {

uint8_t gate_line_width;
bool override_gate_line_width;
struct ssd16xx_dt_array cntrl1_data;
bool data_mode_2;
struct ssd16xx_dt_array otp_selection_ctl;
};

static inline void ssd16xx_busy_wait(const struct device *dev)
Expand Down Expand Up @@ -812,6 +815,15 @@ static int ssd16xx_controller_init(const struct device *dev)
SSD16XX_CTRL2_DISABLE_ANALOG |
SSD16XX_CTRL2_DISABLE_CLK);

if (config->cntrl1_data.len) {
err = ssd16xx_write_cmd(dev, SSD16XX_CMD_UPDATE_CTRL1,
config->cntrl1_data.data,
config->cntrl1_data.len);
if (err < 0) {
return err;
}
}

err = ssd16xx_load_profile(dev, &config->profile_initial);
if (err < 0) {
return err;
Expand All @@ -833,6 +845,18 @@ static int ssd16xx_controller_init(const struct device *dev)
return err;
}

if (config->otp_selection_ctl.len) {
err = ssd16xx_write_cmd(dev, SSD16XX_CMD_OTP_SELECTION_CTRL,
config->otp_selection_ctl.data,
config->otp_selection_ctl.len);
if (err < 0) {
return err;
}
}

if (config->data_mode_2)
data->update_cmd |= SSD16XX_CTRL2_TO_INITIAL;

return ssd16xx_clear_cntlr_mem(dev, SSD16XX_CMD_WRITE_RAM, true);
}

Expand Down Expand Up @@ -941,6 +965,8 @@ static struct display_driver_api ssd16xx_driver_api = {
#define SSD16XX_DEFINE(n) \
SSD16XX_MAKE_INST_ARRAY_OPT(n, lut_default); \
SSD16XX_MAKE_INST_ARRAY_OPT(n, softstart); \
SSD16XX_MAKE_INST_ARRAY_OPT(n, cntrl1_data); \
SSD16XX_MAKE_INST_ARRAY_OPT(n, otp_selection_ctl); \
SSD16XX_INITIAL_PROFILE_DEFINE(n); \
\
static const struct ssd16xx_config ssd16xx_cfg_##n = { \
Expand All @@ -967,6 +993,10 @@ static struct display_driver_api ssd16xx_driver_api = {
DT_INST_PROP_OR(n, gate_line_width, 0), \
.override_gate_line_width = \
DT_INST_NODE_HAS_PROP(n, gate_line_width), \
.cntrl1_data = SSD16XX_ASSIGN_ARRAY(n, cntrl1_data), \
.data_mode_2 = \
DT_INST_NODE_HAS_PROP(n, data_mode_2), \
.otp_selection_ctl = SSD16XX_ASSIGN_ARRAY(n, otp_selection_ctl), \
}; \
\
static struct ssd16xx_data ssd16xx_data_##n; \
Expand Down
15 changes: 15 additions & 0 deletions dts/bindings/display/solomon,ssd16xxfb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,18 @@ properties:
type: int
required: false
description: Gate line width override.

cntrl1-data:
type: uint8-array
required: false
description: setup cntrl1 register for setting source range

data-mode-2:
type: boolean
required: false
description: send default updates as data2 mode

otp-selection-ctl:
type: uint8-array
required: false
description: setup SSD16XX_CMD_OTP_SELECTION_CTRL register for setting ping pong update