diff options
author | Rabin Vincent <rabin.vincent@stericsson.com> | 2011-02-18 16:26:42 +0530 |
---|---|---|
committer | Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com> | 2011-03-02 07:04:12 +0100 |
commit | 5bae6b6626407b956e28cb6bc6aad49fb728176c (patch) | |
tree | 9550eaaa7f959962f938da3ae597bd377fdd630b | |
parent | ef589a95a59143cd3df77cc57456f846bbc20702 (diff) |
amba-pl022: support runtime PMu8500-android-2.3_v0.25
Control pins and power via the runtime PM API.
ST-Ericsson Linux next: -
ST-Ericsson ID: ER323382
ST-Ericsson FOSS-OUT ID: Trivial
Change-Id: I16b665cf8b0c3429ddd5b79e0ffe4c913f40703d
Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/17195
Reviewed-by: Virupax SADASHIVPETIMATH <virupax.sadashivpetimath@stericsson.com>
Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
Reviewed-by: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
-rw-r--r-- | drivers/spi/amba-pl022.c | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/drivers/spi/amba-pl022.c b/drivers/spi/amba-pl022.c index ae325867e42..68f2b185e84 100644 --- a/drivers/spi/amba-pl022.c +++ b/drivers/spi/amba-pl022.c @@ -47,7 +47,7 @@ #include <linux/dmaengine.h> #include <linux/dma-mapping.h> #include <linux/scatterlist.h> -#include <mach/regulator.h> +#include <linux/pm_runtime.h> /* * This macro is used to define some register default values. @@ -405,7 +405,6 @@ struct pl022 { struct sg_table sgt_tx; char *dummypage; #endif - struct ux500_regulator *regulator; enum ssp_rx_level_trig rx_lev_trig; enum ssp_tx_level_trig tx_lev_trig; }; @@ -537,8 +536,7 @@ static void giveback(struct pl022 *pl022) /* This message is completed, so let's turn off the clock! */ clk_disable(pl022->clk); - if (pl022->regulator) - ux500_regulator_atomic_disable(pl022->regulator); + pm_runtime_put(&pl022->adev->dev); } /** @@ -1517,8 +1515,7 @@ static void pump_messages(struct work_struct *work) * We enable the clock here, then the clock will be disabled when * giveback() is called in each method (poll/interrupt/DMA) */ - if (pl022->regulator) - ux500_regulator_atomic_enable(pl022->regulator); + pm_runtime_get_sync(&pl022->adev->dev); clk_enable(pl022->clk); restore_state(pl022); flush(pl022); @@ -2116,11 +2113,8 @@ pl022_probe(struct amba_device *adev, struct amba_id *id) printk(KERN_INFO "pl022: mapped registers from 0x%08x to %p\n", adev->res.start, pl022->virtbase); - pl022->regulator = ux500_regulator_get(dev); - if (IS_ERR(pl022->regulator)) { - dev_warn(dev, "could not get spi regulator\n"); - pl022->regulator = NULL; - } + pm_runtime_enable(dev); + pm_runtime_resume(dev); pl022->clk = clk_get(&adev->dev, NULL); if (IS_ERR(pl022->clk)) { @@ -2182,8 +2176,6 @@ pl022_probe(struct amba_device *adev, struct amba_id *id) err_no_irq: clk_put(pl022->clk); err_no_clk: - if (pl022->regulator) - ux500_regulator_put(pl022->regulator); iounmap(pl022->virtbase); err_no_ioremap: amba_release_regions(adev); @@ -2212,10 +2204,9 @@ pl022_remove(struct amba_device *adev) load_ssp_default_config(pl022); pl022_dma_remove(pl022); free_irq(adev->irq[0], pl022); + pm_runtime_disable(&adev->dev); clk_disable(pl022->clk); clk_put(pl022->clk); - if (pl022->regulator) - ux500_regulator_put(pl022->regulator); iounmap(pl022->virtbase); amba_release_regions(adev); tasklet_disable(&pl022->pump_transfers); |