ARM: gpio: pxa: convert drivers to use asm/gpio.h rather than mach/gpio.h
[linux-2.6.git] / drivers / pcmcia / topic.h
index be420bb..615a45a 100644 (file)
 #define  TOPIC97_AVS_AUDIO_CONTROL     0x02
 #define  TOPIC97_AVS_VIDEO_CONTROL     0x01
 
+#define TOPIC_EXCA_IF_CONTROL          0x3e    /* 8 bit */
+#define TOPIC_EXCA_IFC_33V_ENA         0x01
 
 static void topic97_zoom_video(struct pcmcia_socket *sock, int onoff)
 {
@@ -112,22 +114,17 @@ static void topic97_zoom_video(struct pcmcia_socket *sock, int onoff)
                reg_zv |= TOPIC97_ZV_CONTROL_ENABLE;
                config_writeb(socket, TOPIC97_ZOOM_VIDEO_CONTROL, reg_zv);
 
-               reg = config_readb(socket, TOPIC97_MISC2);
-               reg |= TOPIC97_MISC2_ZV_ENABLE;
-               config_writeb(socket, TOPIC97_MISC2, reg);
-
-               /* not sure this is needed, doc is unclear */
-#if 0
                reg = config_readb(socket, TOPIC97_AUDIO_VIDEO_SWITCH);
                reg |= TOPIC97_AVS_AUDIO_CONTROL | TOPIC97_AVS_VIDEO_CONTROL;
                config_writeb(socket, TOPIC97_AUDIO_VIDEO_SWITCH, reg);
-#endif
-       }
-       else {
+       } else {
                reg_zv &= ~TOPIC97_ZV_CONTROL_ENABLE;
                config_writeb(socket, TOPIC97_ZOOM_VIDEO_CONTROL, reg_zv);
-       }
 
+               reg = config_readb(socket, TOPIC97_AUDIO_VIDEO_SWITCH);
+               reg &= ~(TOPIC97_AVS_AUDIO_CONTROL | TOPIC97_AVS_VIDEO_CONTROL);
+               config_writeb(socket, TOPIC97_AUDIO_VIDEO_SWITCH, reg);
+       }
 }
 
 static int topic97_override(struct yenta_socket *socket)
@@ -137,4 +134,19 @@ static int topic97_override(struct yenta_socket *socket)
        return 0;
 }
 
+
+static int topic95_override(struct yenta_socket *socket)
+{
+       u8 fctrl;
+
+       /* enable 3.3V support for 16bit cards */
+       fctrl = exca_readb(socket, TOPIC_EXCA_IF_CONTROL);
+       exca_writeb(socket, TOPIC_EXCA_IF_CONTROL, fctrl | TOPIC_EXCA_IFC_33V_ENA);
+
+       /* tell yenta to use exca registers to power 16bit cards */
+       socket->flags |= YENTA_16BIT_POWER_EXCA | YENTA_16BIT_POWER_DF;
+
+       return 0;
+}
+
 #endif /* _LINUX_TOPIC_H */