From daa1e772623f91a59364094f845f51a1fe9f236f Mon Sep 17 00:00:00 2001 From: Andy Green Date: Wed, 19 Nov 2008 17:09:47 +0000 Subject: fix-glamo-mci-resume-dependency-on-pcf50633.patch Glamo MCI has a resume order dependncy on pcf50633, it has to be able to power the SD slot via it. Signed-off-by: Andy Green --- drivers/mfd/glamo/glamo-core.c | 8 ++++++++ drivers/mfd/glamo/glamo-core.h | 3 +++ drivers/mfd/glamo/glamo-mci.c | 11 ++++++++++- 3 files changed, 21 insertions(+), 1 deletion(-) (limited to 'drivers/mfd/glamo') 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 -- cgit v1.2.3