diff options
Diffstat (limited to 'include/linux/device.h')
| -rw-r--r-- | include/linux/device.h | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/include/linux/device.h b/include/linux/device.h index 0eb8ee2dc6d1..6558af90c8fe 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
| @@ -38,6 +38,7 @@ struct class; | |||
| 38 | struct subsys_private; | 38 | struct subsys_private; |
| 39 | struct bus_type; | 39 | struct bus_type; |
| 40 | struct device_node; | 40 | struct device_node; |
| 41 | struct fwnode_handle; | ||
| 41 | struct iommu_ops; | 42 | struct iommu_ops; |
| 42 | struct iommu_group; | 43 | struct iommu_group; |
| 43 | 44 | ||
| @@ -650,14 +651,6 @@ struct device_dma_parameters { | |||
| 650 | unsigned long segment_boundary_mask; | 651 | unsigned long segment_boundary_mask; |
| 651 | }; | 652 | }; |
| 652 | 653 | ||
| 653 | struct acpi_device; | ||
| 654 | |||
| 655 | struct acpi_dev_node { | ||
| 656 | #ifdef CONFIG_ACPI | ||
| 657 | struct acpi_device *companion; | ||
| 658 | #endif | ||
| 659 | }; | ||
| 660 | |||
| 661 | /** | 654 | /** |
| 662 | * struct device - The basic device structure | 655 | * struct device - The basic device structure |
| 663 | * @parent: The device's "parent" device, the device to which it is attached. | 656 | * @parent: The device's "parent" device, the device to which it is attached. |
| @@ -703,7 +696,7 @@ struct acpi_dev_node { | |||
| 703 | * @cma_area: Contiguous memory area for dma allocations | 696 | * @cma_area: Contiguous memory area for dma allocations |
| 704 | * @archdata: For arch-specific additions. | 697 | * @archdata: For arch-specific additions. |
| 705 | * @of_node: Associated device tree node. | 698 | * @of_node: Associated device tree node. |
| 706 | * @acpi_node: Associated ACPI device node. | 699 | * @fwnode: Associated device node supplied by platform firmware. |
| 707 | * @devt: For creating the sysfs "dev". | 700 | * @devt: For creating the sysfs "dev". |
| 708 | * @id: device instance | 701 | * @id: device instance |
| 709 | * @devres_lock: Spinlock to protect the resource of the device. | 702 | * @devres_lock: Spinlock to protect the resource of the device. |
| @@ -779,7 +772,7 @@ struct device { | |||
| 779 | struct dev_archdata archdata; | 772 | struct dev_archdata archdata; |
| 780 | 773 | ||
| 781 | struct device_node *of_node; /* associated device tree node */ | 774 | struct device_node *of_node; /* associated device tree node */ |
| 782 | struct acpi_dev_node acpi_node; /* associated ACPI device node */ | 775 | struct fwnode_handle *fwnode; /* firmware device node */ |
| 783 | 776 | ||
| 784 | dev_t devt; /* dev_t, creates the sysfs "dev" */ | 777 | dev_t devt; /* dev_t, creates the sysfs "dev" */ |
| 785 | u32 id; /* device instance */ | 778 | u32 id; /* device instance */ |
| @@ -916,6 +909,13 @@ static inline void device_lock_assert(struct device *dev) | |||
| 916 | lockdep_assert_held(&dev->mutex); | 909 | lockdep_assert_held(&dev->mutex); |
| 917 | } | 910 | } |
| 918 | 911 | ||
| 912 | static inline struct device_node *dev_of_node(struct device *dev) | ||
| 913 | { | ||
| 914 | if (!IS_ENABLED(CONFIG_OF)) | ||
| 915 | return NULL; | ||
| 916 | return dev->of_node; | ||
| 917 | } | ||
| 918 | |||
| 919 | void driver_init(void); | 919 | void driver_init(void); |
| 920 | 920 | ||
| 921 | /* | 921 | /* |
| @@ -947,6 +947,9 @@ extern void unlock_device_hotplug(void); | |||
| 947 | extern int lock_device_hotplug_sysfs(void); | 947 | extern int lock_device_hotplug_sysfs(void); |
| 948 | extern int device_offline(struct device *dev); | 948 | extern int device_offline(struct device *dev); |
| 949 | extern int device_online(struct device *dev); | 949 | extern int device_online(struct device *dev); |
| 950 | extern void set_primary_fwnode(struct device *dev, struct fwnode_handle *fwnode); | ||
| 951 | extern void set_secondary_fwnode(struct device *dev, struct fwnode_handle *fwnode); | ||
| 952 | |||
| 950 | /* | 953 | /* |
| 951 | * Root device objects for grouping under /sys/devices | 954 | * Root device objects for grouping under /sys/devices |
| 952 | */ | 955 | */ |
