rtc: rx8025: fix transfer mode
authorAlexandre Belloni <alexandre.belloni@free-electrons.com>
Sat, 25 Jul 2015 13:54:59 +0000 (15:54 +0200)
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>
Sat, 5 Sep 2015 11:19:11 +0000 (13:19 +0200)
The datasheet specifies that transfer mode must be 0 for write and either
0x4 (simplified read) or 0 (standard read). 0x8 is not specified, use
standard mode.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
drivers/rtc/rtc-rx8025.c

index 3612362b65ac45092203a96305829ee82359054b..771558602409e1096a2b108b464f2717e96bce75 100644 (file)
@@ -77,7 +77,7 @@ struct rx8025_data {
 
 static int rx8025_read_reg(struct i2c_client *client, int number, u8 *value)
 {
-       int ret = i2c_smbus_read_byte_data(client, (number << 4) | 0x08);
+       int ret = i2c_smbus_read_byte_data(client, number << 4);
 
        if (ret < 0) {
                dev_err(&client->dev, "Unable to read register #%d\n", number);
@@ -91,7 +91,7 @@ static int rx8025_read_reg(struct i2c_client *client, int number, u8 *value)
 static int rx8025_read_regs(struct i2c_client *client,
                            int number, u8 length, u8 *values)
 {
-       int ret = i2c_smbus_read_i2c_block_data(client, (number << 4) | 0x08,
+       int ret = i2c_smbus_read_i2c_block_data(client, number << 4,
                                                length, values);
 
        if (ret != length) {
@@ -117,7 +117,7 @@ static int rx8025_write_reg(struct i2c_client *client, int number, u8 value)
 static int rx8025_write_regs(struct i2c_client *client,
                             int number, u8 length, u8 *values)
 {
-       int ret = i2c_smbus_write_i2c_block_data(client, (number << 4) | 0x08,
+       int ret = i2c_smbus_write_i2c_block_data(client, number << 4,
                                                 length, values);
 
        if (ret)