diff options
author | Philippe Langlais <philippe.langlais@linaro.org> | 2011-03-21 10:39:49 +0100 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@stericsson.com> | 2011-09-19 15:14:36 +0200 |
commit | 10c06097fd1f48c1aa49b02fec39093752e3b0d0 (patch) | |
tree | 8407aa5a9cf41154840d3ad2323adcbd4d2011f3 | |
parent | 87bd3cf399d13a658e8d973b83181fb154773418 (diff) |
nmk-i2c: use pm_runtime API
Use the pm_runtime API for pins control.
ST-Ericsson Linux next: -
ST-Ericsson ID: ER323382
ST-Ericsson FOSS-OUT ID: Trivial
Change-Id: Ib847143b96950c25221c6aa25dae541017840677
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/16045
Tested-by: Rabin VINCENT <rabin.vincent@stericsson.com>
Reviewed-by: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
-rw-r--r-- | drivers/i2c/busses/i2c-nomadik.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/i2c/busses/i2c-nomadik.c b/drivers/i2c/busses/i2c-nomadik.c index 5a579222754..a0cfe9e0ec4 100644 --- a/drivers/i2c/busses/i2c-nomadik.c +++ b/drivers/i2c/busses/i2c-nomadik.c @@ -251,6 +251,8 @@ static int init_hw(struct nmk_i2c_dev *dev) { int stat; + clk_enable(dev->clk); + stat = flush_i2c_fifo(dev); if (stat) goto exit; @@ -431,9 +433,10 @@ static int read_i2c(struct nmk_i2c_dev *dev) } if (timeout == 0) { - /* Controller timed out */ - dev_err(&dev->pdev->dev, "read from slave 0x%x timed out\n", + /* controller has timedout, re-init the h/w */ + dev_err(&dev->pdev->dev, "Read from Slave 0x%x timed out\n", dev->cli.slave_adr); + (void) init_hw(dev); status = -ETIMEDOUT; } return status; @@ -518,9 +521,10 @@ static int write_i2c(struct nmk_i2c_dev *dev) } if (timeout == 0) { - /* Controller timed out */ - dev_err(&dev->pdev->dev, "write to slave 0x%x timed out\n", + /* controller has timedout, re-init the h/w */ + dev_err(&dev->pdev->dev, "Write to slave 0x%x timed out\n", dev->cli.slave_adr); + (void) init_hw(dev); status = -ETIMEDOUT; } |