From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 4/6] ata: ahci: Allow 'detect' on hardware device
Date: Thu, 6 Jun 2013 16:22:37 +0200 [thread overview]
Message-ID: <1370528559-15694-4-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1370528559-15694-1-git-send-email-s.hauer@pengutronix.de>
Hook the detect callback to the hardware device.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/ata/ahci.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 19d445a..f9cf2d1 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;
}
--
1.8.2.rc2
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2013-06-06 14:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-06 14:22 [PATCH 1/6] ata: move ATA_ID_ fields and functions to include/ Sascha Hauer
2013-06-06 14:22 ` [PATCH 2/6] ata: ahci: only use lba48 on drives which support it Sascha Hauer
2013-06-06 14:22 ` [PATCH 3/6] ata: implement detect Sascha Hauer
2013-06-06 14:22 ` Sascha Hauer [this message]
2013-06-06 14:22 ` [PATCH 5/6] ata: i.MX sata: Add devicetree probe support Sascha Hauer
2013-06-06 14:22 ` [PATCH 6/6] ARM: i.MX6: Add sata device to devicetree Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1370528559-15694-4-git-send-email-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox