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:
parent
7c0fc99c79
commit
13b5d62625
1 changed files with 7 additions and 0 deletions
|
@ -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)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue