i2c: rk3x: set special bit for rv1126 i2c2

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

Change-Id: Id2b5c1b06c206e43de19fe42024846918fa0b145
Signed-off-by: David Wu <david.wu@rock-chips.com>
This commit is contained in:
David Wu
2020-04-03 11:38:49 +08:00
committed by Tao Huang
parent 17e882e4bd
commit 87bf929a47

View File

@@ -1261,6 +1261,11 @@ static const struct rk3x_i2c_soc_data rv1108_soc_data = {
.calc_timings = rk3x_i2c_v1_calc_timings,
};
static const struct rk3x_i2c_soc_data rv1126_soc_data = {
.grf_offset = 0x118,
.calc_timings = rk3x_i2c_v1_calc_timings,
};
static const struct rk3x_i2c_soc_data rk3066_soc_data = {
.grf_offset = 0x154,
.calc_timings = rk3x_i2c_v0_calc_timings,
@@ -1291,6 +1296,10 @@ static const struct of_device_id rk3x_i2c_match[] = {
.compatible = "rockchip,rv1108-i2c",
.data = &rv1108_soc_data
},
{
.compatible = "rockchip,rv1126-i2c",
.data = &rv1126_soc_data
},
{
.compatible = "rockchip,rk3066-i2c",
.data = &rk3066_soc_data
@@ -1381,6 +1390,10 @@ static int rk3x_i2c_probe(struct platform_device *pdev)
if (i2c->soc_data == &rv1108_soc_data && bus_nr == 2)
/* rv1108 i2c2 set grf offset-0x408, bit-10 */
value = BIT(26) | BIT(10);
else if (i2c->soc_data == &rv1126_soc_data &&
bus_nr == 2)
/* rv1126 i2c2 set pmugrf offset-0x118, bit-4 */
value = BIT(20) | BIT(4);
else
/* rk3xxx 27+i: write mask, 11+i: value */
value = BIT(27 + bus_nr) | BIT(11 + bus_nr);