mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 10:58:48 +09:00
Audio codec: add i2c scl_rate,default 100k.
This commit is contained in:
4
drivers/base/regmap/regmap-i2c.c
Normal file → Executable file
4
drivers/base/regmap/regmap-i2c.c
Normal file → Executable file
@@ -49,11 +49,13 @@ static int regmap_i2c_gather_write(void *context,
|
||||
xfer[0].flags = 0;
|
||||
xfer[0].len = reg_size;
|
||||
xfer[0].buf = (void *)reg;
|
||||
xfer[0].scl_rate = 100*1000;
|
||||
|
||||
xfer[1].addr = i2c->addr;
|
||||
xfer[1].flags = I2C_M_NOSTART;
|
||||
xfer[1].len = val_size;
|
||||
xfer[1].buf = (void *)val;
|
||||
xfer[1].scl_rate = 100*1000;
|
||||
|
||||
ret = i2c_transfer(i2c->adapter, xfer, 2);
|
||||
if (ret == 2)
|
||||
@@ -77,11 +79,13 @@ static int regmap_i2c_read(void *context,
|
||||
xfer[0].flags = 0;
|
||||
xfer[0].len = reg_size;
|
||||
xfer[0].buf = (void *)reg;
|
||||
xfer[0].scl_rate = 100*1000;
|
||||
|
||||
xfer[1].addr = i2c->addr;
|
||||
xfer[1].flags = I2C_M_RD;
|
||||
xfer[1].len = val_size;
|
||||
xfer[1].buf = val;
|
||||
xfer[1].scl_rate = 100*1000;
|
||||
|
||||
ret = i2c_transfer(i2c->adapter, xfer, 2);
|
||||
if (ret == 2)
|
||||
|
||||
2
drivers/i2c/i2c-core.c
Normal file → Executable file
2
drivers/i2c/i2c-core.c
Normal file → Executable file
@@ -1586,6 +1586,7 @@ int i2c_master_send(const struct i2c_client *client, const char *buf, int count)
|
||||
msg.flags = client->flags & I2C_M_TEN;
|
||||
msg.len = count;
|
||||
msg.buf = (char *)buf;
|
||||
msg.scl_rate = 100 * 1000;
|
||||
|
||||
ret = i2c_transfer(adap, &msg, 1);
|
||||
|
||||
@@ -1616,6 +1617,7 @@ int i2c_master_recv(const struct i2c_client *client, char *buf, int count)
|
||||
msg.flags |= I2C_M_RD;
|
||||
msg.len = count;
|
||||
msg.buf = buf;
|
||||
msg.scl_rate = 100 * 1000;
|
||||
|
||||
ret = i2c_transfer(adap, &msg, 1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user