diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2013-06-06 09:41:33 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2013-06-06 09:42:16 +0200 |
commit | 769d1faaf589ffb44bbfe174a9fbe707568b3be4 (patch) | |
tree | 8d810b306e103b0305f9dea4c436eae3a8e38606 /drivers/ata/ahci.c | |
parent | 6883fc4378b2d4e438a45a874a424460f58a2db1 (diff) | |
download | barebox-769d1faaf589ffb44bbfe174a9fbe707568b3be4.tar.gz barebox-769d1faaf589ffb44bbfe174a9fbe707568b3be4.tar.xz |
ata: ahci: Allow 'detect' on hardware device
Hook the detect callback to the hardware device.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/ata/ahci.c')
-rw-r--r-- | drivers/ata/ahci.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 19d445a596..f9cf2d1436 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -569,6 +569,20 @@ void ahci_info(struct device_d *dev) ahci_print_info(ahci); } +static int ahci_detect(struct device_d *dev) +{ + struct ahci_device *ahci = dev->priv; + int i; + + for (i = 0; i < ahci->n_ports; i++) { + struct ahci_port *ahci_port = &ahci->ports[i]; + + ata_port_detect(&ahci_port->ata); + } + + return 0; +} + int ahci_add_host(struct ahci_device *ahci) { u8 *mmio = (u8 *)ahci->mmio_base; @@ -630,6 +644,8 @@ int ahci_add_host(struct ahci_device *ahci) ahci_iowrite(ahci, HOST_CTL, tmp | HOST_IRQ_EN); tmp = ahci_ioread(ahci, HOST_CTL); + ahci->dev->detect = ahci_detect; + return 0; } |