summaryrefslogtreecommitdiff
path: root/include/linux/misc
diff options
context:
space:
mode:
authorPrathima <Prathima.Lk@amd.com>2026-07-10 16:46:37 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-07-17 15:50:48 +0200
commitd4f8babf8e8ffb8cd75d12d1003d2a2c17a53420 (patch)
treee2eb0f0becd6c303a8b9d5bccdaa0d2a7165939f /include/linux/misc
parent54a7848c24a5e786d25b209f61d3c86528bdce62 (diff)
downloadlinux-next-d4f8babf8e8ffb8cd75d12d1003d2a2c17a53420.tar.gz
linux-next-d4f8babf8e8ffb8cd75d12d1003d2a2c17a53420.zip
hwmon/misc: amd-sbi: Move sbtsi register transfer to core abstraction
Move the I2C read/write byte operations from the sbtsi hwmon driver into a common sbtsi_xfer() function in tsi-core.c. This decouples the hwmon sensor driver from the underlying bus transport, preparing for I3C support in a subsequent patch. This patch does not introduce any functional changes. The updates are limited to code organization/cleanup and should not affect the runtime behavior of the driver Reviewed-by: Akshay Gupta <Akshay.Gupta@amd.com> Signed-off-by: Prathima <Prathima.Lk@amd.com> Acked-by: Guenter Roeck <linux@roeck-us.net> Link: https://patch.msgid.link/20260710111642.850022-4-Akshay.Gupta@amd.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/misc')
-rw-r--r--include/linux/misc/tsi.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/misc/tsi.h b/include/linux/misc/tsi.h
index befdc2d14160..2d2709f1ff32 100644
--- a/include/linux/misc/tsi.h
+++ b/include/linux/misc/tsi.h
@@ -31,4 +31,17 @@ struct sbtsi_data {
#define AMD_SBTSI_ADEV "amd-sbtsi"
#define AMD_SBTSI_AUX_HWMON "temp-sensor"
+/**
+ * sbtsi_xfer - Perform a register read or write transfer on an AMD SB-TSI device.
+ *
+ * @data: Pointer to the sbtsi_data structure containing the device context
+ * @reg: Register address to access.
+ * @val: Pointer to the value to read into or write from.
+ * @is_read: If true, performs a read transfer and stores the result in @val.
+ * If false, performs a write transfer using the value in @val.
+ *
+ * Returns 0 on success, or a negative error code on failure.
+ */
+int sbtsi_xfer(struct sbtsi_data *data, u8 reg, u8 *val, bool is_read);
+
#endif /* _LINUX_MISC_TSI_H_ */