Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers: counter: npcm: remove low-freq-select property #142

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion boards/nuvoton/npcm400_evb/npcm400_evb.dts
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@
};

&timer1 {
low-freq-select;
prescaler = <2>;
status = "okay";
};
6 changes: 2 additions & 4 deletions drivers/counter/counter_npcm_itim32.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <zephyr/drivers/counter.h>
#include <zephyr/logging/log.h>
#include <zephyr/drivers/clock_control.h>
#include <zephyr/dt-bindings/clock/npcm_clock.h>
#include <zephyr/sys_clock.h>
#include <zephyr/kernel.h>
#include <zephyr/irq.h>
Expand All @@ -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);
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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, \
}; \
Expand Down
4 changes: 0 additions & 4 deletions dts/bindings/counter/nuvoton,npcm-itim32.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Loading