diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2024-07-19 16:46:26 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2024-07-19 16:46:26 -0700 |
commit | ef035628c326af9aa645af1b91fbb72fdfec874e (patch) | |
tree | 31bbda74c95f96d2f20307fd6bc356ec6cc7a3d7 /include | |
parent | acc5965b9ff8a1889f5b51466562896d59c6e1b9 (diff) | |
parent | 5d89b5bdbce3937c86f05ffe19455c3068fd94f7 (diff) |
Merge tag 'i2c-for-6.11-rc1-try2' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux
Pull i2c fixes from Wolfram Sang:
"The I2C core gains documentation updates for the testunit, a cleanup
regarding unneeded 'driver_data' and more sanity checks in the char
device.
For the host drivers, this release includes significant updates, with
the primary change being the renaming from "master/slave" to
"controller/target" to adhere to I2C v7 and SMBus 3.2 standards.
New Support:
- Added support for Intel Arrow Lake-H
- Added I2C support in the Arioha SoC by linking the Mediatek I2C
controller
Cleanups:
- Added the MODULE_DESCRIPTION() macro, resolving a modpost warning
in the ALi 1563 Southbridge driver.
- Constified the regmap_config declaration in the i2c-designware
driver.
- Improved the coding style in the Renesas R-Car driver by removing
unnecessary semicolons after brackets.
General improvements:
- In the OMAP device, replaced NOIRQ_SYSTEM_SLEEP_PM_OPS with
RUNTIME_PM_OPS to enable waking up the controller during suspend()
before suspend_noirq() kicks in.
- Improved logging in the Xilinx driver.
- Added a warning (WARN()) in the Renesas R-Car driver for spurious
interrupts.
DTS Changes:
- Removed address-cell and size-cell from the Atmel at91sam, nVidia
Tegra 20, and Samsung S3c2410 devices.
- Fixed Texas Instruments OMAP4 I2C controller to comply with the
i2c-controller.yaml schema.
- Improved indentation in DTS examples for several I2C devices.
- Converted the NXP LPC1788 binding to the dt-schema.
- Added documentation for the compatible string thead,th1520-i2c.
- Added the "power-domains" property for the Meson I2C driver.
AT24 EEPROM driver changes:
- add support for two new Microchip models
- document even more new models in DT bindings (those use fallback
compatibles so no code changes)"
* tag 'i2c-for-6.11-rc1-try2' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (87 commits)
i2c: document new callbacks in i2c_algorithm
dt-bindings: i2c: amlogic,meson6-i2c: add optional power-domains
dt-bindings: i2c: at91: Add sama7d65 compatible string
i2c: st: reword according to newest specification
i2c: cpm: reword according to newest specification
i2c: virtio: reword according to newest specification
i2c: nvidia-gpu: reword according to newest specification
i2c: viai2c: reword according to newest specification
i2c: viperboard: reword according to newest specification
i2c: uniphier: reword according to newest specification
i2c: uniphier-f: reword according to newest specification
i2c: tiny-usb: reword according to newest specification
i2c: thunderx-pcidrv: reword according to newest specification
i2c: tegra-bpmp: reword according to newest specification
i2c: taos-evm: reword according to newest specification
i2c: sun6i-p2wi: reword according to newest specification
i2c: stm32f4: reword according to newest specification
i2c: sprd: reword according to newest specification
i2c: sis5595: reword according to newest specification
i2c: rzv2m: reword according to newest specification
...
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/i2c.h | 44 |
1 files changed, 32 insertions, 12 deletions
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 424acb98c7c2..e9cc14b1f9a1 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -513,10 +513,10 @@ i2c_register_board_info(int busnum, struct i2c_board_info const *info, /** * struct i2c_algorithm - represent I2C transfer method - * @master_xfer: Issue a set of i2c transactions to the given I2C adapter + * @xfer: Issue a set of i2c transactions to the given I2C adapter * defined by the msgs array, with num messages available to transfer via * the adapter specified by adap. - * @master_xfer_atomic: same as @master_xfer. Yet, only using atomic context + * @xfer_atomic: same as @xfer. Yet, only using atomic context * so e.g. PMICs can be accessed very late before shutdown. Optional. * @smbus_xfer: Issue smbus transactions to the given I2C adapter. If this * is not present, then the bus layer will try and convert the SMBus calls @@ -525,33 +525,47 @@ i2c_register_board_info(int busnum, struct i2c_board_info const *info, * so e.g. PMICs can be accessed very late before shutdown. Optional. * @functionality: Return the flags that this algorithm/adapter pair supports * from the ``I2C_FUNC_*`` flags. - * @reg_slave: Register given client to I2C slave mode of this adapter - * @unreg_slave: Unregister given client from I2C slave mode of this adapter + * @reg_target: Register given client to local target mode of this adapter + * @unreg_target: Unregister given client from local target mode of this adapter + * + * @master_xfer: deprecated, use @xfer + * @master_xfer_atomic: deprecated, use @xfer_atomic + * @reg_slave: deprecated, use @reg_target + * @unreg_slave: deprecated, use @unreg_target + * * * The following structs are for those who like to implement new bus drivers: * i2c_algorithm is the interface to a class of hardware solutions which can * be addressed using the same bus algorithms - i.e. bit-banging or the PCF8584 * to name two of the most common. * - * The return codes from the ``master_xfer{_atomic}`` fields should indicate the + * The return codes from the ``xfer{_atomic}`` fields should indicate the * type of error code that occurred during the transfer, as documented in the * Kernel Documentation file Documentation/i2c/fault-codes.rst. Otherwise, the * number of messages executed should be returned. */ struct i2c_algorithm { /* - * If an adapter algorithm can't do I2C-level access, set master_xfer + * If an adapter algorithm can't do I2C-level access, set xfer * to NULL. If an adapter algorithm can do SMBus access, set * smbus_xfer. If set to NULL, the SMBus protocol is simulated * using common I2C messages. * - * master_xfer should return the number of messages successfully + * xfer should return the number of messages successfully * processed, or a negative value on error */ - int (*master_xfer)(struct i2c_adapter *adap, struct i2c_msg *msgs, - int num); - int (*master_xfer_atomic)(struct i2c_adapter *adap, + union { + int (*xfer)(struct i2c_adapter *adap, struct i2c_msg *msgs, + int num); + int (*master_xfer)(struct i2c_adapter *adap, struct i2c_msg *msgs, + int num); + }; + union { + int (*xfer_atomic)(struct i2c_adapter *adap, struct i2c_msg *msgs, int num); + int (*master_xfer_atomic)(struct i2c_adapter *adap, + struct i2c_msg *msgs, int num); + }; int (*smbus_xfer)(struct i2c_adapter *adap, u16 addr, unsigned short flags, char read_write, u8 command, int size, union i2c_smbus_data *data); @@ -563,8 +577,14 @@ struct i2c_algorithm { u32 (*functionality)(struct i2c_adapter *adap); #if IS_ENABLED(CONFIG_I2C_SLAVE) - int (*reg_slave)(struct i2c_client *client); - int (*unreg_slave)(struct i2c_client *client); + union { + int (*reg_target)(struct i2c_client *client); + int (*reg_slave)(struct i2c_client *client); + }; + union { + int (*unreg_target)(struct i2c_client *client); + int (*unreg_slave)(struct i2c_client *client); + }; #endif }; |