bool has_32kclk_en;
bool has_kicker;
bool has_irqwakeen;
+ bool has_power_up_reset;
};
struct omap_rtc {
};
static const struct omap_rtc_device_type omap_rtc_default_type = {
+ .has_power_up_reset = true,
};
static const struct omap_rtc_device_type omap_rtc_am3352_type = {
{
struct omap_rtc *rtc;
struct resource *res;
- u8 reg, new_ctrl;
+ u8 reg, mask, new_ctrl;
const struct platform_device_id *id_entry;
const struct of_device_id *of_id;
int ret;
/* clear old status */
reg = rtc_read(rtc, OMAP_RTC_STATUS_REG);
- if (reg & (u8) OMAP_RTC_STATUS_POWER_UP) {
- dev_info(&pdev->dev, "RTC power up reset detected\n");
- rtc_write(rtc, OMAP_RTC_STATUS_REG, OMAP_RTC_STATUS_POWER_UP);
+
+ mask = OMAP_RTC_STATUS_ALARM;
+
+ if (rtc->type->has_power_up_reset) {
+ mask |= OMAP_RTC_STATUS_POWER_UP;
+ if (reg & OMAP_RTC_STATUS_POWER_UP)
+ dev_info(&pdev->dev, "RTC power up reset detected\n");
}
- if (reg & (u8) OMAP_RTC_STATUS_ALARM)
- rtc_write(rtc, OMAP_RTC_STATUS_REG, OMAP_RTC_STATUS_ALARM);
+
+ if (reg & mask)
+ rtc_write(rtc, OMAP_RTC_STATUS_REG, reg & mask);
/* On boards with split power, RTC_ON_NOFF won't reset the RTC */
reg = rtc_read(rtc, OMAP_RTC_CTRL_REG);