platform/x86: asus-wmi: cleanup AGFN fan handling
authorDaniel Drake <drake@endlessm.com>
Mon, 29 Jul 2019 08:27:37 +0000 (16:27 +0800)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 30 Jul 2019 11:14:38 +0000 (14:14 +0300)
commit2889ffcfc2522d6d25e5bda704275064062bbb21
tree64bdfbb2641ea9a6a312d4e717e30a0fc3651bbf
parent5037d4ddda31c2dbbb018109655f61054b1756dc
platform/x86: asus-wmi: cleanup AGFN fan handling

The asus-wmi driver currently uses the "AGFN" interface and
the FAN_CTRL device for fan control. According to the spec, this
interface is very dated and marked as pending removal from products
currently in development.

Clean up the way that the AGFN fan is detected and handled, also
preparing the driver for the introduction of an alternate fan
control method needed to support recent Asus products.

Not anticipating further development of this interface, simplify
the code by dropping any notion of being able to control multiple
AGFN fans (this was already limited to just a single fan through only
exposing a single fan in sysfs).

Check for the presence of AGFN fans at probe time, simplifying the code
flow in asus_hwmon_sysfs_is_visible().

Signed-off-by: Daniel Drake <drake@endlessm.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
drivers/platform/x86/asus-wmi.c
include/linux/platform_data/x86/asus-wmi.h