From: Benoit Goby Date: Wed, 11 Aug 2010 23:53:42 +0000 (-0700) Subject: mfd: cpcap-whisper: Ignore the SE1 bit to detect host mode X-Git-Tag: firefly_0821_release~9834^2~674 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=efddedb611e684c30a7c0e8a6285cc2b7cfbd35b;p=firefly-linux-kernel-4.4.55.git mfd: cpcap-whisper: Ignore the SE1 bit to detect host mode The Nexus One data pins are in the SE1 state until vbus is powered. Ignore the SE1 bit to fix host mode detection when a Nexus One is attached. Change-Id: Ia2314b26acdb1d20fa0a43812f88c232c919cba3 Signed-off-by: Benoit Goby --- diff --git a/drivers/mfd/cpcap-whisper.c b/drivers/mfd/cpcap-whisper.c index f8225cf994c7..22456bf5c7c8 100644 --- a/drivers/mfd/cpcap-whisper.c +++ b/drivers/mfd/cpcap-whisper.c @@ -42,6 +42,7 @@ CPCAP_BIT_SESSVLD_S) #define SENSE_USB_HOST (CPCAP_BIT_ID_GROUND_S) +#define SENSE_USB_HOST_MASK (~CPCAP_BIT_SE1_S) #define SENSE_FACTORY (CPCAP_BIT_ID_FLOAT_S | \ CPCAP_BIT_ID_GROUND_S | \ @@ -403,7 +404,7 @@ static void whisper_det_work(struct work_struct *work) /* Special handling of USB undetect. */ data->state = USB; - } else if (data->sense == SENSE_USB_HOST) { + } else if ((data->sense & SENSE_USB_HOST_MASK) == SENSE_USB_HOST) { whisper_notify(data, CPCAP_ACCY_USB_HOST); cpcap_irq_unmask(data->cpcap, CPCAP_IRQ_IDFLOAT);