static void simpad_pcmcia_socket_state(struct soc_pcmcia_socket *skt, struct pcmcia_state *state) { long cs3reg = simpad_get_cs3_ro(); state->bvd1 = 1; /* Might be cs3reg & PCMCIA_BVD1 */ state->bvd2 = 1; /* Might be cs3reg & PCMCIA_BVD2 */ if ((cs3reg & (PCMCIA_VS1|PCMCIA_VS2)) == (PCMCIA_VS1|PCMCIA_VS2)) { state->vs_3v=0; state->vs_Xv=0; } else { state->vs_3v=1; state->vs_Xv=0; } }
static void simpad_pcmcia_socket_state(struct soc_pcmcia_socket *skt, struct pcmcia_state *state) { long cs3reg = simpad_get_cs3_ro(); /* the detect signal is inverted - fix that up here */ state->detect = !state->detect; state->bvd1 = 1; /* Might be cs3reg & PCMCIA_BVD1 */ state->bvd2 = 1; /* Might be cs3reg & PCMCIA_BVD2 */ if ((cs3reg & (PCMCIA_VS1|PCMCIA_VS2)) == (PCMCIA_VS1|PCMCIA_VS2)) { state->vs_3v=0; state->vs_Xv=0; } else { state->vs_3v=1; state->vs_Xv=0; } }
static void simpad_pcmcia_socket_state(struct soc_pcmcia_socket *skt, struct pcmcia_state *state) { unsigned long levels = GPLR; long cs3reg = simpad_get_cs3_ro(); state->detect=((levels & GPIO_CF_CD)==0)?1:0; state->ready=(levels & GPIO_CF_IRQ)?1:0; state->bvd1 = 1; /* Might be cs3reg & PCMCIA_BVD1 */ state->bvd2 = 1; /* Might be cs3reg & PCMCIA_BVD2 */ state->wrprot=0; /* Not available on Simpad. */ if ((cs3reg & (PCMCIA_VS1|PCMCIA_VS2)) == (PCMCIA_VS1|PCMCIA_VS2)) { state->vs_3v=0; state->vs_Xv=0; } else { state->vs_3v=1; state->vs_Xv=0; } }
static int cs3_gpio_get(struct gpio_chip *chip, unsigned offset) { if (offset > 15) return simpad_get_cs3_ro() & (1 << (offset - 16)); return simpad_get_cs3_shadow() & (1 << offset); };