diff options
Diffstat (limited to 'drivers/rtc')
| -rw-r--r-- | drivers/rtc/rtc-sun6i.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/rtc/rtc-sun6i.c b/drivers/rtc/rtc-sun6i.c index 72086f0c0782..b0d45d23a11b 100644 --- a/drivers/rtc/rtc-sun6i.c +++ b/drivers/rtc/rtc-sun6i.c | |||
| @@ -37,9 +37,11 @@ | |||
| 37 | 37 | ||
| 38 | /* Control register */ | 38 | /* Control register */ |
| 39 | #define SUN6I_LOSC_CTRL 0x0000 | 39 | #define SUN6I_LOSC_CTRL 0x0000 |
| 40 | #define SUN6I_LOSC_CTRL_KEY (0x16aa << 16) | ||
| 40 | #define SUN6I_LOSC_CTRL_ALM_DHMS_ACC BIT(9) | 41 | #define SUN6I_LOSC_CTRL_ALM_DHMS_ACC BIT(9) |
| 41 | #define SUN6I_LOSC_CTRL_RTC_HMS_ACC BIT(8) | 42 | #define SUN6I_LOSC_CTRL_RTC_HMS_ACC BIT(8) |
| 42 | #define SUN6I_LOSC_CTRL_RTC_YMD_ACC BIT(7) | 43 | #define SUN6I_LOSC_CTRL_RTC_YMD_ACC BIT(7) |
| 44 | #define SUN6I_LOSC_CTRL_EXT_OSC BIT(0) | ||
| 43 | #define SUN6I_LOSC_CTRL_ACC_MASK GENMASK(9, 7) | 45 | #define SUN6I_LOSC_CTRL_ACC_MASK GENMASK(9, 7) |
| 44 | 46 | ||
| 45 | /* RTC */ | 47 | /* RTC */ |
| @@ -417,6 +419,10 @@ static int sun6i_rtc_probe(struct platform_device *pdev) | |||
| 417 | /* disable alarm wakeup */ | 419 | /* disable alarm wakeup */ |
| 418 | writel(0, chip->base + SUN6I_ALARM_CONFIG); | 420 | writel(0, chip->base + SUN6I_ALARM_CONFIG); |
| 419 | 421 | ||
| 422 | /* switch to the external, more precise, oscillator */ | ||
| 423 | writel(SUN6I_LOSC_CTRL_KEY | SUN6I_LOSC_CTRL_EXT_OSC, | ||
| 424 | chip->base + SUN6I_LOSC_CTRL); | ||
| 425 | |||
| 420 | chip->rtc = rtc_device_register("rtc-sun6i", &pdev->dev, | 426 | chip->rtc = rtc_device_register("rtc-sun6i", &pdev->dev, |
| 421 | &sun6i_rtc_ops, THIS_MODULE); | 427 | &sun6i_rtc_ops, THIS_MODULE); |
| 422 | if (IS_ERR(chip->rtc)) { | 428 | if (IS_ERR(chip->rtc)) { |
