aboutsummaryrefslogtreecommitdiff
path: root/drivers/mfd
diff options
context:
space:
mode:
authorwarmcat <andy@warmcat.com>2008-11-19 17:09:33 +0000
committerAndy Green <agreen@pads.home.warmcat.com>2008-11-19 17:09:33 +0000
commit72389bf132fb8cb7c05b2e5b360e240676d53e4c (patch)
tree89a678132d1a7db1e573f6e5b22dca3b609e2c2a /drivers/mfd
parent695aab30a59b56143489a17b6b4268b3a9548148 (diff)
fix-lcm-reinit-post-resume.patch
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/glamo/glamo-core.c15
-rw-r--r--drivers/mfd/glamo/glamo-spi-gpio.c38
2 files changed, 48 insertions, 5 deletions
diff --git a/drivers/mfd/glamo/glamo-core.c b/drivers/mfd/glamo/glamo-core.c
index ffa494583f5..2076e61ad71 100644
--- a/drivers/mfd/glamo/glamo-core.c
+++ b/drivers/mfd/glamo/glamo-core.c
@@ -513,6 +513,17 @@ void glamo_engine_reset(struct glamo_core *glamo, enum glamo_engine engine)
}
EXPORT_SYMBOL_GPL(glamo_engine_reset);
+void glamo_lcm_reset(int level)
+{
+ if (!glamo_handle)
+ return;
+
+ glamo_gpio_setpin(glamo_handle, GLAMO_GPIO4, level);
+ glamo_gpio_cfgpin(glamo_handle, GLAMO_GPIO4_OUTPUT);
+
+}
+EXPORT_SYMBOL_GPL(glamo_lcm_reset);
+
enum glamo_pll {
GLAMO_PLL1,
GLAMO_PLL2,
@@ -1142,8 +1153,8 @@ static int glamo_resume(struct platform_device *pdev)
static struct platform_driver glamo_driver = {
.probe = glamo_probe,
.remove = glamo_remove,
- .suspend = glamo_suspend,
- .resume = glamo_resume,
+ .suspend_late = glamo_suspend,
+ .resume_early = glamo_resume,
.driver = {
.name = "glamo3362",
.owner = THIS_MODULE,
diff --git a/drivers/mfd/glamo/glamo-spi-gpio.c b/drivers/mfd/glamo/glamo-spi-gpio.c
index 73926bd22a4..eda73223723 100644
--- a/drivers/mfd/glamo/glamo-spi-gpio.c
+++ b/drivers/mfd/glamo/glamo-spi-gpio.c
@@ -224,14 +224,46 @@ static int glamo_spigpio_remove(struct platform_device *pdev)
return 0;
}
-#define glamo_spigpio_suspend NULL
+/*#define glamo_spigpio_suspend NULL
#define glamo_spigpio_resume NULL
+*/
+
+
+#ifdef CONFIG_PM
+static int glamo_spigpio_suspend(struct platform_device *pdev, pm_message_t state)
+{
+ return 0;
+}
+
+static int glamo_spigpio_resume(struct platform_device *pdev)
+{
+ struct glamo_spigpio *sp = platform_get_drvdata(pdev);
+
+ if (!sp)
+ return 0;
+
+ /* set state of spi pins */
+ glamo_gpio_setpin(sp->glamo, sp->info->pin_clk, 0);
+ glamo_gpio_setpin(sp->glamo, sp->info->pin_mosi, 0);
+ glamo_gpio_setpin(sp->glamo, sp->info->pin_cs, 1);
+
+ glamo_gpio_cfgpin(sp->glamo, sp->info->pin_clk);
+ glamo_gpio_cfgpin(sp->glamo, sp->info->pin_mosi);
+ glamo_gpio_cfgpin(sp->glamo, sp->info->pin_cs);
+ if (sp->info->pin_miso)
+ glamo_gpio_cfgpin(sp->glamo, sp->info->pin_miso);
+
+ return 0;
+}
+#endif
static struct platform_driver glamo_spi_drv = {
.probe = glamo_spigpio_probe,
.remove = glamo_spigpio_remove,
- .suspend = glamo_spigpio_suspend,
- .resume = glamo_spigpio_resume,
+#ifdef CONFIG_PM
+ .suspend_late = glamo_spigpio_suspend,
+ .resume_early = glamo_spigpio_resume,
+#endif
.driver = {
.name = "glamo-spi-gpio",
.owner = THIS_MODULE,