Commit 1f01a053 authored by Russell King's avatar Russell King

[PCMCIA] Fix card detection.

Idea from David Hinds.

Some PCMCIA/Cardbus controllers seem to get upset when we ask
them to re-do card interrogation - they miss the next insertion
event.

We therefore avoid forcing needless card interrogations if a
card has already been succesfully detected and interrogated.
parent edf12049
...@@ -461,6 +461,7 @@ static void yenta_clear_maps(struct yenta_socket *socket) ...@@ -461,6 +461,7 @@ static void yenta_clear_maps(struct yenta_socket *socket)
static int yenta_sock_init(struct pcmcia_socket *sock) static int yenta_sock_init(struct pcmcia_socket *sock)
{ {
struct yenta_socket *socket = container_of(sock, struct yenta_socket, socket); struct yenta_socket *socket = container_of(sock, struct yenta_socket, socket);
u32 state;
u16 bridge; u16 bridge;
bridge = config_readw(socket, CB_BRIDGE_CONTROL) & ~CB_BRIDGE_INTR; bridge = config_readw(socket, CB_BRIDGE_CONTROL) & ~CB_BRIDGE_INTR;
...@@ -472,6 +473,9 @@ static int yenta_sock_init(struct pcmcia_socket *sock) ...@@ -472,6 +473,9 @@ static int yenta_sock_init(struct pcmcia_socket *sock)
exca_writeb(socket, I365_GENCTL, 0x00); exca_writeb(socket, I365_GENCTL, 0x00);
/* Redo card voltage interrogation */ /* Redo card voltage interrogation */
state = cb_readl(socket, CB_SOCKET_STATE);
if (!(state & (CB_CDETECT1 | CB_CDETECT2 | CB_5VCARD |
CB_3VCARD | CB_XVCARD | CB_YVCARD)))
cb_writel(socket, CB_SOCKET_FORCE, CB_CVSTEST); cb_writel(socket, CB_SOCKET_FORCE, CB_CVSTEST);
yenta_clear_maps(socket); yenta_clear_maps(socket);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment