Merge with Linus' kernel.
[linux-3.10.git] / drivers / pcmcia / pxa2xx_sharpsl.c
index b5fdeec20b151660b139a32c2275b904dd4dc411..12a7244a5ec86e4a92bfca58f422c7d4c7c69511 100644 (file)
 struct scoop_pcmcia_config *platform_scoop_config;
 #define SCOOP_DEV platform_scoop_config->devs
 
-static void sharpsl_pcmcia_init_reset(struct scoop_pcmcia_dev *scoopdev)
+static void sharpsl_pcmcia_init_reset(struct soc_pcmcia_socket *skt)
 {
+       struct scoop_pcmcia_dev *scoopdev = &SCOOP_DEV[skt->nr];
+
        reset_scoop(scoopdev->dev);
+
+       /* Shared power controls need to be handled carefully */
+       if (platform_scoop_config->power_ctrl)
+               platform_scoop_config->power_ctrl(scoopdev->dev, 0x0000, skt->nr);
+       else
+               write_scoop_reg(scoopdev->dev, SCOOP_CPR, 0x0000);
+
        scoopdev->keep_vs = NO_KEEP_VS;
        scoopdev->keep_rd = 0;
 }
@@ -208,26 +217,17 @@ static int sharpsl_pcmcia_configure_socket(struct soc_pcmcia_socket *skt,
 
 static void sharpsl_pcmcia_socket_init(struct soc_pcmcia_socket *skt)
 {
-       sharpsl_pcmcia_init_reset(&SCOOP_DEV[skt->nr]);
+       sharpsl_pcmcia_init_reset(skt);
 
        /* Enable interrupt */
        write_scoop_reg(SCOOP_DEV[skt->nr].dev, SCOOP_IMR, 0x00C0);
        write_scoop_reg(SCOOP_DEV[skt->nr].dev, SCOOP_MCR, 0x0101);
        SCOOP_DEV[skt->nr].keep_vs = NO_KEEP_VS;
-
-       if (machine_is_collie())
-               /* We need to disable SS_OUTPUT_ENA here. */
-               write_scoop_reg(SCOOP_DEV[skt->nr].dev, SCOOP_CPR, read_scoop_reg(SCOOP_DEV[skt->nr].dev, SCOOP_CPR) & ~0x0080);
 }
 
 static void sharpsl_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt)
 {
-       /* CF_BUS_OFF */
-       sharpsl_pcmcia_init_reset(&SCOOP_DEV[skt->nr]);
-
-       if (machine_is_collie())
-               /* We need to disable SS_OUTPUT_ENA here. */
-               write_scoop_reg(SCOOP_DEV[skt->nr].dev, SCOOP_CPR, read_scoop_reg(SCOOP_DEV[skt->nr].dev, SCOOP_CPR) & ~0x0080);
+       sharpsl_pcmcia_init_reset(skt);
 }
 
 static struct pcmcia_low_level sharpsl_pcmcia_ops = {