From ccfc4f3abdf9be9b0a944938cb15b61a726ebead Mon Sep 17 00:00:00 2001 From: Abhijeet Dharmapurikar Date: Mon, 16 Jan 2012 17:35:18 -0800 Subject: [PATCH] power: pm8xxx-ccadc: reduce boot time for calibration - reduce the wait time between adc readings to 20ms from 60ms. This speeds up the calibration time. - move the initial calibration to a workqueue. CRs-Fixed: 331215 Change-Id: I2034c55f2df8d3e1df216dd5a739cbe70e53c2ed Signed-off-by: Abhijeet Dharmapurikar --- drivers/power/pm8921-bms.c | 2 +- drivers/power/pm8xxx-ccadc.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/power/pm8921-bms.c b/drivers/power/pm8921-bms.c index 2e80692935e..93de829c829 100644 --- a/drivers/power/pm8921-bms.c +++ b/drivers/power/pm8921-bms.c @@ -1893,7 +1893,7 @@ static int __devinit pm8921_bms_probe(struct platform_device *pdev) INIT_DELAYED_WORK(&chip->calib_ccadc_work, calibrate_ccadc_work); /* begin calibration only on chips > 2.0 */ if (chip->revision >= PM8XXX_REVISION_8921_2p0) - calibrate_ccadc_work(&(chip->calib_ccadc_work.work)); + schedule_delayed_work(&chip->calib_ccadc_work, 0); /* initial hkadc calibration */ schedule_work(&chip->calib_hkadc_work); diff --git a/drivers/power/pm8xxx-ccadc.c b/drivers/power/pm8xxx-ccadc.c index 17cf53a0ad4..c95fd93af95 100644 --- a/drivers/power/pm8xxx-ccadc.c +++ b/drivers/power/pm8xxx-ccadc.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. +/* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -209,7 +209,7 @@ static int calib_start_conv(struct pm8xxx_ccadc_chip *chip, return rc; } if ((reg & (START_CONV_BIT | EOC_CONV_BIT)) != EOC_CONV_BIT) - msleep(60); + msleep(20); else break; }