aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ssb/pcmcia.c
diff options
context:
space:
mode:
authorMichael Buesch <mb@bu3sch.de>2008-03-29 19:10:50 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-04-08 15:05:57 -0400
commit8fe2b65a18e49bfde56a59ed4ab3fc7aa0c2f325 (patch)
treea813fe635b7a8c248c586de847d1501c4ccaab6b /drivers/ssb/pcmcia.c
parent5100d5ac81b9330dc57e35adbe50923ba6107b8f (diff)
ssb: Turn suspend/resume upside down
Turn the SSB bus suspend mechanism upside down. Instead of deciding by an internal reference count when to suspend/resume, let the parent bus call us in their suspend/resume routine. Signed-off-by: Michael Buesch <mb@bu3sch.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/ssb/pcmcia.c')
-rw-r--r--drivers/ssb/pcmcia.c34
1 files changed, 24 insertions, 10 deletions
diff --git a/drivers/ssb/pcmcia.c b/drivers/ssb/pcmcia.c
index d674cef7210d..dcaf2412bea7 100644
--- a/drivers/ssb/pcmcia.c
+++ b/drivers/ssb/pcmcia.c
@@ -684,6 +684,29 @@ static int ssb_pcmcia_cor_setup(struct ssb_bus *bus, u8 cor)
684 return 0; 684 return 0;
685} 685}
686 686
687/* Initialize the PCMCIA hardware. This is called on Init and Resume. */
688int ssb_pcmcia_hardware_setup(struct ssb_bus *bus)
689{
690 int err;
691
692 if (bus->bustype != SSB_BUSTYPE_PCMCIA)
693 return 0;
694
695 /* Switch segment to a known state and sync
696 * bus->mapped_pcmcia_seg with hardware state. */
697 ssb_pcmcia_switch_segment(bus, 0);
698 /* Init the COR register. */
699 err = ssb_pcmcia_cor_setup(bus, CISREG_COR);
700 if (err)
701 return err;
702 /* Some cards also need this register to get poked. */
703 err = ssb_pcmcia_cor_setup(bus, CISREG_COR + 0x80);
704 if (err)
705 return err;
706
707 return 0;
708}
709
687void ssb_pcmcia_exit(struct ssb_bus *bus) 710void ssb_pcmcia_exit(struct ssb_bus *bus)
688{ 711{
689 if (bus->bustype != SSB_BUSTYPE_PCMCIA) 712 if (bus->bustype != SSB_BUSTYPE_PCMCIA)
@@ -699,16 +722,7 @@ int ssb_pcmcia_init(struct ssb_bus *bus)
699 if (bus->bustype != SSB_BUSTYPE_PCMCIA) 722 if (bus->bustype != SSB_BUSTYPE_PCMCIA)
700 return 0; 723 return 0;
701 724
702 /* Switch segment to a known state and sync 725 err = ssb_pcmcia_hardware_setup(bus);
703 * bus->mapped_pcmcia_seg with hardware state. */
704 ssb_pcmcia_switch_segment(bus, 0);
705
706 /* Init the COR register. */
707 err = ssb_pcmcia_cor_setup(bus, CISREG_COR);
708 if (err)
709 goto error;
710 /* Some cards also need this register to get poked. */
711 err = ssb_pcmcia_cor_setup(bus, CISREG_COR + 0x80);
712 if (err) 726 if (err)
713 goto error; 727 goto error;
714 728