]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
Driver core: Unified device properties interface for platform firmware
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 4 Nov 2014 00:28:56 +0000 (01:28 +0100)
committerSasha Levin <sasha.levin@oracle.com>
Sun, 28 Jun 2015 17:39:20 +0000 (13:39 -0400)
commit780841321b71d5fc13167260a482ac98ebccd200
tree24e6c62ff7795308bb33b180c9a7eef8374ef3a2
parentd077c9c398e32a45d94f260c4072917f356c5c4f
Driver core: Unified device properties interface for platform firmware

[ Upstream commit b31384fa5de37a100507751dfb5c0a49d06cee67 ]

Add a uniform interface by which device drivers can request device
properties from the platform firmware by providing a property name
and the corresponding data type.  The purpose of it is to help to
write portable code that won't depend on any particular platform
firmware interface.

The following general helper functions are added:

device_property_present()
device_property_read_u8()
device_property_read_u16()
device_property_read_u32()
device_property_read_u64()
device_property_read_string()
device_property_read_u8_array()
device_property_read_u16_array()
device_property_read_u32_array()
device_property_read_u64_array()
device_property_read_string_array()

The first one allows the caller to check if the given property is
present.  The next 5 of them allow single-valued properties of
various types to be retrieved in a uniform way.  The remaining 5 are
for reading properties with multiple values (arrays of either numbers
or strings).

The interface covers both ACPI and Device Trees.

This change set includes material from Mika Westerberg and Aaron Lu.

Signed-off-by: Aaron Lu <aaron.lu@intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Grant Likely <grant.likely@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
drivers/acpi/property.c
drivers/base/Makefile
drivers/base/property.c [new file with mode: 0644]
drivers/of/base.c
include/linux/acpi.h
include/linux/of.h
include/linux/property.h [new file with mode: 0644]