summaryrefslogtreecommitdiffstats
path: root/drivers/gnss
diff options
context:
space:
mode:
authorMartin Blumenstingl <martin.blumenstingl@googlemail.com>2018-11-04 00:10:24 +0100
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2018-11-11 15:29:49 +0000
commit723a61e0a7d21adb5e483e1a2fe20ab9dccdc6ee (patch)
tree2bdabdd8d2535e08fad61418229389c86cd7d7b4 /drivers/gnss
parent27be1f6408baa0ac629f3273433f61051357a60a (diff)
downloadlinux-723a61e0a7d21adb5e483e1a2fe20ab9dccdc6ee.tar.gz
linux-723a61e0a7d21adb5e483e1a2fe20ab9dccdc6ee.tar.bz2
linux-723a61e0a7d21adb5e483e1a2fe20ab9dccdc6ee.zip
iio: adc: meson-saradc: add support for the chip's temperature sensor
Channel 6 of the SAR ADC can be switched between two inputs: SAR_ADC_CH6 input (an actual pad on the SoC) and the signal from the temperature sensor inside the SoC. To get usable results from the temperature sensor we need to read the corresponding calibration data from the eFuse and pass it to the SAR ADC registers. If the temperature sensor is not calibrated (the eFuse data contains a bit for this) then the driver will only register the iio_chan_spec's for voltage measurements. This only enables the temperature sensor for the Meson8 SoC. Meson8b and Meson8m2 SoCs can be supported in the future as well but we first need a way to pass the fifth TSC (temperature sensor coefficient) bit to the HHI register area (apart from that the infrastructure as already implemented for Meson8 can be used). On the 64-bit SoCs (GXBB, GXL and GXM) the temperature sensor inside SAR ADC is firmware-controlled (by BL30, we can simply use the SCPI hwmon driver to get the chip temperature). To keep the devicetree interface backwards compatible we simply skip the temperature sensor initialization if no eFuse nvmem cell is passed via devicetree. The public documentation for the SAR ADC IP block does not explain how to use the registers to read the temperature. The logic from this patch is based on reading and understanding Amlogic's GPL kernel sources. Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/gnss')
0 files changed, 0 insertions, 0 deletions