diff options
author | Andrew McRae <amcrae@google.com> | 2022-01-27 10:41:45 +1100 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2022-01-27 02:34:54 +0000 |
commit | 5074043f78efc090ba040ef839286594c13b6454 (patch) | |
tree | 690dd346eaf1d66c89e4c155f030590907aebe27 /zephyr/drivers/cros_rtc | |
parent | d30785ab5dad951d91d95026d8c5325cce558e85 (diff) | |
download | chrome-ec-5074043f78efc090ba040ef839286594c13b6454.tar.gz |
idt1337: Move int-gpio to int-pin
Avoid having to use #gpio-cells
BUG=b:216402316
TEST=zmake configure --test test/drivers
BRANCH=none
Signed-off-by: Andrew McRae <amcrae@google.com>
Change-Id: Iee7898f3d1b40518bca6fc65444e84ca12dcfd1e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3418798
Reviewed-by: Aaron Massey <aaronmassey@google.com>
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Diffstat (limited to 'zephyr/drivers/cros_rtc')
-rw-r--r-- | zephyr/drivers/cros_rtc/renesas_rtc_idt1337ag.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/zephyr/drivers/cros_rtc/renesas_rtc_idt1337ag.c b/zephyr/drivers/cros_rtc/renesas_rtc_idt1337ag.c index bbe76f5286..d5606a0469 100644 --- a/zephyr/drivers/cros_rtc/renesas_rtc_idt1337ag.c +++ b/zephyr/drivers/cros_rtc/renesas_rtc_idt1337ag.c @@ -445,8 +445,8 @@ static int renesas_rtc_idt1337ag_init(const struct device *dev) GPIO_INT_EDGE_FALLING); } -#define IDT1337AG_INT_GPIOS \ - DT_PHANDLE_BY_IDX(DT_NODELABEL(idt1337ag), int_gpios, 0) +#define IDT1337AG_INT_PIN \ + DT_PHANDLE(DT_NODELABEL(idt1337ag), int_pin) /* * dt_flags is a uint8_t type. However, for platform/ec @@ -455,20 +455,18 @@ static int renesas_rtc_idt1337ag_init(const struct device *dev) * Cast back to a gpio_dt_flags to compile, discarding the bits * that are not supported by the Zephyr GPIO API. */ -#define CROS_EC_GPIO_DT_SPEC_GET_BY_IDX(node_id, prop, idx) \ - { \ - .port = \ - DEVICE_DT_GET(DT_GPIO_CTLR_BY_IDX(node_id, prop, idx)), \ - .pin = DT_GPIO_PIN_BY_IDX(node_id, prop, idx), \ - .dt_flags = \ - (gpio_dt_flags_t)DT_GPIO_FLAGS_BY_IDX(node_id, prop, idx), \ +#define CROS_EC_GPIO_DT_SPEC_GET(node_id, prop) \ + { \ + .port = DEVICE_DT_GET(DT_GPIO_CTLR(node_id, prop)), \ + .pin = DT_GPIO_PIN(node_id, prop), \ + .dt_flags = \ + (gpio_dt_flags_t)DT_GPIO_FLAGS(node_id, prop), \ } static const struct renesas_rtc_idt1337ag_config renesas_rtc_idt1337ag_cfg_0 = { .bus = DEVICE_DT_GET(DT_INST_BUS(0)), .i2c_addr_flags = DT_INST_REG_ADDR(0), - .gpio_alert = - CROS_EC_GPIO_DT_SPEC_GET_BY_IDX(IDT1337AG_INT_GPIOS, gpios, 0) + .gpio_alert = CROS_EC_GPIO_DT_SPEC_GET(IDT1337AG_INT_PIN, gpios) }; static struct renesas_rtc_idt1337ag_data renesas_rtc_idt1337ag_data_0; |