All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC linux v2 0/2] drivers/hwmon: OCC hwmon driver restructuring
@ 2016-10-11 21:42 eajames.ibm
  2016-10-12  5:24 ` Joel Stanley
  0 siblings, 1 reply; 2+ messages in thread
From: eajames.ibm @ 2016-10-11 21:42 UTC (permalink / raw)
  To: openbmc; +Cc: Edward A. James

From: "Edward A. James" <eajames@us.ibm.com>

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/hwmon: Move OCC driver to occ directory"
- Move the existing OCC hwmon driver to it's own directory.
- Edit makefiles and Kconfig accordingly to preserve the build.

Patch 2: "drivers/hwmon: Isolate bus transfer protocol"
- Copy i2c related code into occ_i2c.c and simplify.
- Copy common platform code into occ.c; more functions can be placed here
  later.
- Change core functions to accept OCC driver data parameter instead of
  device pointer.

Edward A. James (2):
  drivers/hwmon: Move OCC driver to occ directory
  drivers/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        |   47 ++
 drivers/hwmon/occ/occ_i2c.c    |  150 +++++
 drivers/hwmon/occ/power8_occ.c | 1055 +++++++++++++++++++++++++++++++++
 drivers/hwmon/occ/power8_occ.h |   25 +
 drivers/hwmon/power8_occ_i2c.c | 1254 ----------------------------------------
 10 files changed, 1422 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

-- 
1.9.1

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [RFC linux v2 0/2] drivers/hwmon: OCC hwmon driver restructuring
  2016-10-11 21:42 [RFC linux v2 0/2] drivers/hwmon: OCC hwmon driver restructuring eajames.ibm
@ 2016-10-12  5:24 ` Joel Stanley
  0 siblings, 0 replies; 2+ messages in thread
From: Joel Stanley @ 2016-10-12  5:24 UTC (permalink / raw)
  To: eajames.ibm, Edward A. James
  Cc: OpenBMC Maillist, Jeremy Kerr, Christopher Bostic

Hey,

On Wed, Oct 12, 2016 at 8:42 AM,  <eajames.ibm@gmail.com> wrote:
> From: "Edward A. James" <eajames@us.ibm.com>
>
> 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.

Cool. I think you should consider sending these patches as a series
that introduce the driver from scratch. You can achieve this by
reverting the patch that adds the code Yi wrote, and adding your
cleaned up version as a series of small patches.

This will be one of our first client drivers for Jeremy and Chris' fsi
bus. I recommend taking a read of the current state of the client
driver API, and keeping that in mind when you write the i2c version.

Cheers,

Joel


>
> 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/hwmon: Move OCC driver to occ directory"
> - Move the existing OCC hwmon driver to it's own directory.
> - Edit makefiles and Kconfig accordingly to preserve the build.
>
> Patch 2: "drivers/hwmon: Isolate bus transfer protocol"
> - Copy i2c related code into occ_i2c.c and simplify.
> - Copy common platform code into occ.c; more functions can be placed here
>   later.
> - Change core functions to accept OCC driver data parameter instead of
>   device pointer.
>
> Edward A. James (2):
>   drivers/hwmon: Move OCC driver to occ directory
>   drivers/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        |   47 ++
>  drivers/hwmon/occ/occ_i2c.c    |  150 +++++
>  drivers/hwmon/occ/power8_occ.c | 1055 +++++++++++++++++++++++++++++++++
>  drivers/hwmon/occ/power8_occ.h |   25 +
>  drivers/hwmon/power8_occ_i2c.c | 1254 ----------------------------------------
>  10 files changed, 1422 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
>
> --
> 1.9.1
>
> _______________________________________________
> openbmc mailing list
> openbmc@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/openbmc

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-10-12  5:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-11 21:42 [RFC linux v2 0/2] drivers/hwmon: OCC hwmon driver restructuring eajames.ibm
2016-10-12  5:24 ` Joel Stanley

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.