From: Nick Hawkins <[email protected]>
The GXP SoC can support up to 16 fans through the interface provided by
the CPLD. The fans speeds are controlled via a pwm value 0-255. The fans
are also capable of reporting if they have failed to the CPLD which in
turn reports the status to the GXP SoC. Based on previous feedback the
registers required for fan control have been regmaped individualy to fan
driver. Specifically these registers are the function 2 registers and the
programmable logic registers from the CPLD. Additionally in this patchset
there is support for the SPI driver which already exists as spi-gxp.c in
the SPI driver.
---
Changes since v2:
*Removed use of regmap in favor of __iomem
*Updated description on yaml documentation
*Simplified commit description on sysfs-class-hwmon
*Removed use of dev and hwmon_dev from drvdata structure
*Fixed missing breaks in switch statements
*Added check for pwm values less than 0
*Removed regmap and slab header file includes
Changes since v1:
*Renamed fn2reg to fn2 in dtsi file and documentation
*Renamed plreg to pl in dtsi file and documentation
*Renamed fanctrl to fan-controller in dtsi file and documentation
*Adjusted base register range for fan ctrl in dtsi
*Changed commit description on fan-ctrl device-tree binding
*Changed register description on fan-ctrl device-tree binding
*Changed number of supported fans from 16 to 8 in driver code and
documentation
*Modified commit description of fan code
*Removed support for fan[0-15]_input
*Removed PWM defines in driver code
*Added gxp-fan-ctrl to hwmon's index.rst
*Removed mutex in driver code
*Added fan_enable support in fan code and documentation
*Fixed comment in driver code presents -> present
*Removed unecessary include files in fan code
*Added comments to describe what power state is and
calculations for accessing plreg in fan code
*Removed use of variable offsets in fan code
*Fixed GPL header in fan code
*Changed module description for fan controller
*Added kfree in case of failure to initialize driver
*Added missing yaml file to MAINTAINERS*** SUBJECT HERE ***
Nick Hawkins (6):
hwmon: (gxp-fan-ctrl) Add GXP fan controller
ABI: sysfs-class-hwmon: add a description for fanY_fault
dt-bindings: hwmon: Add hpe,gxp-fan-ctrl
ARM: dts: add GXP Support for fans and SPI
ARM: multi_v7_defconfig: Add GXP Fan and SPI support
MAINTAINERS: add gxp fan controller and documents
Documentation/ABI/testing/sysfs-class-hwmon | 9 +
.../bindings/hwmon/hpe,gxp-fan-ctrl.yaml | 45 ++++
Documentation/hwmon/gxp-fan-ctrl.rst | 28 ++
Documentation/hwmon/index.rst | 1 +
MAINTAINERS | 3 +
arch/arm/boot/dts/hpe-bmc-dl360gen10.dts | 58 ++++
arch/arm/boot/dts/hpe-gxp.dtsi | 64 +++--
arch/arm/configs/multi_v7_defconfig | 2 +
drivers/hwmon/Kconfig | 9 +
drivers/hwmon/Makefile | 1 +
drivers/hwmon/gxp-fan-ctrl.c | 254 ++++++++++++++++++
11 files changed, 455 insertions(+), 19 deletions(-)
create mode 100644 Documentation/devicetree/bindings/hwmon/hpe,gxp-fan-ctrl.yaml
create mode 100644 Documentation/hwmon/gxp-fan-ctrl.rst
create mode 100644 drivers/hwmon/gxp-fan-ctrl.c
--
2.17.1
From: Nick Hawkins <[email protected]>
Create documentation for the binding to support control of the fans on
HPE platforms.
Signed-off-by: Nick Hawkins <[email protected]>
---
.../bindings/hwmon/hpe,gxp-fan-ctrl.yaml | 45 +++++++++++++++++++
1 file changed, 45 insertions(+)
create mode 100644 Documentation/devicetree/bindings/hwmon/hpe,gxp-fan-ctrl.yaml
diff --git a/Documentation/devicetree/bindings/hwmon/hpe,gxp-fan-ctrl.yaml b/Documentation/devicetree/bindings/hwmon/hpe,gxp-fan-ctrl.yaml
new file mode 100644
index 000000000000..4a52aac6be72
--- /dev/null
+++ b/Documentation/devicetree/bindings/hwmon/hpe,gxp-fan-ctrl.yaml
@@ -0,0 +1,45 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/hwmon/hpe,gxp-fan-ctrl.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: HPE GXP Fan Controller
+
+maintainers:
+ - Nick Hawkins <[email protected]>
+
+description: |
+ The HPE GXP fan controller controls the fans through an external CPLD
+ device that connects to the fans.
+
+properties:
+ compatible:
+ const: hpe,gxp-fan-ctrl
+
+ reg:
+ items:
+ - description: Fan controller PWM
+ - description: Programmable logic
+ - description: Function 2
+
+ reg-names:
+ items:
+ - const: base
+ - const: pl
+ - const: fn2
+
+required:
+ - compatible
+ - reg
+ - reg-names
+
+additionalProperties: false
+
+examples:
+ - |
+ fan-controller@1000c00 {
+ compatible = "hpe,gxp-fan-ctrl";
+ reg = <0x1000c00 0x200>, <0xd1000000 0xff>, <0x80200000 0x100000>;
+ reg-names = "base", "pl", "fn2";
+ };
--
2.17.1
On Wed, 30 Nov 2022 14:08:43 -0600, [email protected] wrote:
> From: Nick Hawkins <[email protected]>
>
> Create documentation for the binding to support control of the fans on
> HPE platforms.
>
> Signed-off-by: Nick Hawkins <[email protected]>
> ---
> .../bindings/hwmon/hpe,gxp-fan-ctrl.yaml | 45 +++++++++++++++++++
> 1 file changed, 45 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/hwmon/hpe,gxp-fan-ctrl.yaml
>
Reviewed-by: Rob Herring <[email protected]>
On Wed, Nov 30, 2022 at 02:08:43PM -0600, [email protected] wrote:
> From: Nick Hawkins <[email protected]>
>
> Create documentation for the binding to support control of the fans on
> HPE platforms.
>
> Signed-off-by: Nick Hawkins <[email protected]>
> Reviewed-by: Rob Herring <[email protected]>
For my reference:
Reviewed-by: Guenter Roeck <[email protected]>
> ---
> .../bindings/hwmon/hpe,gxp-fan-ctrl.yaml | 45 +++++++++++++++++++
> 1 file changed, 45 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/hwmon/hpe,gxp-fan-ctrl.yaml
>
> diff --git a/Documentation/devicetree/bindings/hwmon/hpe,gxp-fan-ctrl.yaml b/Documentation/devicetree/bindings/hwmon/hpe,gxp-fan-ctrl.yaml
> new file mode 100644
> index 000000000000..4a52aac6be72
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/hwmon/hpe,gxp-fan-ctrl.yaml
> @@ -0,0 +1,45 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/hwmon/hpe,gxp-fan-ctrl.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: HPE GXP Fan Controller
> +
> +maintainers:
> + - Nick Hawkins <[email protected]>
> +
> +description: |
> + The HPE GXP fan controller controls the fans through an external CPLD
> + device that connects to the fans.
> +
> +properties:
> + compatible:
> + const: hpe,gxp-fan-ctrl
> +
> + reg:
> + items:
> + - description: Fan controller PWM
> + - description: Programmable logic
> + - description: Function 2
> +
> + reg-names:
> + items:
> + - const: base
> + - const: pl
> + - const: fn2
> +
> +required:
> + - compatible
> + - reg
> + - reg-names
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + fan-controller@1000c00 {
> + compatible = "hpe,gxp-fan-ctrl";
> + reg = <0x1000c00 0x200>, <0xd1000000 0xff>, <0x80200000 0x100000>;
> + reg-names = "base", "pl", "fn2";
> + };