This patch adds clk_prepare/clk_unprepare calls to the i2c-pxa
driver by using the helper functions clk_prepare_enable and
clk_disable_unprepare.

Signed-off-by: Philipp Zabel <[email protected]>
Cc: Haojian Zhuang <[email protected]>
Cc: Eric Miao <[email protected]>
Cc: Jean Delvare <[email protected]>
Cc: Ben Dooks <[email protected]>
Cc: Wolfram Sang <[email protected]>
---
 drivers/i2c/busses/i2c-pxa.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c
index d603646..950b76c 100644
--- a/drivers/i2c/busses/i2c-pxa.c
+++ b/drivers/i2c/busses/i2c-pxa.c
@@ -42,8 +42,10 @@
 #ifndef CONFIG_HAVE_CLK
 #define clk_get(dev, id)       NULL
 #define clk_put(clk)           do { } while (0)
+#define clk_prepare_enable(clk)        do { } while (0)
 #define clk_disable(clk)       do { } while (0)
 #define clk_enable(clk)                do { } while (0)
+#define clk_disable_unprepare(clk) do { } while (0)
 #endif
 
 struct pxa_reg_layout {
@@ -1116,7 +1118,7 @@ static int i2c_pxa_probe(struct platform_device *dev)
        }
 #endif
 
-       clk_enable(i2c->clk);
+       clk_prepare_enable(i2c->clk);
 
        if (plat) {
                i2c->adap.class = plat->class;
@@ -1164,7 +1166,7 @@ eadapt:
        if (!i2c->use_pio)
                free_irq(irq, i2c);
 ereqirq:
-       clk_disable(i2c->clk);
+       clk_disable_unprepare(i2c->clk);
        iounmap(i2c->reg_base);
 eremap:
        clk_put(i2c->clk);
@@ -1185,7 +1187,7 @@ static int __exit i2c_pxa_remove(struct platform_device 
*dev)
        if (!i2c->use_pio)
                free_irq(i2c->irq, i2c);
 
-       clk_disable(i2c->clk);
+       clk_disable_unprepare(i2c->clk);
        clk_put(i2c->clk);
 
        iounmap(i2c->reg_base);
-- 
1.7.9.1


--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to