dts_fixups: Use DT_ prefix in all defined labels not related to Kconfig

These changes were obtained by running a script  created by
Ulf Magnusson <Ulf.Magnusson@nordicsemi.no> for the following
specification:

1. Read the contents of all dts_fixup.h files in Zephyr
2. Check the left-hand side of the #define macros (i.e. the X in
   #define X Y)
3. Check if that name is also the name of a Kconfig option
   3.a If it is, then do nothing
   3.b If it is not, then replace CONFIG_ with DT_ or add DT_ if it
       has neither of these two prefixes
4. Replace the use of the changed #define in the code itself
   (.c, .h, .ld)

Additionally, some tweaks had to be added to this script to catch some
of the macros used in the code in a parameterized form, e.g.:
- CONFIG_GPIO_STM32_GPIO##__SUFFIX##_BASE_ADDRESS
- CONFIG_UART_##idx##_TX_PIN
- I2C_SBCON_##_num##_BASE_ADDR
and to prevent adding DT_ prefix to the following symbols:
- FLASH_START
- FLASH_SIZE
- SRAM_START
- SRAM_SIZE
- _ROM_ADDR
- _ROM_SIZE
- _RAM_ADDR
- _RAM_SIZE
which are surprisingly also defined in some dts_fixup.h files.

Finally, some manual corrections had to be done as well:
- name##_IRQ -> DT_##name##_IRQ in uart_stm32.c

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
This commit is contained in:
Andrzej Głąbek 2018-11-13 15:15:23 +01:00 committed by Kumar Gala
commit 20202902f2
304 changed files with 5118 additions and 5118 deletions

View file

@ -41,15 +41,15 @@ static int ili9340_init(struct device *dev)
LOG_DBG("Initializing display driver");
data->spi_dev = device_get_binding(CONFIG_ILI9340_SPI_DEV_NAME);
data->spi_dev = device_get_binding(DT_ILI9340_SPI_DEV_NAME);
if (data->spi_dev == NULL) {
LOG_ERR("Could not get SPI device for ILI9340");
return -EPERM;
}
data->spi_config.frequency = CONFIG_ILI9340_SPI_FREQ;
data->spi_config.frequency = DT_ILI9340_SPI_FREQ;
data->spi_config.operation = SPI_OP_MODE_MASTER | SPI_WORD_SET(8);
data->spi_config.slave = CONFIG_ILI9340_SPI_SLAVE_NUMBER;
data->spi_config.slave = DT_ILI9340_SPI_SLAVE_NUMBER;
#ifdef CONFIG_ILI9340_GPIO_CS
data->cs_ctrl.gpio_dev =
@ -62,31 +62,31 @@ static int ili9340_init(struct device *dev)
#endif
data->reset_gpio =
device_get_binding(CONFIG_ILI9340_RESET_GPIO_PORT_NAME);
device_get_binding(DT_ILI9340_RESET_GPIO_PORT_NAME);
if (data->reset_gpio == NULL) {
LOG_ERR("Could not get GPIO port for ILI9340 reset");
return -EPERM;
}
gpio_pin_configure(data->reset_gpio, CONFIG_ILI9340_RESET_PIN,
gpio_pin_configure(data->reset_gpio, DT_ILI9340_RESET_PIN,
GPIO_DIR_OUT);
data->command_data_gpio =
device_get_binding(CONFIG_ILI9340_CMD_DATA_GPIO_PORT_NAME);
device_get_binding(DT_ILI9340_CMD_DATA_GPIO_PORT_NAME);
if (data->command_data_gpio == NULL) {
LOG_ERR("Could not get GPIO port for ILI9340 command/data");
return -EPERM;
}
gpio_pin_configure(data->command_data_gpio, CONFIG_ILI9340_CMD_DATA_PIN,
gpio_pin_configure(data->command_data_gpio, DT_ILI9340_CMD_DATA_PIN,
GPIO_DIR_OUT);
LOG_DBG("Resetting display driver");
gpio_pin_write(data->reset_gpio, CONFIG_ILI9340_RESET_PIN, 1);
gpio_pin_write(data->reset_gpio, DT_ILI9340_RESET_PIN, 1);
k_sleep(1);
gpio_pin_write(data->reset_gpio, CONFIG_ILI9340_RESET_PIN, 0);
gpio_pin_write(data->reset_gpio, DT_ILI9340_RESET_PIN, 0);
k_sleep(1);
gpio_pin_write(data->reset_gpio, CONFIG_ILI9340_RESET_PIN, 1);
gpio_pin_write(data->reset_gpio, DT_ILI9340_RESET_PIN, 1);
k_sleep(5);
LOG_DBG("Initializing LCD");
@ -242,7 +242,7 @@ void ili9340_transmit(struct ili9340_data *data, u8_t cmd, void *tx_data,
struct spi_buf tx_buf = { .buf = &cmd, .len = 1 };
struct spi_buf_set tx_bufs = { .buffers = &tx_buf, .count = 1 };
gpio_pin_write(data->command_data_gpio, CONFIG_ILI9340_CMD_DATA_PIN,
gpio_pin_write(data->command_data_gpio, DT_ILI9340_CMD_DATA_PIN,
ILI9340_CMD_DATA_PIN_COMMAND);
spi_write(data->spi_dev, &data->spi_config, &tx_bufs);
@ -250,7 +250,7 @@ void ili9340_transmit(struct ili9340_data *data, u8_t cmd, void *tx_data,
tx_buf.buf = tx_data;
tx_buf.len = tx_len;
gpio_pin_write(data->command_data_gpio,
CONFIG_ILI9340_CMD_DATA_PIN,
DT_ILI9340_CMD_DATA_PIN,
ILI9340_CMD_DATA_PIN_DATA);
spi_write(data->spi_dev, &data->spi_config, &tx_bufs);
}
@ -271,6 +271,6 @@ static const struct display_driver_api ili9340_api = {
static struct ili9340_data ili9340_data;
DEVICE_AND_API_INIT(ili9340, CONFIG_ILI9340_DEV_NAME, &ili9340_init,
DEVICE_AND_API_INIT(ili9340, DT_ILI9340_DEV_NAME, &ili9340_init,
&ili9340_data, NULL, APPLICATION,
CONFIG_APPLICATION_INIT_PRIORITY, &ili9340_api);

View file

@ -26,51 +26,51 @@
/* Onboard LED Row 1 */
#define LED_ROW1_GPIO_PIN 13
#define LED_ROW1_GPIO_PORT CONFIG_GPIO_P0_DEV_NAME
#define LED_ROW1_GPIO_PORT DT_GPIO_P0_DEV_NAME
/* Onboard LED Row 2 */
#define LED_ROW2_GPIO_PIN 14
#define LED_ROW2_GPIO_PORT CONFIG_GPIO_P0_DEV_NAME
#define LED_ROW2_GPIO_PORT DT_GPIO_P0_DEV_NAME
/* Onboard LED Row 3 */
#define LED_ROW3_GPIO_PIN 15
#define LED_ROW3_GPIO_PORT CONFIG_GPIO_P0_DEV_NAME
#define LED_ROW3_GPIO_PORT DT_GPIO_P0_DEV_NAME
/* Onboard LED Column 1 */
#define LED_COL1_GPIO_PIN 4
#define LED_COL1_GPIO_PORT CONFIG_GPIO_P0_DEV_NAME
#define LED_COL1_GPIO_PORT DT_GPIO_P0_DEV_NAME
/* Onboard LED Column 2 */
#define LED_COL2_GPIO_PIN 5
#define LED_COL2_GPIO_PORT CONFIG_GPIO_P0_DEV_NAME
#define LED_COL2_GPIO_PORT DT_GPIO_P0_DEV_NAME
/* Onboard LED Column 3 */
#define LED_COL3_GPIO_PIN 6
#define LED_COL3_GPIO_PORT CONFIG_GPIO_P0_DEV_NAME
#define LED_COL3_GPIO_PORT DT_GPIO_P0_DEV_NAME
/* Onboard LED Column 4 */
#define LED_COL4_GPIO_PIN 7
#define LED_COL4_GPIO_PORT CONFIG_GPIO_P0_DEV_NAME
#define LED_COL4_GPIO_PORT DT_GPIO_P0_DEV_NAME
/* Onboard LED Column 5 */
#define LED_COL5_GPIO_PIN 8
#define LED_COL5_GPIO_PORT CONFIG_GPIO_P0_DEV_NAME
#define LED_COL5_GPIO_PORT DT_GPIO_P0_DEV_NAME
/* Onboard LED Column 6 */
#define LED_COL6_GPIO_PIN 9
#define LED_COL6_GPIO_PORT CONFIG_GPIO_P0_DEV_NAME
#define LED_COL6_GPIO_PORT DT_GPIO_P0_DEV_NAME
/* Onboard LED Column 7 */
#define LED_COL7_GPIO_PIN 10
#define LED_COL7_GPIO_PORT CONFIG_GPIO_P0_DEV_NAME
#define LED_COL7_GPIO_PORT DT_GPIO_P0_DEV_NAME
/* Onboard LED Column 8 */
#define LED_COL8_GPIO_PIN 11
#define LED_COL8_GPIO_PORT CONFIG_GPIO_P0_DEV_NAME
#define LED_COL8_GPIO_PORT DT_GPIO_P0_DEV_NAME
/* Onboard LED Column 9 */
#define LED_COL9_GPIO_PIN 12
#define LED_COL9_GPIO_PORT CONFIG_GPIO_P0_DEV_NAME
#define LED_COL9_GPIO_PORT DT_GPIO_P0_DEV_NAME
#define DISPLAY_ROWS 3
@ -434,7 +434,7 @@ static int mb_display_init(struct device *dev)
{
ARG_UNUSED(dev);
display.dev = device_get_binding(CONFIG_GPIO_P0_DEV_NAME);
display.dev = device_get_binding(DT_GPIO_P0_DEV_NAME);
__ASSERT(dev, "No GPIO device found");

View file

@ -17,19 +17,19 @@ LOG_MODULE_REGISTER(ssd1306);
#include "ssd1306_regs.h"
#include <display/cfb.h>
#if CONFIG_SSD1306_PANEL_SEGMENT_REMAP == 1
#if DT_SSD1306_PANEL_SEGMENT_REMAP == 1
#define SSD1306_PANEL_SEGMENT_REMAP true
#else
#define SSD1306_PANEL_SEGMENT_REMAP false
#endif
#if CONFIG_SSD1306_PANEL_COM_INVDIR == 1
#if DT_SSD1306_PANEL_COM_INVDIR == 1
#define SSD1306_PANEL_COM_INVDIR true
#else
#define SSD1306_PANEL_COM_INVDIR false
#endif
#define SSD1306_PANEL_NUMOF_PAGES (SSD1306_PANEL_HEIGHT / 8)
#define SSD1306_PANEL_NUMOF_PAGES (DT_SSD1306_PANEL_HEIGHT / 8)
#define SSD1306_CLOCK_DIV_RATIO 0x0
#define SSD1306_CLOCK_FREQUENCY 0x8
#define SSD1306_PANEL_MUX_RATIO 63
@ -55,21 +55,21 @@ struct ssd1306_data {
static inline int ssd1306_reg_read(struct ssd1306_data *driver,
u8_t reg, u8_t * const val)
{
return i2c_reg_read_byte(driver->i2c, CONFIG_SSD1306_I2C_ADDR,
return i2c_reg_read_byte(driver->i2c, DT_SSD1306_I2C_ADDR,
reg, val);
}
static inline int ssd1306_reg_write(struct ssd1306_data *driver,
u8_t reg, u8_t val)
{
return i2c_reg_write_byte(driver->i2c, CONFIG_SSD1306_I2C_ADDR,
return i2c_reg_write_byte(driver->i2c, DT_SSD1306_I2C_ADDR,
reg, val);
}
static inline int ssd1306_reg_update(struct ssd1306_data *driver, u8_t reg,
u8_t mask, u8_t val)
{
return i2c_reg_update_byte(driver->i2c, CONFIG_SSD1306_I2C_ADDR,
return i2c_reg_update_byte(driver->i2c, DT_SSD1306_I2C_ADDR,
reg, mask, val);
}
@ -88,7 +88,7 @@ static inline int ssd1306_set_panel_orientation(struct device *dev)
};
return i2c_write(driver->i2c, cmd_buf, sizeof(cmd_buf),
CONFIG_SSD1306_I2C_ADDR);
DT_SSD1306_I2C_ADDR);
}
static inline int ssd1306_set_timing_setting(struct device *dev)
@ -102,7 +102,7 @@ static inline int ssd1306_set_timing_setting(struct device *dev)
SSD1306_CONTROL_BYTE_CMD,
SSD1306_SET_CHARGE_PERIOD,
SSD1306_CONTROL_BYTE_CMD,
SSD1306_PANEL_PRECHARGE_PERIOD,
DT_SSD1306_PANEL_PRECHARGE_PERIOD,
SSD1306_CONTROL_BYTE_CMD,
SSD1306_SET_VCOM_DESELECT_LEVEL,
SSD1306_CONTROL_LAST_BYTE_CMD,
@ -110,7 +110,7 @@ static inline int ssd1306_set_timing_setting(struct device *dev)
};
return i2c_write(driver->i2c, cmd_buf, sizeof(cmd_buf),
CONFIG_SSD1306_I2C_ADDR);
DT_SSD1306_I2C_ADDR);
}
static inline int ssd1306_set_hardware_config(struct device *dev)
@ -122,7 +122,7 @@ static inline int ssd1306_set_hardware_config(struct device *dev)
SSD1306_CONTROL_BYTE_CMD,
SSD1306_SET_DISPLAY_OFFSET,
SSD1306_CONTROL_BYTE_CMD,
SSD1306_PANEL_DISPLAY_OFFSET,
DT_SSD1306_PANEL_DISPLAY_OFFSET,
SSD1306_CONTROL_BYTE_CMD,
SSD1306_SET_PADS_HW_CONFIG,
SSD1306_CONTROL_BYTE_CMD,
@ -134,7 +134,7 @@ static inline int ssd1306_set_hardware_config(struct device *dev)
};
return i2c_write(driver->i2c, cmd_buf, sizeof(cmd_buf),
CONFIG_SSD1306_I2C_ADDR);
DT_SSD1306_I2C_ADDR);
}
static inline int ssd1306_set_charge_pump(const struct device *dev)
@ -158,7 +158,7 @@ static inline int ssd1306_set_charge_pump(const struct device *dev)
};
return i2c_write(driver->i2c, cmd_buf, sizeof(cmd_buf),
CONFIG_SSD1306_I2C_ADDR);
DT_SSD1306_I2C_ADDR);
}
int ssd1306_resume(const struct device *dev)
@ -190,11 +190,11 @@ int ssd1306_write_page(struct device *dev, u8_t page, void * const data,
#endif
SSD1306_CONTROL_BYTE_CMD,
SSD1306_SET_LOWER_COL_ADDRESS |
(SSD1306_PANEL_FIRST_SEG &
(DT_SSD1306_PANEL_FIRST_SEG &
SSD1306_SET_LOWER_COL_ADDRESS_MASK),
SSD1306_CONTROL_BYTE_CMD,
SSD1306_SET_HIGHER_COL_ADDRESS |
((SSD1306_PANEL_FIRST_SEG >> 4) &
((DT_SSD1306_PANEL_FIRST_SEG >> 4) &
SSD1306_SET_LOWER_COL_ADDRESS_MASK),
SSD1306_CONTROL_LAST_BYTE_CMD,
SSD1306_SET_PAGE_START_ADDRESS | page
@ -209,11 +209,11 @@ int ssd1306_write_page(struct device *dev, u8_t page, void * const data,
}
if (i2c_write(driver->i2c, cmd_buf, sizeof(cmd_buf),
CONFIG_SSD1306_I2C_ADDR)) {
DT_SSD1306_I2C_ADDR)) {
return -1;
}
return i2c_burst_write(driver->i2c, CONFIG_SSD1306_I2C_ADDR,
return i2c_burst_write(driver->i2c, DT_SSD1306_I2C_ADDR,
SSD1306_CONTROL_LAST_BYTE_DATA,
data, length);
}
@ -265,25 +265,25 @@ int ssd1306_write(const struct device *dev, const u16_t x, const u16_t y,
};
if (i2c_write(driver->i2c, cmd_buf, sizeof(cmd_buf),
CONFIG_SSD1306_I2C_ADDR)) {
DT_SSD1306_I2C_ADDR)) {
LOG_ERR("Failed to write command");
return -1;
}
return i2c_burst_write(driver->i2c, CONFIG_SSD1306_I2C_ADDR,
return i2c_burst_write(driver->i2c, DT_SSD1306_I2C_ADDR,
SSD1306_CONTROL_LAST_BYTE_DATA,
(u8_t *)buf, desc->buf_size);
#elif defined(CONFIG_SSD1306_SH1106_COMPATIBLE)
if (len != SSD1306_PANEL_NUMOF_PAGES * SSD1306_PANEL_WIDTH) {
if (len != SSD1306_PANEL_NUMOF_PAGES * DT_SSD1306_PANEL_WIDTH) {
return -1;
}
for (size_t pidx = 0; pidx < SSD1306_PANEL_NUMOF_PAGES; pidx++) {
if (ssd1306_write_page(dev, pidx, buf, SSD1306_PANEL_WIDTH)) {
if (ssd1306_write_page(dev, pidx, buf, DT_SSD1306_PANEL_WIDTH)) {
return -1;
}
buf = (u8_t *)buf + SSD1306_PANEL_WIDTH;
buf = (u8_t *)buf + DT_SSD1306_PANEL_WIDTH;
}
#endif
@ -323,15 +323,15 @@ int ssd1306_set_contrast(const struct device *dev, const u8_t contrast)
};
return i2c_write(driver->i2c, cmd_buf, sizeof(cmd_buf),
CONFIG_SSD1306_I2C_ADDR);
DT_SSD1306_I2C_ADDR);
}
static void ssd1306_get_capabilities(const struct device *dev,
struct display_capabilities *caps)
{
memset(caps, 0, sizeof(struct display_capabilities));
caps->x_resolution = SSD1306_PANEL_WIDTH;
caps->y_resolution = SSD1306_PANEL_HEIGHT;
caps->x_resolution = DT_SSD1306_PANEL_WIDTH;
caps->y_resolution = DT_SSD1306_PANEL_HEIGHT;
caps->supported_pixel_formats = PIXEL_FORMAT_MONO10;
caps->current_pixel_format = PIXEL_FORMAT_MONO10;
caps->screen_info = SCREEN_INFO_MONO_VTILED;
@ -378,7 +378,7 @@ static int ssd1306_init_device(struct device *dev)
}
if (i2c_write(driver->i2c, cmd_buf, sizeof(cmd_buf),
CONFIG_SSD1306_I2C_ADDR)) {
DT_SSD1306_I2C_ADDR)) {
return -EIO;
}
@ -397,10 +397,10 @@ static int ssd1306_init(struct device *dev)
LOG_DBG("");
driver->i2c = device_get_binding(CONFIG_SSD1306_I2C_MASTER_DEV_NAME);
driver->i2c = device_get_binding(DT_SSD1306_I2C_MASTER_DEV_NAME);
if (driver->i2c == NULL) {
LOG_ERR("Failed to get pointer to %s device!",
CONFIG_SSD1306_I2C_MASTER_DEV_NAME);
DT_SSD1306_I2C_MASTER_DEV_NAME);
return -EINVAL;
}
@ -426,7 +426,7 @@ static struct display_driver_api ssd1306_driver_api = {
.set_pixel_format = ssd1306_set_pixel_format,
};
DEVICE_AND_API_INIT(ssd1306, CONFIG_SSD1306_DEV_NAME, ssd1306_init,
DEVICE_AND_API_INIT(ssd1306, DT_SSD1306_DEV_NAME, ssd1306_init,
&ssd1306_driver, NULL,
POST_KERNEL, CONFIG_APPLICATION_INIT_PRIORITY,
&ssd1306_driver_api);

View file

@ -36,7 +36,7 @@ struct ssd1673_data {
struct device *busy;
struct device *spi_dev;
struct spi_config spi_config;
#if defined(CONFIG_SSD1673_SPI_GPIO_CS)
#if defined(DT_SSD1673_SPI_GPIO_CS)
struct spi_cs_control cs_ctrl;
#endif
u8_t contrast;
@ -69,7 +69,7 @@ static inline int ssd1673_write_cmd(struct ssd1673_data *driver,
struct spi_buf buf = {.buf = &cmd, .len = sizeof(cmd)};
struct spi_buf_set buf_set = {.buffers = &buf, .count = 1};
gpio_pin_write(driver->dc, CONFIG_SSD1673_DC_PIN, 0);
gpio_pin_write(driver->dc, DT_SSD1673_DC_PIN, 0);
if (spi_write(driver->spi_dev, &driver->spi_config, &buf_set)) {
return -1;
}
@ -77,7 +77,7 @@ static inline int ssd1673_write_cmd(struct ssd1673_data *driver,
if (data != NULL) {
buf.buf = data;
buf.len = len;
gpio_pin_write(driver->dc, CONFIG_SSD1673_DC_PIN, 1);
gpio_pin_write(driver->dc, DT_SSD1673_DC_PIN, 1);
if (spi_write(driver->spi_dev, &driver->spi_config, &buf_set)) {
return -1;
}
@ -90,10 +90,10 @@ static inline void ssd1673_busy_wait(struct ssd1673_data *driver)
{
u32_t val = 0;
gpio_pin_read(driver->busy, CONFIG_SSD1673_BUSY_PIN, &val);
gpio_pin_read(driver->busy, DT_SSD1673_BUSY_PIN, &val);
while (val) {
k_busy_wait(SSD1673_BUSY_DELAY);
gpio_pin_read(driver->busy, CONFIG_SSD1673_BUSY_PIN, &val);
gpio_pin_read(driver->busy, DT_SSD1673_BUSY_PIN, &val);
}
}
@ -136,7 +136,7 @@ static inline int ssd1673_set_ram_ptr(struct ssd1673_data *driver,
static inline void ssd1673_set_orientation(struct ssd1673_data *driver)
{
#if CONFIG_SSD1673_ORIENTATION_FLIPPED == 1
#if DT_SSD1673_ORIENTATION_FLIPPED == 1
driver->scan_mode = SSD1673_DATA_ENTRY_XIYDY;
#else
driver->scan_mode = SSD1673_DATA_ENTRY_XDYIY;
@ -298,12 +298,12 @@ static int ssd1673_write(const struct device *dev, const u16_t x,
return -1;
}
gpio_pin_write(driver->dc, CONFIG_SSD1673_DC_PIN, 0);
gpio_pin_write(driver->dc, DT_SSD1673_DC_PIN, 0);
if (spi_write(driver->spi_dev, &driver->spi_config, &buf_set)) {
return -1;
}
gpio_pin_write(driver->dc, CONFIG_SSD1673_DC_PIN, 1);
gpio_pin_write(driver->dc, DT_SSD1673_DC_PIN, 1);
/* clear unusable page */
if (driver->scan_mode == SSD1673_DATA_ENTRY_XDYIY) {
sbuf.buf = dummy_page;
@ -397,9 +397,9 @@ static int ssd1673_controller_init(struct device *dev)
LOG_DBG("");
gpio_pin_write(driver->reset, CONFIG_SSD1673_RESET_PIN, 0);
gpio_pin_write(driver->reset, DT_SSD1673_RESET_PIN, 0);
k_sleep(SSD1673_RESET_DELAY);
gpio_pin_write(driver->reset, CONFIG_SSD1673_RESET_PIN, 1);
gpio_pin_write(driver->reset, DT_SSD1673_RESET_PIN, 1);
k_sleep(SSD1673_RESET_DELAY);
ssd1673_busy_wait(driver);
@ -454,53 +454,53 @@ static int ssd1673_init(struct device *dev)
LOG_DBG("");
driver->spi_dev = device_get_binding(CONFIG_SSD1673_SPI_DEV_NAME);
driver->spi_dev = device_get_binding(DT_SSD1673_SPI_DEV_NAME);
if (driver->spi_dev == NULL) {
LOG_ERR("Could not get SPI device for SSD1673");
return -EIO;
}
driver->spi_config.frequency = CONFIG_SSD1673_SPI_FREQ;
driver->spi_config.frequency = DT_SSD1673_SPI_FREQ;
driver->spi_config.operation = SPI_OP_MODE_MASTER | SPI_WORD_SET(8);
driver->spi_config.slave = CONFIG_SSD1673_SPI_SLAVE_NUMBER;
driver->spi_config.slave = DT_SSD1673_SPI_SLAVE_NUMBER;
driver->spi_config.cs = NULL;
driver->reset = device_get_binding(CONFIG_SSD1673_RESET_GPIO_PORT_NAME);
driver->reset = device_get_binding(DT_SSD1673_RESET_GPIO_PORT_NAME);
if (driver->reset == NULL) {
LOG_ERR("Could not get GPIO port for SSD1673 reset");
return -EIO;
}
gpio_pin_configure(driver->reset, CONFIG_SSD1673_RESET_PIN,
gpio_pin_configure(driver->reset, DT_SSD1673_RESET_PIN,
GPIO_DIR_OUT);
driver->dc = device_get_binding(CONFIG_SSD1673_DC_GPIO_PORT_NAME);
driver->dc = device_get_binding(DT_SSD1673_DC_GPIO_PORT_NAME);
if (driver->dc == NULL) {
LOG_ERR("Could not get GPIO port for SSD1673 DC signal");
return -EIO;
}
gpio_pin_configure(driver->dc, CONFIG_SSD1673_DC_PIN,
gpio_pin_configure(driver->dc, DT_SSD1673_DC_PIN,
GPIO_DIR_OUT);
driver->busy = device_get_binding(CONFIG_SSD1673_BUSY_GPIO_PORT_NAME);
driver->busy = device_get_binding(DT_SSD1673_BUSY_GPIO_PORT_NAME);
if (driver->busy == NULL) {
LOG_ERR("Could not get GPIO port for SSD1673 busy signal");
return -EIO;
}
gpio_pin_configure(driver->busy, CONFIG_SSD1673_BUSY_PIN,
gpio_pin_configure(driver->busy, DT_SSD1673_BUSY_PIN,
GPIO_DIR_IN);
#if defined(CONFIG_SSD1673_SPI_GPIO_CS)
#if defined(DT_SSD1673_SPI_GPIO_CS)
driver->cs_ctrl.gpio_dev = device_get_binding(
CONFIG_SSD1673_SPI_GPIO_CS_DRV_NAME);
DT_SSD1673_SPI_GPIO_CS_DRV_NAME);
if (!driver->cs_ctrl.gpio_dev) {
LOG_ERR("Unable to get SPI GPIO CS device");
return -EIO;
}
driver->cs_ctrl.gpio_pin = CONFIG_SSD1673_SPI_GPIO_CS_PIN;
driver->cs_ctrl.gpio_pin = DT_SSD1673_SPI_GPIO_CS_PIN;
driver->cs_ctrl.delay = 0;
driver->spi_config.cs = &driver->cs_ctrl;
#endif
@ -526,7 +526,7 @@ static struct display_driver_api ssd1673_driver_api = {
};
DEVICE_AND_API_INIT(ssd1673, CONFIG_SSD1673_DEV_NAME, ssd1673_init,
DEVICE_AND_API_INIT(ssd1673, DT_SSD1673_DEV_NAME, ssd1673_init,
&ssd1673_driver, NULL,
POST_KERNEL, CONFIG_APPLICATION_INIT_PRIORITY,
&ssd1673_driver_api);