Skip to content

Commit 8313320

Browse files
mbolivar-nordicnashif
authored andcommitted
pwm: it8xxx2: use new DT pinctrl accessors
Update to use the new APIs. Signed-off-by: Martí Bolívar <[email protected]>
1 parent 7ab602a commit 8313320

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

drivers/i2c/i2c_ite_it8xxx2.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,8 +1019,9 @@ static const struct i2c_driver_api i2c_it8xxx2_driver_api = {
10191019

10201020
#define I2C_ITE_IT8XXX2_INIT(idx) \
10211021
static void i2c_it8xxx2_config_func_##idx(void); \
1022-
static const struct i2c_alts_cfg i2c_alts_##idx[DT_INST_PROP_LEN \
1023-
(idx, pinctrl_0)] = IT8XXX2_DT_ALT_ITEMS_LIST(idx); \
1022+
static const struct i2c_alts_cfg \
1023+
i2c_alts_##idx[DT_INST_NUM_PINCTRLS_BY_IDX(idx, 0)] = \
1024+
IT8XXX2_DT_ALT_ITEMS_LIST(idx); \
10241025
\
10251026
static const struct i2c_it8xxx2_config i2c_it8xxx2_cfg_##idx = { \
10261027
.base = (uint8_t *)(DT_INST_REG_ADDR(idx)), \

drivers/pwm/pwm_ite_it8xxx2.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,8 @@ struct pwm_it8xxx2_cfg {
5151
#define DRV_REG(dev) (struct pwm_it8xxx2_regs *)(DRV_CONFIG(dev)->base)
5252
#define DEV_PINMUX(inst) \
5353
DEVICE_DT_GET(DT_PHANDLE_BY_IDX(DT_NODELABEL(pinctrl_pwm##inst), pinctrls, 0))
54-
#define DEV_PIN(inst) \
55-
DT_PHA(DT_PHANDLE_BY_IDX(DT_DRV_INST(inst), pinctrl_0, 0), pinctrls, pin)
56-
#define DEV_ALT_FUN(inst) \
57-
DT_PHA(DT_PHANDLE_BY_IDX(DT_DRV_INST(inst), pinctrl_0, 0), pinctrls, alt_func)
54+
#define DEV_PIN(inst) DT_PHA(DT_INST_PINCTRL_0(inst, 0), pinctrls, pin)
55+
#define DEV_ALT_FUN(inst) DT_PHA(DT_INST_PINCTRL_0(inst, 0), pinctrls, alt_func)
5856

5957
static void pwm_enable(const struct device *dev, int enabled)
6058
{

0 commit comments

Comments
 (0)