From 13aaa04fef3e800966717d910f7195fe43f6e371 Mon Sep 17 00:00:00 2001 From: James Chiang Date: Mon, 7 Oct 2024 18:54:15 -0700 Subject: [PATCH] drivers: counter: npcm: remove low-freq-select property since we can get the clock source definition from dts, remove npcm low-freq-select property. Signed-off-by: James Chiang --- boards/nuvoton/npcm400_evb/npcm400_evb.dts | 1 - drivers/counter/counter_npcm_itim32.c | 6 ++---- dts/bindings/counter/nuvoton,npcm-itim32.yaml | 4 ---- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/boards/nuvoton/npcm400_evb/npcm400_evb.dts b/boards/nuvoton/npcm400_evb/npcm400_evb.dts index 267e9224d656c9..a61176ceb3b8c9 100644 --- a/boards/nuvoton/npcm400_evb/npcm400_evb.dts +++ b/boards/nuvoton/npcm400_evb/npcm400_evb.dts @@ -211,7 +211,6 @@ }; &timer1 { - low-freq-select; prescaler = <2>; status = "okay"; }; diff --git a/drivers/counter/counter_npcm_itim32.c b/drivers/counter/counter_npcm_itim32.c index 2a16b4ba57ccbd..41a40112adf57d 100644 --- a/drivers/counter/counter_npcm_itim32.c +++ b/drivers/counter/counter_npcm_itim32.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -35,8 +36,6 @@ struct counter_npcm_itim32_config { uintptr_t base; /* Clock configuration */ struct npcm_clk_cfg clk_cfg; - /* select low-frequency input source */ - bool lf_select; /* prescaler that use to divide input source frequency */ uint8_t prescaler; void (*irq_config_func)(const struct device *dev); @@ -277,7 +276,7 @@ static int counter_npcm_itim32_init(const struct device *dev) BIT(NPCM_ITCTS_TO_STS); /* Select low-frequency input clock source and change src freq to LF */ - if (config->lf_select == true) { + if (config->clk_cfg.bus == NPCM_CLOCK_BUS_LFCLK) { data->freq = LF_CYCLES_PER_SEC; itcts |= BIT(NPCM_ITCTS_CKSEL); } @@ -323,7 +322,6 @@ static const struct counter_driver_api counter_npcm_itim32_driver_api = { }, \ .base = DT_INST_REG_ADDR(id), \ .clk_cfg = NPCM_DT_CLK_CFG_ITEM(id), \ - .lf_select = DT_INST_PROP_OR(id, low_freq_select, false), \ .prescaler = DT_INST_PROP(id, prescaler), \ .irq_config_func = counter_npcm_itim32_irq_config_##id, \ }; \ diff --git a/dts/bindings/counter/nuvoton,npcm-itim32.yaml b/dts/bindings/counter/nuvoton,npcm-itim32.yaml index 3704cb6370157a..182251e44e803e 100644 --- a/dts/bindings/counter/nuvoton,npcm-itim32.yaml +++ b/dts/bindings/counter/nuvoton,npcm-itim32.yaml @@ -24,7 +24,3 @@ properties: The allowed values for this property are in the range [1..256]. Values above that range will be 8-bit-masked. - - low-freq-select: - type: boolean - description: select low-frequency input clock source.