OMAP: TILER: Add bounds checking on format inputs

Added bounds checking to validate incoming tiler format.

Change-Id: Icd791cc294ecb1838afb3f91451626debd59c29e
Signed-off-by: Andy Gross <andy.gross@ti.com>
OMAP: DSS2: Taal: Set first_vsync flag during panel poweron()

During poweron(), the first_vsync has not been received yet,
hence set the flag as false.

Change-Id: Iabc9c47952b84fa5b69ecd66b183357952f3be9c
Signed-off-by: Gilles-Arnaud Bleu-Laine <gilles@ti.com>
OMAP: DSS: Add device latency constraint

Request a latency constraint on PM framework for DSS before
cutting module clocks.
Release the request upon enabling the clocks.

Change-Id: If257218a3cb8c3ea0d8451421f87e0a9ba199bb5
Signed-off-by: Gilles-Arnaud Bleu-Laine <gilles@ti.com>

Conflicts:
	drivers/video/omap2/dss/dispc.c
ARM: OMAP2+: I2C: always compile I2C reset code, even if I2C driver is not built

During kernel init, we reset all IP blocks on the OMAP that we can,
even if there is no driver compiled for that IP block.  Unlike most IP
blocks, the I2C block requires some extra programming for this to
work.  This reset code is incorrectly omitted when the I2C driver is
deselected.  In this circumstance, the build breaks.  Fix by compiling
the I2C reset code unconditionally.

Problem reported by Russell King <linux@arm.linux.org.uk>.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Russell King <linux@arm.linux.org.uk>
Tested-by: Shubhrajyoti <shubhrajyoti@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
ARM: OMAP4: add omap-secure.h
ARM: OMAP3+: SmartReflex: fix error handling

Fix the code to correctly use IS_ERR and PTR_ERR on the return
values pointers

Reported-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Jean Pihet <j-pihet@ti.com>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
ARM: OMAP3+: SmartReflex: add missing platform_set_drvdata()

That's very useful to fetch the correct struct sr_info
from the PM handlers.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Jean Pihet <j-pihet@ti.com>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
ARM: OMAP3+: SmartReflex: move late_initcall() closer to its argument

no functional changes, trivial patch.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Jean Pihet <j-pihet@ti.com>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
ARM: OMAP3+: SmartReflex: micro-optimization for sanity check

val && (val != 1) == val > 1

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Jean Pihet <j-pihet@ti.com>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
ARM: OMAP3+: SmartReflex: fix the use of debugfs_create_* API

The debugfs_create_* API returns a return code or NULL
in the return ptr in case of problem.
Fix the smartreflex code to take this into account.

Signed-off-by: Jean Pihet <j-pihet@ti.com>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
OMAP4: PM: setup initial OPP configuration

pm.c setups the initial voltage and frequencies for init devices
on bootup to be careful of invalid device configurations by
custom bootloaders. However, DVFS data structures are not aware
of these - As a result, when doing the first time scale of
a differnt device we could have a following scenario:

At boot - MPU,IVA,Core at OPP100

after pm framework has completed initialization, lets say IVA/AESS
transitions to OPP50, DVFS framework does not have information about
the OPP current frequency/voltage of IVA/MPU and sees that only
IVA is requested, moves the IVA and core to OPP50. This configuration
is invalid as MPU is currently at OPP100 and device should not have
scaled core to OPP50 without looking at OPP100 configuration of
MPU.

To resolve this, we populate the dvfs data structure with the
requisite init devices' frequency configuration by doing a
omap_device_scale.

Change-Id: Ib3048fb7fadec5adabbbcbce56c1ead026953de6
Reported-by: Hemanth V <hemanthv@ti.com>
Tested-by: Akash Choudhari <akashc@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
OMAP4: cpuidle: Some obvious optimisations to the code path
ION : Fix memory leak issue for TILER 2D buffers

The ION was not freeing all allocated physical pages.

Change-Id: I079a8ef68afce42e425739fcc5873d4bdd9393b8
Signed-off-by: Lakshman Gowda <lakshman79@ti.com>
(cherry picked from commit bc52ad012af778f73de30d9a63db2624aaf328f2)

Conflicts:

	drivers/gpu/ion/omap/omap_tiler_heap.c
Undervolt usim and vaux3