summaryrefslogtreecommitdiffstats
path: root/include/driver.h
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2013-05-24 15:42:27 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2013-05-31 12:32:05 +0200
commit95e7982f99c03806b640c2e98e3e8e29ecefa3f1 (patch)
tree9549784580f7a6924c276353754162f647d4b255 /include/driver.h
parent9897dec869bfc54f704fd07dc85800aad2e37250 (diff)
downloadbarebox-95e7982f99c03806b640c2e98e3e8e29ecefa3f1.tar.gz
barebox-95e7982f99c03806b640c2e98e3e8e29ecefa3f1.tar.xz
devices: add detect mechanism
We often encounter the situation where slow devices should not be probed during startup since probing is slow and maybe unnecessary for unused devices. With MMC we have the 'probe' device parameter, for ata we have the same, for USB we have the 'usb' command. Overall this is not very consistent. With MMC there is the additional problem that the probe parameter is attached to the logical device when we often have the information which physical device we want to probe. This patch adds a 'detect' callback for devices and adds a command to detect devices and to list the devices which are actually detecable. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/driver.h')
-rw-r--r--include/driver.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/driver.h b/include/driver.h
index de195c5e5c..da4f446ec9 100644
--- a/include/driver.h
+++ b/include/driver.h
@@ -109,6 +109,11 @@ struct device_d {
struct of_device_id *of_id_entry;
void (*info) (struct device_d *);
+ /*
+ * For devices which take longer to probe this is called
+ * when the driver should actually detect client devices
+ */
+ int (*detect) (struct device_d *);
};
/** @brief Describes a driver present in the system */
@@ -152,6 +157,9 @@ int register_device(struct device_d *);
*/
int device_probe(struct device_d *dev);
+/* detect devices attached to this device (cards, disks,...) */
+int device_detect(struct device_d *dev);
+
/* Unregister a device. This function can fail, e.g. when the device
* has children.
*/