Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 44346
b: refs/heads/master
c: 763d9c0
h: refs/heads/master
v: v3
  • Loading branch information
Dirk Eibach authored and Jean Delvare committed Dec 10, 2006
1 parent 65e0118 commit 6c88507
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a980a99ae5ada5260ddae15da45582dad32dbb93
refs/heads/master: 763d9c046a2e511ec090a8986d3f85edf7448e7e
8 changes: 7 additions & 1 deletion trunk/drivers/i2c/chips/ds1337.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 6c88507

Please sign in to comment.