Skip to content

Commit

Permalink
i2c: rcar: fix resume by always initializing registers before transfer
Browse files Browse the repository at this point in the history
Resume failed because of uninitialized registers. Instead of adding a
resume callback, we simply initialize registers before every transfer.
This lightweight change is more robust and will keep us safe if we ever
need support for power domains or dynamic frequency changes.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
  • Loading branch information
Wolfram Sang authored and Wolfram Sang committed Apr 21, 2017
1 parent 8c91fd5 commit ae481cc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/i2c/busses/i2c-rcar.c
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,8 @@ static int rcar_i2c_master_xfer(struct i2c_adapter *adap,

pm_runtime_get_sync(dev);

rcar_i2c_init(priv);

ret = rcar_i2c_bus_barrier(priv);
if (ret < 0)
goto out;
Expand Down Expand Up @@ -860,8 +862,6 @@ static int rcar_i2c_probe(struct platform_device *pdev)
if (ret < 0)
goto out_pm_put;

rcar_i2c_init(priv);

/* Don't suspend when multi-master to keep arbitration working */
if (of_property_read_bool(dev->of_node, "multi-master"))
priv->flags |= ID_P_PM_BLOCKED;
Expand Down

0 comments on commit ae481cc

Please sign in to comment.