aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2009-10-11 01:29:59 +0200
committerLars-Peter Clausen <lars@metafoo.de>2009-10-11 01:29:59 +0200
commit4b1d11c8506ecc4f6f892f293177b2f4416f9b83 (patch)
treede7dbdba9ee68e335ab9b899a7374a1f25033e52
parentc3738d6c639dbe1ec170666d76a1c1372ff77c0b (diff)
parentdda793e722a5db08345dbf642c7590c7eb61ab67 (diff)
Merge branch 'glamo-2.6.31' into om-gta02-2.6.31
-rw-r--r--drivers/mfd/glamo/glamo-core.c41
-rw-r--r--drivers/mfd/glamo/glamo-mci.c45
-rw-r--r--include/linux/mfd/glamo.h12
3 files changed, 60 insertions, 38 deletions
diff --git a/drivers/mfd/glamo/glamo-core.c b/drivers/mfd/glamo/glamo-core.c
index d35d177ff5c..e0e39409595 100644
--- a/drivers/mfd/glamo/glamo-core.c
+++ b/drivers/mfd/glamo/glamo-core.c
@@ -310,7 +310,7 @@ static struct irq_chip glamo_irq_chip = {
static void glamo_irq_demux_handler(unsigned int irq, struct irq_desc *desc)
{
- struct glamo_core *glamo = get_irq_desc_chip_data(desc);
+ struct glamo_core *glamo = get_irq_desc_data(desc);
desc->status &= ~(IRQ_REPLAY | IRQ_WAITING);
if (unlikely(desc->status & IRQ_INPROGRESS)) {
@@ -901,7 +901,7 @@ static int __devinit glamo_supported(struct glamo_core *glamo)
static int __devinit glamo_probe(struct platform_device *pdev)
{
- int ret = 0, irq;
+ int ret = 0, irq, irq_base;
struct glamo_core *glamo;
struct resource *mem;
@@ -912,13 +912,20 @@ static int __devinit glamo_probe(struct platform_device *pdev)
spin_lock_init(&glamo->lock);
glamo->pdev = pdev;
- mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
glamo->irq = platform_get_irq(pdev, 0);
+ glamo->irq_base = irq_base = platform_get_irq(pdev, 1);
glamo->pdata = pdev->dev.platform_data;
if (glamo->irq < 0) {
+ ret = glamo->irq;
dev_err(&pdev->dev, "Failed to get platform irq: %d\n", ret);
+ goto err_free;
+ }
+
+ if (irq_base < 0) {
ret = glamo->irq;
+ dev_err(&pdev->dev, "Failed to get glamo irq base: %d\n", ret);
goto err_free;
}
@@ -973,15 +980,20 @@ static int __devinit glamo_probe(struct platform_device *pdev)
/*
* finally set the mfd interrupts up
*/
- for (irq = glamo->irq_base; irq < glamo->irq_base + GLAMO_NR_IRQS; ++irq) {
- set_irq_chip_and_handler(irq, &glamo_irq_chip, handle_level_irq);
+ for (irq = irq_base; irq < irq_base + GLAMO_NR_IRQS; ++irq) {
+#ifdef CONFIG_ARM
set_irq_flags(irq, IRQF_VALID);
+#else
+ set_irq_noprobe(irq);
+#endif
set_irq_chip_data(irq, glamo);
+ set_irq_chip_and_handler(irq, &glamo_irq_chip,
+ handle_level_irq);
}
- set_irq_chained_handler(glamo->irq, glamo_irq_demux_handler);
set_irq_type(glamo->irq, IRQ_TYPE_EDGE_FALLING);
- set_irq_chip_data(glamo->irq, glamo);
+ set_irq_data(glamo->irq, glamo);
+ set_irq_chained_handler(glamo->irq, glamo_irq_demux_handler);
glamo->irq_works = 1;
ret = mfd_add_devices(&pdev->dev, pdev->id, glamo_cells,
@@ -1003,9 +1015,13 @@ err_free_irqs:
set_irq_chained_handler(glamo->irq, NULL);
set_irq_chip_data(glamo->irq, NULL);
- for (irq = glamo->irq_base; irq < glamo->irq_base + GLAMO_NR_IRQS; ++irq) {
- set_irq_flags(irq, 0);
+ for (irq = irq_base; irq < irq_base + GLAMO_NR_IRQS; ++irq) {
set_irq_chip(irq, NULL);
+#ifdef CONFIG_ARM
+ set_irq_flags(irq, 0);
+#else
+ set_irq_probe(irq);
+#endif
set_irq_chip_data(irq, NULL);
}
err_iounmap:
@@ -1023,6 +1039,7 @@ static int __devexit glamo_remove(struct platform_device *pdev)
{
struct glamo_core *glamo = platform_get_drvdata(pdev);
int irq;
+ int irq_base = glamo->irq_base;
mfd_remove_devices(&pdev->dev);
@@ -1030,8 +1047,12 @@ static int __devexit glamo_remove(struct platform_device *pdev)
set_irq_chained_handler(glamo->irq, NULL);
set_irq_chip_data(glamo->irq, NULL);
- for (irq = glamo->irq_base; irq < glamo->irq_base + GLAMO_NR_IRQS; ++irq) {
+ for (irq = irq_base; irq < irq_base + GLAMO_NR_IRQS; ++irq) {
+#ifdef CONFIG_ARM
set_irq_flags(irq, 0);
+#else
+ set_irq_noprobe();
+#endif
set_irq_chip(irq, NULL);
set_irq_chip_data(irq, NULL);
}
diff --git a/drivers/mfd/glamo/glamo-mci.c b/drivers/mfd/glamo/glamo-mci.c
index a173bbaaea3..948e380700c 100644
--- a/drivers/mfd/glamo/glamo-mci.c
+++ b/drivers/mfd/glamo/glamo-mci.c
@@ -140,6 +140,22 @@ static void glamo_reg_set_bit_mask(struct glamo_mci_host *glamo,
glamo_reg_write(glamo, reg, tmp);
}
+static void glamo_mci_reset(struct glamo_mci_host *host)
+{
+ glamo_engine_reset(host->core, GLAMO_ENGINE_MMC);
+
+ glamo_reg_write(host, GLAMO_REG_MMC_WDATADS1,
+ (uint16_t)(host->data_mem->start));
+ glamo_reg_write(host, GLAMO_REG_MMC_WDATADS2,
+ (uint16_t)(host->data_mem->start >> 16));
+
+ glamo_reg_write(host, GLAMO_REG_MMC_RDATADS1,
+ (uint16_t)(host->data_mem->start));
+ glamo_reg_write(host, GLAMO_REG_MMC_RDATADS2,
+ (uint16_t)(host->data_mem->start >> 16));
+
+}
+
static void glamo_mci_clock_disable(struct glamo_mci_host *host)
{
if (host->clk_enabled) {
@@ -229,8 +245,10 @@ static int glamo_mci_wait_idle(struct glamo_mci_host *host,
status = glamo_reg_read(host, GLAMO_REG_MMC_RB_STAT1);
} while (!(status & GLAMO_STAT1_MMC_IDLE) && jiffies < timeout);
- if (jiffies >= timeout)
+ if (jiffies >= timeout) {
+ glamo_mci_reset(host);
return -ETIMEDOUT;
+ }
return 0;
}
@@ -880,17 +898,8 @@ static int glamo_mci_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, mmc);
glamo_engine_enable(host->core, GLAMO_ENGINE_MMC);
- glamo_engine_reset(host->core, GLAMO_ENGINE_MMC);
-
- glamo_reg_write(host, GLAMO_REG_MMC_WDATADS1,
- (uint16_t)(host->data_mem->start));
- glamo_reg_write(host, GLAMO_REG_MMC_WDATADS2,
- (uint16_t)(host->data_mem->start >> 16));
-
- glamo_reg_write(host, GLAMO_REG_MMC_RDATADS1,
- (uint16_t)(host->data_mem->start));
- glamo_reg_write(host, GLAMO_REG_MMC_RDATADS2,
- (uint16_t)(host->data_mem->start >> 16));
+ glamo_mci_reset(host);
+ glamo_engine_disable(host->core, GLAMO_ENGINE_MMC);
setup_timer(&host->disable_timer, glamo_mci_disable_timer,
(unsigned long)host);
@@ -970,18 +979,10 @@ static int glamo_mci_resume(struct device *dev)
struct glamo_mci_host *host = mmc_priv(mmc);
int ret;
- glamo_engine_enable(host->core, GLAMO_ENGINE_MMC);
- glamo_engine_reset(host->core, GLAMO_ENGINE_MMC);
- glamo_reg_write(host, GLAMO_REG_MMC_WDATADS1,
- (uint16_t)(host->data_mem->start));
- glamo_reg_write(host, GLAMO_REG_MMC_WDATADS2,
- (uint16_t)(host->data_mem->start >> 16));
+ glamo_engine_enable(host->core, GLAMO_ENGINE_MMC);
+ glamo_mci_reset(host);
- glamo_reg_write(host, GLAMO_REG_MMC_RDATADS1,
- (uint16_t)(host->data_mem->start));
- glamo_reg_write(host, GLAMO_REG_MMC_RDATADS2,
- (uint16_t)(host->data_mem->start >> 16));
mdelay(5);
ret = mmc_resume_host(host->mmc);
diff --git a/include/linux/mfd/glamo.h b/include/linux/mfd/glamo.h
index 566948b3cfc..529d4f07f03 100644
--- a/include/linux/mfd/glamo.h
+++ b/include/linux/mfd/glamo.h
@@ -8,7 +8,7 @@ struct glamo_fb_platform_data;
struct glamo_mmc_platform_data {
int (*glamo_mmc_use_slow)(void);
- struct glamo_core *core;
+ struct glamo_core *core;
};
struct glamo_gpio_platform_data {
@@ -17,13 +17,13 @@ struct glamo_gpio_platform_data {
};
struct glamo_platform_data {
- struct glamo_fb_platform_data *fb_data;
- struct glamo_mmc_platform_data *mmc_data;
- struct glamo_gpio_platform_data *gpio_data;
+ struct glamo_fb_platform_data *fb_data;
+ struct glamo_mmc_platform_data *mmc_data;
+ struct glamo_gpio_platform_data *gpio_data;
- unsigned int osci_clock_rate;
+ unsigned int osci_clock_rate;
- void (*glamo_external_reset)(int);
+ void (*glamo_external_reset)(int);
};
enum glamo_engine {