mfd: cpcap-whisper: Config EMUMODE for audio when MODE_PU set
authorGreg Meiste <w30289@motorola.com>
Mon, 30 Aug 2010 16:19:07 +0000 (11:19 -0500)
committerColin Cross <ccross@android.com>
Wed, 6 Oct 2010 23:50:53 +0000 (16:50 -0700)
When the 100K ID PU is enabled, it puts the basic dock into audio
mode.  The EMUMODE bits in CPCAP should also be configured so
audio can be routed out the D+/D- lines.

Change-Id: I9bc7718391156932c116c980ccb4d41942356c8b
Signed-off-by: Greg Meiste <w30289@motorola.com>
drivers/mfd/cpcap-whisper.c

index 22456bf5c7c81ebe8559001373a22a33709d45ea..b10f3bf33f8c5cf17ad6053477d9b17ba27e64e7 100644 (file)
@@ -552,6 +552,14 @@ int cpcap_accy_whisper(struct cpcap_device *cpcap, unsigned int cmd,
                value = (cmd & CPCAP_WHISPER_MODE_PU) ? CPCAP_BIT_ID100KPU : 0;
                retval |= cpcap_regacc_write(cpcap, CPCAP_REG_USBC1,
                                             value, CPCAP_BIT_ID100KPU);
+               if (value) {
+                       retval |= cpcap_regacc_write(cpcap, CPCAP_REG_USBC2,
+                                                    (CPCAP_BIT_EMUMODE2 |
+                                                     CPCAP_BIT_EMUMODE0),
+                                                    (CPCAP_BIT_EMUMODE2 |
+                                                     CPCAP_BIT_EMUMODE1 |
+                                                     CPCAP_BIT_EMUMODE0));
+               }
 
                /* Report dock type to system. */
                dock = (cmd & CPCAP_WHISPER_ACCY_MASK) >>