Lines Matching refs:calibration
78 struct twl4030_madc_bat_calibration *calibration; in twl4030_madc_bat_voltscale() local
83 calibration = bat->pdata->charging; in twl4030_madc_bat_voltscale()
85 calibration = bat->pdata->discharging; in twl4030_madc_bat_voltscale()
87 if (volt > calibration[0].voltage) { in twl4030_madc_bat_voltscale()
88 res = calibration[0].level; in twl4030_madc_bat_voltscale()
90 for (i = 0; calibration[i+1].voltage >= 0; i++) { in twl4030_madc_bat_voltscale()
91 if (volt <= calibration[i].voltage && in twl4030_madc_bat_voltscale()
92 volt >= calibration[i+1].voltage) { in twl4030_madc_bat_voltscale()
94 res = calibration[i].level - in twl4030_madc_bat_voltscale()
95 ((calibration[i].voltage - volt) * in twl4030_madc_bat_voltscale()
96 (calibration[i].level - in twl4030_madc_bat_voltscale()
97 calibration[i+1].level)) / in twl4030_madc_bat_voltscale()
98 (calibration[i].voltage - in twl4030_madc_bat_voltscale()
99 calibration[i+1].voltage); in twl4030_madc_bat_voltscale()