diff options
Diffstat (limited to 'drivers/rtc/rtc-pl031.c')
| -rw-r--r-- | drivers/rtc/rtc-pl031.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/rtc/rtc-pl031.c b/drivers/rtc/rtc-pl031.c index 08378e3cc21c..10c1a3454e48 100644 --- a/drivers/rtc/rtc-pl031.c +++ b/drivers/rtc/rtc-pl031.c | |||
| @@ -44,6 +44,7 @@ | |||
| 44 | #define RTC_YMR 0x34 /* Year match register */ | 44 | #define RTC_YMR 0x34 /* Year match register */ |
| 45 | #define RTC_YLR 0x38 /* Year data load register */ | 45 | #define RTC_YLR 0x38 /* Year data load register */ |
| 46 | 46 | ||
| 47 | #define RTC_CR_EN (1 << 0) /* counter enable bit */ | ||
| 47 | #define RTC_CR_CWEN (1 << 26) /* Clockwatch enable bit */ | 48 | #define RTC_CR_CWEN (1 << 26) /* Clockwatch enable bit */ |
| 48 | 49 | ||
| 49 | #define RTC_TCR_EN (1 << 1) /* Periodic timer enable bit */ | 50 | #define RTC_TCR_EN (1 << 1) /* Periodic timer enable bit */ |
| @@ -320,7 +321,7 @@ static int pl031_probe(struct amba_device *adev, const struct amba_id *id) | |||
| 320 | struct pl031_local *ldata; | 321 | struct pl031_local *ldata; |
| 321 | struct pl031_vendor_data *vendor = id->data; | 322 | struct pl031_vendor_data *vendor = id->data; |
| 322 | struct rtc_class_ops *ops = &vendor->ops; | 323 | struct rtc_class_ops *ops = &vendor->ops; |
| 323 | unsigned long time; | 324 | unsigned long time, data; |
| 324 | 325 | ||
| 325 | ret = amba_request_regions(adev, NULL); | 326 | ret = amba_request_regions(adev, NULL); |
| 326 | if (ret) | 327 | if (ret) |
| @@ -345,10 +346,11 @@ static int pl031_probe(struct amba_device *adev, const struct amba_id *id) | |||
| 345 | dev_dbg(&adev->dev, "designer ID = 0x%02x\n", amba_manf(adev)); | 346 | dev_dbg(&adev->dev, "designer ID = 0x%02x\n", amba_manf(adev)); |
| 346 | dev_dbg(&adev->dev, "revision = 0x%01x\n", amba_rev(adev)); | 347 | dev_dbg(&adev->dev, "revision = 0x%01x\n", amba_rev(adev)); |
| 347 | 348 | ||
| 349 | data = readl(ldata->base + RTC_CR); | ||
| 348 | /* Enable the clockwatch on ST Variants */ | 350 | /* Enable the clockwatch on ST Variants */ |
| 349 | if (vendor->clockwatch) | 351 | if (vendor->clockwatch) |
| 350 | writel(readl(ldata->base + RTC_CR) | RTC_CR_CWEN, | 352 | data |= RTC_CR_CWEN; |
| 351 | ldata->base + RTC_CR); | 353 | writel(data | RTC_CR_EN, ldata->base + RTC_CR); |
| 352 | 354 | ||
| 353 | /* | 355 | /* |
| 354 | * On ST PL031 variants, the RTC reset value does not provide correct | 356 | * On ST PL031 variants, the RTC reset value does not provide correct |
