aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/device.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/linux/device.h b/include/linux/device.h
index 1e05911325f0..d3991810f39d 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -349,6 +349,20 @@ enum probe_type {
349 * @probe_type: Type of the probe (synchronous or asynchronous) to use. 349 * @probe_type: Type of the probe (synchronous or asynchronous) to use.
350 * @of_match_table: The open firmware table. 350 * @of_match_table: The open firmware table.
351 * @acpi_match_table: The ACPI match table. 351 * @acpi_match_table: The ACPI match table.
352 * @edit_links: Called to allow a matched driver to edit the device links the
353 * bus might have added incorrectly. This will be useful to handle
354 * cases where the bus incorrectly adds functional dependencies
355 * that aren't true or tries to create cyclic dependencies. But
356 * doesn't correctly handle functional dependencies that are
357 * missed by the bus as the supplier's sync_state might get to
358 * execute before the driver for a missing consumer is loaded and
359 * gets to edit the device links for the consumer.
360 *
361 * This function might be called multiple times after a new device
362 * is added. The function is expected to create all the device
363 * links for the new device and return 0 if it was completed
364 * successfully or return an error if it needs to be reattempted
365 * in the future.
352 * @probe: Called to query the existence of a specific device, 366 * @probe: Called to query the existence of a specific device,
353 * whether this driver can work with it, and bind the driver 367 * whether this driver can work with it, and bind the driver
354 * to a specific device. 368 * to a specific device.
@@ -388,6 +402,7 @@ struct device_driver {
388 const struct of_device_id *of_match_table; 402 const struct of_device_id *of_match_table;
389 const struct acpi_device_id *acpi_match_table; 403 const struct acpi_device_id *acpi_match_table;
390 404
405 int (*edit_links)(struct device *dev);
391 int (*probe) (struct device *dev); 406 int (*probe) (struct device *dev);
392 int (*remove) (struct device *dev); 407 int (*remove) (struct device *dev);
393 void (*shutdown) (struct device *dev); 408 void (*shutdown) (struct device *dev);
@@ -1220,6 +1235,8 @@ struct dev_links_info {
1220 * @offline: Set after successful invocation of bus type's .offline(). 1235 * @offline: Set after successful invocation of bus type's .offline().
1221 * @of_node_reused: Set if the device-tree node is shared with an ancestor 1236 * @of_node_reused: Set if the device-tree node is shared with an ancestor
1222 * device. 1237 * device.
1238 * @has_edit_links: This device has a driver than is capable of
1239 * editing the device links created by driver core.
1223 * @dma_coherent: this particular device is dma coherent, even if the 1240 * @dma_coherent: this particular device is dma coherent, even if the
1224 * architecture supports non-coherent devices. 1241 * architecture supports non-coherent devices.
1225 * 1242 *
@@ -1313,6 +1330,7 @@ struct device {
1313 bool offline_disabled:1; 1330 bool offline_disabled:1;
1314 bool offline:1; 1331 bool offline:1;
1315 bool of_node_reused:1; 1332 bool of_node_reused:1;
1333 bool has_edit_links:1;
1316#if defined(CONFIG_ARCH_HAS_SYNC_DMA_FOR_DEVICE) || \ 1334#if defined(CONFIG_ARCH_HAS_SYNC_DMA_FOR_DEVICE) || \
1317 defined(CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU) || \ 1335 defined(CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU) || \
1318 defined(CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU_ALL) 1336 defined(CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU_ALL)
@@ -1564,6 +1582,7 @@ extern int __must_check device_attach(struct device *dev);
1564extern int __must_check driver_attach(struct device_driver *drv); 1582extern int __must_check driver_attach(struct device_driver *drv);
1565extern void device_initial_probe(struct device *dev); 1583extern void device_initial_probe(struct device *dev);
1566extern int __must_check device_reprobe(struct device *dev); 1584extern int __must_check device_reprobe(struct device *dev);
1585extern int driver_edit_links(struct device *dev);
1567 1586
1568extern bool device_is_bound(struct device *dev); 1587extern bool device_is_bound(struct device *dev);
1569 1588
@@ -1654,6 +1673,7 @@ struct device_link *device_link_add(struct device *consumer,
1654 struct device *supplier, u32 flags); 1673 struct device *supplier, u32 flags);
1655void device_link_del(struct device_link *link); 1674void device_link_del(struct device_link *link);
1656void device_link_remove(void *consumer, struct device *supplier); 1675void device_link_remove(void *consumer, struct device *supplier);
1676void device_link_remove_from_wfs(struct device *consumer);
1657 1677
1658#ifndef dev_fmt 1678#ifndef dev_fmt
1659#define dev_fmt(fmt) fmt 1679#define dev_fmt(fmt) fmt