diff options
author | Daniel Drake <dsd@laptop.org> | 2013-06-17 11:30:36 -0400 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2013-06-18 12:11:32 -0400 |
commit | 7a10f4732972b48f75a547a42f9cdfef340124a6 (patch) | |
tree | 9e8953c887e06377a50d18ab7cd74bc084cd1280 /drivers/i2c | |
parent | 661f6c1cd926c6c973e03c6b5151d161f3a666ed (diff) |
i2c-pxa: prepare clock before use
On OLPC XO-1.75 (MMP2), a WARN_ON() was occurring during boot
since the clock being enabled by i2c-pxa had not been prepared.
Use clk_prepare_enable() to ensure that the prepare operation
has taken place, and use clk_disable_unprepare() in the matching
shutdown paths.
Signed-off-by: Daniel Drake <dsd@laptop.org>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/busses/i2c-pxa.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c index ea6d45d1dcd6..fbafed29fb81 100644 --- a/drivers/i2c/busses/i2c-pxa.c +++ b/drivers/i2c/busses/i2c-pxa.c | |||
@@ -1160,7 +1160,7 @@ static int i2c_pxa_probe(struct platform_device *dev) | |||
1160 | i2c->adap.class = plat->class; | 1160 | i2c->adap.class = plat->class; |
1161 | } | 1161 | } |
1162 | 1162 | ||
1163 | clk_enable(i2c->clk); | 1163 | clk_prepare_enable(i2c->clk); |
1164 | 1164 | ||
1165 | if (i2c->use_pio) { | 1165 | if (i2c->use_pio) { |
1166 | i2c->adap.algo = &i2c_pxa_pio_algorithm; | 1166 | i2c->adap.algo = &i2c_pxa_pio_algorithm; |
@@ -1202,7 +1202,7 @@ eadapt: | |||
1202 | if (!i2c->use_pio) | 1202 | if (!i2c->use_pio) |
1203 | free_irq(irq, i2c); | 1203 | free_irq(irq, i2c); |
1204 | ereqirq: | 1204 | ereqirq: |
1205 | clk_disable(i2c->clk); | 1205 | clk_disable_unprepare(i2c->clk); |
1206 | iounmap(i2c->reg_base); | 1206 | iounmap(i2c->reg_base); |
1207 | eremap: | 1207 | eremap: |
1208 | clk_put(i2c->clk); | 1208 | clk_put(i2c->clk); |
@@ -1221,7 +1221,7 @@ static int i2c_pxa_remove(struct platform_device *dev) | |||
1221 | if (!i2c->use_pio) | 1221 | if (!i2c->use_pio) |
1222 | free_irq(i2c->irq, i2c); | 1222 | free_irq(i2c->irq, i2c); |
1223 | 1223 | ||
1224 | clk_disable(i2c->clk); | 1224 | clk_disable_unprepare(i2c->clk); |
1225 | clk_put(i2c->clk); | 1225 | clk_put(i2c->clk); |
1226 | 1226 | ||
1227 | iounmap(i2c->reg_base); | 1227 | iounmap(i2c->reg_base); |