Lines Matching full:driver
25 * SSD1673, SSD1608, SSD1681, ILI3897 compatible EPD controller driver.
79 static inline int ssd16xx_write_cmd(struct ssd16xx_data *driver, in ssd16xx_write_cmd() argument
86 gpio_pin_set(driver->dc, SSD16XX_DC_PIN, 1); in ssd16xx_write_cmd()
87 err = spi_write_dt(&driver->config->bus, &buf_set); in ssd16xx_write_cmd()
95 gpio_pin_set(driver->dc, SSD16XX_DC_PIN, 0); in ssd16xx_write_cmd()
96 err = spi_write_dt(&driver->config->bus, &buf_set); in ssd16xx_write_cmd()
105 static inline void ssd16xx_busy_wait(struct ssd16xx_data *driver) in ssd16xx_busy_wait() argument
107 int pin = gpio_pin_get(driver->busy, SSD16XX_BUSY_PIN); in ssd16xx_busy_wait()
112 pin = gpio_pin_get(driver->busy, SSD16XX_BUSY_PIN); in ssd16xx_busy_wait()
143 static inline int ssd16xx_set_ram_param(struct ssd16xx_data *driver, in ssd16xx_set_ram_param() argument
152 err = ssd16xx_write_cmd(driver, SSD16XX_CMD_RAM_XPOS_CTRL, tmp, len); in ssd16xx_set_ram_param()
159 err = ssd16xx_write_cmd(driver, SSD16XX_CMD_RAM_YPOS_CTRL, tmp, len); in ssd16xx_set_ram_param()
167 static inline int ssd16xx_set_ram_ptr(struct ssd16xx_data *driver, in ssd16xx_set_ram_ptr() argument
175 err = ssd16xx_write_cmd(driver, SSD16XX_CMD_RAM_XPOS_CNTR, tmp, len); in ssd16xx_set_ram_ptr()
181 return ssd16xx_write_cmd(driver, SSD16XX_CMD_RAM_YPOS_CNTR, tmp, len); in ssd16xx_set_ram_ptr()
184 static void ssd16xx_set_orientation_internall(struct ssd16xx_data *driver) in ssd16xx_set_orientation_internall() argument
188 driver->scan_mode = SSD16XX_DATA_ENTRY_XIYDY; in ssd16xx_set_orientation_internall()
190 driver->scan_mode = SSD16XX_DATA_ENTRY_XDYIY; in ssd16xx_set_orientation_internall()
206 struct ssd16xx_data *driver = dev->data; in ssd16xx_update_display() local
209 err = ssd16xx_write_cmd(driver, SSD16XX_CMD_UPDATE_CTRL2, in ssd16xx_update_display()
210 &driver->update_cmd, 1); in ssd16xx_update_display()
215 return ssd16xx_write_cmd(driver, SSD16XX_CMD_MASTER_ACTIVATION, in ssd16xx_update_display()
224 struct ssd16xx_data *driver = dev->data; in ssd16xx_write() local
272 switch (driver->scan_mode) { in ssd16xx_write()
291 ssd16xx_busy_wait(driver); in ssd16xx_write()
293 err = ssd16xx_write_cmd(driver, SSD16XX_CMD_ENTRY_MODE, in ssd16xx_write()
294 &driver->scan_mode, sizeof(driver->scan_mode)); in ssd16xx_write()
299 err = ssd16xx_set_ram_param(driver, x_start, x_end, y_start, y_end); in ssd16xx_write()
304 err = ssd16xx_set_ram_ptr(driver, x_start, y_start); in ssd16xx_write()
309 err = ssd16xx_write_cmd(driver, SSD16XX_CMD_WRITE_RAM, (uint8_t *)buf, in ssd16xx_write()
383 struct ssd16xx_data *driver = dev->data; in ssd16xx_clear_cntlr_mem() local
397 if (ssd16xx_write_cmd(driver, SSD16XX_CMD_ENTRY_MODE, &scan_mode, 1)) { in ssd16xx_clear_cntlr_mem()
401 if (ssd16xx_set_ram_param(driver, SSD16XX_PANEL_FIRST_PAGE, in ssd16xx_clear_cntlr_mem()
408 if (ssd16xx_set_ram_ptr(driver, SSD16XX_PANEL_FIRST_PAGE, in ssd16xx_clear_cntlr_mem()
416 if (ssd16xx_write_cmd(driver, ram_cmd, clear_page, in ssd16xx_clear_cntlr_mem()
431 struct ssd16xx_data *driver = dev->data; in ssd16xx_load_ws_from_otp() local
442 if (ssd16xx_write_cmd(driver, in ssd16xx_load_ws_from_otp()
448 driver->update_cmd |= SSD16XX_CTRL2_LOAD_LUT | in ssd16xx_load_ws_from_otp()
458 if (ssd16xx_write_cmd(driver, SSD16XX_CMD_UPDATE_CTRL2, in ssd16xx_load_ws_from_otp()
463 if (ssd16xx_write_cmd(driver, SSD16XX_CMD_MASTER_ACTIVATION, in ssd16xx_load_ws_from_otp()
468 ssd16xx_busy_wait(driver); in ssd16xx_load_ws_from_otp()
472 if (ssd16xx_write_cmd(driver, SSD16XX_CMD_TSENS_CTRL, in ssd16xx_load_ws_from_otp()
478 if (ssd16xx_write_cmd(driver, SSD16XX_CMD_UPDATE_CTRL2, in ssd16xx_load_ws_from_otp()
483 if (ssd16xx_write_cmd(driver, SSD16XX_CMD_MASTER_ACTIVATION, in ssd16xx_load_ws_from_otp()
488 ssd16xx_busy_wait(driver); in ssd16xx_load_ws_from_otp()
490 driver->update_cmd |= SSD16XX_CTRL2_LOAD_LUT; in ssd16xx_load_ws_from_otp()
499 struct ssd16xx_data *driver = dev->data; in ssd16xx_load_ws_initial() local
501 if (ssd16xx_write_cmd(driver, SSD16XX_CMD_UPDATE_LUT, in ssd16xx_load_ws_initial()
507 ssd16xx_busy_wait(driver); in ssd16xx_load_ws_initial()
518 struct ssd16xx_data *driver = dev->data; in ssd16xx_load_ws_default() local
520 if (ssd16xx_write_cmd(driver, SSD16XX_CMD_UPDATE_LUT, in ssd16xx_load_ws_default()
526 ssd16xx_busy_wait(driver); in ssd16xx_load_ws_default()
537 struct ssd16xx_data *driver = dev->data; in ssd16xx_controller_init() local
541 gpio_pin_set(driver->reset, SSD16XX_RESET_PIN, 1); in ssd16xx_controller_init()
543 gpio_pin_set(driver->reset, SSD16XX_RESET_PIN, 0); in ssd16xx_controller_init()
545 ssd16xx_busy_wait(driver); in ssd16xx_controller_init()
547 err = ssd16xx_write_cmd(driver, SSD16XX_CMD_SW_RESET, NULL, 0); in ssd16xx_controller_init()
551 ssd16xx_busy_wait(driver); in ssd16xx_controller_init()
555 err = ssd16xx_write_cmd(driver, SSD16XX_CMD_GDO_CTRL, tmp, len); in ssd16xx_controller_init()
561 err = ssd16xx_write_cmd(driver, SSD16XX_CMD_SOFTSTART, in ssd16xx_controller_init()
568 err = ssd16xx_write_cmd(driver, SSD16XX_CMD_GDV_CTRL, ssd16xx_gdv, in ssd16xx_controller_init()
574 err = ssd16xx_write_cmd(driver, SSD16XX_CMD_SDV_CTRL, ssd16xx_sdv, in ssd16xx_controller_init()
581 err = ssd16xx_write_cmd(driver, SSD16XX_CMD_VCOM_VOLTAGE, tmp, 1); in ssd16xx_controller_init()
587 err = ssd16xx_write_cmd(driver, SSD16XX_CMD_DUMMY_LINE, tmp, 1); in ssd16xx_controller_init()
593 err = ssd16xx_write_cmd(driver, SSD16XX_CMD_GATE_LINE_WIDTH, tmp, 1); in ssd16xx_controller_init()
599 err = ssd16xx_write_cmd(driver, SSD16XX_CMD_BWF_CTRL, tmp, 1); in ssd16xx_controller_init()
604 ssd16xx_set_orientation_internall(driver); in ssd16xx_controller_init()
605 driver->update_cmd = (SSD16XX_CTRL2_ENABLE_CLK | in ssd16xx_controller_init()
620 ssd16xx_busy_wait(driver); in ssd16xx_controller_init()
628 ssd16xx_busy_wait(driver); in ssd16xx_controller_init()
639 struct ssd16xx_data *driver = dev->data; in ssd16xx_init() local
640 const struct ssd16xx_config *config = driver->config; in ssd16xx_init()
649 driver->reset = device_get_binding(SSD16XX_RESET_CNTRL); in ssd16xx_init()
650 if (driver->reset == NULL) { in ssd16xx_init()
655 gpio_pin_configure(driver->reset, SSD16XX_RESET_PIN, in ssd16xx_init()
658 driver->dc = device_get_binding(SSD16XX_DC_CNTRL); in ssd16xx_init()
659 if (driver->dc == NULL) { in ssd16xx_init()
664 gpio_pin_configure(driver->dc, SSD16XX_DC_PIN, in ssd16xx_init()
667 driver->busy = device_get_binding(SSD16XX_BUSY_CNTRL); in ssd16xx_init()
668 if (driver->busy == NULL) { in ssd16xx_init()
673 gpio_pin_configure(driver->busy, SSD16XX_BUSY_PIN, in ssd16xx_init()