Skip to contentSkip to conversation

hwmon: Add OCC hwmon driver stub

RFC Superseded [email protected] 1 participant 1 message Oct 12, 2016 Hardware monitoring

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

RFC v3 2/4 hwmon: Add OCC hwmon driver stub

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

This change creates the structure for the Power CPU on-chip controller (OCC) driver.

---
 drivers/hwmon/Kconfig          |   2 +
 drivers/hwmon/Makefile         |   1 +
 drivers/hwmon/occ/Kconfig      |  15 +++++
 drivers/hwmon/occ/Makefile     |   1 +
 drivers/hwmon/occ/occ.c        | 128 +++++++++++++++++++++++++++++++++++
 drivers/hwmon/occ/occ.h        |  47 +++++++++++++
 drivers/hwmon/occ/occ_i2c.c    | 150 +++++++++++++++++++++++++++++++++++++++++
 drivers/hwmon/occ/power8_occ.c |  58 ++++++++++++++++
 drivers/hwmon/occ/power8_occ.h |  25 +++++++
 9 files changed, 427 insertions(+)
 create mode 100644 drivers/hwmon/occ/Kconfig
 create mode 100644 drivers/hwmon/occ/Makefile
 create mode 100644 drivers/hwmon/occ/occ.c
 create mode 100644 drivers/hwmon/occ/occ.h
 create mode 100644 drivers/hwmon/occ/occ_i2c.c
 create mode 100644 drivers/hwmon/occ/power8_occ.c
 create mode 100644 drivers/hwmon/occ/power8_occ.h
drivers/hwmon/Kconfig +2 -0
index 367496c..f4b0180 100644
@@ -1226,6 +1226,8 @@ config SENSORS_NSA320
 	  This driver can also be built as a module. If so, the module
 	  will be called nsa320-hwmon.
 
+source drivers/hwmon/occ/Kconfig
+
 config SENSORS_PCF8591
 	tristate "Philips PCF8591 ADC/DAC"
 	depends on I2C
drivers/hwmon/Makefile +1 -0
index d7ccb02..ab1c121 100644
@@ -165,6 +165,7 @@ obj-$(CONFIG_SENSORS_WM831X)	+= wm831x-hwmon.o
 obj-$(CONFIG_SENSORS_WM8350)	+= wm8350-hwmon.o
 
 obj-$(CONFIG_PMBUS)		+= pmbus/
+obj-$(CONFIG_OCC)		+= occ/
 
 ccflags-$(CONFIG_HWMON_DEBUG_CHIP) := -DDEBUG
 
drivers/hwmon/occ/Kconfig new file +15 -0
new file mode 100644
index 0000000..628fd6e
@@ -0,0 +1,15 @@
+#
+# On Chip Controller configuration
+#
+
+config OCC
+	tristate "On Chip Controller driver"
+	help
+	  If you say yes here you get support to monitor Power CPU
+	  sensors via the On Chip Controller (OCC).
+
+	  Generally this is used by management controllers such as a BMC
+	  on an OpenPower system.
+
+	  This driver can also be built as a module. If so, the module
+	  will be called occ.
drivers/hwmon/occ/Makefile new file +1 -0
new file mode 100644
index 0000000..05b5031
@@ -0,0 +1 @@
+obj-$(CONFIG_OCC) += occ.o occ_i2c.o power8_occ.o
drivers/hwmon/occ/occ.c new file +128 -0

128 lines not on this page · raw message

drivers/hwmon/occ/occ.h new file +47 -0

47 lines not on this page · raw message

drivers/hwmon/occ/occ_i2c.c new file +150 -0

150 lines not on this page · raw message

drivers/hwmon/occ/power8_occ.c new file +58 -0

58 lines not on this page · raw message

drivers/hwmon/occ/power8_occ.h new file +25 -0
new file mode 100644
index 0000000..7df6dc1
@@ -0,0 +1,25 @@
+/*
+ * power8_occ.h - Power8 OCC hwmon driver
+ *
+ * This file contains Power8 specific function prototypes
+ *
+ * Copyright 2016 IBM Corp.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __POWER8_OCC_H__
+#define __POWER8_OCC_H__
+
+int occ_init(struct occ_driver *driver);
+void occ_exit(struct occ_driver *driver);
+
+#endif /* __POWER8_OCC_H__ */
Signature · 1 line
1.9.1