Commit 1feafd64 authored by Russell King's avatar Russell King

Merge branches 'fixes-pcmcia' and 'fixes-sa1111' into fixes

parents 817ed574 87d5dd62
...@@ -472,8 +472,8 @@ static int sa1111_setup_irq(struct sa1111 *sachip, unsigned irq_base) ...@@ -472,8 +472,8 @@ static int sa1111_setup_irq(struct sa1111 *sachip, unsigned irq_base)
* specifies that S0ReadyInt and S1ReadyInt should be '1'. * specifies that S0ReadyInt and S1ReadyInt should be '1'.
*/ */
sa1111_writel(0, irqbase + SA1111_INTPOL0); sa1111_writel(0, irqbase + SA1111_INTPOL0);
sa1111_writel(SA1111_IRQMASK_HI(IRQ_S0_READY_NINT) | sa1111_writel(BIT(IRQ_S0_READY_NINT & 31) |
SA1111_IRQMASK_HI(IRQ_S1_READY_NINT), BIT(IRQ_S1_READY_NINT & 31),
irqbase + SA1111_INTPOL1); irqbase + SA1111_INTPOL1);
/* clear all IRQs */ /* clear all IRQs */
...@@ -754,7 +754,7 @@ static int __sa1111_probe(struct device *me, struct resource *mem, int irq) ...@@ -754,7 +754,7 @@ static int __sa1111_probe(struct device *me, struct resource *mem, int irq)
if (sachip->irq != NO_IRQ) { if (sachip->irq != NO_IRQ) {
ret = sa1111_setup_irq(sachip, pd->irq_base); ret = sa1111_setup_irq(sachip, pd->irq_base);
if (ret) if (ret)
goto err_unmap; goto err_clk;
} }
#ifdef CONFIG_ARCH_SA1100 #ifdef CONFIG_ARCH_SA1100
...@@ -799,6 +799,8 @@ static int __sa1111_probe(struct device *me, struct resource *mem, int irq) ...@@ -799,6 +799,8 @@ static int __sa1111_probe(struct device *me, struct resource *mem, int irq)
return 0; return 0;
err_clk:
clk_disable(sachip->clk);
err_unmap: err_unmap:
iounmap(sachip->base); iounmap(sachip->base);
err_clk_unprep: err_clk_unprep:
...@@ -869,9 +871,9 @@ struct sa1111_save_data { ...@@ -869,9 +871,9 @@ struct sa1111_save_data {
#ifdef CONFIG_PM #ifdef CONFIG_PM
static int sa1111_suspend(struct platform_device *dev, pm_message_t state) static int sa1111_suspend_noirq(struct device *dev)
{ {
struct sa1111 *sachip = platform_get_drvdata(dev); struct sa1111 *sachip = dev_get_drvdata(dev);
struct sa1111_save_data *save; struct sa1111_save_data *save;
unsigned long flags; unsigned long flags;
unsigned int val; unsigned int val;
...@@ -934,9 +936,9 @@ static int sa1111_suspend(struct platform_device *dev, pm_message_t state) ...@@ -934,9 +936,9 @@ static int sa1111_suspend(struct platform_device *dev, pm_message_t state)
* restored by their respective drivers, and must be called * restored by their respective drivers, and must be called
* via LDM after this function. * via LDM after this function.
*/ */
static int sa1111_resume(struct platform_device *dev) static int sa1111_resume_noirq(struct device *dev)
{ {
struct sa1111 *sachip = platform_get_drvdata(dev); struct sa1111 *sachip = dev_get_drvdata(dev);
struct sa1111_save_data *save; struct sa1111_save_data *save;
unsigned long flags, id; unsigned long flags, id;
void __iomem *base; void __iomem *base;
...@@ -952,7 +954,7 @@ static int sa1111_resume(struct platform_device *dev) ...@@ -952,7 +954,7 @@ static int sa1111_resume(struct platform_device *dev)
id = sa1111_readl(sachip->base + SA1111_SKID); id = sa1111_readl(sachip->base + SA1111_SKID);
if ((id & SKID_ID_MASK) != SKID_SA1111_ID) { if ((id & SKID_ID_MASK) != SKID_SA1111_ID) {
__sa1111_remove(sachip); __sa1111_remove(sachip);
platform_set_drvdata(dev, NULL); dev_set_drvdata(dev, NULL);
kfree(save); kfree(save);
return 0; return 0;
} }
...@@ -1003,8 +1005,8 @@ static int sa1111_resume(struct platform_device *dev) ...@@ -1003,8 +1005,8 @@ static int sa1111_resume(struct platform_device *dev)
} }
#else #else
#define sa1111_suspend NULL #define sa1111_suspend_noirq NULL
#define sa1111_resume NULL #define sa1111_resume_noirq NULL
#endif #endif
static int sa1111_probe(struct platform_device *pdev) static int sa1111_probe(struct platform_device *pdev)
...@@ -1017,7 +1019,7 @@ static int sa1111_probe(struct platform_device *pdev) ...@@ -1017,7 +1019,7 @@ static int sa1111_probe(struct platform_device *pdev)
return -EINVAL; return -EINVAL;
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) if (irq < 0)
return -ENXIO; return irq;
return __sa1111_probe(&pdev->dev, mem, irq); return __sa1111_probe(&pdev->dev, mem, irq);
} }
...@@ -1038,6 +1040,11 @@ static int sa1111_remove(struct platform_device *pdev) ...@@ -1038,6 +1040,11 @@ static int sa1111_remove(struct platform_device *pdev)
return 0; return 0;
} }
static struct dev_pm_ops sa1111_pm_ops = {
.suspend_noirq = sa1111_suspend_noirq,
.resume_noirq = sa1111_resume_noirq,
};
/* /*
* Not sure if this should be on the system bus or not yet. * Not sure if this should be on the system bus or not yet.
* We really want some way to register a system device at * We really want some way to register a system device at
...@@ -1050,10 +1057,9 @@ static int sa1111_remove(struct platform_device *pdev) ...@@ -1050,10 +1057,9 @@ static int sa1111_remove(struct platform_device *pdev)
static struct platform_driver sa1111_device_driver = { static struct platform_driver sa1111_device_driver = {
.probe = sa1111_probe, .probe = sa1111_probe,
.remove = sa1111_remove, .remove = sa1111_remove,
.suspend = sa1111_suspend,
.resume = sa1111_resume,
.driver = { .driver = {
.name = "sa1111", .name = "sa1111",
.pm = &sa1111_pm_ops,
}, },
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment