diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-02-21 05:06:09 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-02-21 05:06:09 +0300 |
commit | 786856b6d111a30d51c98526cc7a283ecc73f00f (patch) | |
tree | c9577b59d34b36009d11131c547d3df60de8534b /include | |
parent | 43e31e40473a00c936ffb9c2eebedc0566c92e89 (diff) | |
parent | d3e1b617ae20c459627f501b4bc55b1ea91f662b (diff) | |
download | linux-786856b6d111a30d51c98526cc7a283ecc73f00f.tar.xz |
Merge tag 'device-properties-4.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull device property updates from Rafael J. Wysocki:
"Generic device properties framework updates for v4.11-rc1
Allow built-in (static) device properties to be declared as constant,
make it possible to save memory by discarding alternative (but unused)
built-in (static) property sets and add support for automatic handling
of built-in properties to the I2C code"
* tag 'device-properties-4.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
i2c: allow specify device properties in i2c_board_info
device property: export code duplicating array of property entries
device property: constify property arrays values
device property: allow to constify properties
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/i2c.h | 3 | ||||
-rw-r--r-- | include/linux/property.h | 19 |
2 files changed, 15 insertions, 7 deletions
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 4b45ec46161f..7b23a3316dcb 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -51,6 +51,7 @@ enum i2c_slave_event; typedef int (*i2c_slave_cb_t)(struct i2c_client *, enum i2c_slave_event, u8 *); struct module; +struct property_entry; #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) /* @@ -299,6 +300,7 @@ static inline int i2c_slave_event(struct i2c_client *client, * @archdata: copied into i2c_client.dev.archdata * @of_node: pointer to OpenFirmware device node * @fwnode: device node supplied by the platform firmware + * @properties: additional device properties for the device * @irq: stored in i2c_client.irq * * I2C doesn't actually support hardware probing, although controllers and @@ -320,6 +322,7 @@ struct i2c_board_info { struct dev_archdata *archdata; struct device_node *of_node; struct fwnode_handle *fwnode; + const struct property_entry *properties; int irq; }; diff --git a/include/linux/property.h b/include/linux/property.h index 856e50b2140c..64e3a9c6d95f 100644 --- a/include/linux/property.h +++ b/include/linux/property.h @@ -160,12 +160,12 @@ struct property_entry { bool is_string; union { union { - void *raw_data; - u8 *u8_data; - u16 *u16_data; - u32 *u32_data; - u64 *u64_data; - const char **str; + const void *raw_data; + const u8 *u8_data; + const u16 *u16_data; + const u32 *u32_data; + const u64 *u64_data; + const char * const *str; } pointer; union { unsigned long long raw_data; @@ -241,8 +241,13 @@ struct property_entry { .name = _name_, \ } +struct property_entry * +property_entries_dup(const struct property_entry *properties); + +void property_entries_free(const struct property_entry *properties); + int device_add_properties(struct device *dev, - struct property_entry *properties); + const struct property_entry *properties); void device_remove_properties(struct device *dev); bool device_dma_supported(struct device *dev); |