Lines Matching +full:4 +full:- +full:pole

3     Device driver for Databook TCIC-2 PCMCIA controller
55 MODULE_DESCRIPTION("Databook TCIC-2 PCMCIA socket driver");
62 /* The base port address of the TCIC-2 chip */
66 static int ignore = -1;
76 /* The card status change interrupt -- 0 means autoselect */
79 /* Poll status interval -- 0 means default to interrupt */
82 /* Delay for card status double-checking */
195 return 2*(ns-14)/cycle_time; in to_cycles()
214 return -1; in try_irq()
218 return -1; in try_irq()
246 /* Don't probe level-triggered interrupts -- reserved for PCI */ in irq_scan()
279 printk("%s%d", ((mask1 & ((1<<i)-1)) ? "," : ""), i); in irq_scan()
288 bound to a (non-PCMCIA) Linux driver.
314 num = (base ^ (base-1)); in is_active()
315 base = base & (base-1); in is_active()
321 struct resource *res = request_region(base, num, "tcic-2"); in is_active()
351 .name = "tcic-pcmcia",
356 .name = "tcic-pcmcia",
367 return -1; in init_tcic()
369 printk(KERN_INFO "Databook TCIC-2 PCMCIA probe: "); in init_tcic()
372 if (!request_region(tcic_base, 16, "tcic-2")) { in init_tcic()
375 return -ENODEV; in init_tcic()
398 return -ENODEV; in init_tcic()
408 /* only 16-bit cards, memory windows must be size-aligned */ in init_tcic()
411 /* irq 14, 11, 10, 7, 6, 5, 4, 3 */ in init_tcic()
413 /* 4K minimum window size */ in init_tcic()
449 /* irq 14, 11, 10, 7, 6, 5, 4, 3 */ in init_tcic()
457 scan = (mask & (mask-1)); in init_tcic()
458 if (((scan & (scan-1)) == 0) && (poll_interval == 0)) in init_tcic()
464 for (i = 15; i > 0; i--) in init_tcic()
595 u_short psock = container_of(sock, struct tcic_socket, socket)->psock; in tcic_get_status()
613 dev_dbg(&sock->dev, "GetStatus(%d) = %#2.2x\n", psock, *value); in tcic_get_status()
621 u_short psock = container_of(sock, struct tcic_socket, socket)->psock; in tcic_set_socket()
625 dev_dbg(&sock->dev, "SetSocket(%d, flags %#3.3x, Vcc %d, Vpp %d, " in tcic_set_socket()
626 "io_irq %d, csc_mask %#2.2x)\n", psock, state->flags, in tcic_set_socket()
627 state->Vcc, state->Vpp, state->io_irq, state->csc_mask); in tcic_set_socket()
633 if (state->Vcc == 50) { in tcic_set_socket()
634 switch (state->Vpp) { in tcic_set_socket()
638 default: return -EINVAL; in tcic_set_socket()
640 } else if (state->Vcc != 0) in tcic_set_socket()
641 return -EINVAL; in tcic_set_socket()
647 if (state->flags & SS_OUTPUT_ENA) { in tcic_set_socket()
652 if (state->flags & SS_RESET) in tcic_set_socket()
658 scf1 |= TCIC_IRQ(state->io_irq); in tcic_set_socket()
659 if (state->flags & SS_IOCARD) { in tcic_set_socket()
661 if (state->flags & SS_SPKR_ENA) in tcic_set_socket()
663 if (state->flags & SS_DMA_MODE) in tcic_set_socket()
677 if (state->csc_mask & SS_DETECT) scf2 &= ~TCIC_SCF2_MCD; in tcic_set_socket()
678 if (state->flags & SS_IOCARD) { in tcic_set_socket()
679 if (state->csc_mask & SS_STSCHG) reg &= ~TCIC_SCF2_MLBAT1; in tcic_set_socket()
681 if (state->csc_mask & SS_BATDEAD) reg &= ~TCIC_SCF2_MLBAT1; in tcic_set_socket()
682 if (state->csc_mask & SS_BATWARN) reg &= ~TCIC_SCF2_MLBAT2; in tcic_set_socket()
683 if (state->csc_mask & SS_READY) reg &= ~TCIC_SCF2_MRDY; in tcic_set_socket()
686 /* For the ISA bus, the irq should be active-high totem-pole */ in tcic_set_socket()
696 u_short psock = container_of(sock, struct tcic_socket, socket)->psock; in tcic_set_io_map()
700 dev_dbg(&sock->dev, "SetIOMap(%d, %d, %#2.2x, %d ns, " in tcic_set_io_map()
701 "%#llx-%#llx)\n", psock, io->map, io->flags, io->speed, in tcic_set_io_map()
702 (unsigned long long)io->start, (unsigned long long)io->stop); in tcic_set_io_map()
703 if ((io->map > 1) || (io->start > 0xffff) || (io->stop > 0xffff) || in tcic_set_io_map()
704 (io->stop < io->start)) return -EINVAL; in tcic_set_io_map()
706 addr = TCIC_IWIN(psock, io->map); in tcic_set_io_map()
708 base = io->start; len = io->stop - io->start; in tcic_set_io_map()
710 if ((len & (len+1)) || (base & len)) return -EINVAL; in tcic_set_io_map()
717 ioctl |= (io->flags & MAP_ACTIVE) ? TCIC_ICTL_ENA : 0; in tcic_set_io_map()
718 ioctl |= to_cycles(io->speed) & TCIC_ICTL_WSCNT_MASK; in tcic_set_io_map()
719 if (!(io->flags & MAP_AUTOSZ)) { in tcic_set_io_map()
721 ioctl |= (io->flags & MAP_16BIT) ? TCIC_ICTL_BW_16 : TCIC_ICTL_BW_8; in tcic_set_io_map()
733 u_short psock = container_of(sock, struct tcic_socket, socket)->psock; in tcic_set_mem_map()
737 dev_dbg(&sock->dev, "SetMemMap(%d, %d, %#2.2x, %d ns, " in tcic_set_mem_map()
738 "%#llx-%#llx, %#x)\n", psock, mem->map, mem->flags, in tcic_set_mem_map()
739 mem->speed, (unsigned long long)mem->res->start, in tcic_set_mem_map()
740 (unsigned long long)mem->res->end, mem->card_start); in tcic_set_mem_map()
741 if ((mem->map > 3) || (mem->card_start > 0x3ffffff) || in tcic_set_mem_map()
742 (mem->res->start > 0xffffff) || (mem->res->end > 0xffffff) || in tcic_set_mem_map()
743 (mem->res->start > mem->res->end) || (mem->speed > 1000)) in tcic_set_mem_map()
744 return -EINVAL; in tcic_set_mem_map()
746 addr = TCIC_MWIN(psock, mem->map); in tcic_set_mem_map()
748 base = mem->res->start; len = mem->res->end - mem->res->start; in tcic_set_mem_map()
749 if ((len & (len+1)) || (base & len)) return -EINVAL; in tcic_set_mem_map()
757 mmap = mem->card_start - mem->res->start; in tcic_set_mem_map()
759 if (mem->flags & MAP_ATTRIB) mmap |= TCIC_MMAP_REG; in tcic_set_mem_map()
764 ctl |= to_cycles(mem->speed) & TCIC_MCTL_WSCNT_MASK; in tcic_set_mem_map()
765 ctl |= (mem->flags & MAP_16BIT) ? 0 : TCIC_MCTL_B8; in tcic_set_mem_map()
766 ctl |= (mem->flags & MAP_WRPROT) ? TCIC_MCTL_WP : 0; in tcic_set_mem_map()
767 ctl |= (mem->flags & MAP_ACTIVE) ? TCIC_MCTL_ENA : 0; in tcic_set_mem_map()