asus-wmi: add fan control
asus-wmi: add fan control

This patch is partially based on Felipe Contrera's earlier patch, that
was discussed here: https://lkml.org/lkml/2013/10/8/800
Some problems of that patch are solved, now:

1) The main obstacle for the earlier patch seemed to be the use of
virt_to_phys, which is accepted, now

2) random memory corruption occurred on my notebook, thus DMA-able memory
is allocated now, which solves this problem

3) hwmon interface is used instead of the thermal interface, as a
hwmon device is already set up by this driver and seemed more
appropriate than the thermal interface

4) Calling the ACPI-functions was modularized thus it's possible to call
some multifunctions easily, now (by using
asus_wmi_evaluate_method_agfn).

Unfortunately the WMI doesn't support controlling both fans on
a dual-fan notebook because of an restriction in the acpi-method
"SFNS", that is callable through the wmi. If "SFNV" would be called
directly even dual fan configurations could be controlled, but not by using
wmi.

Speed readings only work on auto-mode, thus "-1" will be reported in
manual mode.
Additionally the speed readings are reported as hundreds of RPM thus
they are not too precise.

This patch is tested only on one notebook (N551JK) but a similar module,
that contained some code to try to control the second fan also, was
reported to work on an UX32VD, at least for the first fan.

As Felipe already mentioned the low-level functions are described here:
http://forum.notebookreview.com/threads/fan-control-on-asus-prime-ux31-ux31a-ux32a-ux32vd.705656/

Signed-off-by: Kast Bernd <ba7b25068b1a5cb0d2d8a1cc790ca58b20e64a46@gmx.de>
Acked-by: Corentin Chary <4153b5fcec9d8639b77e759711dc8338f0db8708@gmail.com>
Cc: Corentin Chary <4153b5fcec9d8639b77e759711dc8338f0db8708@gmail.com>
Cc: Darren Hart <38f9eaa30910c40b06f5a60020b1222f2a953801@infradead.org>
Cc: Matthew Garrett <10ea1ff373631291cadf45b163e9fbaf27d1200e@srcf.ucam.org>
Cc: Rafael J. Wysocki <a11f87183a953ab11f50fbafff689c5a7fa3506c@rjwysocki.net>
Signed-off-by: Darren Hart <38f9eaa30910c40b06f5a60020b1222f2a953801@linux.intel.com>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs