aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAndy Green <andy@openmoko.com>2008-11-19 17:11:16 +0000
committerAndy Green <andy@openmoko.com>2008-11-19 17:11:16 +0000
commit870784bf1f7a8e2269f2384867a651fce101757f (patch)
treed1bd5ff577cc697c3d7fa0cae511ab14dc829967 /drivers
parent27460b673fa446babd4d35ca8eb5f66c42cb99a3 (diff)
tracking-glamo-suspend-even-more-meddling.patch
Signed-off-by: Andy Green <andy@openmoko.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mfd/glamo/glamo-core.c32
-rw-r--r--drivers/mfd/glamo/glamo-core.h1
-rw-r--r--drivers/video/display/jbt6k74.c18
3 files changed, 40 insertions, 11 deletions
diff --git a/drivers/mfd/glamo/glamo-core.c b/drivers/mfd/glamo/glamo-core.c
index d605e2d7cb8..9d44717c406 100644
--- a/drivers/mfd/glamo/glamo-core.c
+++ b/drivers/mfd/glamo/glamo-core.c
@@ -932,7 +932,7 @@ static void glamo_power(struct glamo_core *glamo,
spin_lock_irqsave(&glamo->lock, flags);
- dev_dbg(&glamo->pdev->dev, "***** glamo_power -> %d\n", new_state);
+ dev_info(&glamo->pdev->dev, "***** glamo_power -> %d\n", new_state);
/*
Power management
@@ -965,12 +965,23 @@ static const REG_VALUE_MASK_TYPE reg_powerSuspend[] =
switch (new_state) {
case GLAMO_POWER_ON:
- mdelay(100);
+ /*
+ * glamo state on resume is nondeterministic in some
+ * fundamental way, it has also been observed that the
+ * Glamo reset pin can get asserted by, eg, touching it with
+ * a scope probe. So the only answer is to roll with it and
+ * force an external reset on the Glamo during resume.
+ */
- glamo_run_script(glamo, glamo_resume_script,
- ARRAY_SIZE(glamo_resume_script), 0);
+ (glamo->pdata->glamo_external_reset)(0);
+ udelay(10);
+ (glamo->pdata->glamo_external_reset)(1);
+ mdelay(10);
- for (n = 0; n < 3 /*ARRAY_SIZE(reg_range)*/; n++)
+ glamo_run_script(glamo, glamo_init_script,
+ ARRAY_SIZE(glamo_init_script), 0);
+
+ for (n = 0; n < ARRAY_SIZE(reg_range); n++)
for (ads = reg_range[n].start; ads <
(reg_range[n].start + reg_range[n].count); ads += 2)
__reg_write(glamo, ads, suspend_regs[ads >> 1]);
@@ -978,13 +989,13 @@ static const REG_VALUE_MASK_TYPE reg_powerSuspend[] =
spin_unlock_irqrestore(&glamo->lock, flags);
/* dump down printk */
- regs_read(&glamo->pdev->dev, NULL, debug_buffer);
+// regs_read(&glamo->pdev->dev, NULL, debug_buffer);
return;
case GLAMO_POWER_SUSPEND:
- for (n = 0; n < 3 /*ARRAY_SIZE(reg_range) */; n++)
+ for (n = 0; n < ARRAY_SIZE(reg_range); n++)
for (ads = reg_range[n].start; ads <
(reg_range[n].start + reg_range[n].count); ads += 2)
suspend_regs[ads >> 1] = __reg_read(glamo, ads);
@@ -1198,7 +1209,12 @@ static int __init glamo_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, glamo);
-/*
+ (glamo->pdata->glamo_external_reset)(0);
+ udelay(10);
+ (glamo->pdata->glamo_external_reset)(1);
+ mdelay(10);
+
+ /*
* finally set the mfd interrupts up
* can't do them earlier or sibling probes blow up
*/
diff --git a/drivers/mfd/glamo/glamo-core.h b/drivers/mfd/glamo/glamo-core.h
index c7b76f83b27..4ba909ccb15 100644
--- a/drivers/mfd/glamo/glamo-core.h
+++ b/drivers/mfd/glamo/glamo-core.h
@@ -28,7 +28,6 @@ struct glamo_core {
u_int16_t type;
u_int16_t revision;
spinlock_t lock;
- struct resume_dependency resume_dependency;
u32 engine_enabled_bitfield;
u32 engine_enabled_bitfield_suspend;
int suspending;
diff --git a/drivers/video/display/jbt6k74.c b/drivers/video/display/jbt6k74.c
index 77f9528ff5a..56a6c955482 100644
--- a/drivers/video/display/jbt6k74.c
+++ b/drivers/video/display/jbt6k74.c
@@ -674,6 +674,7 @@ static int __devexit jbt_remove(struct spi_device *spi)
static int jbt_suspend(struct spi_device *spi, pm_message_t state)
{
struct jbt_info *jbt = dev_get_drvdata(&spi->dev);
+// struct jbt6k74_platform_data *jbt6k74_pdata = spi->dev.platform_data;
/* Save mode for resume */
jbt->last_state = jbt->state;
@@ -682,7 +683,7 @@ static int jbt_suspend(struct spi_device *spi, pm_message_t state)
jbt->have_resumed = 0;
-/* (jbt6k74_pdata->reset)(0, 0); */
+// (jbt6k74_pdata->reset)(0, 0);
return 0;
}
@@ -692,6 +693,19 @@ int jbt6k74_resume(struct spi_device *spi)
struct jbt_info *jbt = dev_get_drvdata(&spi->dev);
struct jbt6k74_platform_data *jbt6k74_pdata = spi->dev.platform_data;
+ printk(KERN_ERR "****** jbt6k74_resume\n");
+
+ /* software reset */
+ jbt_reg_write_nodata(jbt, 1);
+
+ msleep(120);
+
+ sleep_to_normal(jbt);
+ sleep_to_normal(jbt);
+
+/*
+ jbt6k74_display_onoff(jbt, 1);
+
switch (jbt->last_state) {
case JBT_STATE_QVGA_NORMAL:
jbt6k74_enter_state(jbt, JBT_STATE_QVGA_NORMAL);
@@ -701,7 +715,7 @@ int jbt6k74_resume(struct spi_device *spi)
break;
}
jbt6k74_display_onoff(jbt, 1);
-
+*/
if (jbt6k74_pdata->resuming)
(jbt6k74_pdata->resuming)(0);