acpi: implement -ctV, fix recursion, plug a small leak

* acpi_callback had blindly assumed that a path of 26 chars or more was
  the right depth; rely on depth from dirtree root

* acpi -c shows cooling device state
  some backlights are set up so that they will report dimmer as higher,
  but that's a hardware issue that can't be sanely worked around.

* acpi -t shows temperatures
  this implementation will pick up fan, battery temperatures, etc.
  (but currently not hwmon-type temperatures, or hdd temps;
  acpi 1.7 does not measure these either)
  we handle milli-C (typical) and deci-C (I've seen this on Qualcomm
  batteries, and not yet anywhere else)
  we do *not* handle deci-K yet

* acpi -V shows all sensors

* without saving the result of dirtree_path() to free later, we had
  a slow leak.
  all callbacks call this once, so save it in GLOBALS()
  acpi -t happens to need this anyhow, though using openat()/readall()
  instead of readfile() would work.
1 file changed