Commit 8a19ac89 authored by Tejun Heo's avatar Tejun Heo Committed by Jeff Garzik

[PATCH] libata: implement ata_std_probeinit()

This patch implements the off-the-shelf probeinit component operation.
Currently, all it does is waking up the PHY if it's a SATA port.
Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
Signed-off-by: default avatarJeff Garzik <jgarzik@pobox.com>
parent 7944ea95
...@@ -2295,6 +2295,19 @@ static int sata_phy_resume(struct ata_port *ap) ...@@ -2295,6 +2295,19 @@ static int sata_phy_resume(struct ata_port *ap)
return -1; return -1;
} }
/**
* ata_std_probeinit - initialize probing
* @ap: port to be probed
*
* @ap is about to be probed. Initialize it. This function is
* to be used as standard callback for ata_drive_probe_reset().
*/
extern void ata_std_probeinit(struct ata_port *ap)
{
if (ap->flags & ATA_FLAG_SATA && ap->ops->scr_read)
sata_phy_resume(ap);
}
/** /**
* ata_std_softreset - reset host port via ATA SRST * ata_std_softreset - reset host port via ATA SRST
* @ap: port to reset * @ap: port to reset
...@@ -2485,7 +2498,7 @@ int ata_std_probe_reset(struct ata_port *ap, unsigned int *classes) ...@@ -2485,7 +2498,7 @@ int ata_std_probe_reset(struct ata_port *ap, unsigned int *classes)
if (ap->flags & ATA_FLAG_SATA && ap->ops->scr_read) if (ap->flags & ATA_FLAG_SATA && ap->ops->scr_read)
hardreset = sata_std_hardreset; hardreset = sata_std_hardreset;
return ata_drive_probe_reset(ap, NULL, return ata_drive_probe_reset(ap, ata_std_probeinit,
ata_std_softreset, hardreset, ata_std_softreset, hardreset,
ata_std_postreset, classes); ata_std_postreset, classes);
} }
...@@ -5535,6 +5548,7 @@ EXPORT_SYMBOL_GPL(ata_port_probe); ...@@ -5535,6 +5548,7 @@ EXPORT_SYMBOL_GPL(ata_port_probe);
EXPORT_SYMBOL_GPL(sata_phy_reset); EXPORT_SYMBOL_GPL(sata_phy_reset);
EXPORT_SYMBOL_GPL(__sata_phy_reset); EXPORT_SYMBOL_GPL(__sata_phy_reset);
EXPORT_SYMBOL_GPL(ata_bus_reset); EXPORT_SYMBOL_GPL(ata_bus_reset);
EXPORT_SYMBOL_GPL(ata_std_probeinit);
EXPORT_SYMBOL_GPL(ata_std_softreset); EXPORT_SYMBOL_GPL(ata_std_softreset);
EXPORT_SYMBOL_GPL(sata_std_hardreset); EXPORT_SYMBOL_GPL(sata_std_hardreset);
EXPORT_SYMBOL_GPL(ata_std_postreset); EXPORT_SYMBOL_GPL(ata_std_postreset);
......
...@@ -488,6 +488,7 @@ extern int ata_drive_probe_reset(struct ata_port *ap, ...@@ -488,6 +488,7 @@ extern int ata_drive_probe_reset(struct ata_port *ap,
ata_probeinit_fn_t probeinit, ata_probeinit_fn_t probeinit,
ata_reset_fn_t softreset, ata_reset_fn_t hardreset, ata_reset_fn_t softreset, ata_reset_fn_t hardreset,
ata_postreset_fn_t postreset, unsigned int *classes); ata_postreset_fn_t postreset, unsigned int *classes);
extern void ata_std_probeinit(struct ata_port *ap);
extern int ata_std_softreset(struct ata_port *ap, int verbose, extern int ata_std_softreset(struct ata_port *ap, int verbose,
unsigned int *classes); unsigned int *classes);
extern int sata_std_hardreset(struct ata_port *ap, int verbose, extern int sata_std_hardreset(struct ata_port *ap, int verbose,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment