OMAP3630: Add margins to SR-calibrated voltages for VDD2 (CORE) as well
drivers: cpufreq: Send a uevent when governor changes

 * Useful so userspace tools can reconfigure.

Change-Id: Ib423910b8b9ac791ebe81a75bf399f58272f64f2
ARM: OMAP3+: Implement timer workaround for errata i103 and i767

Errata Titles:
i103: Delay needed to read some GP timer, WD timer and sync timer
      registers after wakeup (OMAP3/4)
i767: Delay needed to read some GP timer registers after wakeup (OMAP5)

Description (i103/i767):
If a General Purpose Timer (GPTimer) is in posted mode
(TSICR [2].POSTED=1), due to internal resynchronizations, values read in
TCRR, TCAR1 and TCAR2 registers right after the timer interface clock
(L4) goes from stopped to active may not return the expected values. The
most common event leading to this situation occurs upon wake up from
idle.

GPTimer non-posted synchronization mode is not impacted by this
limitation.

Workarounds:
1). Disable posted mode
2). Use static dependency between timer clock domain and MPUSS clock
    domain
3). Use no-idle mode when the timer is active

Workarounds #2 and #3 are not pratical from a power standpoint and so
workaround #1 has been implemented. Disabling posted mode adds some CPU
overhead for configuring and reading the timers as the CPU has to wait
for accesses to be re-synchronised within the timer. However, disabling
posted mode guarantees correct operation.

Please note that it is safe to use posted mode for timers if the counter
(TCRR) and capture (TCARx) registers will never be read. An example of
this is the clock-event system timer. This is used by the kernel to
schedule events however, the timers counter is never read and capture
registers are not used. Given that the kernel configures this timer
often yet never reads the counter register it is safe to enable posted
mode in this case. Hence, for the timer used for kernel clock-events,
posted mode is enabled by overriding the errata for devices that are
impacted by this defect.

For drivers using the timers that do not read the counter or capture
registers and wish to use posted mode, can override the errata and
enable posted mode by making the following function calls.

	__omap_dm_timer_override_errata(timer, OMAP_TIMER_ERRATA_I103_I767);
	__omap_dm_timer_enable_posted(timer);

Both dmtimers and watchdogs are impacted by this defect this patch only
implements the workaround for the dmtimer. Currently the watchdog driver
does not read the counter register and so no workaround is necessary.

Posted mode will be disabled for all OMAP2+ devices (including AM33xx)
using a GP timer as a clock-source timer to guarantee correct operation.
This is not necessary for OMAP24xx devices but the default clock-source
timer for OMAP24xx devices is the 32k-sync timer and not the GP timer
and so should not have any impact. This should be re-visited for future
devices if this errata is fixed.

Confirmed with Vaibhav Hiremath that this bug also impacts AM33xx
devices.

Signed-off-by: Jon Hunter <jon-hunter@ti.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>

Change-Id: Id10648050492d8c91ea22093127584f02ec3655b
usb:gadget:android: avoid sending extra uevents

Don't schedule a uevet from android_disconnect
if there is no change in the connection state
and if the DISCONNECT event was already sent.
This patch will avoid these unecessary messages:

android_work: did not send uevent (0 0   (null))

Change-Id: I074d9fb712a18b2f805d4e46a4f6a5412b682ffe
Signed-off-by: Moiz Sonasath <m-sonasath@ti.com>
Signed-off-by: Arun Joseph <arunjoseph@ti.com>
Revert "OMAP:DSS: SW workaround for HW scaler overread issue"

This reverts commit 0e11c5b311d2c7436756f80c35c8aef4cd0d911b.

The SW workaround is no longer needed as a hardware workaround
exists, and the SW workaround created artifacts.

Change-Id: I5d8a601b24502a3ac5d4c1f17fcb3936ba8e7e10
Signed-off-by: Sathya Prakash M R <a0393677@ti.com>
Signed-off-by: Lajos Molnar <lajos@ti.com>
OMAPDSS: DISPC: more precise scale limits checking

Use division with rounding-up when checking if maximum downscale ratio
was reached. This allows to avoid SYNC_LOST errors in case when small
amount of extra pixels or lines (usually 1-3) not taken into account

Change-Id: Id8f88c64671146a64738cfd820378bb7a28c1455
Signed-off-by: Sergiy Kibrik <sergiy.kibrik@globallogic.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>
OMAP4: DSI: DSI reset removal during enabling

DSI module is made wake up capable in its HWMOD flags but in
The function omapdss_dsi_display_enable(), DSI module is
reset thus values set in DSI_SYSCONFIG is lost because of which
DSI is no longer wakeup capable. This prevents any interrupt from
DSI to be permeated to A9 when A9 sleeping.this reset is not
required while enabling the display thus now it is removed.so it
retains the HWMOD settings.

Now with this fix, the mdelay() within dsi_vc_send_bta_sync(), is removed
and a proper interrupt based implementation is done.

Change-Id: If6c3d25a5ba8003a0bd7732af0fcd81a839293aa
Signed-off-by: Sujeet Kumar Baranwal <s-baranwal@ti.com>

Conflicts:
	drivers/video/omap2/dss/dsi.c
OMAPDSS: DSS: Complete callbacks on mgr->blank if not wait_for_go

Disabled panels do not clear GO automatically, therefore, we
assume no wait_for_go on disabled panels.

When not waiting for GO, complete all pending composition
callbacks regardless of dirty state, as dirty state will not
be propagated.

Change-Id: Ic5ddd81414bab56d136a716907fd8e6dfa0f795f
Signed-off-by: Lajos Molnar <lajos@ti.com>
OMAPDSS: DSS: Fix wait_for_go support on mgr->blank() for manual update panels

Manual update panels do not clear GO automatically.  For these panels we need
to call update so that GO gets cleared.

Change-Id: Idb446af8c77553cec8baf7af893d180cfbaa7582
Signed-off-by: Lajos Molnar <lajos@ti.com>
OMAP4: DSI: Reset required disable-enable sequence

During the initialization of DSI,some times BTA
sent by OMAP DSI, was not receiving an BTA ACK.
To rectify this, we need to reset the DSI module
whenever we diable-enable the DSI module.

Change-Id: Ic2542970da06a121559a8cc700222881c60c025c
Signed-off-by: Sujeet Kumar Baranwal <s-baranwal@ti.com>
OMAPDSS:DSI: dispose of static bpp definition

Calculation of bytes per pixel in dispc_to_dsi_clock() is not precise,
based on static value definition.
Instead, it should be calculated in-place, based on actual pixel size,
which produce more accurate numbers in situations where remainder appears
(e.g. 18-bit pixel size).

Change-Id: I4c90b2ec5e1d6139d84cbdc55af3f2a484785968
Signed-off-by: Sergiy Kibrik <sergiy.kibrik@globallogic.com>
OMAP4 DSS: Fix to return 24bit as the recommended bpp for 18bit panels

Display driver logic to calculate the recommended bpp for FB has been modified
to recommend 24bit for all panels above 16bit mode.

DRT# OMAPS00259536 - ICS R0: App Tray disappears on Hi Res display (1920x1200)

Change-Id: I16aad396083d0ad416e035c59a93089df20d6d82
Signed-off-by: Sunita Nadampalli <sunitan@ti.com>
OMAPDSS: DSSCOMP: Fix klocworks errors

Change-Id: If2ed914c738e28c9b5b19b67353bd367d612e91b
Signed-off-by: Tony Lofthouse <a0741364@ti.com>
OMAPDSS: DSSCOMP: Handle DSI manual mode update errors

Description: Upon errors returned from manually updated panels,
previous compositions needs to be cleared to ensure SGX won't
block on commandcomplete function indefinitely.

Change-Id: I3a09018ce0c971a5978de7b178e07137ed320948
Signed-off-by: Sreenidhi Koti <sreenidhi@ti.com>
OMAPDSS: DSI: fix debug messages

Routine names in debug messages of dsi_vc_gen_read_2() and dsi_vc_dcs_read()
are set to same "dsi_vc_rcs_read". Fix routine names in these messages.

Change-Id: I9cceca5711932ba2c2ea3f2919baf461e30ddd8b
Signed-off-by: Sergiy Kibrik <sergiy.kibrik@globallogic.com>
OMAPDSS: DISPC: fix pclk divisor limits

According to TRM, minimal pixel clock divisor value can be 1.
Fix corresponding checks, as high resolution panels use undivided
pixel clock frequency.

Also certain scaler unit constraint must be met: in case DISPC_CLK
and pixel clock frequencies are equal, set IPC to work on rising edge.

Change-Id: Iabeac2ad81f6909213cb81f4e16b1d0762369b53
Signed-off-by: Sergiy Kibrik <sergiy.kibrik@globallogic.com>
Signed-off-by: Lajos Molnar <lajos@ti.com>
Signed-off-by: Dima Svetlov <svetlov@ti.com>
OMAPDSS: DSSCOMP: Skip manager set to overlay if manager is currently blank.

This is done to prevent call of dispc_set_channel_out when manager
is blanked. And to prevent changes to dispc registers, when dispc
is disabled (all managers blanked).

Change-Id: I0887abd3a9e883c09e75ef0a5f0632c40754d24d
Signed-off-by: Volodymyr Frolov <volodymyr.frolov@ti.com>
Signed-off-by: Kostiantyn Luzan <x0166170@ti.com>
[steven@steven676.net: make apply to p-android-omap3-3.0]
OMAPDSS: DSS: Handle configure_dispc error in dss_setup_partial_planes for manual mode

Description: Upon errors returned from configure_dispc for manually
updated panels in dss_setup_partial_planes, previous compositions
needs to be cleared to ensure SGX won't block on commandcomplete
function indefinitely.

This patch depends on http://review.omapzoom.org/#/c/20659/
Can not be merged without it.

Change-Id: Id125a7a7d83e317af868472ba62297b7673ccb47
Signed-off-by: Kostiantyn Luzan <x0166170@ti.com>
OMAP4 : DSSCOMP : Avoid pushing content if no panel is active

Currently we push content on a blanked manager in case it is
default display. This causes a lot of logging in dsscomp call
back when we apply blank to manager.

Check added to see if any dss device is active and then only
push data to panel.

Change-Id: Idffd022e293949bfea260a01b96b8f6eff8327d3
Signed-off-by: Dandawate Saket <dsaket@ti.com>
Signed-off-by: Muralidhar Dixit <murali.dixit@ti.com>