aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/chips
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/i2c/chips')
-rw-r--r--drivers/i2c/chips/ds1337.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/i2c/chips/ds1337.c b/drivers/i2c/chips/ds1337.c
index 74ece8ac1c23..82cf959989fd 100644
--- a/drivers/i2c/chips/ds1337.c
+++ b/drivers/i2c/chips/ds1337.c
@@ -165,7 +165,7 @@ static int ds1337_set_datetime(struct i2c_client *client, struct rtc_time *dt)
165 buf[0] = 0; /* reg offset */ 165 buf[0] = 0; /* reg offset */
166 buf[1] = BIN2BCD(dt->tm_sec); 166 buf[1] = BIN2BCD(dt->tm_sec);
167 buf[2] = BIN2BCD(dt->tm_min); 167 buf[2] = BIN2BCD(dt->tm_min);
168 buf[3] = BIN2BCD(dt->tm_hour) | (1 << 6); 168 buf[3] = BIN2BCD(dt->tm_hour);
169 buf[4] = BIN2BCD(dt->tm_wday) + 1; 169 buf[4] = BIN2BCD(dt->tm_wday) + 1;
170 buf[5] = BIN2BCD(dt->tm_mday); 170 buf[5] = BIN2BCD(dt->tm_mday);
171 buf[6] = BIN2BCD(dt->tm_mon) + 1; 171 buf[6] = BIN2BCD(dt->tm_mon) + 1;
@@ -344,9 +344,9 @@ static void ds1337_init_client(struct i2c_client *client)
344 344
345 /* Ensure that device is set in 24-hour mode */ 345 /* Ensure that device is set in 24-hour mode */
346 val = i2c_smbus_read_byte_data(client, DS1337_REG_HOUR); 346 val = i2c_smbus_read_byte_data(client, DS1337_REG_HOUR);
347 if ((val >= 0) && (val & (1 << 6)) == 0) 347 if ((val >= 0) && (val & (1 << 6)))
348 i2c_smbus_write_byte_data(client, DS1337_REG_HOUR, 348 i2c_smbus_write_byte_data(client, DS1337_REG_HOUR,
349 val | (1 << 6)); 349 val & 0x3f);
350} 350}
351 351
352static int ds1337_detach_client(struct i2c_client *client) 352static int ds1337_detach_client(struct i2c_client *client)