aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Green <andy@openmoko.com>2008-11-19 17:11:11 +0000
committerAndy Green <agreen@pads.home.warmcat.com>2008-11-19 17:11:11 +0000
commitf39594d4998c1b4e7fb4de3a5d5936f5966499a8 (patch)
tree2b806a8c7f8dcb9f4a5e0b316cafbcc4ef3f0b12
parent105a84e9504f7a35b5b4d2c2560d86937bc4027d (diff)
fix-remove-resume-dependencies-on-pmu-for-pmu-children.patch
All that stuff should be enforced by device tree now, out with it Signed-off-by: Andy Green <andy@openmoko.com>
-rw-r--r--arch/arm/mach-s3c2440/mach-gta02.c60
-rw-r--r--drivers/i2c/chips/pcf50633.c24
-rw-r--r--drivers/mfd/glamo/glamo-core.c21
-rw-r--r--drivers/mfd/glamo/glamo-mci.c17
-rw-r--r--drivers/video/display/jbt6k74.c9
-rw-r--r--include/linux/glamofb.h5
-rw-r--r--include/linux/jbt6k74.h2
-rw-r--r--kernel/power/main.c2
8 files changed, 11 insertions, 129 deletions
diff --git a/arch/arm/mach-s3c2440/mach-gta02.c b/arch/arm/mach-s3c2440/mach-gta02.c
index 57b63b76cc1..505ec6359c9 100644
--- a/arch/arm/mach-s3c2440/mach-gta02.c
+++ b/arch/arm/mach-s3c2440/mach-gta02.c
@@ -98,14 +98,6 @@
/* arbitrates which sensor IRQ owns the shared SPI bus */
static spinlock_t motion_irq_lock;
-/* the dependency of jbt / LCM on pcf50633 resume */
-struct resume_dependency resume_dep_jbt_pcf;
-/* the dependency of jbt / LCM on glamo resume */
-struct resume_dependency resume_dep_jbt_glamo;
-/* the dependency of Glamo MCI on pcf50633 resume (has to power SD slot) */
-struct resume_dependency resume_dep_glamo_mci_pcf;
-
-
static int gta02_charger_online_status;
static int gta02_charger_active_status;
@@ -1060,38 +1052,10 @@ static void gta02_jbt6k74_resuming(int devidx)
pcf50633_backlight_resume(pcf50633_global);
}
-static int gta02_jbt6k74_all_dependencies_resumed(int devidx)
-{
- if (!resume_dep_jbt_pcf.called_flag)
- return 0;
-
- if (!resume_dep_jbt_glamo.called_flag)
- return 0;
-
- return 1;
-}
-
-/* register jbt resume action to be dependent on pcf50633 and glamo resume */
-
-static void gta02_jbt6k74_suspending(int devindex, struct spi_device *spi)
-{
- void jbt6k74_resume(void *spi); /* little white lies about types */
-
- resume_dep_jbt_pcf.callback = jbt6k74_resume;
- resume_dep_jbt_pcf.context = (void *)spi;
- pcf50633_register_resume_dependency(pcf50633_global,
- &resume_dep_jbt_pcf);
- resume_dep_jbt_glamo.callback = jbt6k74_resume;
- resume_dep_jbt_glamo.context = (void *)spi;
- glamo_register_resume_dependency(&resume_dep_jbt_glamo);
-}
-
const struct jbt6k74_platform_data jbt6k74_pdata = {
.reset = gta02_jbt6k74_reset,
.resuming = gta02_jbt6k74_resuming,
- .suspending = gta02_jbt6k74_suspending,
- .all_dependencies_resumed = gta02_jbt6k74_all_dependencies_resumed,
};
static struct spi_board_info gta02_spi_board_info[] = {
@@ -1484,27 +1448,6 @@ gta02_glamo_mmc_set_power(unsigned char power_mode, unsigned short vdd)
}
-static int gta02_glamo_mci_all_dependencies_resumed(struct platform_device *dev)
-{
- return resume_dep_glamo_mci_pcf.called_flag;
-}
-
-/* register jbt resume action to be dependent on pcf50633 and glamo resume */
-
-static void gta02_glamo_mci_suspending(struct platform_device *dev)
-{
- int glamo_mci_resume(struct platform_device *dev);
-
-#if defined(CONFIG_MFD_GLAMO_MCI) && defined(CONFIG_PM)
- resume_dep_glamo_mci_pcf.callback = (void (*)(void *))glamo_mci_resume;
- resume_dep_glamo_mci_pcf.context = (void *)dev;
- pcf50633_register_resume_dependency(pcf50633_global,
- &resume_dep_glamo_mci_pcf);
-#endif
-}
-
-
-
/* Smedia Glamo 3362 */
/*
@@ -1550,9 +1493,6 @@ static struct glamofb_platform_data gta02_glamo_pdata = {
.glamo_set_mci_power = gta02_glamo_mmc_set_power,
.glamo_mci_use_slow = gta02_glamo_mci_use_slow,
.glamo_irq_is_wired = glamo_irq_is_wired,
- .mci_suspending = gta02_glamo_mci_suspending,
- .mci_all_dependencies_resumed =
- gta02_glamo_mci_all_dependencies_resumed,
};
static struct resource gta02_glamo_resources[] = {
diff --git a/drivers/i2c/chips/pcf50633.c b/drivers/i2c/chips/pcf50633.c
index 9ae53ac9949..182fe2f683e 100644
--- a/drivers/i2c/chips/pcf50633.c
+++ b/drivers/i2c/chips/pcf50633.c
@@ -52,7 +52,7 @@
#include <asm/mach-types.h>
#include "pcf50633.h"
-#include <linux/resume-dependency.h>
+#include <linux/pcf50633.h>
#if 1
#define DEBUGP(x, args ...) printk("%s: " x, __FUNCTION__, ## args)
@@ -183,9 +183,6 @@ struct pcf50633_data {
u_int8_t ldo[PCF50633_REG_HCLDOENA - PCF50633_REG_LDO1OUT + 1];
} standby_regs;
- struct resume_dependency resume_dependency;
- int is_suspended;
-
#endif
};
@@ -2179,7 +2176,7 @@ static int pcf50633_detect(struct i2c_adapter *adapter, int address, int kind)
goto exit_free;
}
- init_resume_dependency_list(&pcf->resume_dependency);
+ pcf50633_global = pcf;
populate_sysfs_group(pcf);
@@ -2401,20 +2398,6 @@ int pcf50633_report_resumers(struct pcf50633_data *pcf, char *buf)
#ifdef CONFIG_PM
-/*
- * we need to export this because pcf50633_data is kept opaque
- */
-
-void pcf50633_register_resume_dependency(struct pcf50633_data *pcf,
- struct resume_dependency *dep)
-{
- register_resume_dependency(&pcf->resume_dependency, dep);
- if (pcf->is_suspended)
- activate_all_resume_dependencies(&pcf->resume_dependency);
-}
-EXPORT_SYMBOL_GPL(pcf50633_register_resume_dependency);
-
-
static int pcf50633_suspend(struct device *dev, pm_message_t state)
{
struct i2c_client *client = to_i2c_client(dev);
@@ -2641,9 +2624,6 @@ static int pcf50633_resume(struct device *dev)
get_device(&pcf->client.dev);
pcf50633_work(&pcf->work);
- pcf->is_suspended = 0;
- callback_all_resume_dependencies(&pcf->resume_dependency);
-
return 0;
}
#else
diff --git a/drivers/mfd/glamo/glamo-core.c b/drivers/mfd/glamo/glamo-core.c
index 61b0ef811e4..1d7d235f0da 100644
--- a/drivers/mfd/glamo/glamo-core.c
+++ b/drivers/mfd/glamo/glamo-core.c
@@ -1143,8 +1143,6 @@ static int __init glamo_probe(struct platform_device *pdev)
goto bail_free;
}
- init_resume_dependency_list(&glamo->resume_dependency);
-
/* register a number of sibling devices whoise IOMEM resources
* are siblings of pdev's IOMEM resource */
#if 0
@@ -1217,10 +1215,6 @@ static int __init glamo_probe(struct platform_device *pdev)
glamo->pdata->glamo_mci_use_slow;
glamo_mci_def_pdata.glamo_irq_is_wired =
glamo->pdata->glamo_irq_is_wired;
- glamo_mci_def_pdata.mci_suspending =
- glamo->pdata->mci_suspending;
- glamo_mci_def_pdata.mci_all_dependencies_resumed =
- glamo->pdata->mci_all_dependencies_resumed;
/* start creating the siblings */
@@ -1317,19 +1311,6 @@ static int glamo_remove(struct platform_device *pdev)
#ifdef CONFIG_PM
-/* have to export this because struct glamo_core is opaque */
-
-void glamo_register_resume_dependency(struct resume_dependency *
- resume_dependency)
-{
- register_resume_dependency(&glamo_handle->resume_dependency,
- resume_dependency);
- if (glamo_handle->is_suspended)
- activate_all_resume_dependencies(&glamo_handle->resume_dependency);
-}
-EXPORT_SYMBOL_GPL(glamo_register_resume_dependency);
-
-
static int glamo_suspend(struct platform_device *pdev, pm_message_t state)
{
glamo_power(glamo_handle, GLAMO_POWER_SUSPEND);
@@ -1341,8 +1322,6 @@ static int glamo_suspend(struct platform_device *pdev, pm_message_t state)
static int glamo_resume(struct platform_device *pdev)
{
glamo_power(glamo_handle, GLAMO_POWER_ON);
- glamo_handle->is_suspended = 0;
- callback_all_resume_dependencies(&glamo_handle->resume_dependency);
return 0;
}
diff --git a/drivers/mfd/glamo/glamo-mci.c b/drivers/mfd/glamo/glamo-mci.c
index 32ace262cac..13175c4a240 100644
--- a/drivers/mfd/glamo/glamo-mci.c
+++ b/drivers/mfd/glamo/glamo-mci.c
@@ -716,7 +716,7 @@ static void glamo_mci_request(struct mmc_host *mmc, struct mmc_request *mrq)
#if 0
static void glamo_mci_reset(struct glamo_mci_host *host)
{
- dev_dbg(&host->pdev->dev, "******* glamo_mci_reset\n");
+ dev_err(&host->pdev->dev, "******* glamo_mci_reset\n");
/* reset MMC controller */
writew(GLAMO_CLOCK_MMC_RESET | GLAMO_CLOCK_MMC_DG_TCLK |
GLAMO_CLOCK_MMC_EN_TCLK | GLAMO_CLOCK_MMC_DG_M9CLK |
@@ -782,7 +782,7 @@ static void glamo_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
* initialize itself. Doubt any modern cards need it but anyway...
*/
if (powering)
- msleep(1);
+ mdelay(1);
if (!sd_idleclk && !host->force_slow_during_powerup)
/* stop the clock to card, because we are idle until transfer */
@@ -929,13 +929,16 @@ static int glamo_mci_probe(struct platform_device *pdev)
dev_info(&host->pdev->dev, "probe: mapped mci_base:%p irq:%u.\n",
host->base, host->irq);
+ platform_set_drvdata(pdev, mmc);
+
+ glamo_engine_enable(glamo_mci_def_pdata.pglamo, GLAMO_ENGINE_MMC);
+ glamo_mci_reset(host);
+
if ((ret = mmc_add_host(mmc))) {
dev_err(&pdev->dev, "failed to add mmc host.\n");
goto probe_free_mem_region_data;
}
- platform_set_drvdata(pdev, mmc);
-
dev_info(&pdev->dev,"initialisation done.\n");
return 0;
@@ -996,8 +999,6 @@ static int glamo_mci_suspend(struct platform_device *dev, pm_message_t state)
sd_idleclk = 1;
host->suspending++;
- if (host->pdata->mci_all_dependencies_resumed)
- (host->pdata->mci_suspending)(dev);
ret = mmc_suspend_host(mmc, state);
@@ -1013,10 +1014,6 @@ int glamo_mci_resume(struct platform_device *dev)
struct glamo_mci_host *host = mmc_priv(mmc);
int ret;
- if (host->pdata->mci_all_dependencies_resumed)
- if (!(host->pdata->mci_all_dependencies_resumed)(dev))
- return 0;
-
host->suspending--;
ret = mmc_resume_host(mmc);
diff --git a/drivers/video/display/jbt6k74.c b/drivers/video/display/jbt6k74.c
index 9570543fc3d..807d6b538f7 100644
--- a/drivers/video/display/jbt6k74.c
+++ b/drivers/video/display/jbt6k74.c
@@ -674,11 +674,6 @@ 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;
-
- /* platform can register resume dependencies here, if any */
- if (jbt6k74_pdata->suspending)
- (jbt6k74_pdata->suspending)(0, spi);
/* Save mode for resume */
jbt->last_state = jbt->state;
@@ -697,10 +692,6 @@ 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;
- if (jbt6k74_pdata->all_dependencies_resumed)
- if (!(jbt6k74_pdata->all_dependencies_resumed)(0))
- return 0;
-
/* we can get called twice with all dependencies resumed if our core
* resume callback is last of all. Protect against doing anything twice
*/
diff --git a/include/linux/glamofb.h b/include/linux/glamofb.h
index ca63355d43b..1e760dc3517 100644
--- a/include/linux/glamofb.h
+++ b/include/linux/glamofb.h
@@ -2,7 +2,6 @@
#define _LINUX_GLAMOFB_H
#include <linux/spi/glamo.h>
-#include <linux/resume-dependency.h>
struct glamofb_val {
unsigned int defval;
@@ -34,14 +33,10 @@ struct glamofb_platform_data {
/* glamo-mci asking if it should use the slow clock to card */
int (*glamo_mci_use_slow)(void);
int (*glamo_irq_is_wired)(void);
- void (*mci_suspending)(struct platform_device *dev);
- int (*mci_all_dependencies_resumed)(struct platform_device *dev);
};
int glamofb_cmd_mode(struct glamofb_handle *gfb, int on);
int glamofb_cmd_write(struct glamofb_handle *gfb, u_int16_t val);
void glamo_lcm_reset(int level);
-extern void
-glamo_register_resume_dependency(struct resume_dependency * resume_dependency);
#endif
diff --git a/include/linux/jbt6k74.h b/include/linux/jbt6k74.h
index f0eaf398b13..50e39347c20 100644
--- a/include/linux/jbt6k74.h
+++ b/include/linux/jbt6k74.h
@@ -6,8 +6,6 @@
struct jbt6k74_platform_data {
void (*reset)(int devindex, int level);
void (*resuming)(int devindex); /* called when LCM is resumed */
- void (*suspending)(int devindex, struct spi_device *spi);
- int (*all_dependencies_resumed)(int devindex);
};
#endif
diff --git a/kernel/power/main.c b/kernel/power/main.c
index 3fdc1f42376..14f539825d8 100644
--- a/kernel/power/main.c
+++ b/kernel/power/main.c
@@ -434,6 +434,8 @@ static int enter_state(suspend_state_t state)
return -EBUSY;
printk(KERN_INFO "PM: Syncing filesystems ... ");
+ global_inside_suspend = 1;
+
sys_sync();
printk("done.\n");