Skip to contentSkip to conversation

hwmon: Driver for TI TPS2483 hotswap controller

PATCH In review Philby John 2 participants 2 messages Sep 7, 2020 Hardware monitoring

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hwmon: Driver for TI TPS2483 hotswap controller

Adds support for Texas Instruments TPS2483 Series
Hot Swap Voltage Controller. The driver in its current form supports reading Shunt Voltage, Bus Voltage, Power and Current.

Since TPS2483 can be configured to a particular slave address based on the state of A0 and A1 pins, instantiation is done manually. For eg:-
echo tps2483 0x40 > /sys/bus/i2c/devices/i2c-1/new_device

---
 drivers/hwmon/Kconfig   |  11 +++
 drivers/hwmon/Makefile  |   1 +
 drivers/hwmon/tps2483.c | 174 ++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 186 insertions(+)
 create mode 100644 drivers/hwmon/tps2483.c
drivers/hwmon/Kconfig +11 -0
index 8dc28b26916e..9e51c25f695e 100644
@@ -1852,6 +1852,17 @@ config SENSORS_TMP513
 	  This driver can also be built as a module. If so, the module
 	  will be called tmp513.
 
+config SENSORS_TPS2483
+	tristate "Texas Instruments TPS2483"
+	depends on I2C
+	select REGMAP_I2C
+	help
+	  If you say yes here you get support for Texas Instruments TPS2483
+	  Hot Swap Controller I2C interface.
+
+	  This driver can also be built as a module. If so, the module will
+	  be called tps2483.
+
 config SENSORS_VEXPRESS
 	tristate "Versatile Express"
 	depends on VEXPRESS_CONFIG
drivers/hwmon/Makefile +1 -0
index a8f4b35b136b..2f1551c77a4c 100644
@@ -179,6 +179,7 @@ obj-$(CONFIG_SENSORS_TMP108)	+= tmp108.o
 obj-$(CONFIG_SENSORS_TMP401)	+= tmp401.o
 obj-$(CONFIG_SENSORS_TMP421)	+= tmp421.o
 obj-$(CONFIG_SENSORS_TMP513)	+= tmp513.o
+obj-$(CONFIG_SENSORS_TPS2483)   += tps2483.o
 obj-$(CONFIG_SENSORS_VEXPRESS)	+= vexpress-hwmon.o
 obj-$(CONFIG_SENSORS_VIA_CPUTEMP)+= via-cputemp.o
 obj-$(CONFIG_SENSORS_VIA686A)	+= via686a.o
drivers/hwmon/tps2483.c new file +174 -0

174 lines not on this page · raw message

Signature · 1 line
2.13.6
maintainer
#1 lore raw
Quoted 9 lines · Philby John

Adds support for Texas Instruments TPS2483 Series
Hot Swap Voltage Controller. The driver in its current form supports reading Shunt Voltage, Bus Voltage, Power and Current.

Since TPS2483 can be configured to a particular slave address based on the state of A0 and A1 pins, instantiation is done manually. For eg:-
echo tps2483 0x40 > /sys/bus/i2c/devices/i2c-1/new_device

Please use the devm_hwmon_device_register_with_info() API for new drivers. Also, please read and follow Documentation/hwmon/submitting-patches.rst, especially the guidance for new drivers.

Thanks,
Guenter