@@ -113,20 +113,20 @@ static int mcp23sxx_bus_is_ready(const struct device *dev)
113113 return 0 ;
114114}
115115
116- #define GPIO_MCP23SXX_DEVICE (inst , num_gpios , open_drain ) \
117- static struct mcp23xxx_drv_data mcp23sxx_## inst##_drvdata = { \
116+ #define GPIO_MCP23SXX_DEVICE (inst , num_gpios , open_drain , model ) \
117+ static struct mcp23xxx_drv_data mcp##model##_## inst##_drvdata = { \
118118 /* Default for registers according to datasheet */ \
119119 .reg_cache .iodir = 0xFFFF, .reg_cache.ipol = 0x0, .reg_cache.gpinten = 0x0, \
120120 .reg_cache.defval = 0x0, .reg_cache.intcon = 0x0, .reg_cache.iocon = 0x0, \
121121 .reg_cache.gppu = 0x0, .reg_cache.intf = 0x0, .reg_cache.intcap = 0x0, \
122122 .reg_cache.gpio = 0x0, .reg_cache.olat = 0x0, \
123123 }; \
124- static struct mcp23xxx_config mcp23sxx_## inst##_config = { \
124+ static struct mcp23xxx_config mcp##model##_## inst##_config = { \
125125 .config = { \
126- .port_pin_mask = GPIO_PORT_PIN_MASK_FROM_DT_INST(inst), \
126+ .port_pin_mask = GPIO_PORT_PIN_MASK_FROM_DT_INST(inst), \
127127 }, \
128128 .bus = { \
129- .spi = SPI_DT_SPEC_INST_GET(inst, \
129+ .spi = SPI_DT_SPEC_INST_GET(inst, \
130130 SPI_OP_MODE_MASTER | SPI_MODE_CPOL | \
131131 SPI_MODE_CPHA | SPI_WORD_SET(8), 0) \
132132 }, \
@@ -138,20 +138,20 @@ static int mcp23sxx_bus_is_ready(const struct device *dev)
138138 .write_fn = mcp23sxx_write_port_regs, \
139139 .bus_fn = mcp23sxx_bus_is_ready \
140140 }; \
141- DEVICE_DT_INST_DEFINE(inst, gpio_mcp23xxx_init, NULL, &mcp23sxx_## inst##_drvdata, \
142- &mcp23sxx_## inst##_config, POST_KERNEL, \
141+ DEVICE_DT_INST_DEFINE(inst, gpio_mcp23xxx_init, NULL, &mcp##model##_## inst##_drvdata, \
142+ &mcp##model##_## inst##_config, POST_KERNEL, \
143143 CONFIG_GPIO_MCP23SXX_INIT_PRIORITY, &gpio_mcp23xxx_api_table);
144144
145145
146146#define DT_DRV_COMPAT microchip_mcp23s08
147- DT_INST_FOREACH_STATUS_OKAY_VARGS (GPIO_MCP23SXX_DEVICE , 8 , false)
147+ DT_INST_FOREACH_STATUS_OKAY_VARGS (GPIO_MCP23SXX_DEVICE , 8 , false, 23 s08 )
148148#undef DT_DRV_COMPAT
149149#define DT_DRV_COMPAT microchip_mcp23s09
150- DT_INST_FOREACH_STATUS_OKAY_VARGS (GPIO_MCP23SXX_DEVICE , 8 , true)
150+ DT_INST_FOREACH_STATUS_OKAY_VARGS (GPIO_MCP23SXX_DEVICE , 8 , true, 23 s09 )
151151#undef DT_DRV_COMPAT
152152#define DT_DRV_COMPAT microchip_mcp23s17
153- DT_INST_FOREACH_STATUS_OKAY_VARGS (GPIO_MCP23SXX_DEVICE , 16 , false)
153+ DT_INST_FOREACH_STATUS_OKAY_VARGS (GPIO_MCP23SXX_DEVICE , 16 , false, 23 s17 )
154154#undef DT_DRV_COMPAT
155155#define DT_DRV_COMPAT microchip_mcp23s18
156- DT_INST_FOREACH_STATUS_OKAY_VARGS (GPIO_MCP23SXX_DEVICE , 16 , true)
156+ DT_INST_FOREACH_STATUS_OKAY_VARGS (GPIO_MCP23SXX_DEVICE , 16 , true, 23 s18 )
157157#undef DT_DRV_COMPAT
0 commit comments