aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ssb/pcmcia.c
diff options
context:
space:
mode:
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