thermal: armada: add multi-channel sensors support
authorMiquel Raynal <miquel.raynal@bootlin.com>
Mon, 16 Jul 2018 14:41:52 +0000 (16:41 +0200)
committerEduardo Valentin <edubezval@gmail.com>
Fri, 27 Jul 2018 21:43:09 +0000 (14:43 -0700)
commitf7c2068a1728c1b2aed9416b071a3e2f8f887786
tree86e19f09a1ed92eba480633ea9701f2d63c4493b
parentc9899c183921f919e10fe821be7de9fea876ba65
thermal: armada: add multi-channel sensors support

MVEBU thermal IP supports multiple channels. Each channel may have
several sensors but for now each channel is wired to only one thermal
sensor. The first channel always points to the so called internal
sensor, within the thermal IP. There is usually one more channel (with
one sensor each time) per CPU. The code has been written to support
possible evolutions of the ap806 IP that would embed more CPUs and thus
more channels to select. Each channel should be referenced in the device
tree as an independent thermal zone.

Add the possibility to read each of these sensors through sysfs by
registering all the sensors (translated in "thermal_zone"). Also add a
mutex on these accesses to avoid read conflicts (only one channel/sensor
may be selected and read at a time).

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
drivers/thermal/armada_thermal.c