Re: [PATCH] thermal: qcom: tsens: Allow number of sensors to come from DT

From: Bjorn Andersson
Date: Mon May 14 2018 - 13:47:00 EST


On Mon 14 May 07:45 PDT 2018, Amit Kucheria wrote:

> On Tue, May 8, 2018 at 2:53 AM, Bjorn Andersson
> <bjorn.andersson@xxxxxxxxxx> wrote:
> > For platforms that has multiple copies of the TSENS hardware block it's
> > necessary to be able to specify the number of sensors per block in DeviceTree.
>
> I assume you want to replace the hardcoded num_sensors values in the
> tsens-xxxx.c files with values in device tree atleast on platforms
> that use devicetree?
>

Right, e.g. in msm8998 we have two blocks with 12 and 8 sensors
respectively. With the patch we will overwrite the num_sensors with a
value from DT, iff specified.

As probe will fail if num_sensors is 0 we can reuse ops_8996 and just
not provide num_sensors for 8998, hence requiring it to be specified in
DT.


PS. Looking at the register spec 8996 too seems to have two tsens
blocks, so in order to access sensors off the second bank this patch
would be needed (and would work and be backwards compatible).

Regards,
Bjorn