drivers: counter: incorporate changes of api name and signature.
patch incorporates new api name and signature changes. Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>
This commit is contained in:
parent
59da574601
commit
60348e8081
|
@ -38,9 +38,9 @@ static u32_t aon_counter_qmsi_read(struct device *dev)
|
|||
return value;
|
||||
}
|
||||
|
||||
static int aon_counter_qmsi_set_alarm(struct device *dev,
|
||||
static int aon_counter_qmsi_set_top(struct device *dev,
|
||||
u32_t ticks,
|
||||
counter_wrap_callback_t callback,
|
||||
counter_top_callback_t callback,
|
||||
void *user_data)
|
||||
|
||||
{
|
||||
|
@ -51,7 +51,7 @@ static const struct counter_driver_api aon_counter_qmsi_api = {
|
|||
.start = aon_counter_qmsi_start,
|
||||
.stop = aon_counter_qmsi_stop,
|
||||
.read = aon_counter_qmsi_read,
|
||||
.set_wrap = aon_counter_qmsi_set_alarm,
|
||||
.set_top_value = aon_counter_qmsi_set_top,
|
||||
};
|
||||
|
||||
static int aon_counter_init(struct device *dev)
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
static void aonpt_int_callback(void *user_data);
|
||||
|
||||
static counter_wrap_callback_t user_cb;
|
||||
static counter_top_callback_t user_cb;
|
||||
|
||||
struct aonpt_config {
|
||||
struct counter_config_info info;
|
||||
|
@ -112,15 +112,9 @@ static u32_t aon_timer_qmsi_read(struct device *dev)
|
|||
return value;
|
||||
}
|
||||
|
||||
static int aon_timer_qmsi_set_alarm(struct device *dev,
|
||||
const struct counter_alarm_cfg *alarm_cfg)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
static int aon_timer_qmsi_set_wrap(struct device *dev,
|
||||
static int aon_timer_qmsi_set_top(struct device *dev,
|
||||
u32_t ticks,
|
||||
counter_wrap_callback_t callback,
|
||||
counter_top_callback_t callback,
|
||||
void *user_data)
|
||||
{
|
||||
qm_aonpt_config_t qmsi_cfg;
|
||||
|
@ -158,8 +152,7 @@ static const struct counter_driver_api aon_timer_qmsi_api = {
|
|||
.start = aon_timer_qmsi_start,
|
||||
.stop = aon_timer_qmsi_stop,
|
||||
.read = aon_timer_qmsi_read,
|
||||
.set_alarm = aon_timer_qmsi_set_alarm,
|
||||
.set_wrap = aon_timer_qmsi_set_wrap,
|
||||
.set_top_value = aon_timer_qmsi_set_top,
|
||||
.get_pending_int = aon_timer_qmsi_get_pending_int,
|
||||
};
|
||||
|
||||
|
@ -247,10 +240,10 @@ static int aon_timer_init(struct device *dev)
|
|||
|
||||
static const struct aonpt_config aonpt_conf_info = {
|
||||
.info = {
|
||||
.max_wrap = UINT32_MAX,
|
||||
.max_top_value = UINT32_MAX,
|
||||
.freq = 32768,
|
||||
.count_up = false,
|
||||
.channels = 1,
|
||||
.channels = 0,
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -91,14 +91,14 @@ static int rtc_qmsi_cancel_alarm(struct device *dev,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int rtc_qmsi_set_wrap(struct device *dev, u32_t ticks,
|
||||
counter_wrap_callback_t callback,
|
||||
static int rtc_qmsi_set_top(struct device *dev, u32_t ticks,
|
||||
counter_top_callback_t callback,
|
||||
void *user_data)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
static int rtc_qmsi_set_alarm(struct device *dev,
|
||||
static int rtc_qmsi_set_alarm(struct device *dev, u8_t chan_id,
|
||||
const struct counter_alarm_cfg *alarm_cfg)
|
||||
{
|
||||
qm_rtc_config_t qm_cfg;
|
||||
|
@ -108,7 +108,7 @@ static int rtc_qmsi_set_alarm(struct device *dev,
|
|||
qm_cfg.alarm_en = 1;
|
||||
qm_cfg.alarm_val = alarm_cfg->ticks;
|
||||
|
||||
user_cb = alarm_cfg->handler;
|
||||
user_cb = alarm_cfg->callback;
|
||||
/* Casting callback type due different input parameter from QMSI
|
||||
* compared aganst the Zephyr callback from void cb(struct device *dev)
|
||||
* to void cb(void *)
|
||||
|
@ -156,7 +156,7 @@ static const struct counter_driver_api api = {
|
|||
.start = rtc_qmsi_enable,
|
||||
.stop = rtc_qmsi_disable,
|
||||
.read = rtc_qmsi_read,
|
||||
.set_wrap = rtc_qmsi_set_wrap,
|
||||
.set_top_value = rtc_qmsi_set_top,
|
||||
.set_alarm = rtc_qmsi_set_alarm,
|
||||
.cancel_alarm = rtc_qmsi_cancel_alarm,
|
||||
.get_pending_int = rtc_qmsi_get_pending_int,
|
||||
|
@ -227,7 +227,7 @@ static int rtc_qmsi_device_ctrl(struct device *dev, u32_t ctrl_command,
|
|||
|
||||
static const struct rtc_config rtc_conf_info = {
|
||||
.info = {
|
||||
.max_wrap = UINT32_MAX,
|
||||
.max_top_value = UINT32_MAX,
|
||||
.freq = 32768,
|
||||
.count_up = true,
|
||||
.channels = 1,
|
||||
|
@ -243,6 +243,6 @@ static void rtc_callback(void *user_data)
|
|||
const struct counter_alarm_cfg *cfg = user_data;
|
||||
|
||||
if (user_cb) {
|
||||
(*user_cb)(DEVICE_GET(rtc), cfg, cfg->ticks);
|
||||
(*user_cb)(DEVICE_GET(rtc), 0, cfg->ticks, user_data);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
#define DT_I2C_1_IRQ DT_INTEL_QMSI_I2C_B0002C00_IRQ_0
|
||||
#define DT_I2C_1_IRQ_PRI DT_INTEL_QMSI_I2C_B0002C00_IRQ_0_PRIORITY
|
||||
|
||||
#define CONFIG_RTC_0_NAME DT_INTEL_QMSI_RTC_B0000400_LABEL
|
||||
#define DT_RTC_0_NAME DT_INTEL_QMSI_RTC_B0000400_LABEL
|
||||
#define DT_RTC_0_IRQ DT_INTEL_QMSI_RTC_B0000400_IRQ_0
|
||||
#define CONFIG_RTC_0_IRQ_PRI DT_INTEL_QMSI_RTC_B0000400_IRQ_0_PRIORITY
|
||||
|
||||
|
|
Loading…
Reference in a new issue