diff options
| author | Cosmin Tanislav <demonsingur@gmail.com> | 2025-05-07 15:19:13 +0300 |
|---|---|---|
| committer | Wolfram Sang <wsa+renesas@sang-engineering.com> | 2025-05-22 11:07:05 +0200 |
| commit | 18355307dc56c198365c6b6b359a4a24db013685 (patch) | |
| tree | 03ff08b9c47996b018a82b3d397fc3040fdd5a29 /include/linux | |
| parent | b09d8a9cce2664cdcef91f10eed9557321ce4a81 (diff) | |
i2c: atr: add static flag
Some I2C ATRs do not support dynamic remapping, only static mapping
of direct children.
Mappings will only be added or removed as a result of devices being
added or removed from a child bus.
The ATR pool will have to be big enough to accommodate all devices
expected to be added to the child buses.
Add a new flag that prevents old mappings to be replaced or new mappings
to be created in the alias finding code paths. That mens adding a flags
parameter to i2c_atr_new() and an i2c_atr_flags enum.
Signed-off-by: Cosmin Tanislav <demonsingur@gmail.com>
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Reviewed-by: Romain Gantois <romain.gantois@bootlin.com>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/i2c-atr.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/include/linux/i2c-atr.h b/include/linux/i2c-atr.h index 1c3a5bcd939f..5aaab1598084 100644 --- a/include/linux/i2c-atr.h +++ b/include/linux/i2c-atr.h @@ -19,6 +19,19 @@ struct fwnode_handle; struct i2c_atr; /** + * enum i2c_atr_flags - Flags for an I2C ATR driver + * + * @I2C_ATR_F_STATIC: ATR does not support dynamic mapping, use static mapping. + * Mappings will only be added or removed as a result of + * devices being added or removed from a child bus. + * The ATR pool will have to be big enough to accomodate all + * devices expected to be added to the child buses. + */ +enum i2c_atr_flags { + I2C_ATR_F_STATIC = BIT(0), +}; + +/** * struct i2c_atr_ops - Callbacks from ATR to the device driver. * @attach_addr: Notify the driver of a new device connected on a child * bus, with the alias assigned to it. The driver must @@ -65,6 +78,7 @@ struct i2c_atr_adap_desc { * @dev: The device acting as an ATR * @ops: Driver-specific callbacks * @max_adapters: Maximum number of child adapters + * @flags: Flags for ATR * * The new ATR helper is connected to the parent adapter but has no child * adapters. Call i2c_atr_add_adapter() to add some. @@ -74,7 +88,8 @@ struct i2c_atr_adap_desc { * Return: pointer to the new ATR helper object, or ERR_PTR */ struct i2c_atr *i2c_atr_new(struct i2c_adapter *parent, struct device *dev, - const struct i2c_atr_ops *ops, int max_adapters); + const struct i2c_atr_ops *ops, int max_adapters, + u32 flags); /** * i2c_atr_delete - Delete an I2C ATR helper. |
