OMAPDSS: HDMI: Add additional DDC SDA vs SCL delay.

On OMAP5 ES2.0, failed EDID read is still observed on certain
devices due to the timing issue between the SDA and SCL line.
Adding additional delay to SDA vs SCL on DDC line solved this
issue.
This register does not existed on ES1.0.

Change-Id: If11f176cb690b8158b4dc55167324554f5553fc9
Signed-off-by: Fairuz WAN ISMAIL <f-wanismail@ti.com>
OMAPDSS: HDMI: Increase M2 divider value

PLL cannot be locked on frequency lower than 50Mhz.
For example, it cannot be locked for VGA (VIC-1 640x480p) which
frequency is at 25.2Mhz.
All timings below 50Mhz are affected by this issue.
Increasing M2 divider value fix this issue.

Change-Id: I8d0d328c07168d78b70bcefc853caca6f95c6208
Signed-off-by: Fairuz WAN ISMAIL <f-wanismail@ti.com>
OMAPDSS: HDMI: Add DDC multiblock EDID read support.

Adding multiblock EDID read support using DDC.

Change-Id: Iacbcba96ca4e3588de0d4eb1bf6f9cd4f533b61a
Signed-off-by: Fairuz WAN ISMAIL <f-wanismail@ti.com>
OMAPDSS: HDMI: Fix HSync width value for OMAP5 ES2.0

For certain timings, we need a value of 256 for hsync width which is
only 8 bits.
In ES2.0, the HW automatically added 1 to the programmed hsync width.
So to avoid changing the timing table, we will do minus 1 to the hsync
value that will be put in the register.

Change-Id: I08751a79ef8cdf9459796a78a6c354efeae75a2a
Signed-off-by: Fairuz WAN ISMAIL <f-wanismail@ti.com>
Bluetooth: Add tty HCI driver

tty_hci driver exposes a /dev/hci_tty character device node, that intends to
emulate a generic /dev/ttyX device that would be used by the user-space
Bluetooth stacks to send/receive data to/from the WL combo-connectivity
chipsets.

The device driver has no internal logic of its own to intrepret data & all
such logic is handled by the user-space stack.

Change-Id: Ifa3860bbc7e252af210fde710bce14143239b552
Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
android_omap_defconfig: Enable TTY_HCI driver for Bluetooth

tty_hci driver exposes a /dev/hci_tty character device node, that intends
to emulate a generic /dev/ttyX device that would be used by the user-space
Bluetooth stacks to send/receive data to/from the WL combo-connectivity
chipsets.

This patch is dependent on http://review.omapzoom.org/29352  so merge
this patch only after above patch gets merged.

Change-Id: I5a7919148bf026fbafbe74dc6fa5dec091e0e6ef
Signed-off-by: Manjunatha Halli <x0130808@ti.com>
Merge branch 'p-linux-omap-3.4' into p-android-omap-3.4

* p-linux-omap-3.4:
  Bluetooth: Add tty HCI driver

Change-Id: I8f4ecedfd6674e33477c5cc4d4451faa0055d24a
Signed-off-by: Praneeth Bajjuri <praneeth@ti.com>
HACK: Disable MSTANDBY for display controller

This patch disables MSTANDBY for display controller

Use flags : HWMOD_SWSUP_SIDLE , HWMOD_SWSUP_MSTANDBY

Change-Id: Iccdc4605a918e43b15a6dae9d6c02e8d6f6be67d
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Sreenidhi Koti <sreenidhi@ti.com>
Signed-off-by: Praneeth Bajjuri <praneeth@ti.com>
ARM: OMAP3+: VC: do not depend on bootloader i2c cfg defaults

Do not depend on VC configuration by bootloader OR reset values
to be sane. Instead, switch to Highspeed mode or required
configuration in kernel itself.

Change-Id: Ibebfe2804844c0f97efc17f83dba2b5e8f2e13fd
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Andrii.Tseglytskyi <andrii.tseglytskyi@ti.com>
ARM: OMAP5: DPLL: fix OPP_HIGH handling

Change-Id: I5dc1a6df823dd9f3a61575f6b024a6d960803158
Signed-off-by: Taras Kondratiuk <taras@ti.com>
Signed-off-by: Andrii.Tseglytskyi <andrii.tseglytskyi@ti.com>
ARM: OMAP5: CPUFREQ: use virtual clock for scaling

Cpufreq driver supposed to scale virtual clock "virt_dpll_mpu_ck"
instead of "dpll_mpu_ck", to allow proper handling of
all stuff covered by virtual clock. One of most important
points here - is DCC handling.

Change-Id: Ibe445aa5ec3269a8b77ac768b73ca0191aa1b5c1
Signed-off-by: Andrii.Tseglytskyi <andrii.tseglytskyi@ti.com>
Merge branch 'p-linux-omap-3.4' into p-android-omap-3.4

* p-linux-omap-3.4:
  ARM: OMAP5: CPUFREQ: use virtual clock for scaling
  ARM: OMAP5: DPLL: fix OPP_HIGH handling
  ARM: OMAP3+: VC: do not depend on bootloader i2c cfg defaults
  HACK: Disable MSTANDBY for display controller

Change-Id: Iab1e444992129b26d3d784830062e255bad9870d
Signed-off-by: Praneeth Bajjuri <praneeth@ti.com>
OMAP: Board: Add a mechanism to check the board revision

Add a mechanism to check the OMAP board revision based on
the apps board EEPROM value read.

Based on reworked k3.0 commits:
p-android-omap-3.0: 8c9492cd20 [Dan Murphy <dmurphy@ti.com>]
p-android-omap-3.0: 9ed662b22e [Dan Murphy <dmurphy@ti.com>]
p-android-omap-3.0: ff6aa237d9 [Dan Murphy <dmurphy@ti.com>]
p-android-omap-3.0: 1eb6aa1563 [Dan Murphy <dmurphy@ti.com>]
p-android-omap-3.0: 35517bc993 [Volodymyr Riazantsev <v.riazantsev@ti.com>]

Change-Id: I5692a0af62ca86cbd5468899cf151f1083494931
Signed-off-by: Dan Murphy <dmurphy@ti.com>
Signed-off-by: Volodymyr Riazantsev <v.riazantsev@ti.com>
Signed-off-by: Alexander Savchenko <oleksandr.savchenko@ti.com>
HACK: GPIO: OMAP4: Fix omap2_gpio_set_wakeupenables to have an effect

Ignore gpios that have multiple sources. Gpio 0-3 and 86 are special
and may be used as gpio interrupts without being connected to the pad
that mux points to.

Change-Id: I221cdcf273e471c69c3a160bfcbf4ff0e6506338
Signed-off-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com>
usb: otg: twl6030-usb: fix vbus irq handler

Due to HW bugs in TWL6030 and related fix in twl6030-irq.c
(see commit 77b1d3fa8: mfd: TWL6030: USBOTG VBUS event generation on)
we use CHARGER VBUS detection status bit for VBUS events detection
(since VBUS status bit is not reliable for VBUS disconnect)

But this interrupt occurs also if VAC irq is generated
(since VAC and VBUS irqs are setting up the same bit
in the INT_STS_C register). This leads to crashes if there is
nothing connected to the OTG port.

This patch fixes this issue in vbus irq handler

Change-Id: I6540645af5ee4538ca0c02609c437d94d65381a2
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@ti.com>
Merge remote-tracking branch 'omapzoom/p-android-omap-3.4' into NTkernel3.4
OMAPDSS: DSS: Relax L3 bus bandwidth constraint

In a current codebase L3 BW constraint allways is set.

Estimated available DSS bandwidth on L3@OPP50 is ~800MB/s.
It is approximately 3 WXGA layers or almost 1.5 FullHD layers at
60fps rate.

This patch relaxes L3 BW constraint and set it only
if current overlays' configuration needs higher BW.

Author: Taras Kondratiuk <taras@ti.com>
Co-author: Mykhailo Denysiuk <x0172934@ti.com>
Change-Id: If90d3c25ffa5069dafffcf64d82806f9071983e2
Signed-off-by: Mykhailo Denysiuk <x0172934@ti.com>
usb: ehci-omap: make PORT_RESUME handler omap-specific

This patch copies PORT_RESUME handler from ehci-hub.c
to ehci-omap.c
This is needed for errata SW WA implementations and
will make errata WA easier for implementing and
understanding.

Change-Id: I1cd44b56decee54f07abc856ff1a486f33680476
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@ti.com>
usb: ehci-omap: implement workaround for errata i701

The OMAP4/5 EHCI controller has the following defect (errata ID i701):

Title:
	USB Host - Possible Interoperability With External PHY At Resume Time

Description:
	This issue impacts the USB host used with an external PHY.
	TLL mode is not impacted. The issue is PHY dependent, and
	shows up as a disconnect upon resume. Depending on PHY and
	timings, the problem is not systematic and the occurrence
	rate is random.

Workaround
	The known workaround consists in manually sending the "switch
	to HS" command to the PHY (write 0x40 to function_control
	register thanks to INSNREG05_ULPI register) right after the
	"stop drive K" (that is clear PORTSC[6]:FPR).

OMAP4 and OMAP543x ES1.0 devices are impacted.

Change-Id: Ia577db2ddde4d3803a50264cf4f36dabaf8f5f26
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@ti.com>
usb: musb: Fix memory corruption

rx_count, the number of bytes in the rx fifo, may be larger than the
size of the transfer buffer. Make sure we don't overflow the transfer
buffer in that case.

Bug: 6497399

[Ruslan] Ported from k3.0 commit-id 253a265

Change-Id: I5bcf6dd543f9da4ee22944aa6c41673f2cca4c1f
Signed-off-by: Benoit Goby <benoit@android.com>
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@ti.com>