Lines Matching refs:sock
219 static u_char i365_get(u_short sock, u_short reg)
224 unsigned int port = socket[sock].ioaddr;
226 reg = I365_REG(socket[sock].psock, reg);
233 static void i365_set(u_short sock, u_short reg, u_char data)
238 unsigned int port = socket[sock].ioaddr;
239 u_char val = I365_REG(socket[sock].psock, reg);
245 static void i365_bset(u_short sock, u_short reg, u_char mask)
247 u_char d = i365_get(sock, reg);
249 i365_set(sock, reg, d);
252 static void i365_bclr(u_short sock, u_short reg, u_char mask)
254 u_char d = i365_get(sock, reg);
256 i365_set(sock, reg, d);
259 static void i365_bflip(u_short sock, u_short reg, u_char mask, int b)
261 u_char d = i365_get(sock, reg);
266 i365_set(sock, reg, d);
269 static u_short i365_get_pair(u_short sock, u_short reg)
272 a = i365_get(sock, reg);
273 b = i365_get(sock, reg+1);
277 static void i365_set_pair(u_short sock, u_short reg, u_short data)
279 i365_set(sock, reg, data & 0xff);
280 i365_set(sock, reg+1, data >> 8);
491 static u_int __init test_irq(u_short sock, int irq)
497 irq_hits = 0; irq_sock = sock;
506 i365_set(sock, I365_CSCINT, I365_CSC_DETECT | (irq << 4));
507 i365_bset(sock, I365_GENCTL, I365_CTL_SW_IRQ);
513 i365_set(sock, I365_CSCINT, 0);
519 static u_int __init isa_scan(u_short sock, u_int mask0)
531 set_bridge_state(sock);
532 i365_set(sock, I365_CSCINT, 0);
534 if ((mask0 & (1 << i)) && (test_irq(sock, i) == 0))
537 if ((mask1 & (1 << i)) && (test_irq(sock, i) != 0))
574 static int __init identify(unsigned int port, u_short sock)
581 socket[sockets].psock = sock;
642 static int __init is_alive(u_short sock)
647 stat = i365_get(sock, I365_STATUS);
648 start = i365_get_pair(sock, I365_IO(0)+I365_W_START);
649 stop = i365_get_pair(sock, I365_IO(0)+I365_W_STOP);
651 (i365_get(sock, I365_INTCTL) & I365_PC_IOCARD) &&
652 (i365_get(sock, I365_ADDRWIN) & I365_ENA_IO(0)) &&
757 int i, j, sock, k, ns, id;
798 sock = (i & 1) << 1;
799 if (identify(port, sock) == IS_I82365DF) {
800 add_socket(port, sock, IS_VLSI);
809 sock = (i & 3);
810 id = identify(port, sock);
815 if ((ignore == i+j) || (identify(port, sock+j) < 0))
824 add_socket(port, sock+j, id); ns++;
889 static int i365_get_status(u_short sock, u_int *value)
893 status = i365_get(sock, I365_STATUS);
897 if (i365_get(sock, I365_INTCTL) & I365_PC_IOCARD)
907 if (socket[sock].type == IS_VG469) {
908 status = i365_get(sock, VG469_VSENSE);
909 if (socket[sock].psock & 1) {
918 pr_debug("GetStatus(%d) = %#4.4x\n", sock, *value);
924 static int i365_set_socket(u_short sock, socket_state_t *state)
926 struct i82365_socket *t = &socket[sock];
930 "io_irq %d, csc_mask %#2.2x)\n", sock, state->flags,
934 set_bridge_state(sock);
941 i365_set(sock, I365_INTCTL, reg);
958 i365_bset(sock, PD67_MISC_CTL_1, PD67_MC1_VCC_3V);
960 i365_bclr(sock, PD67_MISC_CTL_1, PD67_MC1_VCC_3V);
974 i365_bset(sock, VG469_VSELECT, VG469_VSEL_VCC);
976 i365_bclr(sock, VG469_VSELECT, VG469_VSEL_VCC);
1006 if (reg != i365_get(sock, I365_POWER))
1007 i365_set(sock, I365_POWER, reg);
1012 i365_bflip(sock, PD67_MISC_CTL_1, PD67_MC1_SPKR_ENA,
1026 i365_set(sock, I365_CSCINT, reg);
1027 i365_get(sock, I365_CSC);
1034 static int i365_set_io_map(u_short sock, struct pccard_io_map *io)
1039 "%#llx-%#llx)\n", sock, io->map, io->flags, io->speed,
1045 if (i365_get(sock, I365_ADDRWIN) & I365_ENA_IO(map))
1046 i365_bclr(sock, I365_ADDRWIN, I365_ENA_IO(map));
1047 i365_set_pair(sock, I365_IO(map)+I365_W_START, io->start);
1048 i365_set_pair(sock, I365_IO(map)+I365_W_STOP, io->stop);
1049 ioctl = i365_get(sock, I365_IOCTL) & ~I365_IOCTL_MASK(map);
1054 i365_set(sock, I365_IOCTL, ioctl);
1057 i365_bset(sock, I365_ADDRWIN, I365_ENA_IO(map));
1063 static int i365_set_mem_map(u_short sock, struct pccard_mem_map *mem)
1069 "%#x)\n", sock, mem->map, mem->flags, mem->speed,
1081 if (i365_get(sock, I365_ADDRWIN) & I365_ENA_MEM(map))
1082 i365_bclr(sock, I365_ADDRWIN, I365_ENA_MEM(map));
1088 i365_set_pair(sock, base+I365_W_START, i);
1097 i365_set_pair(sock, base+I365_W_STOP, i);
1102 i365_set_pair(sock, base+I365_W_OFF, i);
1106 i365_bset(sock, I365_ADDRWIN, I365_ENA_MEM(map));
1127 unsigned int sock = container_of(s, struct i82365_socket, socket)->number;
1129 if (socket[sock].flags & IS_ALIVE) {
1134 LOCKED(i365_get_status(sock, value));
1139 unsigned int sock = container_of(s, struct i82365_socket, socket)->number;
1141 if (socket[sock].flags & IS_ALIVE)
1144 LOCKED(i365_set_socket(sock, state));
1149 unsigned int sock = container_of(s, struct i82365_socket, socket)->number;
1150 if (socket[sock].flags & IS_ALIVE)
1153 LOCKED(i365_set_io_map(sock, io));
1158 unsigned int sock = container_of(s, struct i82365_socket, socket)->number;
1159 if (socket[sock].flags & IS_ALIVE)
1162 LOCKED(i365_set_mem_map(sock, mem));