aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2005-11-12 17:56:33 -0500
committerDominik Brodowski <linux@dominikbrodowski.net>2006-01-05 17:41:09 -0500
commit9da4bc6d6a38c1c3d850c046d0aee324c1a2e52a (patch)
tree2783de4a280ece6707b9b5800b82e1149b4d4f48 /drivers/pcmcia
parent7f316b033b36adfbdf56bfb15c13de49798ab0b2 (diff)
[PATCH] pcmcia: remove get_socket callback
The .get_socket callback is never used by the PCMCIA core, therefore remove it. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/pcmcia')
-rw-r--r--drivers/pcmcia/au1000_generic.c18
-rw-r--r--drivers/pcmcia/hd64465_ss.c13
-rw-r--r--drivers/pcmcia/i82092.c73
-rw-r--r--drivers/pcmcia/i82092aa.h1
-rw-r--r--drivers/pcmcia/i82365.c83
-rw-r--r--drivers/pcmcia/m32r_cfc.c32
-rw-r--r--drivers/pcmcia/m32r_pcc.c20
-rw-r--r--drivers/pcmcia/m8xx_pcmcia.c12
-rw-r--r--drivers/pcmcia/pd6729.c70
-rw-r--r--drivers/pcmcia/soc_common.c20
-rw-r--r--drivers/pcmcia/tcic.c61
-rw-r--r--drivers/pcmcia/vrc4171_card.c70
-rw-r--r--drivers/pcmcia/vrc4173_cardu.c43
-rw-r--r--drivers/pcmcia/yenta_socket.c90
14 files changed, 0 insertions, 606 deletions
diff --git a/drivers/pcmcia/au1000_generic.c b/drivers/pcmcia/au1000_generic.c
index 87302c548c24..0868b72c3996 100644
--- a/drivers/pcmcia/au1000_generic.c
+++ b/drivers/pcmcia/au1000_generic.c
@@ -241,23 +241,6 @@ au1x00_pcmcia_get_status(struct pcmcia_socket *sock, unsigned int *status)
241 return 0; 241 return 0;
242} 242}
243 243
244/* au1x00_pcmcia_get_socket()
245 * Implements the get_socket() operation for the in-kernel PCMCIA
246 * service (formerly SS_GetSocket in Card Services). Not a very
247 * exciting routine.
248 *
249 * Returns: 0
250 */
251static int
252au1x00_pcmcia_get_socket(struct pcmcia_socket *sock, socket_state_t *state)
253{
254 struct au1000_pcmcia_socket *skt = to_au1000_socket(sock);
255
256 debug("for sock %u\n", skt->nr);
257 *state = skt->cs_state;
258 return 0;
259}
260
261/* au1x00_pcmcia_set_socket() 244/* au1x00_pcmcia_set_socket()
262 * Implements the set_socket() operation for the in-kernel PCMCIA 245 * Implements the set_socket() operation for the in-kernel PCMCIA
263 * service (formerly SS_SetSocket in Card Services). We more or 246 * service (formerly SS_SetSocket in Card Services). We more or
@@ -352,7 +335,6 @@ static struct pccard_operations au1x00_pcmcia_operations = {
352 .init = au1x00_pcmcia_sock_init, 335 .init = au1x00_pcmcia_sock_init,
353 .suspend = au1x00_pcmcia_suspend, 336 .suspend = au1x00_pcmcia_suspend,
354 .get_status = au1x00_pcmcia_get_status, 337 .get_status = au1x00_pcmcia_get_status,
355 .get_socket = au1x00_pcmcia_get_socket,
356 .set_socket = au1x00_pcmcia_set_socket, 338 .set_socket = au1x00_pcmcia_set_socket,
357 .set_io_map = au1x00_pcmcia_set_io_map, 339 .set_io_map = au1x00_pcmcia_set_io_map,
358 .set_mem_map = au1x00_pcmcia_set_mem_map, 340 .set_mem_map = au1x00_pcmcia_set_mem_map,
diff --git a/drivers/pcmcia/hd64465_ss.c b/drivers/pcmcia/hd64465_ss.c
index 561706ba4499..b39435bbfaeb 100644
--- a/drivers/pcmcia/hd64465_ss.c
+++ b/drivers/pcmcia/hd64465_ss.c
@@ -417,18 +417,6 @@ static int hs_get_status(struct pcmcia_socket *s, u_int *value)
417 417
418/*============================================================*/ 418/*============================================================*/
419 419
420static int hs_get_socket(struct pcmcia_socket *s, socket_state_t *state)
421{
422 hs_socket_t *sp = container_of(s, struct hs_socket_t, socket);
423
424 DPRINTK("hs_get_socket(%d)\n", sock);
425
426 *state = sp->state;
427 return 0;
428}
429
430/*============================================================*/
431
432static int hs_set_socket(struct pcmcia_socket *s, socket_state_t *state) 420static int hs_set_socket(struct pcmcia_socket *s, socket_state_t *state)
433{ 421{
434 hs_socket_t *sp = container_of(s, struct hs_socket_t, socket); 422 hs_socket_t *sp = container_of(s, struct hs_socket_t, socket);
@@ -749,7 +737,6 @@ static irqreturn_t hs_interrupt(int irq, void *dev, struct pt_regs *regs)
749static struct pccard_operations hs_operations = { 737static struct pccard_operations hs_operations = {
750 .init = hs_init, 738 .init = hs_init,
751 .get_status = hs_get_status, 739 .get_status = hs_get_status,
752 .get_socket = hs_get_socket,
753 .set_socket = hs_set_socket, 740 .set_socket = hs_set_socket,
754 .set_io_map = hs_set_io_map, 741 .set_io_map = hs_set_io_map,
755 .set_mem_map = hs_set_mem_map, 742 .set_mem_map = hs_set_mem_map,
diff --git a/drivers/pcmcia/i82092.c b/drivers/pcmcia/i82092.c
index f3fdc748659d..7979c85df3dc 100644
--- a/drivers/pcmcia/i82092.c
+++ b/drivers/pcmcia/i82092.c
@@ -66,7 +66,6 @@ static struct pci_driver i82092aa_pci_drv = {
66static struct pccard_operations i82092aa_operations = { 66static struct pccard_operations i82092aa_operations = {
67 .init = i82092aa_init, 67 .init = i82092aa_init,
68 .get_status = i82092aa_get_status, 68 .get_status = i82092aa_get_status,
69 .get_socket = i82092aa_get_socket,
70 .set_socket = i82092aa_set_socket, 69 .set_socket = i82092aa_set_socket,
71 .set_io_map = i82092aa_set_io_map, 70 .set_io_map = i82092aa_set_io_map,
72 .set_mem_map = i82092aa_set_mem_map, 71 .set_mem_map = i82092aa_set_mem_map,
@@ -482,78 +481,6 @@ static int i82092aa_get_status(struct pcmcia_socket *socket, u_int *value)
482} 481}
483 482
484 483
485static int i82092aa_get_socket(struct pcmcia_socket *socket, socket_state_t *state)
486{
487 unsigned int sock = container_of(socket, struct socket_info, socket)->number;
488 unsigned char reg,vcc,vpp;
489
490 enter("i82092aa_get_socket");
491 state->flags = 0;
492 state->Vcc = 0;
493 state->Vpp = 0;
494 state->io_irq = 0;
495 state->csc_mask = 0;
496
497 /* First the power status of the socket */
498 reg = indirect_read(sock,I365_POWER); /* PCTRL - Power Control Register */
499
500 if (reg & I365_PWR_AUTO)
501 state->flags |= SS_PWR_AUTO; /* Automatic Power Switch */
502
503 if (reg & I365_PWR_OUT)
504 state->flags |= SS_OUTPUT_ENA; /* Output signals are enabled */
505
506 vcc = reg & I365_VCC_MASK; vpp = reg & I365_VPP1_MASK;
507
508 if (reg & I365_VCC_5V) { /* Can still be 3.3V, in this case the Vcc value will be overwritten later */
509 state->Vcc = 50;
510
511 if (vpp == I365_VPP1_5V)
512 state->Vpp = 50;
513 if (vpp == I365_VPP1_12V)
514 state->Vpp = 120;
515
516 }
517
518 if ((reg & I365_VCC_3V)==I365_VCC_3V)
519 state->Vcc = 33;
520
521
522 /* Now the IO card, RESET flags and IO interrupt */
523
524 reg = indirect_read(sock, I365_INTCTL); /* IGENC, Interrupt and General Control */
525
526 if ((reg & I365_PC_RESET)==0)
527 state->flags |= SS_RESET;
528 if (reg & I365_PC_IOCARD)
529 state->flags |= SS_IOCARD; /* This is an IO card */
530
531 /* Set the IRQ number */
532 if (sockets[sock].dev!=NULL)
533 state->io_irq = sockets[sock].dev->irq;
534
535 /* Card status change */
536 reg = indirect_read(sock, I365_CSCINT); /* CSCICR, Card Status Change Interrupt Configuration */
537
538 if (reg & I365_CSC_DETECT)
539 state->csc_mask |= SS_DETECT; /* Card detect is enabled */
540
541 if (state->flags & SS_IOCARD) {/* IO Cards behave different */
542 if (reg & I365_CSC_STSCHG)
543 state->csc_mask |= SS_STSCHG;
544 } else {
545 if (reg & I365_CSC_BVD1)
546 state->csc_mask |= SS_BATDEAD;
547 if (reg & I365_CSC_BVD2)
548 state->csc_mask |= SS_BATWARN;
549 if (reg & I365_CSC_READY)
550 state->csc_mask |= SS_READY;
551 }
552
553 leave("i82092aa_get_socket");
554 return 0;
555}
556
557static int i82092aa_set_socket(struct pcmcia_socket *socket, socket_state_t *state) 484static int i82092aa_set_socket(struct pcmcia_socket *socket, socket_state_t *state)
558{ 485{
559 unsigned int sock = container_of(socket, struct socket_info, socket)->number; 486 unsigned int sock = container_of(socket, struct socket_info, socket)->number;
diff --git a/drivers/pcmcia/i82092aa.h b/drivers/pcmcia/i82092aa.h
index b98cac7bda9f..9c14599d0673 100644
--- a/drivers/pcmcia/i82092aa.h
+++ b/drivers/pcmcia/i82092aa.h
@@ -29,7 +29,6 @@ static irqreturn_t i82092aa_interrupt(int irq, void *dev, struct pt_regs *regs);
29 29
30 30
31static int i82092aa_get_status(struct pcmcia_socket *socket, u_int *value); 31static int i82092aa_get_status(struct pcmcia_socket *socket, u_int *value);
32static int i82092aa_get_socket(struct pcmcia_socket *socket, socket_state_t *state);
33static int i82092aa_set_socket(struct pcmcia_socket *socket, socket_state_t *state); 32static int i82092aa_set_socket(struct pcmcia_socket *socket, socket_state_t *state);
34static int i82092aa_set_io_map(struct pcmcia_socket *socket, struct pccard_io_map *io); 33static int i82092aa_set_io_map(struct pcmcia_socket *socket, struct pccard_io_map *io);
35static int i82092aa_set_mem_map(struct pcmcia_socket *socket, struct pccard_mem_map *mem); 34static int i82092aa_set_mem_map(struct pcmcia_socket *socket, struct pccard_mem_map *mem);
diff --git a/drivers/pcmcia/i82365.c b/drivers/pcmcia/i82365.c
index 4d56bc9926d6..35a92d1e4945 100644
--- a/drivers/pcmcia/i82365.c
+++ b/drivers/pcmcia/i82365.c
@@ -940,78 +940,6 @@ static int i365_get_status(u_short sock, u_int *value)
940 940
941/*====================================================================*/ 941/*====================================================================*/
942 942
943static int i365_get_socket(u_short sock, socket_state_t *state)
944{
945 struct i82365_socket *t = &socket[sock];
946 u_char reg, vcc, vpp;
947
948 reg = i365_get(sock, I365_POWER);
949 state->flags = (reg & I365_PWR_AUTO) ? SS_PWR_AUTO : 0;
950 state->flags |= (reg & I365_PWR_OUT) ? SS_OUTPUT_ENA : 0;
951 vcc = reg & I365_VCC_MASK; vpp = reg & I365_VPP1_MASK;
952 state->Vcc = state->Vpp = 0;
953 if (t->flags & IS_CIRRUS) {
954 if (i365_get(sock, PD67_MISC_CTL_1) & PD67_MC1_VCC_3V) {
955 if (reg & I365_VCC_5V) state->Vcc = 33;
956 if (vpp == I365_VPP1_5V) state->Vpp = 33;
957 } else {
958 if (reg & I365_VCC_5V) state->Vcc = 50;
959 if (vpp == I365_VPP1_5V) state->Vpp = 50;
960 }
961 if (vpp == I365_VPP1_12V) state->Vpp = 120;
962 } else if (t->flags & IS_VG_PWR) {
963 if (i365_get(sock, VG469_VSELECT) & VG469_VSEL_VCC) {
964 if (reg & I365_VCC_5V) state->Vcc = 33;
965 if (vpp == I365_VPP1_5V) state->Vpp = 33;
966 } else {
967 if (reg & I365_VCC_5V) state->Vcc = 50;
968 if (vpp == I365_VPP1_5V) state->Vpp = 50;
969 }
970 if (vpp == I365_VPP1_12V) state->Vpp = 120;
971 } else if (t->flags & IS_DF_PWR) {
972 if (vcc == I365_VCC_3V) state->Vcc = 33;
973 if (vcc == I365_VCC_5V) state->Vcc = 50;
974 if (vpp == I365_VPP1_5V) state->Vpp = 50;
975 if (vpp == I365_VPP1_12V) state->Vpp = 120;
976 } else {
977 if (reg & I365_VCC_5V) {
978 state->Vcc = 50;
979 if (vpp == I365_VPP1_5V) state->Vpp = 50;
980 if (vpp == I365_VPP1_12V) state->Vpp = 120;
981 }
982 }
983
984 /* IO card, RESET flags, IO interrupt */
985 reg = i365_get(sock, I365_INTCTL);
986 state->flags |= (reg & I365_PC_RESET) ? 0 : SS_RESET;
987 if (reg & I365_PC_IOCARD) state->flags |= SS_IOCARD;
988 state->io_irq = reg & I365_IRQ_MASK;
989
990 /* speaker control */
991 if (t->flags & IS_CIRRUS) {
992 if (i365_get(sock, PD67_MISC_CTL_1) & PD67_MC1_SPKR_ENA)
993 state->flags |= SS_SPKR_ENA;
994 }
995
996 /* Card status change mask */
997 reg = i365_get(sock, I365_CSCINT);
998 state->csc_mask = (reg & I365_CSC_DETECT) ? SS_DETECT : 0;
999 if (state->flags & SS_IOCARD)
1000 state->csc_mask |= (reg & I365_CSC_STSCHG) ? SS_STSCHG : 0;
1001 else {
1002 state->csc_mask |= (reg & I365_CSC_BVD1) ? SS_BATDEAD : 0;
1003 state->csc_mask |= (reg & I365_CSC_BVD2) ? SS_BATWARN : 0;
1004 state->csc_mask |= (reg & I365_CSC_READY) ? SS_READY : 0;
1005 }
1006
1007 debug(1, "GetSocket(%d) = flags %#3.3x, Vcc %d, Vpp %d, "
1008 "io_irq %d, csc_mask %#2.2x\n", sock, state->flags,
1009 state->Vcc, state->Vpp, state->io_irq, state->csc_mask);
1010 return 0;
1011} /* i365_get_socket */
1012
1013/*====================================================================*/
1014
1015static int i365_set_socket(u_short sock, socket_state_t *state) 943static int i365_set_socket(u_short sock, socket_state_t *state)
1016{ 944{
1017 struct i82365_socket *t = &socket[sock]; 945 struct i82365_socket *t = &socket[sock];
@@ -1265,16 +1193,6 @@ static int pcic_get_status(struct pcmcia_socket *s, u_int *value)
1265 LOCKED(i365_get_status(sock, value)); 1193 LOCKED(i365_get_status(sock, value));
1266} 1194}
1267 1195
1268static int pcic_get_socket(struct pcmcia_socket *s, socket_state_t *state)
1269{
1270 unsigned int sock = container_of(s, struct i82365_socket, socket)->number;
1271
1272 if (socket[sock].flags & IS_ALIVE)
1273 return -EINVAL;
1274
1275 LOCKED(i365_get_socket(sock, state));
1276}
1277
1278static int pcic_set_socket(struct pcmcia_socket *s, socket_state_t *state) 1196static int pcic_set_socket(struct pcmcia_socket *s, socket_state_t *state)
1279{ 1197{
1280 unsigned int sock = container_of(s, struct i82365_socket, socket)->number; 1198 unsigned int sock = container_of(s, struct i82365_socket, socket)->number;
@@ -1324,7 +1242,6 @@ static int pcic_init(struct pcmcia_socket *s)
1324static struct pccard_operations pcic_operations = { 1242static struct pccard_operations pcic_operations = {
1325 .init = pcic_init, 1243 .init = pcic_init,
1326 .get_status = pcic_get_status, 1244 .get_status = pcic_get_status,
1327 .get_socket = pcic_get_socket,
1328 .set_socket = pcic_set_socket, 1245 .set_socket = pcic_set_socket,
1329 .set_io_map = pcic_set_io_map, 1246 .set_io_map = pcic_set_io_map,
1330 .set_mem_map = pcic_set_mem_map, 1247 .set_mem_map = pcic_set_mem_map,
diff --git a/drivers/pcmcia/m32r_cfc.c b/drivers/pcmcia/m32r_cfc.c
index 078579ae6359..071cf485e1a3 100644
--- a/drivers/pcmcia/m32r_cfc.c
+++ b/drivers/pcmcia/m32r_cfc.c
@@ -480,25 +480,6 @@ static int _pcc_get_status(u_short sock, u_int *value)
480 480
481/*====================================================================*/ 481/*====================================================================*/
482 482
483static int _pcc_get_socket(u_short sock, socket_state_t *state)
484{
485// pcc_socket_t *t = &socket[sock];
486
487 state->flags = 0;
488 state->csc_mask = SS_DETECT;
489 state->csc_mask |= SS_READY;
490 state->io_irq = 0;
491 state->Vcc = 33; /* 3.3V fixed */
492 state->Vpp = 33;
493
494 debug(3, "m32r_cfc: GetSocket(%d) = flags %#3.3x, Vcc %d, Vpp %d, "
495 "io_irq %d, csc_mask %#2.2x\n", sock, state->flags,
496 state->Vcc, state->Vpp, state->io_irq, state->csc_mask);
497 return 0;
498} /* _get_socket */
499
500/*====================================================================*/
501
502static int _pcc_set_socket(u_short sock, socket_state_t *state) 483static int _pcc_set_socket(u_short sock, socket_state_t *state)
503{ 484{
504 debug(3, "m32r_cfc: SetSocket(%d, flags %#3.3x, Vcc %d, Vpp %d, " 485 debug(3, "m32r_cfc: SetSocket(%d, flags %#3.3x, Vcc %d, Vpp %d, "
@@ -667,18 +648,6 @@ static int pcc_get_status(struct pcmcia_socket *s, u_int *value)
667 LOCKED(_pcc_get_status(sock, value)); 648 LOCKED(_pcc_get_status(sock, value));
668} 649}
669 650
670static int pcc_get_socket(struct pcmcia_socket *s, socket_state_t *state)
671{
672 unsigned int sock = container_of(s, struct pcc_socket, socket)->number;
673
674 if (socket[sock].flags & IS_ALIVE) {
675 debug(3, "m32r_cfc: pcc_get_socket: sock(%d) -EINVAL\n", sock);
676 return -EINVAL;
677 }
678 debug(3, "m32r_cfc: pcc_get_socket: sock(%d)\n", sock);
679 LOCKED(_pcc_get_socket(sock, state));
680}
681
682static int pcc_set_socket(struct pcmcia_socket *s, socket_state_t *state) 651static int pcc_set_socket(struct pcmcia_socket *s, socket_state_t *state)
683{ 652{
684 unsigned int sock = container_of(s, struct pcc_socket, socket)->number; 653 unsigned int sock = container_of(s, struct pcc_socket, socket)->number;
@@ -724,7 +693,6 @@ static int pcc_init(struct pcmcia_socket *s)
724static struct pccard_operations pcc_operations = { 693static struct pccard_operations pcc_operations = {
725 .init = pcc_init, 694 .init = pcc_init,
726 .get_status = pcc_get_status, 695 .get_status = pcc_get_status,
727 .get_socket = pcc_get_socket,
728 .set_socket = pcc_set_socket, 696 .set_socket = pcc_set_socket,
729 .set_io_map = pcc_set_io_map, 697 .set_io_map = pcc_set_io_map,
730 .set_mem_map = pcc_set_mem_map, 698 .set_mem_map = pcc_set_mem_map,
diff --git a/drivers/pcmcia/m32r_pcc.c b/drivers/pcmcia/m32r_pcc.c
index 356a6fb416a1..70d5f0748d55 100644
--- a/drivers/pcmcia/m32r_pcc.c
+++ b/drivers/pcmcia/m32r_pcc.c
@@ -429,16 +429,6 @@ static int _pcc_get_status(u_short sock, u_int *value)
429 429
430/*====================================================================*/ 430/*====================================================================*/
431 431
432static int _pcc_get_socket(u_short sock, socket_state_t *state)
433{
434 debug(3, "m32r-pcc: GetSocket(%d) = flags %#3.3x, Vcc %d, Vpp %d, "
435 "io_irq %d, csc_mask %#2.2x\n", sock, state->flags,
436 state->Vcc, state->Vpp, state->io_irq, state->csc_mask);
437 return 0;
438} /* _get_socket */
439
440/*====================================================================*/
441
442static int _pcc_set_socket(u_short sock, socket_state_t *state) 432static int _pcc_set_socket(u_short sock, socket_state_t *state)
443{ 433{
444 u_long reg = 0; 434 u_long reg = 0;
@@ -641,15 +631,6 @@ static int pcc_get_status(struct pcmcia_socket *s, u_int *value)
641 LOCKED(_pcc_get_status(sock, value)); 631 LOCKED(_pcc_get_status(sock, value));
642} 632}
643 633
644static int pcc_get_socket(struct pcmcia_socket *s, socket_state_t *state)
645{
646 unsigned int sock = container_of(s, struct pcc_socket, socket)->number;
647
648 if (socket[sock].flags & IS_ALIVE)
649 return -EINVAL;
650 LOCKED(_pcc_get_socket(sock, state));
651}
652
653static int pcc_set_socket(struct pcmcia_socket *s, socket_state_t *state) 634static int pcc_set_socket(struct pcmcia_socket *s, socket_state_t *state)
654{ 635{
655 unsigned int sock = container_of(s, struct pcc_socket, socket)->number; 636 unsigned int sock = container_of(s, struct pcc_socket, socket)->number;
@@ -687,7 +668,6 @@ static int pcc_init(struct pcmcia_socket *s)
687static struct pccard_operations pcc_operations = { 668static struct pccard_operations pcc_operations = {
688 .init = pcc_init, 669 .init = pcc_init,
689 .get_status = pcc_get_status, 670 .get_status = pcc_get_status,
690 .get_socket = pcc_get_socket,
691 .set_socket = pcc_set_socket, 671 .set_socket = pcc_set_socket,
692 .set_io_map = pcc_set_io_map, 672 .set_io_map = pcc_set_io_map,
693 .set_mem_map = pcc_set_mem_map, 673 .set_mem_map = pcc_set_mem_map,
diff --git a/drivers/pcmcia/m8xx_pcmcia.c b/drivers/pcmcia/m8xx_pcmcia.c
index 6d9f71cfcb34..a7f27c3dfc24 100644
--- a/drivers/pcmcia/m8xx_pcmcia.c
+++ b/drivers/pcmcia/m8xx_pcmcia.c
@@ -823,17 +823,6 @@ static int m8xx_get_status(struct pcmcia_socket *sock, unsigned int *value)
823 return 0; 823 return 0;
824} 824}
825 825
826static int m8xx_get_socket(struct pcmcia_socket *sock, socket_state_t *state)
827{
828 int lsock = container_of(sock, struct socket_info, socket)->slot;
829 *state = socket[lsock].state; /* copy the whole structure */
830
831 dprintk("GetSocket(%d) = flags %#3.3x, Vcc %d, Vpp %d, "
832 "io_irq %d, csc_mask %#2.2x\n", lsock, state->flags,
833 state->Vcc, state->Vpp, state->io_irq, state->csc_mask);
834 return 0;
835}
836
837static int m8xx_set_socket(struct pcmcia_socket *sock, socket_state_t *state) 826static int m8xx_set_socket(struct pcmcia_socket *sock, socket_state_t *state)
838{ 827{
839 int lsock = container_of(sock, struct socket_info, socket)->slot; 828 int lsock = container_of(sock, struct socket_info, socket)->slot;
@@ -1169,7 +1158,6 @@ static struct pccard_operations m8xx_services = {
1169 .init = m8xx_sock_init, 1158 .init = m8xx_sock_init,
1170 .suspend = m8xx_suspend, 1159 .suspend = m8xx_suspend,
1171 .get_status = m8xx_get_status, 1160 .get_status = m8xx_get_status,
1172 .get_socket = m8xx_get_socket,
1173 .set_socket = m8xx_set_socket, 1161 .set_socket = m8xx_set_socket,
1174 .set_io_map = m8xx_set_io_map, 1162 .set_io_map = m8xx_set_io_map,
1175 .set_mem_map = m8xx_set_mem_map, 1163 .set_mem_map = m8xx_set_mem_map,
diff --git a/drivers/pcmcia/pd6729.c b/drivers/pcmcia/pd6729.c
index 20642f0e7bfe..e7a6d9ac5ed8 100644
--- a/drivers/pcmcia/pd6729.c
+++ b/drivers/pcmcia/pd6729.c
@@ -304,75 +304,6 @@ static int pd6729_get_status(struct pcmcia_socket *sock, u_int *value)
304} 304}
305 305
306 306
307static int pd6729_get_socket(struct pcmcia_socket *sock, socket_state_t *state)
308{
309 struct pd6729_socket *socket
310 = container_of(sock, struct pd6729_socket, socket);
311 unsigned char reg, vcc, vpp;
312
313 state->flags = 0;
314 state->Vcc = 0;
315 state->Vpp = 0;
316 state->io_irq = 0;
317 state->csc_mask = 0;
318
319 /* First the power status of the socket */
320 reg = indirect_read(socket, I365_POWER);
321
322 if (reg & I365_PWR_AUTO)
323 state->flags |= SS_PWR_AUTO; /* Automatic Power Switch */
324
325 if (reg & I365_PWR_OUT)
326 state->flags |= SS_OUTPUT_ENA; /* Output signals are enabled */
327
328 vcc = reg & I365_VCC_MASK; vpp = reg & I365_VPP1_MASK;
329
330 if (reg & I365_VCC_5V) {
331 state->Vcc = (indirect_read(socket, PD67_MISC_CTL_1) &
332 PD67_MC1_VCC_3V) ? 33 : 50;
333
334 if (vpp == I365_VPP1_5V) {
335 if (state->Vcc == 50)
336 state->Vpp = 50;
337 else
338 state->Vpp = 33;
339 }
340 if (vpp == I365_VPP1_12V)
341 state->Vpp = 120;
342 }
343
344 /* Now the IO card, RESET flags and IO interrupt */
345 reg = indirect_read(socket, I365_INTCTL);
346
347 if ((reg & I365_PC_RESET) == 0)
348 state->flags |= SS_RESET;
349 if (reg & I365_PC_IOCARD)
350 state->flags |= SS_IOCARD; /* This is an IO card */
351
352 /* Set the IRQ number */
353 state->io_irq = socket->card_irq;
354
355 /* Card status change */
356 reg = indirect_read(socket, I365_CSCINT);
357
358 if (reg & I365_CSC_DETECT)
359 state->csc_mask |= SS_DETECT; /* Card detect is enabled */
360
361 if (state->flags & SS_IOCARD) {/* IO Cards behave different */
362 if (reg & I365_CSC_STSCHG)
363 state->csc_mask |= SS_STSCHG;
364 } else {
365 if (reg & I365_CSC_BVD1)
366 state->csc_mask |= SS_BATDEAD;
367 if (reg & I365_CSC_BVD2)
368 state->csc_mask |= SS_BATWARN;
369 if (reg & I365_CSC_READY)
370 state->csc_mask |= SS_READY;
371 }
372
373 return 0;
374}
375
376static int pd6729_set_socket(struct pcmcia_socket *sock, socket_state_t *state) 307static int pd6729_set_socket(struct pcmcia_socket *sock, socket_state_t *state)
377{ 308{
378 struct pd6729_socket *socket 309 struct pd6729_socket *socket
@@ -640,7 +571,6 @@ static int pd6729_init(struct pcmcia_socket *sock)
640static struct pccard_operations pd6729_operations = { 571static struct pccard_operations pd6729_operations = {
641 .init = pd6729_init, 572 .init = pd6729_init,
642 .get_status = pd6729_get_status, 573 .get_status = pd6729_get_status,
643 .get_socket = pd6729_get_socket,
644 .set_socket = pd6729_set_socket, 574 .set_socket = pd6729_set_socket,
645 .set_io_map = pd6729_set_io_map, 575 .set_io_map = pd6729_set_io_map,
646 .set_mem_map = pd6729_set_mem_map, 576 .set_mem_map = pd6729_set_mem_map,
diff --git a/drivers/pcmcia/soc_common.c b/drivers/pcmcia/soc_common.c
index 9e7ccd8a4321..a563bd9a8898 100644
--- a/drivers/pcmcia/soc_common.c
+++ b/drivers/pcmcia/soc_common.c
@@ -297,25 +297,6 @@ soc_common_pcmcia_get_status(struct pcmcia_socket *sock, unsigned int *status)
297 297
298 298
299/* 299/*
300 * Implements the get_socket() operation for the in-kernel PCMCIA
301 * service (formerly SS_GetSocket in Card Services). Not a very
302 * exciting routine.
303 *
304 * Returns: 0
305 */
306static int
307soc_common_pcmcia_get_socket(struct pcmcia_socket *sock, socket_state_t *state)
308{
309 struct soc_pcmcia_socket *skt = to_soc_pcmcia_socket(sock);
310
311 debug(skt, 2, "\n");
312
313 *state = skt->cs_state;
314
315 return 0;
316}
317
318/*
319 * Implements the set_socket() operation for the in-kernel PCMCIA 300 * Implements the set_socket() operation for the in-kernel PCMCIA
320 * service (formerly SS_SetSocket in Card Services). We more or 301 * service (formerly SS_SetSocket in Card Services). We more or
321 * less punt all of this work and let the kernel handle the details 302 * less punt all of this work and let the kernel handle the details
@@ -528,7 +509,6 @@ static struct pccard_operations soc_common_pcmcia_operations = {
528 .init = soc_common_pcmcia_sock_init, 509 .init = soc_common_pcmcia_sock_init,
529 .suspend = soc_common_pcmcia_suspend, 510 .suspend = soc_common_pcmcia_suspend,
530 .get_status = soc_common_pcmcia_get_status, 511 .get_status = soc_common_pcmcia_get_status,
531 .get_socket = soc_common_pcmcia_get_socket,
532 .set_socket = soc_common_pcmcia_set_socket, 512 .set_socket = soc_common_pcmcia_set_socket,
533 .set_io_map = soc_common_pcmcia_set_io_map, 513 .set_io_map = soc_common_pcmcia_set_io_map,
534 .set_mem_map = soc_common_pcmcia_set_mem_map, 514 .set_mem_map = soc_common_pcmcia_set_mem_map,
diff --git a/drivers/pcmcia/tcic.c b/drivers/pcmcia/tcic.c
index e31263864377..73bad1d5cb23 100644
--- a/drivers/pcmcia/tcic.c
+++ b/drivers/pcmcia/tcic.c
@@ -181,13 +181,6 @@ static void tcic_setl(u_char reg, u_int data)
181 outw(data >> 16, tcic_base+reg+2); 181 outw(data >> 16, tcic_base+reg+2);
182} 182}
183 183
184static u_char tcic_aux_getb(u_short reg)
185{
186 u_char mode = (tcic_getb(TCIC_MODE) & TCIC_MODE_PGMMASK) | reg;
187 tcic_setb(TCIC_MODE, mode);
188 return tcic_getb(TCIC_AUX);
189}
190
191static void tcic_aux_setb(u_short reg, u_char data) 184static void tcic_aux_setb(u_short reg, u_char data)
192{ 185{
193 u_char mode = (tcic_getb(TCIC_MODE) & TCIC_MODE_PGMMASK) | reg; 186 u_char mode = (tcic_getb(TCIC_MODE) & TCIC_MODE_PGMMASK) | reg;
@@ -641,59 +634,6 @@ static int tcic_get_status(struct pcmcia_socket *sock, u_int *value)
641 debug(1, "GetStatus(%d) = %#2.2x\n", psock, *value); 634 debug(1, "GetStatus(%d) = %#2.2x\n", psock, *value);
642 return 0; 635 return 0;
643} /* tcic_get_status */ 636} /* tcic_get_status */
644
645/*====================================================================*/
646
647static int tcic_get_socket(struct pcmcia_socket *sock, socket_state_t *state)
648{
649 u_short psock = container_of(sock, struct tcic_socket, socket)->psock;
650 u_char reg;
651 u_short scf1, scf2;
652
653 tcic_setl(TCIC_ADDR, (psock << TCIC_ADDR_SS_SHFT)
654 | TCIC_ADDR_INDREG | TCIC_SCF1(psock));
655 scf1 = tcic_getw(TCIC_DATA);
656 state->flags = (scf1 & TCIC_SCF1_IOSTS) ? SS_IOCARD : 0;
657 state->flags |= (scf1 & TCIC_SCF1_DMA_MASK) ? SS_DMA_MODE : 0;
658 state->flags |= (scf1 & TCIC_SCF1_SPKR) ? SS_SPKR_ENA : 0;
659 if (tcic_getb(TCIC_SCTRL) & TCIC_SCTRL_ENA)
660 state->flags |= SS_OUTPUT_ENA;
661 state->io_irq = scf1 & TCIC_SCF1_IRQ_MASK;
662 if (state->io_irq == 1) state->io_irq = 11;
663
664 reg = tcic_getb(TCIC_PWR);
665 state->Vcc = state->Vpp = 0;
666 if (reg & TCIC_PWR_VCC(psock)) {
667 if (reg & TCIC_PWR_VPP(psock))
668 state->Vcc = 50;
669 else
670 state->Vcc = state->Vpp = 50;
671 } else {
672 if (reg & TCIC_PWR_VPP(psock)) {
673 state->Vcc = 50;
674 state->Vpp = 120;
675 }
676 }
677 reg = tcic_aux_getb(TCIC_AUX_ILOCK);
678 state->flags |= (reg & TCIC_ILOCK_CRESET) ? SS_RESET : 0;
679
680 /* Card status change interrupt mask */
681 tcic_setw(TCIC_ADDR, TCIC_SCF2(psock));
682 scf2 = tcic_getw(TCIC_DATA);
683 state->csc_mask = (scf2 & TCIC_SCF2_MCD) ? 0 : SS_DETECT;
684 if (state->flags & SS_IOCARD) {
685 state->csc_mask |= (scf2 & TCIC_SCF2_MLBAT1) ? 0 : SS_STSCHG;
686 } else {
687 state->csc_mask |= (scf2 & TCIC_SCF2_MLBAT1) ? 0 : SS_BATDEAD;
688 state->csc_mask |= (scf2 & TCIC_SCF2_MLBAT2) ? 0 : SS_BATWARN;
689 state->csc_mask |= (scf2 & TCIC_SCF2_MRDY) ? 0 : SS_READY;
690 }
691
692 debug(1, "GetSocket(%d) = flags %#3.3x, Vcc %d, Vpp %d, "
693 "io_irq %d, csc_mask %#2.2x\n", psock, state->flags,
694 state->Vcc, state->Vpp, state->io_irq, state->csc_mask);
695 return 0;
696} /* tcic_get_socket */
697 637
698/*====================================================================*/ 638/*====================================================================*/
699 639
@@ -874,7 +814,6 @@ static int tcic_init(struct pcmcia_socket *s)
874static struct pccard_operations tcic_operations = { 814static struct pccard_operations tcic_operations = {
875 .init = tcic_init, 815 .init = tcic_init,
876 .get_status = tcic_get_status, 816 .get_status = tcic_get_status,
877 .get_socket = tcic_get_socket,
878 .set_socket = tcic_set_socket, 817 .set_socket = tcic_set_socket,
879 .set_io_map = tcic_set_io_map, 818 .set_io_map = tcic_set_io_map,
880 .set_mem_map = tcic_set_mem_map, 819 .set_mem_map = tcic_set_mem_map,
diff --git a/drivers/pcmcia/vrc4171_card.c b/drivers/pcmcia/vrc4171_card.c
index 38a028c725d4..24c547ef512b 100644
--- a/drivers/pcmcia/vrc4171_card.c
+++ b/drivers/pcmcia/vrc4171_card.c
@@ -301,75 +301,6 @@ static int pccard_get_status(struct pcmcia_socket *sock, u_int *value)
301 return 0; 301 return 0;
302} 302}
303 303
304static inline u_char get_Vcc_value(uint8_t voltage)
305{
306 switch (voltage) {
307 case VCC_STATUS_3V:
308 return 33;
309 case VCC_STATUS_5V:
310 return 50;
311 default:
312 break;
313 }
314
315 return 0;
316}
317
318static inline u_char get_Vpp_value(uint8_t power, u_char Vcc)
319{
320 if ((power & 0x03) == 0x01 || (power & 0x03) == 0x02)
321 return Vcc;
322
323 return 0;
324}
325
326static int pccard_get_socket(struct pcmcia_socket *sock, socket_state_t *state)
327{
328 unsigned int slot;
329 uint8_t power, voltage, control, cscint;
330
331 if (sock == NULL || sock->sock >= CARD_MAX_SLOTS || state == NULL)
332 return -EINVAL;
333
334 slot = sock->sock;
335
336 power = exca_read_byte(slot, I365_POWER);
337 voltage = exca_read_byte(slot, CARD_VOLTAGE_SELECT);
338
339 state->Vcc = get_Vcc_value(voltage);
340 state->Vpp = get_Vpp_value(power, state->Vcc);
341
342 state->flags = 0;
343 if (power & POWER_ENABLE)
344 state->flags |= SS_PWR_AUTO;
345 if (power & I365_PWR_OUT)
346 state->flags |= SS_OUTPUT_ENA;
347
348 control = exca_read_byte(slot, I365_INTCTL);
349 if (control & I365_PC_IOCARD)
350 state->flags |= SS_IOCARD;
351 if (!(control & I365_PC_RESET))
352 state->flags |= SS_RESET;
353
354 cscint = exca_read_byte(slot, I365_CSCINT);
355 state->csc_mask = 0;
356 if (state->flags & SS_IOCARD) {
357 if (cscint & I365_CSC_STSCHG)
358 state->flags |= SS_STSCHG;
359 } else {
360 if (cscint & I365_CSC_BVD1)
361 state->csc_mask |= SS_BATDEAD;
362 if (cscint & I365_CSC_BVD2)
363 state->csc_mask |= SS_BATWARN;
364 }
365 if (cscint & I365_CSC_READY)
366 state->csc_mask |= SS_READY;
367 if (cscint & I365_CSC_DETECT)
368 state->csc_mask |= SS_DETECT;
369
370 return 0;
371}
372
373static inline uint8_t set_Vcc_value(u_char Vcc) 304static inline uint8_t set_Vcc_value(u_char Vcc)
374{ 305{
375 switch (Vcc) { 306 switch (Vcc) {
@@ -551,7 +482,6 @@ static int pccard_set_mem_map(struct pcmcia_socket *sock, struct pccard_mem_map
551static struct pccard_operations vrc4171_pccard_operations = { 482static struct pccard_operations vrc4171_pccard_operations = {
552 .init = pccard_init, 483 .init = pccard_init,
553 .get_status = pccard_get_status, 484 .get_status = pccard_get_status,
554 .get_socket = pccard_get_socket,
555 .set_socket = pccard_set_socket, 485 .set_socket = pccard_set_socket,
556 .set_io_map = pccard_set_io_map, 486 .set_io_map = pccard_set_io_map,
557 .set_mem_map = pccard_set_mem_map, 487 .set_mem_map = pccard_set_mem_map,
diff --git a/drivers/pcmcia/vrc4173_cardu.c b/drivers/pcmcia/vrc4173_cardu.c
index db91259dc50e..1b277d2c1c96 100644
--- a/drivers/pcmcia/vrc4173_cardu.c
+++ b/drivers/pcmcia/vrc4173_cardu.c
@@ -198,48 +198,6 @@ static int cardu_get_status(unsigned int sock, u_int *value)
198 return 0; 198 return 0;
199} 199}
200 200
201static inline u_char get_Vcc_value(uint8_t val)
202{
203 switch (val & VCC_MASK) {
204 case VCC_3V:
205 return 33;
206 case VCC_5V:
207 return 50;
208 }
209
210 return 0;
211}
212
213static inline u_char get_Vpp_value(uint8_t val)
214{
215 switch (val & VPP_MASK) {
216 case VPP_12V:
217 return 120;
218 case VPP_VCC:
219 return get_Vcc_value(val);
220 }
221
222 return 0;
223}
224
225static int cardu_get_socket(unsigned int sock, socket_state_t *state)
226{
227 vrc4173_socket_t *socket = &cardu_sockets[sock];
228 uint8_t val;
229
230 val = exca_readb(socket, PWR_CNT);
231 state->Vcc = get_Vcc_value(val);
232 state->Vpp = get_Vpp_value(val);
233 state->flags = 0;
234 if (val & CARD_OUT_EN) state->flags |= SS_OUTPUT_ENA;
235
236 val = exca_readb(socket, INT_GEN_CNT);
237 if (!(val & CARD_REST0)) state->flags |= SS_RESET;
238 if (val & CARD_TYPE_IO) state->flags |= SS_IOCARD;
239
240 return 0;
241}
242
243static inline uint8_t set_Vcc_value(u_char Vcc) 201static inline uint8_t set_Vcc_value(u_char Vcc)
244{ 202{
245 switch (Vcc) { 203 switch (Vcc) {
@@ -431,7 +389,6 @@ static struct pccard_operations cardu_operations = {
431 .register_callback = cardu_register_callback, 389 .register_callback = cardu_register_callback,
432 .inquire_socket = cardu_inquire_socket, 390 .inquire_socket = cardu_inquire_socket,
433 .get_status = cardu_get_status, 391 .get_status = cardu_get_status,
434 .get_socket = cardu_get_socket,
435 .set_socket = cardu_set_socket, 392 .set_socket = cardu_set_socket,
436 .get_io_map = cardu_get_io_map, 393 .get_io_map = cardu_get_io_map,
437 .set_io_map = cardu_set_io_map, 394 .set_io_map = cardu_set_io_map,
diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c
index 8bfe72b71302..fa0625c438dc 100644
--- a/drivers/pcmcia/yenta_socket.c
+++ b/drivers/pcmcia/yenta_socket.c
@@ -224,95 +224,6 @@ static int yenta_get_status(struct pcmcia_socket *sock, unsigned int *value)
224 return 0; 224 return 0;
225} 225}
226 226
227static void yenta_get_power(struct yenta_socket *socket, socket_state_t *state)
228{
229 if (!(cb_readl(socket, CB_SOCKET_STATE) & CB_CBCARD) &&
230 (socket->flags & YENTA_16BIT_POWER_EXCA)) {
231 u8 reg, vcc, vpp;
232
233 reg = exca_readb(socket, I365_POWER);
234 vcc = reg & I365_VCC_MASK;
235 vpp = reg & I365_VPP1_MASK;
236 state->Vcc = state->Vpp = 0;
237
238 if (socket->flags & YENTA_16BIT_POWER_DF) {
239 if (vcc == I365_VCC_3V)
240 state->Vcc = 33;
241 if (vcc == I365_VCC_5V)
242 state->Vcc = 50;
243 if (vpp == I365_VPP1_5V)
244 state->Vpp = state->Vcc;
245 if (vpp == I365_VPP1_12V)
246 state->Vpp = 120;
247 } else {
248 if (reg & I365_VCC_5V) {
249 state->Vcc = 50;
250 if (vpp == I365_VPP1_5V)
251 state->Vpp = 50;
252 if (vpp == I365_VPP1_12V)
253 state->Vpp = 120;
254 }
255 }
256 } else {
257 u32 control;
258
259 control = cb_readl(socket, CB_SOCKET_CONTROL);
260
261 switch (control & CB_SC_VCC_MASK) {
262 case CB_SC_VCC_5V: state->Vcc = 50; break;
263 case CB_SC_VCC_3V: state->Vcc = 33; break;
264 default: state->Vcc = 0;
265 }
266
267 switch (control & CB_SC_VPP_MASK) {
268 case CB_SC_VPP_12V: state->Vpp = 120; break;
269 case CB_SC_VPP_5V: state->Vpp = 50; break;
270 case CB_SC_VPP_3V: state->Vpp = 33; break;
271 default: state->Vpp = 0;
272 }
273 }
274}
275
276static int yenta_get_socket(struct pcmcia_socket *sock, socket_state_t *state)
277{
278 struct yenta_socket *socket = container_of(sock, struct yenta_socket, socket);
279 u8 reg;
280 u32 control;
281
282 control = cb_readl(socket, CB_SOCKET_CONTROL);
283
284 yenta_get_power(socket, state);
285 state->io_irq = socket->io_irq;
286
287 if (cb_readl(socket, CB_SOCKET_STATE) & CB_CBCARD) {
288 u16 bridge = config_readw(socket, CB_BRIDGE_CONTROL);
289 if (bridge & CB_BRIDGE_CRST)
290 state->flags |= SS_RESET;
291 return 0;
292 }
293
294 /* 16-bit card state.. */
295 reg = exca_readb(socket, I365_POWER);
296 state->flags = (reg & I365_PWR_AUTO) ? SS_PWR_AUTO : 0;
297 state->flags |= (reg & I365_PWR_OUT) ? SS_OUTPUT_ENA : 0;
298
299 reg = exca_readb(socket, I365_INTCTL);
300 state->flags |= (reg & I365_PC_RESET) ? 0 : SS_RESET;
301 state->flags |= (reg & I365_PC_IOCARD) ? SS_IOCARD : 0;
302
303 reg = exca_readb(socket, I365_CSCINT);
304 state->csc_mask = (reg & I365_CSC_DETECT) ? SS_DETECT : 0;
305 if (state->flags & SS_IOCARD) {
306 state->csc_mask |= (reg & I365_CSC_STSCHG) ? SS_STSCHG : 0;
307 } else {
308 state->csc_mask |= (reg & I365_CSC_BVD1) ? SS_BATDEAD : 0;
309 state->csc_mask |= (reg & I365_CSC_BVD2) ? SS_BATWARN : 0;
310 state->csc_mask |= (reg & I365_CSC_READY) ? SS_READY : 0;
311 }
312
313 return 0;
314}
315
316static void yenta_set_power(struct yenta_socket *socket, socket_state_t *state) 227static void yenta_set_power(struct yenta_socket *socket, socket_state_t *state)
317{ 228{
318 /* some birdges require to use the ExCA registers to power 16bit cards */ 229 /* some birdges require to use the ExCA registers to power 16bit cards */
@@ -828,7 +739,6 @@ static struct pccard_operations yenta_socket_operations = {
828 .init = yenta_sock_init, 739 .init = yenta_sock_init,
829 .suspend = yenta_sock_suspend, 740 .suspend = yenta_sock_suspend,
830 .get_status = yenta_get_status, 741 .get_status = yenta_get_status,
831 .get_socket = yenta_get_socket,
832 .set_socket = yenta_set_socket, 742 .set_socket = yenta_set_socket,
833 .set_io_map = yenta_set_io_map, 743 .set_io_map = yenta_set_io_map,
834 .set_mem_map = yenta_set_mem_map, 744 .set_mem_map = yenta_set_mem_map,