rtc: Set prescaler to QMSI shim

In QMSI 1.2 API, the RTC divider value for the prescaler can now be set
on runtime. This is done through a config parameter for the qm_rtc
driver.

Fix the rtc shim driver by using the value defined in rtc.h as
RTC_DIVIDER.

Change-Id: I5ab61a5a1a3debca103f2782e0ac584938dc91e1
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
This commit is contained in:
Jesus Sanchez-Palencia 2016-10-18 10:30:27 -07:00 committed by Anas Nashif
commit 13b5d62625

View file

@ -126,6 +126,13 @@ static int rtc_qmsi_set_config(struct device *dev, struct rtc_config *cfg)
qm_cfg.callback = (void *) cfg->cb_fn;
qm_cfg.callback_data = dev;
/* Set prescaler value. Ideally, the divider should come from struct
* rtc_config instead. It's safe to use RTC_DIVIDER here for now since
* values defined by clk_rtc_div and by QMSI's clk_rtc_div_t match for
* both D2000 and SE.
*/
qm_cfg.prescaler = RTC_DIVIDER;
rtc_critical_region_start(dev);
if (qm_rtc_set_config(QM_RTC_0, &qm_cfg)) {