aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMika Westerberg <mika.westerberg@linux.intel.com>2014-10-21 07:33:56 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-11-04 15:58:21 -0500
commit733e625139fe455b4d910ac63c18c90f7cbe2d6f (patch)
tree0c67448b04c118138a66f485094fe951dfe24e84 /include
parentb31384fa5de37a100507751dfb5c0a49d06cee67 (diff)
ACPI: Allow drivers to match using Device Tree compatible property
We have lots of existing Device Tree enabled drivers and allocating separate _HID for each is not feasible. Instead we allocate special _HID "PRP0001" that means that the match should be done using Device Tree compatible property using driver's .of_match_table instead if the driver is missing .acpi_match_table. If there is a need to distinguish from where the device is enumerated (DT/ACPI) driver can check dev->of_node or ACPI_COMPATION(dev). Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Acked-by: Grant Likely <grant.likely@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include')
-rw-r--r--include/acpi/acpi_bus.h1
-rw-r--r--include/linux/acpi.h8
2 files changed, 3 insertions, 6 deletions
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index 475781170091..f59cbf860658 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -341,6 +341,7 @@ struct acpi_device_physical_node {
341struct acpi_device_data { 341struct acpi_device_data {
342 const union acpi_object *pointer; 342 const union acpi_object *pointer;
343 const union acpi_object *properties; 343 const union acpi_object *properties;
344 const union acpi_object *of_compatible;
344}; 345};
345 346
346/* Device */ 347/* Device */
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 76d64d6a903a..38296d686c55 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -424,12 +424,8 @@ extern int acpi_nvs_for_each_region(int (*func)(__u64, __u64, void *),
424const struct acpi_device_id *acpi_match_device(const struct acpi_device_id *ids, 424const struct acpi_device_id *acpi_match_device(const struct acpi_device_id *ids,
425 const struct device *dev); 425 const struct device *dev);
426 426
427static inline bool acpi_driver_match_device(struct device *dev, 427extern bool acpi_driver_match_device(struct device *dev,
428 const struct device_driver *drv) 428 const struct device_driver *drv);
429{
430 return !!acpi_match_device(drv->acpi_match_table, dev);
431}
432
433int acpi_device_uevent_modalias(struct device *, struct kobj_uevent_env *); 429int acpi_device_uevent_modalias(struct device *, struct kobj_uevent_env *);
434int acpi_device_modalias(struct device *, char *, int); 430int acpi_device_modalias(struct device *, char *, int);
435 431