Lines Matching refs:calibration
206 static int ab8500_rtc_set_calibration(struct device *dev, int calibration) in ab8500_rtc_set_calibration() argument
218 if ((calibration < -127) || (calibration > 127)) { in ab8500_rtc_set_calibration()
228 if (calibration >= 0) in ab8500_rtc_set_calibration()
229 rtccal = 0x7F & calibration; in ab8500_rtc_set_calibration()
231 rtccal = ~(calibration - 1) | 0x80; in ab8500_rtc_set_calibration()
239 static int ab8500_rtc_get_calibration(struct device *dev, int *calibration) in ab8500_rtc_get_calibration() argument
253 *calibration = 0 - (rtccal & 0x7F); in ab8500_rtc_get_calibration()
255 *calibration = 0x7F & rtccal; in ab8500_rtc_get_calibration()
266 int calibration = 0; in ab8500_sysfs_store_rtc_calibration() local
268 if (sscanf(buf, " %i ", &calibration) != 1) { in ab8500_sysfs_store_rtc_calibration()
273 retval = ab8500_rtc_set_calibration(dev, calibration); in ab8500_sysfs_store_rtc_calibration()
282 int calibration = 0; in ab8500_sysfs_show_rtc_calibration() local
284 retval = ab8500_rtc_get_calibration(dev, &calibration); in ab8500_sysfs_show_rtc_calibration()
291 return sprintf(buf, "%d\n", calibration); in ab8500_sysfs_show_rtc_calibration()