OMAPLFB: Dont foward compositions to DSSCOMP if overlay is Zero

Do not foward compositions to DSSCOMP in case overlay number
passed by HWC is zero. The dsscomp->num_overlay = 0 means
that there is no primary display and no rendering is required.

Change-Id: If7b582efeb55ce84878d0bfbd19eabd2ebd3afaa
Signed-off-by: Tony Lofthouse <a0741364@ti.com>
Signed-off-by: Dandawate Saket <dsaket@ti.com>
OMAPDSS: connection to HDMI during suspend

This change adds capability to activate HDMI connection if
cable was plugged in during suspend mode.

Change-Id: I3f17489f16a3157fe20ae4ab86b4964a672f595f
Signed-off-by: Mykhailo Denysiuk <x0172934@ti.com>
usb: musb: gadget: use pm autosuspend in musb_gadget_pullup

If musb_gadget_pullup doesn't use pm autosuspend, next may happen:

time |   pseudocode
------------------------------------------------------------
t1   | pm_runtime_put_autosuspend() scedules suspend at 't4'
     |     /* some code running */
t2   | musb_gadget_pullup: pm_runtime_get_sync() <-- cancels requested autosuspend
     |     /* some code running */
t3   | musb_gadget_pullup: pm_runtime_put() <-- suspends device (may happen before t4!)
     |
t4   | <- suspend is expected here, but device may be already suspended between t3 and t4

So use pm autosuspend in musb_gadget_pullup and prevent such situation

Change-Id: I8b9618c6d24bea3810c736f8fc0195802ce79c55
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@ti.com>
USB: musb: do not proceed with interrupt completions if qh is not ready

It's not safe to modify hw_ep if qh is not ready.
This may corrupt data in musb_qh. In RX/TX completions this
may happen on SMP system with current musb host implementation
The main issue is with musb_giveback function. It unlocks and
and after that locks musb->lock so during this time
musb_qh data may be corrupted. This results in null-pointers
dereferences / programming of busy DMA channel / etc in
different places.

This often happens during unlinking URB for ISO and looks like:
CPU0                                  CPU1
...                                   musb_urb_dequeue
...                                      spin_lock_irqsave(&musb->lock)
...                                      (work with musb_qh)
...                                      musb_giveback
...                                         spin_unlock(&musb->lock)
generic_interrupt()                         ...
   spin_lock_irqsave(&musb->lock)           ...
   (work with musb_qh)                      ...
   spin_unlock_irqrestore(&musb->lock)      ...
...                                         spin_lock(&musb->lock)
...                                      (continues work with musb_qh)
...                                      spin_lock_irqrestore(&musb->lock)

Go out from completion if qh is not ready.

Change-Id: I9c9280a7ab7f8e89b2e8bf745800217f903108fc
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@ti.com>
OMAPDSS: DISPC: Use FIR filters other than M19

Pass correct arguments to FIR filter selection.  Previously we
always ended up selecting M19 5-tap filter.

This should improve image quality of scaled layers.

Change-Id: Iabe3219df7dcfd62c713fd92ee9c3d12221bc382
Signed-off-by: Lajos Molnar <lajos@ti.com>
TWL6032: Fix missing VBUS interrupts after OTG-cable insertion

After OTG-cable is plugged there is no possible to connect PC
to the device (not works adb etc) because VBUS interrupts are
missed. This patch fix it.

Change-Id: Ie045508f05069464e415c4e0dc79c448b696ad98
Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com>
PM: OPP: Add opp_find_volt_floor/ceil functions

Add functions to find OPP by voltage value
in the same way as it is made for frequency.

Change-Id: Ic7250258de82ca02d4ee27cfa53bafc7de87685f
Signed-off-by: Taras Kondratiuk <taras@ti.com>
OMAP3+: DVFS: Use opp_find_volt functions instead of _volt_to_opp

Currently OMAP DVFS framework uses _volt_to_opp() function
to find OPP by voltage, but it is made in a hacky way,
because it doens't have access to list of OPP.

That function has a few important limitations:

1. It assumes that each OPP has an unique frequency value
   so it skips next OPPs with the same frequency.
   For example OMAP4 L3 bus has several OPPs which have
   same frequency, but different voltage values.
   So the function is not able to find correct OPP for L3.

2. Rounding direction is not predictable.
   By default function rounds up, but if requested voltage is
   higher that highest OPP voltage, then function rounds down.
   In most places where the function is used, code expect that
   it rounds down which is opposite to default behavior.

The patch change _volt_to_opp() function by opp_find_volt_ceil()
and opp_find_volt_floor() functions.

Change-Id: Iadc47b662924cd6277a008e8cb0d207ef5eb5598
Signed-off-by: Taras Kondratiuk <taras@ti.com>
OMAP3+: OPP: Remove unused _volt_to_opp() function

_volt_to_opp() is not used in the code anymore so can be removed

Change-Id: I2a9f4303c8ef31df928c0414cd6c3b09cd58e219
Signed-off-by: Taras Kondratiuk <taras@ti.com>
OMAP4470: OPP/voltage: Add CORE OPP100 to High Perf CORE OPP set

Initially 4470 High Performance CORE OPP set didn't have OPP100 defined.
That's why when some devices need OPP100 VDD_CORE voltage level
to work at higher frequency they have to scale L3 to OPP-OV.

To fill a gap between OPP50 and OPP-OV a new OPP100 have been added.
It has OPP100 voltage level but keeps L3 frequency at 116MHz.

Both 4470's OPP sets share same OPP depencensies tables,
so a new OPP100H is defined to maintain correct depencencies
in both OPP sets.

Change-Id: Iab44165a4f0a8fecf6888e52a307425bd264e5cd
Signed-off-by: Taras Kondratiuk <taras@ti.com>
OMAP: clock: Add dummy round_rate and set_rate functions

Add functions which are going to be used by dummy virtual clocks:
long clk_dummy_round_rate(struct clk *clk, unsigned long rate)
int clk_dummy_set_rate(struct clk *clk, unsigned long rate)

Change-Id: I9bb1e886888a117548d62ef2edd9598bce2723e6
Signed-off-by: Taras Kondratiuk <taras@ti.com>
OMAP4: clock: Add 'virt_lcd_pclk' clock

Add virtual LCD pixel clock which is going to be used for DSS OPPs

Change-Id: Ia42668873d4dbe75deef22e97cec449a00f987d0
Signed-off-by: Vitaly Chernooky <vitaly.chernooky@ti.com>
Signed-off-by: Taras Kondratiuk <taras@ti.com>
OMAP4: OPP: Add DSS OPPs

To generate pixel clock rate higher than 93MHz
DSS has to scale VDD_CORE to at least OPP100 level.

This patch adds two DSS OPPs, for DSS to be able
to control minimum VDD_CORE level.

Change-Id: I98eab1c3b56fcf41026b742cb43c8155b68dd5c4
Signed-off-by: Taras Kondratiuk <taras@ti.com>
OMAPDSS: DSS: Scale DSS OPP according to pixel clock rate

Before enabling pixel clock DSS should set its OPP
for OPP framework to set correct VDD_CORE voltage level.

When pixel clock is disabled DSS can set the lowest OPP.

Change-Id: Ia1459614ae306dba9b048b149e474442e2880bba
Signed-off-by: Taras Kondratiuk <taras@ti.com>
OMAPDSS: DSS: Relax L3 bus bandwidth constraint

In a current codebase L3 BW constraint is set if
any display has resution higher or equal FullHD.

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.

Change-Id: I45afe36876e9898b45e20901d2b5c2633f32b914
Signed-off-by: Taras Kondratiuk <taras@ti.com>
ARM: OMAP: HS USB Host: fix unbalanced pm calls

There is an issue with unbalanced pm calls.
Only EHCI or only OHCI works good but not together.
Issue appears when OHCI suspends whereas EHCI is active
or vice versa - anyway all HSUSBHOST goes to suspend.
This patch fixes this issue.

Change-Id: Ie4c4e4d4ff210c8ceeec4415569660f8646e8ed5
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@ti.com>
merge w/ omapzoom p-android-omap-3.0

Change-Id: Ie1b9e6df4d5e1747824123502352d4ca6008757c
fix merge

Change-Id: I56db801f076bd59e96a9e69728262454f5cf5fd9