Lines Matching refs:socket

61 static unsigned char indirect_read(struct pd6729_socket *socket,  in indirect_read()  argument
69 reg += socket->number * 0x40; in indirect_read()
70 port = socket->io_base; in indirect_read()
78 static unsigned short indirect_read16(struct pd6729_socket *socket, in indirect_read16() argument
86 reg = reg + socket->number * 0x40; in indirect_read16()
87 port = socket->io_base; in indirect_read16()
98 static void indirect_write(struct pd6729_socket *socket, unsigned short reg, in indirect_write() argument
105 reg = reg + socket->number * 0x40; in indirect_write()
106 port = socket->io_base; in indirect_write()
112 static void indirect_setbit(struct pd6729_socket *socket, unsigned short reg, in indirect_setbit() argument
120 reg = reg + socket->number * 0x40; in indirect_setbit()
121 port = socket->io_base; in indirect_setbit()
130 static void indirect_resetbit(struct pd6729_socket *socket, unsigned short reg, in indirect_resetbit() argument
138 reg = reg + socket->number * 0x40; in indirect_resetbit()
139 port = socket->io_base; in indirect_resetbit()
148 static void indirect_write16(struct pd6729_socket *socket, unsigned short reg, in indirect_write16() argument
156 reg = reg + socket->number * 0x40; in indirect_write16()
157 port = socket->io_base; in indirect_write16()
175 struct pd6729_socket *socket = (struct pd6729_socket *)dev; in pd6729_interrupt() local
195 csc = indirect_read(&socket[i], I365_CSC); in pd6729_interrupt()
204 dev_vdbg(&socket[i].socket.dev, in pd6729_interrupt()
208 if (indirect_read(&socket[i], I365_INTCTL) in pd6729_interrupt()
224 pcmcia_parse_events(&socket[i].socket, events); in pd6729_interrupt()
239 struct pd6729_socket *socket = from_timer(socket, t, poll_timer); in pd6729_interrupt_wrapper() local
241 pd6729_interrupt(0, (void *)socket); in pd6729_interrupt_wrapper()
242 mod_timer(&socket->poll_timer, jiffies + HZ); in pd6729_interrupt_wrapper()
247 struct pd6729_socket *socket in pd6729_get_status() local
248 = container_of(sock, struct pd6729_socket, socket); in pd6729_get_status()
254 status = indirect_read(socket, I365_STATUS); in pd6729_get_status()
264 if (indirect_read(socket, I365_INTCTL) & I365_PC_IOCARD) { in pd6729_get_status()
285 t = (socket->number) ? socket : socket + 1; in pd6729_get_status()
288 *value |= (data & PD67_EXD_VS1(socket->number)) ? 0 : SS_3VCARD; in pd6729_get_status()
296 struct pd6729_socket *socket in pd6729_set_socket() local
297 = container_of(sock, struct pd6729_socket, socket); in pd6729_set_socket()
301 indirect_write(socket, I365_GBLCTL, 0x00); in pd6729_set_socket()
302 indirect_write(socket, I365_GENCTL, 0x00); in pd6729_set_socket()
305 socket->card_irq = state->io_irq; in pd6729_set_socket()
315 indirect_write(socket, I365_INTCTL, reg); in pd6729_set_socket()
336 socket->number); in pd6729_set_socket()
338 indirect_setbit(socket, PD67_MISC_CTL_1, PD67_MC1_VCC_3V); in pd6729_set_socket()
343 socket->number); in pd6729_set_socket()
345 indirect_resetbit(socket, PD67_MISC_CTL_1, PD67_MC1_VCC_3V); in pd6729_set_socket()
357 socket->number); in pd6729_set_socket()
362 socket->number); in pd6729_set_socket()
376 if (reg != indirect_read(socket, I365_POWER)) in pd6729_set_socket()
377 indirect_write(socket, I365_POWER, reg); in pd6729_set_socket()
385 indirect_write(socket, PD67_EXT_INDEX, PD67_EXT_CTL_1); in pd6729_set_socket()
386 indirect_write(socket, PD67_EXT_DATA, data); in pd6729_set_socket()
407 indirect_write(socket, I365_CSCINT, reg); in pd6729_set_socket()
409 reg = indirect_read(socket, I365_INTCTL); in pd6729_set_socket()
413 reg |= socket->card_irq; in pd6729_set_socket()
414 indirect_write(socket, I365_INTCTL, reg); in pd6729_set_socket()
417 (void)indirect_read(socket, I365_CSC); in pd6729_set_socket()
425 struct pd6729_socket *socket in pd6729_set_io_map() local
426 = container_of(sock, struct pd6729_socket, socket); in pd6729_set_io_map()
438 if (indirect_read(socket, I365_ADDRWIN) & I365_ENA_IO(map)) in pd6729_set_io_map()
439 indirect_resetbit(socket, I365_ADDRWIN, I365_ENA_IO(map)); in pd6729_set_io_map()
445 indirect_write16(socket, I365_IO(map)+I365_W_START, io->start); in pd6729_set_io_map()
446 indirect_write16(socket, I365_IO(map)+I365_W_STOP, io->stop); in pd6729_set_io_map()
448 ioctl = indirect_read(socket, I365_IOCTL) & ~I365_IOCTL_MASK(map); in pd6729_set_io_map()
457 indirect_write(socket, I365_IOCTL, ioctl); in pd6729_set_io_map()
461 indirect_setbit(socket, I365_ADDRWIN, I365_ENA_IO(map)); in pd6729_set_io_map()
469 struct pd6729_socket *socket in pd6729_set_mem_map() local
470 = container_of(sock, struct pd6729_socket, socket); in pd6729_set_mem_map()
486 if (indirect_read(socket, I365_ADDRWIN) & I365_ENA_MEM(map)) in pd6729_set_mem_map()
487 indirect_resetbit(socket, I365_ADDRWIN, I365_ENA_MEM(map)); in pd6729_set_mem_map()
496 indirect_write16(socket, base + I365_W_START, i); in pd6729_set_mem_map()
515 indirect_write16(socket, base + I365_W_STOP, i); in pd6729_set_mem_map()
518 indirect_write(socket, PD67_EXT_INDEX, PD67_MEM_PAGE(map)); in pd6729_set_mem_map()
519 indirect_write(socket, PD67_EXT_DATA, mem->res->start >> 24); in pd6729_set_mem_map()
534 indirect_write16(socket, base + I365_W_OFF, i); in pd6729_set_mem_map()
538 indirect_setbit(socket, I365_ADDRWIN, I365_ENA_MEM(map)); in pd6729_set_mem_map()
629 struct pd6729_socket *socket; in pd6729_pci_probe() local
631 socket = kcalloc(MAX_SOCKETS, sizeof(struct pd6729_socket), in pd6729_pci_probe()
633 if (!socket) { in pd6729_pci_probe()
682 socket[i].io_base = pci_resource_start(dev, 0); in pd6729_pci_probe()
683 socket[i].socket.features |= SS_CAP_PAGE_REGS | SS_CAP_PCCARD; in pd6729_pci_probe()
684 socket[i].socket.map_size = 0x1000; in pd6729_pci_probe()
685 socket[i].socket.irq_mask = mask; in pd6729_pci_probe()
686 socket[i].socket.pci_irq = dev->irq; in pd6729_pci_probe()
687 socket[i].socket.cb_dev = dev; in pd6729_pci_probe()
688 socket[i].socket.owner = THIS_MODULE; in pd6729_pci_probe()
690 socket[i].number = i; in pd6729_pci_probe()
692 socket[i].socket.ops = &pd6729_operations; in pd6729_pci_probe()
693 socket[i].socket.resource_ops = &pccard_nonstatic_ops; in pd6729_pci_probe()
694 socket[i].socket.dev.parent = &dev->dev; in pd6729_pci_probe()
695 socket[i].socket.driver_data = &socket[i]; in pd6729_pci_probe()
698 pci_set_drvdata(dev, socket); in pd6729_pci_probe()
702 "pd6729", socket); in pd6729_pci_probe()
710 timer_setup(&socket->poll_timer, pd6729_interrupt_wrapper, 0); in pd6729_pci_probe()
711 mod_timer(&socket->poll_timer, jiffies + HZ); in pd6729_pci_probe()
715 ret = pcmcia_register_socket(&socket[i].socket); in pd6729_pci_probe()
719 pcmcia_unregister_socket(&socket[j].socket); in pd6729_pci_probe()
728 free_irq(dev->irq, socket); in pd6729_pci_probe()
730 del_timer_sync(&socket->poll_timer); in pd6729_pci_probe()
737 kfree(socket); in pd6729_pci_probe()
744 struct pd6729_socket *socket = pci_get_drvdata(dev); in pd6729_pci_remove() local
748 indirect_write(&socket[i], I365_CSCINT, 0); in pd6729_pci_remove()
749 indirect_write(&socket[i], I365_INTCTL, 0); in pd6729_pci_remove()
751 pcmcia_unregister_socket(&socket[i].socket); in pd6729_pci_remove()
755 free_irq(dev->irq, socket); in pd6729_pci_remove()
757 del_timer_sync(&socket->poll_timer); in pd6729_pci_remove()
761 kfree(socket); in pd6729_pci_remove()