aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia/db1xxx_ss.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pcmcia/db1xxx_ss.c')
-rw-r--r--drivers/pcmcia/db1xxx_ss.c40
1 files changed, 4 insertions, 36 deletions
diff --git a/drivers/pcmcia/db1xxx_ss.c b/drivers/pcmcia/db1xxx_ss.c
index 9254ab0b29b1..0f4cc3f00028 100644
--- a/drivers/pcmcia/db1xxx_ss.c
+++ b/drivers/pcmcia/db1xxx_ss.c
@@ -26,6 +26,7 @@
26#include <linux/pm.h> 26#include <linux/pm.h>
27#include <linux/platform_device.h> 27#include <linux/platform_device.h>
28#include <linux/resource.h> 28#include <linux/resource.h>
29#include <linux/slab.h>
29#include <linux/spinlock.h> 30#include <linux/spinlock.h>
30 31
31#include <pcmcia/cs_types.h> 32#include <pcmcia/cs_types.h>
@@ -145,7 +146,6 @@ static irqreturn_t db1200_pcmcia_cdirq(int irq, void *data)
145static int db1x_pcmcia_setup_irqs(struct db1x_pcmcia_sock *sock) 146static int db1x_pcmcia_setup_irqs(struct db1x_pcmcia_sock *sock)
146{ 147{
147 int ret; 148 int ret;
148 unsigned long flags;
149 149
150 if (sock->stschg_irq != -1) { 150 if (sock->stschg_irq != -1) {
151 ret = request_irq(sock->stschg_irq, db1000_pcmcia_stschgirq, 151 ret = request_irq(sock->stschg_irq, db1000_pcmcia_stschgirq,
@@ -161,8 +161,6 @@ static int db1x_pcmcia_setup_irqs(struct db1x_pcmcia_sock *sock)
161 * active one disabled. 161 * active one disabled.
162 */ 162 */
163 if (sock->board_type == BOARD_TYPE_DB1200) { 163 if (sock->board_type == BOARD_TYPE_DB1200) {
164 local_irq_save(flags);
165
166 ret = request_irq(sock->insert_irq, db1200_pcmcia_cdirq, 164 ret = request_irq(sock->insert_irq, db1200_pcmcia_cdirq,
167 IRQF_DISABLED, "pcmcia_insert", sock); 165 IRQF_DISABLED, "pcmcia_insert", sock);
168 if (ret) 166 if (ret)
@@ -172,17 +170,14 @@ static int db1x_pcmcia_setup_irqs(struct db1x_pcmcia_sock *sock)
172 IRQF_DISABLED, "pcmcia_eject", sock); 170 IRQF_DISABLED, "pcmcia_eject", sock);
173 if (ret) { 171 if (ret) {
174 free_irq(sock->insert_irq, sock); 172 free_irq(sock->insert_irq, sock);
175 local_irq_restore(flags);
176 goto out1; 173 goto out1;
177 } 174 }
178 175
179 /* disable the currently active one */ 176 /* enable the currently silent one */
180 if (db1200_card_inserted(sock)) 177 if (db1200_card_inserted(sock))
181 disable_irq_nosync(sock->insert_irq); 178 enable_irq(sock->eject_irq);
182 else 179 else
183 disable_irq_nosync(sock->eject_irq); 180 enable_irq(sock->insert_irq);
184
185 local_irq_restore(flags);
186 } else { 181 } else {
187 /* all other (older) Db1x00 boards use a GPIO to show 182 /* all other (older) Db1x00 boards use a GPIO to show
188 * card detection status: use both-edge triggers. 183 * card detection status: use both-edge triggers.
@@ -558,37 +553,10 @@ static int __devexit db1x_pcmcia_socket_remove(struct platform_device *pdev)
558 return 0; 553 return 0;
559} 554}
560 555
561#ifdef CONFIG_PM
562static int db1x_pcmcia_suspend(struct device *dev)
563{
564 return pcmcia_socket_dev_suspend(dev);
565}
566
567static int db1x_pcmcia_resume(struct device *dev)
568{
569 return pcmcia_socket_dev_resume(dev);
570}
571
572static struct dev_pm_ops db1x_pcmcia_pmops = {
573 .resume = db1x_pcmcia_resume,
574 .suspend = db1x_pcmcia_suspend,
575 .thaw = db1x_pcmcia_resume,
576 .freeze = db1x_pcmcia_suspend,
577};
578
579#define DB1XXX_SS_PMOPS &db1x_pcmcia_pmops
580
581#else
582
583#define DB1XXX_SS_PMOPS NULL
584
585#endif
586
587static struct platform_driver db1x_pcmcia_socket_driver = { 556static struct platform_driver db1x_pcmcia_socket_driver = {
588 .driver = { 557 .driver = {
589 .name = "db1xxx_pcmcia", 558 .name = "db1xxx_pcmcia",
590 .owner = THIS_MODULE, 559 .owner = THIS_MODULE,
591 .pm = DB1XXX_SS_PMOPS
592 }, 560 },
593 .probe = db1x_pcmcia_socket_probe, 561 .probe = db1x_pcmcia_socket_probe,
594 .remove = __devexit_p(db1x_pcmcia_socket_remove), 562 .remove = __devexit_p(db1x_pcmcia_socket_remove),