aboutsummaryrefslogtreecommitdiffstats
path: root/include/acpi
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-12-08 13:50:17 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-12-08 13:50:17 -0500
commitd3eaf5875e36b37f1386a4e3e7562c5a6c35abd2 (patch)
tree13f5b6c391ad74a072a4f77f74e958a6ac287032 /include/acpi
parentb2776bf7149bddd1f4161f14f79520f17fc1d71d (diff)
parent29470ea8d828e4dec74e94f7f17b7479ff5ef276 (diff)
Merge branch 'device-properties'
* device-properties: leds: leds-gpio: Fix multiple instances registration without 'label' property leds: leds-gpio: Fix legacy GPIO number case ACPI / property: Drop size_prop from acpi_dev_get_property_reference() leds: leds-gpio: Convert gpio_blink_set() to use GPIO descriptors ACPI / GPIO: Document ACPI GPIO mappings API net: rfkill: gpio: Add default GPIO driver mappings for ACPI ACPI / GPIO: Driver GPIO mappings for ACPI GPIOs input: gpio_keys_polled: Make use of device property API leds: leds-gpio: Make use of device property API gpio: Support for unified device properties interface Driver core: Unified interface for firmware node properties input: gpio_keys_polled: Add support for GPIO descriptors leds: leds-gpio: Add support for GPIO descriptors gpio: sch: Consolidate core and resume banks gpio / ACPI: Add support for _DSD device properties misc: at25: Make use of device property API ACPI: Allow drivers to match using Device Tree compatible property Driver core: Unified device properties interface for platform firmware ACPI: Add support for device specific properties
Diffstat (limited to 'include/acpi')
-rw-r--r--include/acpi/acpi_bus.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index f34a0835aa4f..7d1ce40e201e 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -27,6 +27,7 @@
27#define __ACPI_BUS_H__ 27#define __ACPI_BUS_H__
28 28
29#include <linux/device.h> 29#include <linux/device.h>
30#include <linux/property.h>
30 31
31/* TBD: Make dynamic */ 32/* TBD: Make dynamic */
32#define ACPI_MAX_HANDLES 10 33#define ACPI_MAX_HANDLES 10
@@ -337,10 +338,20 @@ struct acpi_device_physical_node {
337 bool put_online:1; 338 bool put_online:1;
338}; 339};
339 340
341/* ACPI Device Specific Data (_DSD) */
342struct acpi_device_data {
343 const union acpi_object *pointer;
344 const union acpi_object *properties;
345 const union acpi_object *of_compatible;
346};
347
348struct acpi_gpio_mapping;
349
340/* Device */ 350/* Device */
341struct acpi_device { 351struct acpi_device {
342 int device_type; 352 int device_type;
343 acpi_handle handle; /* no handle for fixed hardware */ 353 acpi_handle handle; /* no handle for fixed hardware */
354 struct fwnode_handle fwnode;
344 struct acpi_device *parent; 355 struct acpi_device *parent;
345 struct list_head children; 356 struct list_head children;
346 struct list_head node; 357 struct list_head node;
@@ -353,9 +364,11 @@ struct acpi_device {
353 struct acpi_device_wakeup wakeup; 364 struct acpi_device_wakeup wakeup;
354 struct acpi_device_perf performance; 365 struct acpi_device_perf performance;
355 struct acpi_device_dir dir; 366 struct acpi_device_dir dir;
367 struct acpi_device_data data;
356 struct acpi_scan_handler *handler; 368 struct acpi_scan_handler *handler;
357 struct acpi_hotplug_context *hp; 369 struct acpi_hotplug_context *hp;
358 struct acpi_driver *driver; 370 struct acpi_driver *driver;
371 const struct acpi_gpio_mapping *driver_gpios;
359 void *driver_data; 372 void *driver_data;
360 struct device dev; 373 struct device dev;
361 unsigned int physical_node_count; 374 unsigned int physical_node_count;
@@ -364,6 +377,21 @@ struct acpi_device {
364 void (*remove)(struct acpi_device *); 377 void (*remove)(struct acpi_device *);
365}; 378};
366 379
380static inline bool is_acpi_node(struct fwnode_handle *fwnode)
381{
382 return fwnode && fwnode->type == FWNODE_ACPI;
383}
384
385static inline struct acpi_device *acpi_node(struct fwnode_handle *fwnode)
386{
387 return fwnode ? container_of(fwnode, struct acpi_device, fwnode) : NULL;
388}
389
390static inline struct fwnode_handle *acpi_fwnode_handle(struct acpi_device *adev)
391{
392 return &adev->fwnode;
393}
394
367static inline void *acpi_driver_data(struct acpi_device *d) 395static inline void *acpi_driver_data(struct acpi_device *d)
368{ 396{
369 return d->driver_data; 397 return d->driver_data;