Skip to content

Commit daa48da

Browse files
MulinChaonashif
authored andcommitted
soc: replace DT_ with NPCX_DT_ prefix for all macros in soc_dt.h
This CL replaces all DT_ prefix with NPCX_DT_ for all macros used for providing npcx device information in soc_dt.h It avoided the ambiguity with the DT_ prefix for system DT macros/defines. Signed-off-by: Mulin Chao <[email protected]>
1 parent 87dddda commit daa48da

File tree

10 files changed

+222
-110
lines changed

10 files changed

+222
-110
lines changed

drivers/adc/adc_npcx.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,11 +307,11 @@ static const struct adc_driver_api adc_npcx_driver_api = {
307307

308308
static int adc_npcx_init(const struct device *dev);
309309

310-
static const struct npcx_alt adc_alts[] = DT_NPCX_ALT_ITEMS_LIST(0);
310+
static const struct npcx_alt adc_alts[] = NPCX_DT_ALT_ITEMS_LIST(0);
311311

312312
static const struct adc_npcx_config adc_npcx_cfg_0 = {
313313
.base = DT_INST_REG_ADDR(0),
314-
.clk_cfg = DT_NPCX_CLK_CFG_ITEM(0),
314+
.clk_cfg = NPCX_DT_CLK_CFG_ITEM(0),
315315
.alts_list = adc_alts,
316316
};
317317

drivers/espi/espi_npcx.c

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -113,41 +113,41 @@ struct npcx_vw_out_config {
113113
*/
114114
static const struct npcx_vw_in_config vw_in_tbl[] = {
115115
/* index 02h (In) */
116-
DT_NPCX_VW_IN_CONF(ESPI_VWIRE_SIGNAL_SLP_S3, vw_slp_s3),
117-
DT_NPCX_VW_IN_CONF(ESPI_VWIRE_SIGNAL_SLP_S4, vw_slp_s4),
118-
DT_NPCX_VW_IN_CONF(ESPI_VWIRE_SIGNAL_SLP_S5, vw_slp_s5),
116+
NPCX_DT_VW_IN_CONF(ESPI_VWIRE_SIGNAL_SLP_S3, vw_slp_s3),
117+
NPCX_DT_VW_IN_CONF(ESPI_VWIRE_SIGNAL_SLP_S4, vw_slp_s4),
118+
NPCX_DT_VW_IN_CONF(ESPI_VWIRE_SIGNAL_SLP_S5, vw_slp_s5),
119119
/* index 03h (In) */
120-
DT_NPCX_VW_IN_CONF(ESPI_VWIRE_SIGNAL_SUS_STAT, vw_sus_stat),
121-
DT_NPCX_VW_IN_CONF(ESPI_VWIRE_SIGNAL_PLTRST, vw_plt_rst),
122-
DT_NPCX_VW_IN_CONF(ESPI_VWIRE_SIGNAL_OOB_RST_WARN, vw_oob_rst_warn),
120+
NPCX_DT_VW_IN_CONF(ESPI_VWIRE_SIGNAL_SUS_STAT, vw_sus_stat),
121+
NPCX_DT_VW_IN_CONF(ESPI_VWIRE_SIGNAL_PLTRST, vw_plt_rst),
122+
NPCX_DT_VW_IN_CONF(ESPI_VWIRE_SIGNAL_OOB_RST_WARN, vw_oob_rst_warn),
123123
/* index 07h (In) */
124-
DT_NPCX_VW_IN_CONF(ESPI_VWIRE_SIGNAL_HOST_RST_WARN, vw_host_rst_warn),
124+
NPCX_DT_VW_IN_CONF(ESPI_VWIRE_SIGNAL_HOST_RST_WARN, vw_host_rst_warn),
125125
/* index 41h (In) */
126-
DT_NPCX_VW_IN_CONF(ESPI_VWIRE_SIGNAL_SUS_WARN, vw_sus_warn),
127-
DT_NPCX_VW_IN_CONF(ESPI_VWIRE_SIGNAL_SUS_PWRDN_ACK, vw_sus_pwrdn_ack),
128-
DT_NPCX_VW_IN_CONF(ESPI_VWIRE_SIGNAL_SLP_A, vw_slp_a),
126+
NPCX_DT_VW_IN_CONF(ESPI_VWIRE_SIGNAL_SUS_WARN, vw_sus_warn),
127+
NPCX_DT_VW_IN_CONF(ESPI_VWIRE_SIGNAL_SUS_PWRDN_ACK, vw_sus_pwrdn_ack),
128+
NPCX_DT_VW_IN_CONF(ESPI_VWIRE_SIGNAL_SLP_A, vw_slp_a),
129129
/* index 42h (In) */
130-
DT_NPCX_VW_IN_CONF(ESPI_VWIRE_SIGNAL_SLP_LAN, vw_slp_lan),
131-
DT_NPCX_VW_IN_CONF(ESPI_VWIRE_SIGNAL_SLP_WLAN, vw_slp_wlan),
130+
NPCX_DT_VW_IN_CONF(ESPI_VWIRE_SIGNAL_SLP_LAN, vw_slp_lan),
131+
NPCX_DT_VW_IN_CONF(ESPI_VWIRE_SIGNAL_SLP_WLAN, vw_slp_wlan),
132132
};
133133

134134
static const struct npcx_vw_out_config vw_out_tbl[] = {
135135
/* index 04h (Out) */
136-
DT_NPCX_VW_OUT_CONF(ESPI_VWIRE_SIGNAL_OOB_RST_ACK, vw_oob_rst_ack),
137-
DT_NPCX_VW_OUT_CONF(ESPI_VWIRE_SIGNAL_WAKE, vw_wake),
138-
DT_NPCX_VW_OUT_CONF(ESPI_VWIRE_SIGNAL_PME, vw_pme),
136+
NPCX_DT_VW_OUT_CONF(ESPI_VWIRE_SIGNAL_OOB_RST_ACK, vw_oob_rst_ack),
137+
NPCX_DT_VW_OUT_CONF(ESPI_VWIRE_SIGNAL_WAKE, vw_wake),
138+
NPCX_DT_VW_OUT_CONF(ESPI_VWIRE_SIGNAL_PME, vw_pme),
139139
/* index 05h (Out) */
140-
DT_NPCX_VW_OUT_CONF(ESPI_VWIRE_SIGNAL_SLV_BOOT_DONE, vw_slv_boot_done),
141-
DT_NPCX_VW_OUT_CONF(ESPI_VWIRE_SIGNAL_ERR_FATAL, vw_err_fatal),
142-
DT_NPCX_VW_OUT_CONF(ESPI_VWIRE_SIGNAL_ERR_NON_FATAL, vw_err_non_fatal),
143-
DT_NPCX_VW_OUT_CONF(ESPI_VWIRE_SIGNAL_SLV_BOOT_STS,
140+
NPCX_DT_VW_OUT_CONF(ESPI_VWIRE_SIGNAL_SLV_BOOT_DONE, vw_slv_boot_done),
141+
NPCX_DT_VW_OUT_CONF(ESPI_VWIRE_SIGNAL_ERR_FATAL, vw_err_fatal),
142+
NPCX_DT_VW_OUT_CONF(ESPI_VWIRE_SIGNAL_ERR_NON_FATAL, vw_err_non_fatal),
143+
NPCX_DT_VW_OUT_CONF(ESPI_VWIRE_SIGNAL_SLV_BOOT_STS,
144144
vw_slv_boot_sts_with_done),
145145
/* index 06h (Out) */
146-
DT_NPCX_VW_OUT_CONF(ESPI_VWIRE_SIGNAL_SCI, vw_sci),
147-
DT_NPCX_VW_OUT_CONF(ESPI_VWIRE_SIGNAL_SMI, vw_smi),
148-
DT_NPCX_VW_OUT_CONF(ESPI_VWIRE_SIGNAL_HOST_RST_ACK, vw_host_rst_ack),
146+
NPCX_DT_VW_OUT_CONF(ESPI_VWIRE_SIGNAL_SCI, vw_sci),
147+
NPCX_DT_VW_OUT_CONF(ESPI_VWIRE_SIGNAL_SMI, vw_smi),
148+
NPCX_DT_VW_OUT_CONF(ESPI_VWIRE_SIGNAL_HOST_RST_ACK, vw_host_rst_ack),
149149
/* index 40h (Out) */
150-
DT_NPCX_VW_OUT_CONF(ESPI_VWIRE_SIGNAL_SUS_ACK, vw_sus_ack),
150+
NPCX_DT_VW_OUT_CONF(ESPI_VWIRE_SIGNAL_SUS_ACK, vw_sus_ack),
151151
};
152152

153153
/* Callbacks for eSPI bus reset and Virtual Wire signals. */
@@ -806,12 +806,12 @@ static const struct espi_driver_api espi_npcx_driver_api = {
806806

807807
static struct espi_npcx_data espi_npcx_data;
808808

809-
static const struct npcx_alt espi_alts[] = DT_NPCX_ALT_ITEMS_LIST(0);
809+
static const struct npcx_alt espi_alts[] = NPCX_DT_ALT_ITEMS_LIST(0);
810810

811811
static const struct espi_npcx_config espi_npcx_config = {
812812
.base = DT_INST_REG_ADDR(0),
813-
.espi_rst_wui = DT_NPCX_WUI_ITEM_BY_NAME(0, espi_rst_wui),
814-
.clk_cfg = DT_NPCX_CLK_CFG_ITEM(0),
813+
.espi_rst_wui = NPCX_DT_WUI_ITEM_BY_NAME(0, espi_rst_wui),
814+
.clk_cfg = NPCX_DT_CLK_CFG_ITEM(0),
815815
.alts_size = ARRAY_SIZE(espi_alts),
816816
.alts_list = espi_alts,
817817
};

drivers/espi/host_subs_npcx.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ struct host_sub_npcx_data {
148148
};
149149

150150
static const struct npcx_clk_cfg host_dev_clk_cfg[] =
151-
DT_NPCX_CLK_CFG_ITEMS_LIST(0);
151+
NPCX_DT_CLK_CFG_ITEMS_LIST(0);
152152

153153
struct host_sub_npcx_config host_sub_cfg = {
154154
.inst_mswc = (struct mswc_reg *)DT_INST_REG_ADDR_BY_NAME(0, mswc),
@@ -157,7 +157,7 @@ struct host_sub_npcx_config host_sub_cfg = {
157157
.inst_kbc = (struct kbc_reg *)DT_INST_REG_ADDR_BY_NAME(0, kbc),
158158
.inst_pm_acpi = (struct pmch_reg *)DT_INST_REG_ADDR_BY_NAME(0, pm_acpi),
159159
.inst_pm_hcmd = (struct pmch_reg *)DT_INST_REG_ADDR_BY_NAME(0, pm_hcmd),
160-
.host_acc_wui = DT_NPCX_WUI_ITEM_BY_NAME(0, host_acc_wui),
160+
.host_acc_wui = NPCX_DT_WUI_ITEM_BY_NAME(0, host_acc_wui),
161161
.clks_size = ARRAY_SIZE(host_dev_clk_cfg),
162162
.clks_list = host_dev_clk_cfg,
163163
};
@@ -440,7 +440,7 @@ static void host_port80_init(void)
440440
#if defined(CONFIG_ESPI_PERIPHERAL_UART)
441441
/* host uart pinmux configuration */
442442
static const struct npcx_alt host_uart_alts[] =
443-
DT_NPCX_ALT_ITEMS_LIST(0);
443+
NPCX_DT_IO_ALT_ITEMS_LIST(nuvoton_npcx_host_uart, 0);
444444
/* Host UART sub-device local functions */
445445
void host_uart_init(void)
446446
{

drivers/gpio/gpio_npcx.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,8 @@ int gpio_npcx_init(const struct device *dev)
273273
}, \
274274
.base = DT_INST_REG_ADDR(inst), \
275275
.port = inst, \
276-
.wui_size = DT_NPCX_WUI_ITEMS_LEN(inst), \
277-
.wui_maps = DT_NPCX_WUI_ITEMS_LIST(inst) \
276+
.wui_size = NPCX_DT_WUI_ITEMS_LEN(inst), \
277+
.wui_maps = NPCX_DT_WUI_ITEMS_LIST(inst) \
278278
}; \
279279
\
280280
static struct gpio_npcx_data gpio_npcx_data_##inst; \

drivers/interrupt_controller/intc_miwu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,8 @@ int npcx_miwu_manage_dev_callback(struct miwu_dev_callback *cb, bool set)
338338
} \
339339
\
340340
/* Config IRQ and MWIU group directly */ \
341-
DT_FOREACH_CHILD(DT_NODE_FROM_MIWU_MAP(inst), \
342-
DT_MIWU_IRQ_CONNECT_IMPL_CHILD_FUNC) \
341+
DT_FOREACH_CHILD(NPCX_DT_NODE_FROM_MIWU_MAP(inst), \
342+
NPCX_DT_MIWU_IRQ_CONNECT_IMPL_CHILD_FUNC) \
343343
return 0; \
344344
} \
345345

drivers/pinmux/pinmux_npcx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ struct npcx_pinctrl_config {
1919

2020
/* Default io list which default functionality are not IOs */
2121
#define DT_DRV_COMPAT nuvoton_npcx_pinctrl_def
22-
static const struct npcx_alt def_alts[] = DT_NPCX_ALT_ITEMS_LIST(0);
22+
static const struct npcx_alt def_alts[] = NPCX_DT_ALT_ITEMS_LIST(0);
2323

2424
static const struct npcx_pinctrl_config npcx_pinctrl_cfg = {
2525
.base = DT_REG_ADDR(DT_NODELABEL(scfg)),

drivers/pwm/pwm_npcx.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,11 +197,11 @@ static int pwm_npcx_init(const struct device *dev)
197197

198198
#define NPCX_PWM_INIT(inst) \
199199
static const struct npcx_alt pwm_alts##inst[] = \
200-
DT_NPCX_ALT_ITEMS_LIST(inst); \
200+
NPCX_DT_ALT_ITEMS_LIST(inst); \
201201
\
202202
static const struct pwm_npcx_config pwm_npcx_cfg_##inst = { \
203203
.base = DT_INST_REG_ADDR(inst), \
204-
.clk_cfg = DT_NPCX_CLK_CFG_ITEM(inst), \
204+
.clk_cfg = NPCX_DT_CLK_CFG_ITEM(inst), \
205205
.alts_size = ARRAY_SIZE(pwm_alts##inst), \
206206
.alts_list = pwm_alts##inst, \
207207
}; \

drivers/serial/uart_npcx.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -388,15 +388,15 @@ static int uart_npcx_init(const struct device *dev)
388388
NPCX_UART_IRQ_CONFIG_FUNC_DECL(inst); \
389389
\
390390
static const struct npcx_alt uart_alts##inst[] = \
391-
DT_NPCX_ALT_ITEMS_LIST(inst); \
391+
NPCX_DT_ALT_ITEMS_LIST(inst); \
392392
\
393393
static const struct uart_npcx_config uart_npcx_cfg_##inst = { \
394394
.uconf = { \
395395
.base = (uint8_t *)DT_INST_REG_ADDR(inst), \
396396
NPCX_UART_IRQ_CONFIG_FUNC_INIT(inst) \
397397
}, \
398-
.clk_cfg = DT_NPCX_CLK_CFG_ITEM(inst), \
399-
.uart_rx_wui = DT_NPCX_WUI_ITEM_BY_NAME(0, uart_rx), \
398+
.clk_cfg = NPCX_DT_CLK_CFG_ITEM(inst), \
399+
.uart_rx_wui = NPCX_DT_WUI_ITEM_BY_NAME(0, uart_rx), \
400400
.alts_size = ARRAY_SIZE(uart_alts##inst), \
401401
.alts_list = uart_alts##inst, \
402402
}; \

0 commit comments

Comments
 (0)