i2c: rk3x: set special bit for rv1108 i2c2

If want to use i2c2, we must write i2c2 register bit with 1 at GRF.

Change-Id: Ia7e59c105647304162bde283a3fb98d9e0db75c3
Signed-off-by: David Wu <david.wu@rock-chips.com>
This commit is contained in:
David Wu
2020-02-05 20:08:29 +08:00
committed by Tao Huang
parent fd1cd4a26c
commit 06aaf9fc7b

View File

@@ -1257,7 +1257,7 @@ static const struct i2c_algorithm rk3x_i2c_algorithm = {
};
static const struct rk3x_i2c_soc_data rv1108_soc_data = {
.grf_offset = -1,
.grf_offset = 0x408,
.calc_timings = rk3x_i2c_v1_calc_timings,
};
@@ -1383,8 +1383,12 @@ static int rk3x_i2c_probe(struct platform_device *pdev)
return -EINVAL;
}
/* 27+i: write mask, 11+i: value */
value = BIT(27 + bus_nr) | BIT(11 + bus_nr);
if (i2c->soc_data == &rv1108_soc_data && bus_nr == 2)
/* rv1108 i2c2 need to set grf offset-0x408, bit-10 */
value = BIT(26) | BIT(10);
else
/* 27+i: write mask, 11+i: value */
value = BIT(27 + bus_nr) | BIT(11 + bus_nr);
ret = regmap_write(grf, i2c->soc_data->grf_offset, value);
if (ret != 0) {