File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ enum ds_type {
65
65
# define DS1340_BIT_CENTURY_EN 0x80 /* in REG_HOUR */
66
66
# define DS1340_BIT_CENTURY 0x40 /* in REG_HOUR */
67
67
#define DS1307_REG_WDAY 0x03 /* 01-07 */
68
+ # define MCP794XX_BIT_OSCRUN BIT(5)
68
69
# define MCP794XX_BIT_VBATEN 0x08
69
70
#define DS1307_REG_MDAY 0x04 /* 01-31 */
70
71
#define DS1307_REG_MONTH 0x05 /* 01-12 */
@@ -242,6 +243,10 @@ static int ds1307_get_time(struct device *dev, struct rtc_time *t)
242
243
regs [DS1307_REG_MIN ] & M41T0_BIT_OF ) {
243
244
dev_warn_once (dev , "oscillator failed, set time!\n" );
244
245
return - EINVAL ;
246
+ } else if (ds1307 -> type == mcp794xx &&
247
+ !(regs [DS1307_REG_WDAY ] & MCP794XX_BIT_OSCRUN )) {
248
+ dev_warn_once (dev , "oscillator failed, set time!\n" );
249
+ return - EINVAL ;
245
250
}
246
251
247
252
tmp = regs [DS1307_REG_SECS ];
You can’t perform that action at this time.
0 commit comments