iio: adc: sun4i-gpadc-iio: register in the thermal after registering in pm
authorQuentin Schulz <quentin.schulz@free-electrons.com>
Tue, 26 Sep 2017 12:52:18 +0000 (14:52 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 9 Oct 2017 19:49:42 +0000 (20:49 +0100)
commitb0a242894f11d2a357a77e0eedebb16477151ddd
tree02a8f7c5850e75934bc7c8874ea38783e3ddbdf5
parentd632a2bd8ffc3541bf300100d6f553e89fd0eb11
iio: adc: sun4i-gpadc-iio: register in the thermal after registering in pm

This driver has a get_temp function used by the thermal framework that
uses pm functions.

However, the driver isn't registered in pm before it is registered in
thermal framework, resulting in the pm_resume not being called and thus
the IP not enabled.

When the IP is disabled, the raw temp value is always 0. With the
devices currently supported, it isn't a problem since with their
respective formula, they return a really cold SoC temperature which
isn't a problem for the thermal framework. But for future SoC that have
a different formula, it could return a critically hot temperature,
forcing the thermal framework to shutdown the board.

Signed-off-by: Quentin Schulz <quentin.schulz@free-electrons.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/sun4i-gpadc-iio.c