ARM: OMAP4: USB: Update workaround for USB errata i719

Due to USB errata i719 the USB host save-and-restore context can be corrupted
if the device enters off mode more than two times without enabling the USB
host controller in between.

The corruption is occuring during the software save of the USB context which
occurs on entry to every off mode attempt. To avoid this problem only save the
USB context if the USB host controller has been enabled since the previous off
mode attempt. We do not need to save the USB context on every entry to off mode
if the USB controller has not been enabled.

Change-Id: I67e07963679af6494ef289eb10db09c0162d6f00
Signed-off-by: Jon Hunter <jon-hunter@ti.com>
Signed-off-by: Volodymyr Riazantsev <v.riazantsev@ti.com>
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@ti.com>
MFD: TWL6030: Introduce errata implementation

This patch adds for the kernel code ability to the errata
implementation for the TWL6030/TWL6032 chips.

Change-Id: Ieb2329ec3cf1e0300decc2908fba28aa471854e5
Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com>
MFD: TWL6032: Implementation of the ProDB00119490 errata

Residual voltage may be present on VBUS when USB cable is unplugged.
Workaround: Increase the VBUS anticollapse loop threshold to 4.44 V.

This errata affects only TWL6032 ES1.1

Change-Id: I7533fa7e3caa98e9e326f0c30cfb31d813303be8
Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com>
OMAP4: SAR: WA overwrite L3INIT CD mode to SW_SLEEP(1) in SAR

The wrong value of CM_L3INIT_CLKSTCTRL.CLKTRCTRL = 2 (SW_WKUP)
has been stored in SAR during omap4_sar_save() execution and
causes power over consumption on OFF mode due to C2C operation.
It happens because the L3INIT CD need to be enabled during
omap4_sar_save() execution for proper USBHOST module context storing.

Problematic use case:
1) OMAP goes to sleep,
2) modem wakeup the C2C, the EMIF but the MPU is still sleeping
(as expected)
3) Modem release all his constraints, C2C is turned to OFF.
4) but OMAP never reach again OFF while we don't wakeup the CPU
(by a keypress for example), sys_clk is already ON and voltages
are not equal to 0. (OPP 50 for CORE_3 and retention voltages
for both VCORE1 and VCORE2).

As WA overwrite CM_L3INIT_CLKSTCTRL.CLKTRCTRL = 0x1 (SW_SLEEP).

Change-Id: I2e453c07f61bab28a7213dd66044fd41a021961b
Signed-off-by: Arthur Cassegrain <a-cassegrain@ti.com>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
OMAP4: PM: cold reset: wrong value is used to set LOGICRETSTATE

The size of LOGICRETSTATE field is 1 bit, and pwrdm_set_logic_retst()
can accept only PWRDM_POWER_RET(0x1)/PWRDM_POWER_OFF(0x0) values.

Additional check of "pwrst" parameter and print out of error message
added in pwrdm_set_logic_retst() to minimize such issues in future.

Change-Id: I413e1e2ba3823574d4450225ed30cffb2cdfd565
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
gcx: driver cleanup; fixed debug printing; dumping improvement.

Change-Id: If875cf055c2904be498b8c15652d5eb3798bc919
Signed-off-by: Alexei Shlychkov <shlychkov@gmail.com>
gcx: fixed surface comparison and surface parameter validation.

Change-Id: I49065cb1262f8bf5beb4c3ed068cc81d6bda8555
Signed-off-by: Alexei Shlychkov <shlychkov@gmail.com>
gc320: determine whether context was lost and reset gpu

If the context is lost this means BB2D_RST is asserted and we will
need to take appropriate action. This assumes that resetting the
GPU is the limit of this. There could be more.

Change-Id: I71ec274e6dd46d0b22c0b1f708eaa3303bef824d
Signed-off-by: Tony Lofthouse <a0741364@ti.com>
omap: dss: use sw sleep/wkup rather than hw_auto mode

With hw_auto we are getting unpredictable lock ups with BB2D
enabled.

Change-Id: Id9c050894a656d8036ffe59d1cc1c29eaec65dfc
Signed-off-by: Tony Lofthouse <a0741364@ti.com>
Merge remote-tracking branch 'omapzoom/p-android-omap-3.0'
Merge branch 'master' of github.com:Kuzma30/kernel3NookTablet