diff options
-rw-r--r-- | arch/arm/mach-s3c2440/mach-gta02.c | 25 | ||||
-rw-r--r-- | drivers/mfd/glamo/glamo-core.c | 8 | ||||
-rw-r--r-- | drivers/mfd/glamo/glamo-core.h | 3 | ||||
-rw-r--r-- | drivers/mfd/glamo/glamo-mci.c | 11 | ||||
-rw-r--r-- | include/linux/glamofb.h | 2 |
5 files changed, 48 insertions, 1 deletions
diff --git a/arch/arm/mach-s3c2440/mach-gta02.c b/arch/arm/mach-s3c2440/mach-gta02.c index 69a952a89c6..64d275deee1 100644 --- a/arch/arm/mach-s3c2440/mach-gta02.c +++ b/arch/arm/mach-s3c2440/mach-gta02.c @@ -92,6 +92,8 @@ static spinlock_t motion_irq_lock; 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; /* define FIQ IPC struct */ @@ -1317,6 +1319,26 @@ 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) +{ + void glamo_mci_resume(void *dev); /* little white lies about types */ + + resume_dep_glamo_mci_pcf.callback = glamo_mci_resume; + resume_dep_glamo_mci_pcf.context = (void *)dev; + pcf50633_register_resume_dependency(pcf50633_global, + &resume_dep_glamo_mci_pcf); +} + + + /* Smedia Glamo 3362 */ static struct glamofb_platform_data gta02_glamo_pdata = { @@ -1352,6 +1374,9 @@ static struct glamofb_platform_data gta02_glamo_pdata = { /* glamo MMC function platform data */ .glamo_set_mci_power = gta02_glamo_mmc_set_power, .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/mfd/glamo/glamo-core.c b/drivers/mfd/glamo/glamo-core.c index 445ff242d5b..3edbfa820d2 100644 --- a/drivers/mfd/glamo/glamo-core.c +++ b/drivers/mfd/glamo/glamo-core.c @@ -270,6 +270,8 @@ struct glamo_mci_pdata glamo_mci_def_pdata = { .glamo_set_mci_power = NULL, /* filled in from MFD platform data */ .ocr_avail = MMC_VDD_32_33, .glamo_irq_is_wired = NULL, /* filled in from MFD platform data */ + .mci_suspending = NULL, /* filled in from MFD platform data */ + .mci_all_dependencies_resumed = NULL, /* filled in from MFD platform data */ }; EXPORT_SYMBOL_GPL(glamo_mci_def_pdata); @@ -1112,6 +1114,10 @@ static int __init glamo_probe(struct platform_device *pdev) glamo->pdata->glamo_set_mci_power; 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; glamo_2d_dev.dev.parent = &pdev->dev; mangle_mem_resources(glamo_2d_dev.resource, @@ -1181,6 +1187,8 @@ static int __init glamo_probe(struct platform_device *pdev) glamo_pll_rate(glamo, GLAMO_PLL1), glamo_pll_rate(glamo, GLAMO_PLL2)); + glamo_lcm_reset(1); + for (irq = IRQ_GLAMO(0); irq <= IRQ_GLAMO(8); irq++) { set_irq_chip(irq, &glamo_irq_chip); set_irq_handler(irq, handle_level_irq); diff --git a/drivers/mfd/glamo/glamo-core.h b/drivers/mfd/glamo/glamo-core.h index 1fee05997d6..b1531b387e5 100644 --- a/drivers/mfd/glamo/glamo-core.h +++ b/drivers/mfd/glamo/glamo-core.h @@ -71,6 +71,9 @@ struct glamo_mci_pdata { void (*glamo_set_mci_power)(unsigned char power_mode, unsigned short vdd); int (*glamo_irq_is_wired)(void); + void (*mci_suspending)(struct platform_device *dev); + int (*mci_all_dependencies_resumed)(struct platform_device *dev); + }; diff --git a/drivers/mfd/glamo/glamo-mci.c b/drivers/mfd/glamo/glamo-mci.c index 05bbfc4b346..37e3d3cb76a 100644 --- a/drivers/mfd/glamo/glamo-mci.c +++ b/drivers/mfd/glamo/glamo-mci.c @@ -817,18 +817,27 @@ static int glamo_mci_suspend(struct platform_device *dev, pm_message_t state) struct glamo_mci_host *host = mmc_priv(mmc); host->suspending++; + if (host->pdata->mci_all_dependencies_resumed) + (host->pdata->mci_suspending)(dev); + return mmc_suspend_host(mmc, state); } -static int glamo_mci_resume(struct platform_device *dev) +int glamo_mci_resume(struct platform_device *dev) { struct mmc_host *mmc = platform_get_drvdata(dev); struct glamo_mci_host *host = mmc_priv(mmc); + if (host->pdata->mci_all_dependencies_resumed) + if (!(host->pdata->mci_all_dependencies_resumed)(dev)) + return 0; + host->suspending--; return mmc_resume_host(mmc); } +EXPORT_SYMBOL_GPL(glamo_mci_resume); + #else /* CONFIG_PM */ #define glamo_mci_suspend NULL diff --git a/include/linux/glamofb.h b/include/linux/glamofb.h index bb4ed0afcc9..bb1a398adf7 100644 --- a/include/linux/glamofb.h +++ b/include/linux/glamofb.h @@ -32,6 +32,8 @@ struct glamofb_platform_data { void (*glamo_set_mci_power)(unsigned char power_mode, unsigned short vdd); 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); |