mfd: cpcap-whisper: Only hold wake lock during debouncing

Only need to hold the wake lock during debouncing.  This change allows
the device to suspend when docks are attached, resulting in better
current drain.

Change-Id: Ieb72bacc5da3678a25a70a34620faa0c8620cbd2
Signed-off-by: Greg Meiste <w30289@motorola.com>
This commit is contained in:
Greg Meiste
2010-12-17 11:41:19 -06:00
committed by Benoit Goby
parent a1cbec0cd4
commit b4e1103d37

View File

@@ -170,7 +170,6 @@ static DEVICE_ATTR(dock_prop, S_IRUGO | S_IWUSR, dock_prop_show, NULL);
static void vusb_enable(struct cpcap_whisper_data *data)
{
if (!data->is_vusb_enabled) {
wake_lock(&data->wake_lock);
regulator_enable(data->regulator);
data->is_vusb_enabled = 1;
}
@@ -179,7 +178,6 @@ static void vusb_enable(struct cpcap_whisper_data *data)
static void vusb_disable(struct cpcap_whisper_data *data)
{
if (data->is_vusb_enabled) {
wake_unlock(&data->wake_lock);
regulator_disable(data->regulator);
data->is_vusb_enabled = 0;
}
@@ -339,6 +337,8 @@ static void whisper_notify(struct cpcap_whisper_data *di, enum cpcap_accy accy)
memset(di->dock_prop, 0, CPCAP_WHISPER_PROP_SIZE);
tegra_cpcap_audio_dock_state(false);
}
wake_lock_timeout(&di->wake_lock, HZ / 2);
}
static void whisper_audio_check(struct cpcap_whisper_data *di)
@@ -387,6 +387,7 @@ static void whisper_det_work(struct work_struct *work)
switch (data->state) {
case CONFIG:
wake_lock(&data->wake_lock);
vusb_enable(data);
cpcap_irq_mask(data->cpcap, CPCAP_IRQ_CHRG_DET);
cpcap_irq_mask(data->cpcap, CPCAP_IRQ_IDFLOAT);