Merge branch 'device-properties'

* device-properties:
  ACPI / property: Fix subnode lookup scope for data-only subnodes
  acpi-dma: Add support for "dma-names" device property
  device property: Add fwnode_property_match_string()
  ACPI / property: Extend device_get_next_child_node() to data-only nodes
  ACPI / gpio: Split acpi_get_gpiod_by_index()
  ACPI / property: Extend fwnode_property_* to data-only subnodes
  ACPI / property: Expose data-only subnodes via sysfs
  ACPI / property: Add support for data-only subnodes
  ACPI / property: Add routine for extraction of _DSD properties
This commit is contained in:
Rafael J. Wysocki
2015-10-25 22:51:48 +01:00
12 changed files with 764 additions and 198 deletions

View File

@@ -49,7 +49,7 @@ static inline acpi_handle acpi_device_handle(struct acpi_device *adev)
return adev ? adev->handle : NULL;
}
#define ACPI_COMPANION(dev) to_acpi_node((dev)->fwnode)
#define ACPI_COMPANION(dev) to_acpi_device_node((dev)->fwnode)
#define ACPI_COMPANION_SET(dev, adev) set_primary_fwnode(dev, (adev) ? \
acpi_fwnode_handle(adev) : NULL)
#define ACPI_HANDLE(dev) acpi_device_handle(ACPI_COMPANION(dev))
@@ -69,7 +69,7 @@ static inline acpi_handle acpi_device_handle(struct acpi_device *adev)
static inline bool has_acpi_companion(struct device *dev)
{
return is_acpi_node(dev->fwnode);
return is_acpi_device_node(dev->fwnode);
}
static inline void acpi_preset_companion(struct device *dev,
@@ -462,7 +462,22 @@ static inline bool is_acpi_node(struct fwnode_handle *fwnode)
return false;
}
static inline struct acpi_device *to_acpi_node(struct fwnode_handle *fwnode)
static inline bool is_acpi_device_node(struct fwnode_handle *fwnode)
{
return false;
}
static inline struct acpi_device *to_acpi_device_node(struct fwnode_handle *fwnode)
{
return NULL;
}
static inline bool is_acpi_data_node(struct fwnode_handle *fwnode)
{
return false;
}
static inline struct acpi_data_node *to_acpi_data_node(struct fwnode_handle *fwnode)
{
return NULL;
}
@@ -744,22 +759,21 @@ struct acpi_reference_args {
#ifdef CONFIG_ACPI
int acpi_dev_get_property(struct acpi_device *adev, const char *name,
acpi_object_type type, const union acpi_object **obj);
int acpi_dev_get_property_array(struct acpi_device *adev, const char *name,
acpi_object_type type,
const union acpi_object **obj);
int acpi_dev_get_property_reference(struct acpi_device *adev,
const char *name, size_t index,
struct acpi_reference_args *args);
int acpi_node_get_property_reference(struct fwnode_handle *fwnode,
const char *name, size_t index,
struct acpi_reference_args *args);
int acpi_dev_prop_get(struct acpi_device *adev, const char *propname,
void **valptr);
int acpi_node_prop_get(struct fwnode_handle *fwnode, const char *propname,
void **valptr);
int acpi_dev_prop_read_single(struct acpi_device *adev, const char *propname,
enum dev_prop_type proptype, void *val);
int acpi_node_prop_read(struct fwnode_handle *fwnode, const char *propname,
enum dev_prop_type proptype, void *val, size_t nval);
int acpi_dev_prop_read(struct acpi_device *adev, const char *propname,
enum dev_prop_type proptype, void *val, size_t nval);
struct acpi_device *acpi_get_next_child(struct device *dev,
struct acpi_device *child);
struct fwnode_handle *acpi_get_next_subnode(struct device *dev,
struct fwnode_handle *subnode);
#else
static inline int acpi_dev_get_property(struct acpi_device *adev,
const char *name, acpi_object_type type,
@@ -767,16 +781,17 @@ static inline int acpi_dev_get_property(struct acpi_device *adev,
{
return -ENXIO;
}
static inline int acpi_dev_get_property_array(struct acpi_device *adev,
const char *name,
acpi_object_type type,
const union acpi_object **obj)
static inline int acpi_node_get_property_reference(struct fwnode_handle *fwnode,
const char *name, const char *cells_name,
size_t index, struct acpi_reference_args *args)
{
return -ENXIO;
}
static inline int acpi_dev_get_property_reference(struct acpi_device *adev,
const char *name, const char *cells_name,
size_t index, struct acpi_reference_args *args)
static inline int acpi_node_prop_get(struct fwnode_handle *fwnode,
const char *propname,
void **valptr)
{
return -ENXIO;
}
@@ -796,6 +811,14 @@ static inline int acpi_dev_prop_read_single(struct acpi_device *adev,
return -ENXIO;
}
static inline int acpi_node_prop_read(struct fwnode_handle *fwnode,
const char *propname,
enum dev_prop_type proptype,
void *val, size_t nval)
{
return -ENXIO;
}
static inline int acpi_dev_prop_read(struct acpi_device *adev,
const char *propname,
enum dev_prop_type proptype,
@@ -804,12 +827,11 @@ static inline int acpi_dev_prop_read(struct acpi_device *adev,
return -ENXIO;
}
static inline struct acpi_device *acpi_get_next_child(struct device *dev,
struct acpi_device *child)
static inline struct fwnode_handle *acpi_get_next_subnode(struct device *dev,
struct fwnode_handle *subnode)
{
return NULL;
}
#endif
#endif /*_LINUX_ACPI_H*/