Skip to contentSkip to conversation

HWMON: Add OCC hwmon driver

PATCH New Yi Li 1 participant 1 message Jan 5, 2016

Subsystems (3)
lore
Share & tools
lore

Yi Li

author
#0 lore raw

PATCH v4 1/1 HWMON: Add OCC hwmon driver

Hi Joel,

I resend the clean patch to the list using git format-patch. Please have a look.

Thanks,
-adam

This patch add a hwmon driver for BMC to monitor POWER CPU sensors via OCC (On-Chip-Controller).

Changes for this version:
1. Fixed checkpatch.pl warnings and errors.
2. Fixed issue from Joel Stanley's review
3. Add a new sysfs interface: '/sys/class/i2c-adaptor/i2c-x/x-yyyy/online', to notify the driver OCC is active.
4. Use device table to instantiate the occ-i2c device.

---
 arch/arm/boot/dts/aspeed-bmc-opp-barreleye.dts |   10 +
 arch/arm/boot/dts/aspeed-bmc-opp-palmetto.dts  |    7 +
 drivers/hwmon/Kconfig                          |   10 +
 drivers/hwmon/Makefile                         |    1 +
 drivers/hwmon/occ_i2c.c                        | 1339 ++++++++++++++++++++++++
 5 files changed, 1367 insertions(+)
 create mode 100644 drivers/hwmon/occ_i2c.c
arch/arm/boot/dts/aspeed-bmc-opp-barreleye.dts +10 -0
index 38a4fd0..a3518b0 100644
@@ -25,6 +25,16 @@
 						reg = <0x4a>;
 					};
 				};
+				i2c3: i2c-bus@100 {
+					occ@50 {
+						compatible = "ibm,occ-i2c";
+						reg = <0x50>;
+					};
+					occ@51 {
+						compatible = "ibm,occ-i2c";
+						reg = <0x51>;
+					};
+				};
 
 				i2c6: i2c-bus@1c0 {
 					nct7904@2d {
arch/arm/boot/dts/aspeed-bmc-opp-palmetto.dts +7 -0
index 92a7c77..45a032d 100644
@@ -29,6 +29,13 @@
 						reg = <0x4c>;
 					};
 				};
+
+				i2c3: i2c-bus@100 {
+					occ@50 {
+						compatible = "ibm,occ-i2c";
+						reg = <0x50>;
+					};
+				};
 			};
 		};
 	};
drivers/hwmon/Kconfig +10 -0
index e13c902..7c74854 100644
@@ -1167,6 +1167,16 @@ config SENSORS_NCT7904
 	  This driver can also be built as a module.  If so, the module
 	  will be called nct7904.
 
+config SENSORS_OCC
+	tristate "OCC sensor BMC driver"
+	depends on I2C
+	help
+	  If you say yes here you get support for BMC to monitor IBM
+	  Power CPU sensors via the On-Chip-Controller (OCC).
+
+	  This driver can aslo be built as a module. If so, the module
+	  will be called occ_i2c.
+
 config SENSORS_PCF8591
 	tristate "Philips PCF8591 ADC/DAC"
 	depends on I2C
drivers/hwmon/Makefile +1 -0
index 9e0f3dd..d6fa923 100644
@@ -123,6 +123,7 @@ obj-$(CONFIG_SENSORS_NCT6775)	+= nct6775.o
 obj-$(CONFIG_SENSORS_NCT7802)	+= nct7802.o
 obj-$(CONFIG_SENSORS_NCT7904)	+= nct7904.o
 obj-$(CONFIG_SENSORS_NTC_THERMISTOR)	+= ntc_thermistor.o
+obj-$(CONFIG_SENSORS_OCC)	+= occ_i2c.o
 obj-$(CONFIG_SENSORS_PC87360)	+= pc87360.o
 obj-$(CONFIG_SENSORS_PC87427)	+= pc87427.o
 obj-$(CONFIG_SENSORS_PCF8591)	+= pcf8591.o
drivers/hwmon/occ_i2c.c new file +1339 -0

1,339 lines not on this page · raw message

Signature · 1 line
1.9.1