From 1f01a0534675fe45393a80da98c5e3fc8875b949 Mon Sep 17 00:00:00 2001 From: Russell King Date: Mon, 27 Oct 2003 23:20:38 +0000 Subject: [PATCH] [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. --- drivers/pcmcia/yenta_socket.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c index 27324a8561548..b60080a921dcc 100644 --- a/drivers/pcmcia/yenta_socket.c +++ b/drivers/pcmcia/yenta_socket.c @@ -461,6 +461,7 @@ static void yenta_clear_maps(struct yenta_socket *socket) static int yenta_sock_init(struct pcmcia_socket *sock) { struct yenta_socket *socket = container_of(sock, struct yenta_socket, socket); + u32 state; u16 bridge; bridge = config_readw(socket, CB_BRIDGE_CONTROL) & ~CB_BRIDGE_INTR; @@ -472,7 +473,10 @@ static int yenta_sock_init(struct pcmcia_socket *sock) exca_writeb(socket, I365_GENCTL, 0x00); /* Redo card voltage interrogation */ - cb_writel(socket, CB_SOCKET_FORCE, CB_CVSTEST); + 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); yenta_clear_maps(socket); -- 2.53.0