thermal: adc_tm: Update support for PMIC4 ADC_TM

Add new compatible field and corresponding device data
for PMIC4 ADC_TM to distinguish it from PMIC5, which
has different device data.

Change-Id: I6c9f20963248c763a6df1f996fd25bdfd6749fa3
Signed-off-by: Jishnu Prakash <jprakash@codeaurora.org>
Signed-off-by: Asha Magadi Venkateshamurthy <amagad@codeaurora.org>
This commit is contained in:
Jishnu Prakash 2020-03-23 17:05:11 +05:30 committed by Gerrit - the friendly Code Review server
parent 1180b8e62b
commit 84e9cfe05d
3 changed files with 15 additions and 2 deletions

View file

@ -195,6 +195,10 @@ static const struct of_device_id adc_tm_match_table[] = {
.compatible = "qcom,adc-tm5",
.data = &data_adc_tm5,
},
{
.compatible = "qcom,adc-tm-rev2",
.data = &data_adc_tm_rev2,
},
{
.compatible = "qcom,adc-tm5-iio",
.data = &data_adc_tm5,

View file

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
* Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
*/
#ifndef __QCOM_ADC_TM_H__
@ -164,6 +164,7 @@ struct adc_tm_data {
extern const struct adc_tm_data data_adc_tm5;
extern const struct adc_tm_data data_adc_tm7;
extern const struct adc_tm_data data_adc_tm_rev2;
/**
* Channel index for the corresponding index to adc_tm_channel_select

View file

@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
* Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
*/
#include <linux/module.h>
@ -1140,3 +1140,11 @@ const struct adc_tm_data data_adc_tm5 = {
.hw_settle = (unsigned int []) {15, 100, 200, 300, 400, 500, 600, 700,
1, 2, 4, 8, 16, 32, 64, 128},
};
const struct adc_tm_data data_adc_tm_rev2 = {
.ops = &ops_adc_tm5,
.full_scale_code_volt = 0x4000,
.decimation = (unsigned int []) {256, 512, 1024},
.hw_settle = (unsigned int []) {0, 100, 200, 300, 400, 500, 600, 700,
800, 900, 1, 2, 4, 6, 8, 10},
};