summaryrefslogtreecommitdiffstats
path: root/drivers/i2c/chips/ds1337.c
diff options
context:
space:
mode:
authorDave Jones <davej@redhat.com>2006-12-12 23:41:41 +0100
committerDave Jones <davej@redhat.com>2006-12-12 23:41:41 +0100
commitc4366889dda8110247be59ca41fddb82951a8c26 (patch)
tree705c1a996bed8fd48ce94ff33ec9fd00f9b94875 /drivers/i2c/chips/ds1337.c
parent[CPUFREQ] Longhaul - Add support for CN400 (diff)
parent[PATCH] remove config ordering/dependency between ucb1400-ts and sound subsystem (diff)
downloadlinux-c4366889dda8110247be59ca41fddb82951a8c26.tar.xz
linux-c4366889dda8110247be59ca41fddb82951a8c26.zip
Merge ../linus
Conflicts: drivers/cpufreq/cpufreq.c
Diffstat (limited to 'drivers/i2c/chips/ds1337.c')
-rw-r--r--drivers/i2c/chips/ds1337.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/i2c/chips/ds1337.c b/drivers/i2c/chips/ds1337.c
index 93d483b8b770..ec17d6b684a2 100644
--- a/drivers/i2c/chips/ds1337.c
+++ b/drivers/i2c/chips/ds1337.c
@@ -347,13 +347,19 @@ static void ds1337_init_client(struct i2c_client *client)
if ((status & 0x80) || (control & 0x80)) {
/* RTC not running */
- u8 buf[16];
+ u8 buf[1+16]; /* First byte is interpreted as address */
struct i2c_msg msg[1];
dev_dbg(&client->dev, "%s: RTC not running!\n", __FUNCTION__);
/* Initialize all, including STATUS and CONTROL to zero */
memset(buf, 0, sizeof(buf));
+
+ /* Write valid values in the date/time registers */
+ buf[1+DS1337_REG_DAY] = 1;
+ buf[1+DS1337_REG_DATE] = 1;
+ buf[1+DS1337_REG_MONTH] = 1;
+
msg[0].addr = client->addr;
msg[0].flags = 0;
msg[0].len = sizeof(buf);