Merge "iio: qcom-spmi-adc5: Add support for calibrated bat_therm channel"

This commit is contained in:
qctecmdr 2022-08-10 22:10:47 -07:00 • committed by Gerrit - the friendly Code Review server
commit 0d46248c73

View file

@ -1037,6 +1037,8 @@ static const struct adc5_channels adc7_chans_pmic[ADC5_MAX_CHANNEL] = {
SCALE_HW_CALIB_THERM_100K_PU_PM7)
[ADC7_GPIO4_100K_PU] = ADC5_CHAN_TEMP("gpio4_pu2", 0,
SCALE_HW_CALIB_THERM_100K_PU_PM7)
[ADC7_V_I_BAT_THERM] = ADC5_CHAN_TEMP("bat_therm_calib_100k_pu",
0, SCALE_HW_CALIB_PM5_GEN3_BATT_THERM_100K)
};
static const struct adc5_channels adc5_chans_rev2[ADC5_MAX_CHANNEL] = {
@ -1094,7 +1096,7 @@ static int adc5_get_dt_channel_data(struct adc5_chip *adc,
chan = (chan & ADC_CHANNEL_MASK);
}
if (chan > ADC5_PARALLEL_ISENSE_VBAT_IDATA ||
if (chan > ADC5_MAX_CHANNEL ||
!data->adc_chans[chan].datasheet_name) {
dev_err(dev, "%s invalid channel number %d\n", name, chan);
return -EINVAL;