drivers: OCC hwmon driver restructuring
cover drivers: OCC hwmon driver restructuring
From: "Edward A. James" <[email protected]>
This patchset is provided to refactor the Power8 OCC hwmon driver. There are a number of issues with the existing driver. Firstly, i2c access was embedded throughout the driver. Secondly, there is no way to easily add different versions of the OCC.
This patchset addresses the first issue by abstracting the bus transfer protocol into a modular structure. In this way, any low level transfer method may be easily implemented.
The second issue is addressed by separating the "version specific" code for the OCC and the common hwmon code. This task is not yet complete, but the general structure is in place. Ultimately, different OCC versions could be probed up using the device tree.
Patch 1: "drivers: move OCC hwmon driver to occ directory"
* Move the Power8 OCC hwmon driver into it's own directory. Now we can have multiple files and avoid cluttering up the main hwmon directory.
Patch 2: "drivers: occ hwmon - isolate bus transfer protocol"
* modify drivers/hwmon Makefile and Kconfig
* create i2c layer
* move some common code out of the Power8 OCC specific file
* clean up Power8 OCC driver
Edward A. James (2):
drivers: move OCC hwmon driver to occ directory
drivers: occ hwmon - isolate bus transfer protocol
drivers/hwmon/Kconfig | 13 +- drivers/hwmon/Makefile | 2 +- drivers/hwmon/occ/Kconfig | 15 + drivers/hwmon/occ/Makefile | 1 + drivers/hwmon/occ/occ.c | 127 ++++ drivers/hwmon/occ/occ.h | 50 ++ drivers/hwmon/occ/occ_i2c.c | 191 ++++++ drivers/hwmon/occ/power8_occ.c | 1048 +++++++++++++++++++++++++++++++++ drivers/hwmon/occ/power8_occ.h | 24 + drivers/hwmon/power8_occ_i2c.c | 1254 ---------------------------------------- 10 files changed, 1458 insertions(+), 1267 deletions(-) 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 delete mode 100644 drivers/hwmon/power8_occ_i2c.c
Signature · 1 line
1.9.1
Hi Eddie,
Quoted 7 lines · On Mon, 2016-10-10 at 14:06 -0500, [email protected] wrote:
From: "Edward A. James" <[email protected]>
This patchset is provided to refactor the Power8 OCC hwmon driver. There are a number of issues with the existing driver. Firstly, i2c access was embedded throughout the driver. Secondly, there is no way to easily add different versions of the OCC.
Quoted 8 lines
This patchset addresses the first issue by abstracting the bus transfer protocol into a modular structure. In this way, any low level transfer method may be easily implemented.
The second issue is addressed by separating the "version specific" code for the OCC and the common hwmon code. This task is not yet complete, but the general structure is in place. Ultimately, different OCC versions could be probed up using the device tree.
Nice description.
As a side note, the associated patches didn't appear to thread under the cover letter. git send-email should sort that out for you by default, unless you added some extra switches (--no-thread)?
Quoted 10 lines
Patch 1: "drivers: move OCC hwmon driver to occ directory"
* Move the Power8 OCC hwmon driver into it's own directory. Now we can have multiple files and avoid cluttering up the main hwmon directory.
Patch 2: "drivers: occ hwmon - isolate bus transfer protocol"
* modifydrivers/hwmonMakefileandKconfig
* create i2c layer
* move some common code out of the Power8 OCC specific file
* clean up Power8 OCC driver
Four bullet points for one patch concerns me.
Andrew
Quoted 25 lines
Edward A. James (2):
drivers: move OCC hwmon driver to occ directory
drivers: occ hwmon - isolate bus transfer protocoldrivers/hwmon/Kconfig | 13 +-
drivers/hwmon/Makefile | 2 +-
drivers/hwmon/occ/Kconfig | 15 +
drivers/hwmon/occ/Makefile | 1 +
drivers/hwmon/occ/occ.c | 127 ++++
drivers/hwmon/occ/occ.h | 50 ++
drivers/hwmon/occ/occ_i2c.c | 191 ++++++drivers/hwmon/occ/power8_occ.c | 1048 +++++++++++++++++++++++++++++++++ drivers/hwmon/occ/power8_occ.h | 24 + drivers/hwmon/power8_occ_i2c.c | 1254 ---------------------------------------- 10 files changed, 1458 insertions(+), 1267 deletions(-)create mode 100644
drivers/hwmon/occ/Kconfigcreate mode 100644drivers/hwmon/occ/Makefilecreate mode 100644drivers/hwmon/occ/occ.ccreate mode 100644drivers/hwmon/occ/occ.hcreate mode 100644drivers/hwmon/occ/occ_i2c.ccreate mode 100644drivers/hwmon/occ/power8_occ.ccreate mode 100644drivers/hwmon/occ/power8_occ.hdelete mode 100644drivers/hwmon/power8_occ_i2c.c