hwmon: (pwm-fan) Support multiple fan tachometers
authorPaul Barker <pbarker@konsulko.com>
Sat, 12 Dec 2020 19:50:08 +0000 (19:50 +0000)
committerGuenter Roeck <linux@roeck-us.net>
Thu, 28 Jan 2021 01:44:18 +0000 (17:44 -0800)
commitf0dc7cb6b4c9cd24a69f80423f6d7a03825b72e4
tree529d810b651697e960408784d85221b9d2bba88f
parent01695410d4529e38fea6159fa9f1260c598290b0
hwmon: (pwm-fan) Support multiple fan tachometers

The pwm-fan driver is extended to support multiple fan tachometer
signals connected to GPIO inputs. This is intended to support the case
where a single PWM output signal is routed to multiple fans, each of
which have a tachometer output connected back to a GPIO pin.

The number of fan tachometer inputs is determined by the number of
interrupt sources configured for the pwm-fan device. The number of
pulses-per-revolution entries should match the number of interrupt
sources so that each input has a value assigned.

The fan tachometer measurements are exposed as sysfs files fan1_input,
fan2_input, etc up to the number of configured inputs.

Signed-off-by: Paul Barker <pbarker@konsulko.com>
Link: https://lore.kernel.org/r/20201212195008.6036-3-pbarker@konsulko.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/pwm-fan.c