ARM: tuna: pogo: adjust S/PDIF entry pulse

Change-Id: I2fd973a45e80749d46556b21cb340c09eb611422
Signed-off-by: Adam Hampson <ahampson@sta.samsung.com>
ARM: tuna: pogo: Add delay before enter S/PDIF pulse

There needs to be a delay between the id pulse and the enter
S/PDIF pulse.  The delay for the desk dock is 100ms and the car
dock is 200ms.

Change-Id: I3ea122b1c165ae952ccc744c6be7f5b71d42b025
Signed-off-by: Adam Hampson <ahampson@sta.samsung.com>
ARM: tuna: use otg_id chain for dock detection

Matching what has been done in the SII9234 driver, use the otg_id
chain for dock detection since the FSA9480 has good debounced VBUS
detection when the pogo pins are detected, and use the POGO_DET
GPIO to detect dock disconnection via a IRQ triggered on a falling
edge.

Change-Id: Iaec312392c24236da08607b4ca4d4733857a48ac
Signed-off-by: Simon Wilson <simonwilson@google.com>
ARM: tuna: pogo: Change dock detection protocol for new scheme

The detection scheme allows us to know whether audio is connected
and what kind of power the device can draw from the dock.

Change-Id: Icaea61cbf1749cee331a7207ff93df0a753d0bac
Signed-off-by: Rom Lemarchand <rlemarchand@sta.samsung.com>
Signed-off-by: Adam Hampson <ahampson@sta.samsung.com>
ARM: tuna: move dock switch code to connector board file

Dock switching is not pogo specific, so move this to a common
area.

Change-Id: Ida0913e84ee542a7c26e99128ce56a0124ca99cc
Signed-off-by: Simon Wilson <simonwilson@google.com>
ARM: omap4: tuna: support charge/dock detection for mhl dongles

Change-Id: Ia8e82a9ab28d503c64ba00bef9e6fcc0f719ab7e
Signed-off-by: Erik Gilling <konkers@android.com>
ARM: omap4: tuna: fix unbalanced default OTG detach

The attach and detach sequences in tuna_fsa_usb_detected() are
balanced so that when an unknown device is detected, we use
the default case for both. Previously the kernel would panic
when calling tuna_ap_usb_detach() without a matching call to
tuna_ap_usb_attach().

Change-Id: I50be0640de341216bd41e094cc9a12e57309dbbf
Signed-off-by: Simon Wilson <simonwilson@google.com>
ARM: omap4: tuna: support docks with 365K ID resistor

Change-Id: Ib11e68aa375c3bbefbdf65483243af503dcf6cb0
Signed-off-by: Simon Wilson <simonwilson@google.com>
OMAP4: tuna: Mask all twl6030 charge control IRQs except VBUS_DET

The only TWL6030 charger control interrupt needed by Tuna is
VBUS_DET.  The first time the Tuna callback for unmasking
VBUS_DET is called, setup the TWL6030 CONTROLLER_INT_MASK register
to mask the other interrupts.

The BAT_TEMP_OVRANGE interrupt is also signaled about 2 seconds
after every suspend on Tuna, probably as a result of disabling the
TWL6030_MADC_TEMP1_EN battery temperature ADC channel in suspend.
This patch prevents those interrupts from waking the device from
suspend.

NB: The TWL6030 TRM version 0.10 is inconsistent in its
documentation of the MVBUS_DET bit position in the
CONTROLLER_INT_MASK register between tables 11.7.1 and 20.2.20.
Experiments suggest bit 1 is the correct bit.

Change-Id: I881042f9ff68c52ee8be1030cc20a1c00889f328
Signed-off-by: Todd Poynor <toddpoynor@google.com>
ARM: tuna: correctly report VBUS/CHARGER on MHL

Change-Id: Ifc5c189f3db51a7e8627f8fb1ad28a04d7633a79
Signed-off-by: Erik Gilling <konkers@android.com>
HACK: ARM: tuna: disable L3_SLEEP when MHL is active

This works arround DSS FIFO watchdog resets when MHL is active

Change-Id: I63a05db0208dc50cf38ab2fa64510376e02c6bef
Signed-off-by: Erik Gilling <konkers@android.com>
ARM: omap4: tuna: attach to USB when MHL negotiation fails

Some buggy MHL docks start the detection process, but do not respond to
devcap reads if HDMI is disconnected.  MHL detection may also be falsely
triggered by a glitchy connection.  In these cases, attach to USB so
charging can still happen.

Change-Id: Ia06dd088375fdcd6f598b6c94249a1e5814d7998
Signed-off-by: Greg Hackmann <ghackmann@google.com>
ARM: OMAP4: tuna: keep device out of suspend when MHL is actice

This works arounds a bug in the HDCP driver.

Change-Id: Idf95e7038b0c557c6d8ce230ed0ffb873cf5b7a9
Signed-off-by: Erik Gilling <konkers@android.com>