hwmon: Add OCC driver stub
RFC v4 2/6 hwmon: Add OCC driver stub
From: "Edward A. James" <[email protected]>
This change creates the structure for the Power CPU on-chip controller (OCC) driver. Also add i2c documentation.
Signed-off-by Edward A. James <[email protected]>
--- .../devicetree/bindings/i2c/i2c-ibm-occ.txt | 13 ++ 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 ++++ 10 files changed, 440 insertions(+) create mode 100644 Documentation/devicetree/bindings/i2c/i2c-ibm-occ.txt 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
Documentation/devicetree/bindings/i2c/i2c-ibm-occ.txt new file +13 -0
@@ -0,0 +1,13 @@ +HWMON i2c driver for IBM POWER CPU OCC (On Chip Controller) + +Required properties: + - compatible: must be "ibm,power8-occ-i2c" + - reg: physical address + +Example: +i2c3: i2c-bus@100 { + occ@50 { + compatible = "ibm,occ-i2c"; + reg = <0x50>; + }; +};
drivers/hwmon/Kconfig +2 -0
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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