]> git.ipfire.org Git - thirdparty/linux.git/commit
i2c: tegra: Add support for SW mutex register
authorKartik Rajput <kkartik@nvidia.com>
Tue, 18 Nov 2025 14:06:19 +0000 (19:36 +0530)
committerWolfram Sang <wsa+renesas@sang-engineering.com>
Wed, 14 Jan 2026 07:02:20 +0000 (08:02 +0100)
commit6077cfd716fbd4d1f2a3702e49ae8bf65c072685
tree5d7f2115a6738347c7d78e655003017083be8ca3
parent978b3ccbbac326cc5fe48c98a0440bdc79d9fd93
i2c: tegra: Add support for SW mutex register

Add support for SW mutex register introduced in Tegra264 to provide
an option to share the interface between multiple firmwares and/or
VMs. This involves following steps:

 - A firmware/OS writes its unique ID to the mutex REQUEST field.
 - Ownership is established when reading the GRANT field returns the
   same ID.
 - If GRANT shows a different non-zero ID, the firmware/OS retries
   until timeout.
 - After completing access, it releases the mutex by writing 0.

However, the hardware does not ensure any protection based on the
values. The driver/firmware should honor the peer who already holds
the mutex.

Signed-off-by: Kartik Rajput <kkartik@nvidia.com>
Signed-off-by: Akhil R <akhilrajeev@nvidia.com>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
drivers/i2c/busses/i2c-tegra.c