Skip to content

Commit 6074696

Browse files
galaknashif
authored andcommitted
counters: Remove deprecated APIs
Remove support for counter_read and counter_get_max_relative_alarm as they have been deprecated for at least 2 releases. As part of the removal of counter_get_max_relative_alarm remove the code in all counter drivers that implemented the API. Signed-off-by: Kumar Gala <[email protected]>
1 parent f3d11cc commit 6074696

18 files changed

+2
-151
lines changed

doc/releases/release-notes-2.6.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ Removed APIs in this release
7171

7272
* Removed support for k_mem_domain_destroy and k_mem_domain_remove_thread
7373

74+
* Removed support for counter_read and counter_get_max_relative_alarm
75+
7476
============================
7577

7678
Stable API changes in this release

drivers/counter/counter_esp32.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,6 @@ static uint32_t counter_esp32_get_top_value(const struct device *dev)
205205
return DEV_CFG(dev)->counter_info.max_top_value;
206206
}
207207

208-
static uint32_t counter_esp32_get_max_relative_alarm(const struct device *dev)
209-
{
210-
return counter_esp32_get_top_value(dev);
211-
}
212-
213208
static const struct counter_driver_api counter_api = {
214209
.start = counter_esp32_start,
215210
.stop = counter_esp32_stop,
@@ -219,7 +214,6 @@ static const struct counter_driver_api counter_api = {
219214
.set_top_value = counter_esp32_set_top_value,
220215
.get_pending_int = counter_esp32_get_pending_int,
221216
.get_top_value = counter_esp32_get_top_value,
222-
.get_max_relative_alarm = counter_esp32_get_max_relative_alarm
223217
};
224218

225219
static void counter_esp32_isr(struct device *dev)

drivers/counter/counter_gecko_rtcc.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,6 @@ static uint32_t counter_gecko_get_top_value(const struct device *dev)
153153
return RTCC_ChannelCCVGet(1);
154154
}
155155

156-
static uint32_t counter_gecko_get_max_relative_alarm(const struct device *dev)
157-
{
158-
ARG_UNUSED(dev);
159-
160-
return RTCC_ChannelCCVGet(1);
161-
}
162-
163156
static int counter_gecko_set_alarm(const struct device *dev, uint8_t chan_id,
164157
const struct counter_alarm_cfg *alarm_cfg)
165158
{
@@ -327,7 +320,6 @@ static const struct counter_driver_api counter_gecko_driver_api = {
327320
.set_top_value = counter_gecko_set_top_value,
328321
.get_pending_int = counter_gecko_get_pending_int,
329322
.get_top_value = counter_gecko_get_top_value,
330-
.get_max_relative_alarm = counter_gecko_get_max_relative_alarm,
331323
};
332324

333325
/* RTCC0 */

drivers/counter/counter_handlers.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,6 @@ static inline uint32_t z_vrfy_counter_get_max_top_value(const struct device *dev
129129
}
130130
#include <syscalls/counter_get_max_top_value_mrsh.c>
131131

132-
static inline uint32_t z_vrfy_counter_get_max_relative_alarm(const struct device *dev)
133-
{
134-
Z_OOPS(Z_SYSCALL_DRIVER_COUNTER(dev, get_max_relative_alarm));
135-
return z_impl_counter_get_max_relative_alarm((const struct device *)dev);
136-
}
137-
#include <syscalls/counter_get_max_relative_alarm_mrsh.c>
138-
139132
static inline uint32_t z_vrfy_counter_get_guard_period(const struct device *dev,
140133
uint32_t flags)
141134
{

drivers/counter/counter_imx_epit.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,19 +134,13 @@ static uint32_t imx_epit_get_top_value(const struct device *dev)
134134
return EPIT_GetCounterLoadValue(base);
135135
}
136136

137-
static uint32_t imx_epit_get_max_relative_alarm(const struct device *dev)
138-
{
139-
return COUNTER_MAX_RELOAD;
140-
}
141-
142137
static const struct counter_driver_api imx_epit_driver_api = {
143138
.start = imx_epit_start,
144139
.stop = imx_epit_stop,
145140
.get_value = imx_epit_get_value,
146141
.set_top_value = imx_epit_set_top_value,
147142
.get_pending_int = imx_epit_get_pending_int,
148143
.get_top_value = imx_epit_get_top_value,
149-
.get_max_relative_alarm = imx_epit_get_max_relative_alarm,
150144
};
151145

152146
#define COUNTER_IMX_EPIT_DEVICE(idx) \

drivers/counter/counter_ll_stm32_rtc.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -246,15 +246,6 @@ static int rtc_stm32_set_top_value(const struct device *dev,
246246

247247
}
248248

249-
250-
static uint32_t rtc_stm32_get_max_relative_alarm(const struct device *dev)
251-
{
252-
const struct counter_config_info *info = dev->config;
253-
254-
return info->max_top_value;
255-
}
256-
257-
258249
void rtc_stm32_isr(const struct device *dev)
259250
{
260251
struct rtc_stm32_data *data = DEV_DATA(dev);
@@ -425,7 +416,6 @@ static const struct counter_driver_api rtc_stm32_driver_api = {
425416
.set_top_value = rtc_stm32_set_top_value,
426417
.get_pending_int = rtc_stm32_get_pending_int,
427418
.get_top_value = rtc_stm32_get_top_value,
428-
.get_max_relative_alarm = rtc_stm32_get_max_relative_alarm,
429419
};
430420

431421
DEVICE_DT_INST_DEFINE(0, &rtc_stm32_init, device_pm_control_nop,

drivers/counter/counter_mchp_xec.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -241,13 +241,6 @@ static int counter_xec_set_top_value(const struct device *dev,
241241
return ret;
242242
}
243243

244-
static uint32_t counter_xec_get_max_relative_alarm(const struct device *dev)
245-
{
246-
const struct counter_xec_config *counter_cfg = COUNTER_XEC_CONFIG(dev);
247-
248-
return counter_cfg->info.max_top_value;
249-
}
250-
251244
static void counter_xec_isr(const struct device *dev)
252245
{
253246
BTMR_Type *counter = COUNTER_XEC_REG_BASE(dev);
@@ -284,7 +277,6 @@ static const struct counter_driver_api counter_xec_api = {
284277
.set_top_value = counter_xec_set_top_value,
285278
.get_pending_int = counter_xec_get_pending_int,
286279
.get_top_value = counter_xec_get_top_value,
287-
.get_max_relative_alarm = counter_xec_get_max_relative_alarm,
288280
};
289281

290282
static int counter_xec_init(const struct device *dev)

drivers/counter/counter_mcux_gpt.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -162,13 +162,6 @@ static uint32_t mcux_gpt_get_top_value(const struct device *dev)
162162
return config->info.max_top_value;
163163
}
164164

165-
static uint32_t mcux_gpt_get_max_relative_alarm(const struct device *dev)
166-
{
167-
const struct mcux_gpt_config *config = dev->config;
168-
169-
return config->info.max_top_value;
170-
}
171-
172165
static int mcux_gpt_init(const struct device *dev)
173166
{
174167
const struct mcux_gpt_config *config = dev->config;
@@ -205,7 +198,6 @@ static const struct counter_driver_api mcux_gpt_driver_api = {
205198
.set_top_value = mcux_gpt_set_top_value,
206199
.get_pending_int = mcux_gpt_get_pending_int,
207200
.get_top_value = mcux_gpt_get_top_value,
208-
.get_max_relative_alarm = mcux_gpt_get_max_relative_alarm,
209201
};
210202

211203
#define GPT_DEVICE_INIT_MCUX(n) \

drivers/counter/counter_mcux_lptmr.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,6 @@ static uint32_t mcux_lptmr_get_top_value(const struct device *dev)
103103
return (config->base->CMR & LPTMR_CMR_COMPARE_MASK) + 1U;
104104
}
105105

106-
static uint32_t mcux_lptmr_get_max_relative_alarm(const struct device *dev)
107-
{
108-
ARG_UNUSED(dev);
109-
110-
/* Alarms not supported */
111-
return 0;
112-
}
113-
114106
static void mcux_lptmr_isr(const struct device *dev)
115107
{
116108
const struct mcux_lptmr_config *config = dev->config;
@@ -156,7 +148,6 @@ static const struct counter_driver_api mcux_lptmr_driver_api = {
156148
.set_top_value = mcux_lptmr_set_top_value,
157149
.get_pending_int = mcux_lptmr_get_pending_int,
158150
.get_top_value = mcux_lptmr_get_top_value,
159-
.get_max_relative_alarm = mcux_lptmr_get_max_relative_alarm,
160151
};
161152

162153
#define TO_LPTMR_CLK_SEL(val) _DO_CONCAT(kLPTMR_PrescalerClock_, val)

drivers/counter/counter_mcux_pit.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,6 @@ static uint32_t mcux_pit_get_pending_int(const struct device *dev)
107107
return ((flags & mask) == mask);
108108
}
109109

110-
static uint32_t mcux_pit_get_max_relative_alarm(const struct device *dev)
111-
{
112-
const struct mcux_pit_config *config = dev->config;
113-
114-
return config->info.max_top_value;
115-
}
116-
117110
static void mcux_pit_isr(const struct device *dev)
118111
{
119112
const struct mcux_pit_config *config = dev->config;
@@ -208,7 +201,6 @@ static const struct counter_driver_api mcux_pit_driver_api = {
208201
.cancel_alarm = mcux_pit_cancel_alarm,
209202
.get_pending_int = mcux_pit_get_pending_int,
210203
.get_top_value = mcux_pit_get_top_value,
211-
.get_max_relative_alarm = mcux_pit_get_max_relative_alarm,
212204
};
213205

214206
/*

0 commit comments

Comments
 (0)