Lines Matching full:ap

30  * Note that all runtime hot priv ports are cached in ap private_data
69 #define ATP867X_IOBASE(ap) ((ap)->host->iomap[0]) argument
70 #define ATP867X_SYS_INFO(ap) (0x3F + ATP867X_IOBASE(ap)) argument
72 #define ATP867X_IO_PORTBASE(ap, port) (0x00 + ATP867X_IOBASE(ap) + \ argument
74 #define ATP867X_IO_DMABASE(ap, port) (0x40 + \ argument
75 ATP867X_IO_PORTBASE((ap), (port)))
77 #define ATP867X_IO_STATUS(ap, port) (0x07 + \ argument
78 ATP867X_IO_PORTBASE((ap), (port)))
79 #define ATP867X_IO_ALTSTATUS(ap, port) (0x0E + \ argument
80 ATP867X_IO_PORTBASE((ap), (port)))
85 #define ATP867X_IO_MSTRPIOSPD(ap, port) (0x08 + \ argument
86 ATP867X_IO_DMABASE((ap), (port)))
87 #define ATP867X_IO_SLAVPIOSPD(ap, port) (0x09 + \ argument
88 ATP867X_IO_DMABASE((ap), (port)))
89 #define ATP867X_IO_8BPIOSPD(ap, port) (0x0A + \ argument
90 ATP867X_IO_DMABASE((ap), (port)))
91 #define ATP867X_IO_DMAMODE(ap, port) (0x0B + \ argument
92 ATP867X_IO_DMABASE((ap), (port)))
94 #define ATP867X_IO_PORTSPD(ap, port) (0x4A + \ argument
95 ATP867X_IO_PORTBASE((ap), (port)))
96 #define ATP867X_IO_PREREAD(ap, port) (0x4C + \ argument
97 ATP867X_IO_PORTBASE((ap), (port)))
107 static void atp867x_set_dmamode(struct ata_port *ap, struct ata_device *adev) in atp867x_set_dmamode() argument
109 struct pci_dev *pdev = to_pci_dev(ap->host->dev); in atp867x_set_dmamode()
110 struct atp867x_priv *dp = ap->private_data; in atp867x_set_dmamode()
138 static int atp867x_get_active_clocks_shifted(struct ata_port *ap, in atp867x_get_active_clocks_shifted() argument
141 struct atp867x_priv *dp = ap->private_data; in atp867x_get_active_clocks_shifted()
202 static void atp867x_set_piomode(struct ata_port *ap, struct ata_device *adev) in atp867x_set_piomode() argument
205 struct atp867x_priv *dp = ap->private_data; in atp867x_set_piomode()
227 b = atp867x_get_active_clocks_shifted(ap, t.active) | in atp867x_set_piomode()
235 b = atp867x_get_active_clocks_shifted(ap, t.act8b) | in atp867x_set_piomode()
251 static int atp867x_cable_detect(struct ata_port *ap) in atp867x_cable_detect() argument
253 struct pci_dev *pdev = to_pci_dev(ap->host->dev); in atp867x_cable_detect()
288 static void atp867x_check_ports(struct ata_port *ap, int port) in atp867x_check_ports() argument
290 struct ata_ioports *ioaddr = &ap->ioaddr; in atp867x_check_ports()
291 struct atp867x_priv *dp = ap->private_data; in atp867x_check_ports()
314 (unsigned long long)ATP867X_IO_PORTBASE(ap, port), in atp867x_check_ports()
316 (unsigned long long)ATP867X_IO_ALTSTATUS(ap, port), in atp867x_check_ports()
318 (unsigned long long)ATP867X_IO_DMABASE(ap, port), in atp867x_check_ports()
337 static int atp867x_set_priv(struct ata_port *ap) in atp867x_set_priv() argument
339 struct pci_dev *pdev = to_pci_dev(ap->host->dev); in atp867x_set_priv()
341 int port = ap->port_no; in atp867x_set_priv()
343 dp = ap->private_data = in atp867x_set_priv()
348 dp->dma_mode = ATP867X_IO_DMAMODE(ap, port); in atp867x_set_priv()
349 dp->mstr_piospd = ATP867X_IO_MSTRPIOSPD(ap, port); in atp867x_set_priv()
350 dp->slave_piospd = ATP867X_IO_SLAVPIOSPD(ap, port); in atp867x_set_priv()
351 dp->eightb_piospd = ATP867X_IO_8BPIOSPD(ap, port); in atp867x_set_priv()
354 ioread8(ATP867X_SYS_INFO(ap)) & ATP867X_IO_SYS_INFO_66MHZ; in atp867x_set_priv()
362 struct ata_port *ap = host->ports[0]; in atp867x_fixup() local
382 iowrite16(ATP867X_IO_PORTSPD_VAL, ATP867X_IO_PORTSPD(ap, i)); in atp867x_fixup()
388 iowrite16(ATP867X_PREREAD_VAL, ATP867X_IO_PREREAD(ap, i)); in atp867x_fixup()
390 v = ioread8(ATP867X_IOBASE(ap) + 0x28); in atp867x_fixup()
393 iowrite8(v, ATP867X_IOBASE(ap) + 0x28); in atp867x_fixup()
398 v = ioread8(ATP867X_SYS_INFO(ap)); in atp867x_fixup()
402 iowrite8(v, ATP867X_SYS_INFO(ap)); in atp867x_fixup()
434 struct ata_port *ap = host->ports[i]; in atp867x_ata_pci_sff_init_host() local
435 struct ata_ioports *ioaddr = &ap->ioaddr; in atp867x_ata_pci_sff_init_host()
437 ioaddr->cmd_addr = ATP867X_IO_PORTBASE(ap, i); in atp867x_ata_pci_sff_init_host()
439 = ATP867X_IO_ALTSTATUS(ap, i); in atp867x_ata_pci_sff_init_host()
440 ioaddr->bmdma_addr = ATP867X_IO_DMABASE(ap, i); in atp867x_ata_pci_sff_init_host()
443 rc = atp867x_set_priv(ap); in atp867x_ata_pci_sff_init_host()
448 atp867x_check_ports(ap, i); in atp867x_ata_pci_sff_init_host()
450 ata_port_desc(ap, "cmd 0x%lx ctl 0x%lx", in atp867x_ata_pci_sff_init_host()
453 ata_port_desc(ap, "bmdma 0x%lx", in atp867x_ata_pci_sff_init_host()