counter: Fix interface

With the current interface if multiple counters/timers are present in
the system, it is not possible to select from which one to read the
current value.

This patch fixes the behavior.

Change-Id: Id1ae1f2330e98d078f755c0b81c3b176e90b8389
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
This commit is contained in:
Vincenzo Frascino 2016-11-29 16:35:15 +00:00 committed by Anas Nashif
commit 73ee7e2d1c
3 changed files with 4 additions and 4 deletions

View file

@ -39,7 +39,7 @@ static int aon_counter_qmsi_stop(struct device *dev)
return 0;
}
static uint32_t aon_counter_qmsi_read(void)
static uint32_t aon_counter_qmsi_read(struct device *dev)
{
uint32_t value;

View file

@ -125,7 +125,7 @@ static int aon_timer_qmsi_stop(struct device *dev)
return 0;
}
static uint32_t aon_timer_qmsi_read(void)
static uint32_t aon_timer_qmsi_read(struct device *dev)
{
uint32_t value;

View file

@ -41,7 +41,7 @@ typedef void (*counter_callback_t)(struct device *dev, void *user_data);
typedef int (*counter_api_start)(struct device *dev);
typedef int (*counter_api_stop)(struct device *dev);
typedef uint32_t (*counter_api_read)(void);
typedef uint32_t (*counter_api_read)(struct device *dev);
typedef int (*counter_api_set_alarm)(struct device *dev,
counter_callback_t callback,
uint32_t count, void *user_data);
@ -99,7 +99,7 @@ static inline uint32_t counter_read(struct device *dev)
{
const struct counter_driver_api *api = dev->driver_api;
return api->read();
return api->read(dev);
}
/**