Loading drivers/hwmon/qpnp-adc-common.c +2 −2 Original line number Diff line number Diff line Loading @@ -1236,7 +1236,7 @@ int32_t qpnp_adc_vbatt_rscaler(struct qpnp_vadc_chip *chip, if (rc < 0) return rc; low_thr = (((param->low_thr/3) - QPNP_ADC_625_UV) * low_thr = (((param->low_thr/param->gain_den) - QPNP_ADC_625_UV) * vbatt_param.dy); if (low_thr < 0) { sign = 1; Loading @@ -1248,7 +1248,7 @@ int32_t qpnp_adc_vbatt_rscaler(struct qpnp_vadc_chip *chip, *low_threshold = low_thr + vbatt_param.adc_gnd; sign = 0; high_thr = (((param->high_thr/3) - QPNP_ADC_625_UV) * high_thr = (((param->high_thr/param->gain_den) - QPNP_ADC_625_UV) * vbatt_param.dy); if (high_thr < 0) { sign = 1; Loading drivers/thermal/qpnp-adc-tm.c +12 −1 Original line number Diff line number Diff line Loading @@ -2018,7 +2018,7 @@ static struct thermal_zone_device_ops qpnp_adc_tm_thermal_ops = { int32_t qpnp_adc_tm_channel_measure(struct qpnp_adc_tm_chip *chip, struct qpnp_adc_tm_btm_param *param) { uint32_t channel, dt_index = 0, scale_type = 0; uint32_t channel, amux_prescaling, dt_index = 0, scale_type = 0; int rc = 0, i = 0, version = 0; bool chan_found = false; Loading Loading @@ -2072,8 +2072,19 @@ int32_t qpnp_adc_tm_channel_measure(struct qpnp_adc_tm_chip *chip, goto fail_unlock; } amux_prescaling = chip->adc->adc_channels[dt_index].chan_path_prescaling; if (amux_prescaling >= PATH_SCALING_NONE) { rc = -EINVAL; goto fail_unlock; } pr_debug("channel:%d, scale_type:%d, dt_idx:%d", channel, scale_type, dt_index); param->gain_num = qpnp_vadc_amux_scaling_ratio[amux_prescaling].num; param->gain_den = qpnp_vadc_amux_scaling_ratio[amux_prescaling].den; chip->adc->amux_prop->amux_channel = channel; chip->adc->amux_prop->decimation = chip->adc->adc_channels[dt_index].adc_decimation; Loading include/linux/qpnp/qpnp-adc.h +2 −0 Original line number Diff line number Diff line Loading @@ -807,6 +807,8 @@ struct qpnp_adc_tm_btm_param { int32_t low_temp; int32_t high_thr; int32_t low_thr; int32_t gain_num; int32_t gain_den; enum qpnp_vadc_channels channel; enum qpnp_state_request state_request; enum qpnp_adc_meas_timer_1 timer_interval; Loading Loading
drivers/hwmon/qpnp-adc-common.c +2 −2 Original line number Diff line number Diff line Loading @@ -1236,7 +1236,7 @@ int32_t qpnp_adc_vbatt_rscaler(struct qpnp_vadc_chip *chip, if (rc < 0) return rc; low_thr = (((param->low_thr/3) - QPNP_ADC_625_UV) * low_thr = (((param->low_thr/param->gain_den) - QPNP_ADC_625_UV) * vbatt_param.dy); if (low_thr < 0) { sign = 1; Loading @@ -1248,7 +1248,7 @@ int32_t qpnp_adc_vbatt_rscaler(struct qpnp_vadc_chip *chip, *low_threshold = low_thr + vbatt_param.adc_gnd; sign = 0; high_thr = (((param->high_thr/3) - QPNP_ADC_625_UV) * high_thr = (((param->high_thr/param->gain_den) - QPNP_ADC_625_UV) * vbatt_param.dy); if (high_thr < 0) { sign = 1; Loading
drivers/thermal/qpnp-adc-tm.c +12 −1 Original line number Diff line number Diff line Loading @@ -2018,7 +2018,7 @@ static struct thermal_zone_device_ops qpnp_adc_tm_thermal_ops = { int32_t qpnp_adc_tm_channel_measure(struct qpnp_adc_tm_chip *chip, struct qpnp_adc_tm_btm_param *param) { uint32_t channel, dt_index = 0, scale_type = 0; uint32_t channel, amux_prescaling, dt_index = 0, scale_type = 0; int rc = 0, i = 0, version = 0; bool chan_found = false; Loading Loading @@ -2072,8 +2072,19 @@ int32_t qpnp_adc_tm_channel_measure(struct qpnp_adc_tm_chip *chip, goto fail_unlock; } amux_prescaling = chip->adc->adc_channels[dt_index].chan_path_prescaling; if (amux_prescaling >= PATH_SCALING_NONE) { rc = -EINVAL; goto fail_unlock; } pr_debug("channel:%d, scale_type:%d, dt_idx:%d", channel, scale_type, dt_index); param->gain_num = qpnp_vadc_amux_scaling_ratio[amux_prescaling].num; param->gain_den = qpnp_vadc_amux_scaling_ratio[amux_prescaling].den; chip->adc->amux_prop->amux_channel = channel; chip->adc->amux_prop->decimation = chip->adc->adc_channels[dt_index].adc_decimation; Loading
include/linux/qpnp/qpnp-adc.h +2 −0 Original line number Diff line number Diff line Loading @@ -807,6 +807,8 @@ struct qpnp_adc_tm_btm_param { int32_t low_temp; int32_t high_thr; int32_t low_thr; int32_t gain_num; int32_t gain_den; enum qpnp_vadc_channels channel; enum qpnp_state_request state_request; enum qpnp_adc_meas_timer_1 timer_interval; Loading