Lines Matching refs:ap
44 struct ata_port *ap; member
66 static void ata_acpi_detach_device(struct ata_port *ap, struct ata_device *dev) in ata_acpi_detach_device() argument
74 ata_for_each_link(tlink, ap, EDGE) in ata_acpi_detach_device()
79 ata_port_schedule_eh(ap); in ata_acpi_detach_device()
99 static void ata_acpi_handle_hotplug(struct ata_port *ap, struct ata_device *dev, in ata_acpi_handle_hotplug() argument
102 struct ata_eh_info *ehi = &ap->link.eh_info; in ata_acpi_handle_hotplug()
106 spin_lock_irqsave(ap->lock, flags); in ata_acpi_handle_hotplug()
118 ata_port_freeze(ap); in ata_acpi_handle_hotplug()
123 ata_acpi_detach_device(ap, dev); in ata_acpi_handle_hotplug()
128 spin_unlock_irqrestore(ap->lock, flags); in ata_acpi_handle_hotplug()
131 ata_port_wait_eh(ap); in ata_acpi_handle_hotplug()
137 ata_acpi_handle_hotplug(dev->link->ap, dev, event); in ata_acpi_dev_notify_dock()
143 ata_acpi_handle_hotplug(ata_hotplug_data(adev->hp).ap, NULL, event); in ata_acpi_ap_notify_dock()
147 static void ata_acpi_uevent(struct ata_port *ap, struct ata_device *dev, in ata_acpi_uevent() argument
158 kobj = &ap->dev->kobj; in ata_acpi_uevent()
168 ata_acpi_uevent(ata_hotplug_data(adev->hp).ap, NULL, event); in ata_acpi_ap_uevent()
174 ata_acpi_uevent(dev->link->ap, dev, event); in ata_acpi_dev_uevent()
178 void ata_acpi_bind_port(struct ata_port *ap) in ata_acpi_bind_port() argument
180 struct acpi_device *host_companion = ACPI_COMPANION(ap->host->dev); in ata_acpi_bind_port()
184 if (libata_noacpi || ap->flags & ATA_FLAG_ACPI_SATA || !host_companion) in ata_acpi_bind_port()
187 acpi_preset_companion(&ap->tdev, host_companion, ap->port_no); in ata_acpi_bind_port()
189 if (ata_acpi_gtm(ap, &ap->__acpi_init_gtm) == 0) in ata_acpi_bind_port()
190 ap->pflags |= ATA_PFLAG_INIT_GTM_VALID; in ata_acpi_bind_port()
192 adev = ACPI_COMPANION(&ap->tdev); in ata_acpi_bind_port()
200 context->data.ap = ap; in ata_acpi_bind_port()
207 struct ata_port *ap = dev->link->ap; in ata_acpi_bind_dev() local
208 struct acpi_device *port_companion = ACPI_COMPANION(&ap->tdev); in ata_acpi_bind_dev()
209 struct acpi_device *host_companion = ACPI_COMPANION(ap->host->dev); in ata_acpi_bind_dev()
219 (!(ap->flags & ATA_FLAG_ACPI_SATA) && !port_companion)) in ata_acpi_bind_dev()
222 if (ap->flags & ATA_FLAG_ACPI_SATA) { in ata_acpi_bind_dev()
223 if (!sata_pmp_attached(ap)) in ata_acpi_bind_dev()
224 adr = SATA_ADR(ap->port_no, NO_PORT_MULT); in ata_acpi_bind_dev()
226 adr = SATA_ADR(ap->port_no, dev->link->pmp); in ata_acpi_bind_dev()
265 struct ata_port *ap = host->ports[i]; in ata_acpi_dissociate() local
266 const struct ata_acpi_gtm *gtm = ata_acpi_init_gtm(ap); in ata_acpi_dissociate()
268 if (ACPI_HANDLE(&ap->tdev) && gtm) in ata_acpi_dissociate()
269 ata_acpi_stm(ap, gtm); in ata_acpi_dissociate()
286 int ata_acpi_gtm(struct ata_port *ap, struct ata_acpi_gtm *gtm) in ata_acpi_gtm() argument
292 acpi_handle handle = ACPI_HANDLE(&ap->tdev); in ata_acpi_gtm()
305 ata_port_err(ap, "ACPI get timing mode failed (AE 0x%x)\n", in ata_acpi_gtm()
312 ata_port_warn(ap, "_GTM returned unexpected object type 0x%x\n", in ata_acpi_gtm()
319 ata_port_err(ap, "_GTM returned invalid length %d\n", in ata_acpi_gtm()
346 int ata_acpi_stm(struct ata_port *ap, const struct ata_acpi_gtm *stm) in ata_acpi_stm() argument
359 in_params[1].buffer.pointer = (u8 *)ap->link.device[0].id; in ata_acpi_stm()
362 in_params[2].buffer.pointer = (u8 *)ap->link.device[1].id; in ata_acpi_stm()
367 status = acpi_evaluate_object(ACPI_HANDLE(&ap->tdev), "_STM", in ata_acpi_stm()
373 ata_port_err(ap, "ACPI set timing mode failed (status=0x%x)\n", in ata_acpi_stm()
404 struct ata_port *ap = dev->link->ap; in ata_dev_get_GTF() local
420 if (ata_msg_probe(ap)) in ata_dev_get_GTF()
422 __func__, ap->port_no); in ata_dev_get_GTF()
439 if (ata_msg_probe(ap)) in ata_dev_get_GTF()
466 if (ata_msg_probe(ap)) in ata_dev_get_GTF()
530 int ata_acpi_cbl_80wire(struct ata_port *ap, const struct ata_acpi_gtm *gtm) in ata_acpi_cbl_80wire() argument
534 ata_for_each_dev(dev, &ap->link, ENABLED) { in ata_acpi_cbl_80wire()
772 struct ata_port *ap = dev->link->ap; in ata_acpi_push_id() local
777 if (ata_msg_probe(ap)) in ata_acpi_push_id()
779 __func__, dev->devno, ap->port_no); in ata_acpi_push_id()
822 int ata_acpi_on_suspend(struct ata_port *ap) in ata_acpi_on_suspend() argument
838 void ata_acpi_on_resume(struct ata_port *ap) in ata_acpi_on_resume() argument
840 const struct ata_acpi_gtm *gtm = ata_acpi_init_gtm(ap); in ata_acpi_on_resume()
843 if (ACPI_HANDLE(&ap->tdev) && gtm) { in ata_acpi_on_resume()
847 ata_acpi_stm(ap, gtm); in ata_acpi_on_resume()
853 ata_for_each_dev(dev, &ap->link, ALL) { in ata_acpi_on_resume()
865 ata_for_each_dev(dev, &ap->link, ALL) { in ata_acpi_on_resume()
891 static void sata_acpi_set_state(struct ata_port *ap, pm_message_t state) in sata_acpi_set_state() argument
898 ata_for_each_dev(dev, &ap->link, ENABLED) { in sata_acpi_set_state()
920 static void pata_acpi_set_state(struct ata_port *ap, pm_message_t state) in pata_acpi_set_state() argument
925 port_handle = ACPI_HANDLE(&ap->tdev); in pata_acpi_set_state()
934 ata_for_each_dev(dev, &ap->link, ENABLED) { in pata_acpi_set_state()
955 void ata_acpi_set_state(struct ata_port *ap, pm_message_t state) in ata_acpi_set_state() argument
957 if (ap->flags & ATA_FLAG_ACPI_SATA) in ata_acpi_set_state()
958 sata_acpi_set_state(ap, state); in ata_acpi_set_state()
960 pata_acpi_set_state(ap, state); in ata_acpi_set_state()
979 struct ata_port *ap = dev->link->ap; in ata_acpi_on_devcfg() local
980 struct ata_eh_context *ehc = &ap->link.eh_context; in ata_acpi_on_devcfg()
981 int acpi_sata = ap->flags & ATA_FLAG_ACPI_SATA; in ata_acpi_on_devcfg()
1021 if (rc == -EINVAL && !nr_executed && !(ap->pflags & ATA_PFLAG_FROZEN)) in ata_acpi_on_devcfg()
1036 if (!nr_executed && !(ap->pflags & ATA_PFLAG_FROZEN)) in ata_acpi_on_devcfg()