Skip to contentSkip to conversation

hwmon: (pmbus): Add POWER System power supply driver

PATCH Superseded Eddie James 1 participant 5 messages Aug 10, 2017

Subsystems (5)

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v4 cover hwmon: (pmbus): Add POWER System power supply driver

From: "Edward A. James" <[email protected]>

This series adds a hwmon pmbus driver for a POWER System power supply. The core monitoring functionality is provided by pmbus.

This series depends on the pmbus core extensions for debugfs recently submitted to the mailing list:
http://patchwork.ozlabs.org/patch/800350/
http://patchwork.ozlabs.org/patch/800351/
http://patchwork.ozlabs.org/patch/800352/
http://patchwork.ozlabs.org/patch/800353/

These devices should be auto-probed on the I2C bus, so I added them to the witherspoon device tree.

Edward A. James (4):
dt-bindings: i2c: Document the IBM POWER system power supply device
hwmon: (pmbus): Add POWER system power supply driver
Documentation: hwmon: Add POWER system power supply documentation
ARM: dts: aspeed: Witherspoon: Add power supplies to i2c bus

 .../devicetree/bindings/i2c/ibm,power-ps.txt       |  21 +++
 Documentation/hwmon/powerps                        |  54 ++++++++
 arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts   |  10 ++
 drivers/hwmon/pmbus/Kconfig                        |  10 ++
 drivers/hwmon/pmbus/Makefile                       |   1 +
 drivers/hwmon/pmbus/powerps.c                      | 144 +++++++++++++++++++++
 6 files changed, 240 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/i2c/ibm,power-ps.txt
 create mode 100644 Documentation/hwmon/powerps
 create mode 100644 drivers/hwmon/pmbus/powerps.c
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH v4 1/4 dt-bindings: i2c: Document the IBM POWER system power supply device

From: "Edward A. James" <[email protected]>

---
 .../devicetree/bindings/i2c/ibm,power-ps.txt        | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/i2c/ibm,power-ps.txt
Documentation/devicetree/bindings/i2c/ibm,power-ps.txt new file +21 -0
new file mode 100644
index 0000000..2ea8ea2
@@ -0,0 +1,21 @@
+Device-tree bindings for IBM POWER system power supplies
+--------------------------------------------------------
+
+Required properties:
+ - compatible = "ibm,power-ps";
+ - reg = < I2C bus address >;		: Address of the power supply on the
+					  I2C bus.
+
+Example:
+
+    i2c-bus@100 {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        #interrupt-cells = <1>;
+        < more properties >
+
+        power_ps@68 {
+            compatible = "ibm,power-ps";
+            reg = <0x68>;
+        };
+    };
Signature · 1 line
1.8.3.1
#2 lore raw

PATCH v4 2/4 hwmon: (pmbus): Add POWER system power supply driver

In reply to Eddie James

From: "Edward A. James" <[email protected]>

Add the driver to monitor POWER system power supplies with hwmon over pmbus.

---
 drivers/hwmon/pmbus/Kconfig   |  10 +++
 drivers/hwmon/pmbus/Makefile  |   1 +
 drivers/hwmon/pmbus/powerps.c | 144 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 155 insertions(+)
 create mode 100644 drivers/hwmon/pmbus/powerps.c
drivers/hwmon/pmbus/Kconfig +10 -0
index 04f6baa..7074f8d 100644
@@ -135,6 +135,16 @@ config SENSORS_MAX8688
 	  This driver can also be built as a module. If so, the module will
 	  be called max8688.
 
+config SENSORS_POWERPS
+	tristate "IBM POWER System Power Supply"
+	default n
+	help
+	  If you say yes here you get hardware monitoring support for the IBM
+	  POWER system power supply.
+
+	  This driver can also be built as a module. If so, the module will
+	  be called powerps.
+
 config SENSORS_TPS40422
 	tristate "TI TPS40422"
 	default n
drivers/hwmon/pmbus/Makefile +1 -0
index 663801c..009aefa 100644
@@ -14,6 +14,7 @@ obj-$(CONFIG_SENSORS_MAX20751)	+= max20751.o
 obj-$(CONFIG_SENSORS_MAX31785)	+= max31785.o
 obj-$(CONFIG_SENSORS_MAX34440)	+= max34440.o
 obj-$(CONFIG_SENSORS_MAX8688)	+= max8688.o
+obj-$(CONFIG_SENSORS_POWERPS)	+= powerps.o
 obj-$(CONFIG_SENSORS_TPS40422)	+= tps40422.o
 obj-$(CONFIG_SENSORS_UCD9000)	+= ucd9000.o
 obj-$(CONFIG_SENSORS_UCD9200)	+= ucd9200.o
drivers/hwmon/pmbus/powerps.c new file +144 -0

144 lines not on this page · raw message

Signature · 1 line
1.8.3.1
#3 lore raw

PATCH v4 3/4 Documentation: hwmon: Add POWER system power supply documentation

In reply to Eddie James

From: "Edward A. James" <[email protected]>

---
 Documentation/hwmon/powerps | 54 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)
 create mode 100644 Documentation/hwmon/powerps
Documentation/hwmon/powerps new file +54 -0
new file mode 100644
index 0000000..a4fbe92
@@ -0,0 +1,54 @@
+Kernel driver powerps
+=====================
+
+Supported chips:
+  * POWER system power supply
+
+Author: Eddie James <[email protected]>
+
+Description
+-----------
+
+This driver supports POWER system power supplies. This driver is a client
+to the core PMBus driver.
+
+Usage Notes
+-----------
+
+This driver should auto-detect devices. In the event that it does not, you will
+have to instantiate the devices explicitly. Please see
+Documentation/i2c/instantiating-devices for details.
+
+Sysfs entries
+-------------
+
+The following attributes are supported:
+
+curr1_alarm		Output current over-current fault.
+curr1_input		Measured output current in mA.
+curr1_label		"iout1"
+
+fan1_alarm		Fan 1 warning.
+fan1_fault		Fan 1 fault.
+fan1_input		Fan 1 speed in RPM.
+fan2_alarm		Fan 2 warning.
+fan2_fault		Fan 2 fault.
+fan2_input		Fan 2 speed in RPM.
+
+in1_alarm		Input voltage under-voltage fault.
+in1_input		Measured input voltage in mV.
+in1_label		"vin"
+in2_alarm		Output voltage over-voltage fault.
+in2_input		Measured output voltage in mV.
+in2_label		"vout1"
+
+power1_alarm		Input fault.
+power1_input		Measured input power in uW.
+power1_label		"pin"
+
+temp1_alarm		PSU inlet ambient temperature over-temperature fault.
+temp1_input		Measured PSU inlet ambient temp in millidegrees C.
+temp2_alarm		Secondary rectifier temp over-temperature fault.
+temp2_input		Measured secondary rectifier temp in millidegrees C.
+temp3_alarm		ORing FET temperature over-temperature fault.
+temp3_input		Measured ORing FET temperature in millidegrees C.
Signature · 1 line
1.8.3.1
#4 lore raw

PATCH v4 4/4 ARM: dts: aspeed: Witherspoon: Add power supplies to i2c bus

In reply to Eddie James

From: "Edward A. James" <[email protected]>

---
 arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/arm/boot/dts/aspeed-bmc-opp-witherspoon.dts +10 -0
index 9ab8e46..841d9ab 100644
@@ -417,6 +417,16 @@
 			type = <PCA955X_TYPE_GPIO>;
 		};
 	};
+
+	power_ps@68 {
+		compatible = "ibm,power-ps"
+		reg = <0x68>;
+	};
+
+	power_ps@69 {
+		compatible = "ibm,power-ps";
+		reg = <0x69>;
+	};
 };
 
 &i2c4 {
Signature · 1 line
1.8.3.1