hwmon: (gpio-fan) allow to use alarm support alone from DT
Subsystems (3)
PATCH v2 1/1 hwmon: (gpio-fan) allow to use alarm support alone from DT
On some boards, such as the LaCie 2Big Network v2 or 2Big NAS (based on Marvell Kirkwood SoCs), an I2C fan controller is used but the alarm signal is wired to a separate GPIO. Unfortunately, the gpio-fan driver can't be used to handle GPIO alarm alone from DT: an error is returned if the "gpios" DT property is missing.
This patch allows to use the gpio-fan driver even if the "alarm-gpios" DT property is defined alone.
--- .../devicetree/bindings/gpio/gpio-fan.txt | 6 ++- drivers/hwmon/gpio-fan.c | 44 +++++++++++----------- 2 files changed, 27 insertions(+), 23 deletions(-)
v2 change:
- Fix sentence in binding document about having at least one of the "gpios" or "alarm-gpios" properties set.
Documentation/devicetree/bindings/gpio/gpio-fan.txt +4 -2
@@ -2,16 +2,18 @@ Bindings for fan connected to GPIO lines Required properties: - compatible : "gpio-fan" + +Optional properties: - gpios: Specifies the pins that map to bits in the control value, ordered MSB-->LSB. - gpio-fan,speed-map: A mapping of possible fan RPM speeds and the control value that should be set to achieve them. This array must have the RPM values in ascending order. - -Optional properties: - alarm-gpios: This pin going active indicates something is wrong with the fan, and a udev event will be fired. +Note: At least one the "gpios" or "alarm-gpios" properties must be set. + Examples: gpio_fan {
drivers/hwmon/gpio-fan.c +23 -21
59 lines not on this page · raw message
Signature · 1 line
2.1.1
PATCH v2 1/1 hwmon: (gpio-fan) allow to use alarm support alone from DT
Quoted 10 lines · Simon Guinot
On some boards, such as the LaCie 2Big Network v2 or 2Big NAS (based on Marvell Kirkwood SoCs), an I2C fan controller is used but the alarm signal is wired to a separate GPIO. Unfortunately, the gpio-fan driver can't be used to handle GPIO alarm alone from DT: an error is returned if the "gpios" DT property is missing.
This patch allows to use the gpio-fan driver even if the "alarm-gpios" DT property is defined alone.
Signed-off-by Simon Guinot <[email protected]>
Applied to -next.
Thanks,
Guenter