rpmsg: omx: lower the traces level in driver open, ioctl & release

The dev_info traces in open, connect ioctl and release incur a time
penalty and affect application launch time performances. These have
been converted to dev_dbg traces.

Change-Id: Ie8ffd027c4a96bbb5cbfa634f0d661400da8dc09
Signed-off-by: Suman Anna <s-anna@ti.com>
omap: mailbox: add pm constraint field to mbox structure

By adding this field, the pm qos apis can be selectively applied
only if the pm constraint is set to a +ve value.

Change-Id: I3b6930e85f65f7354826813798dec76b25149370
Signed-off-by: Subramaniam C.A <subramaniam.ca@ti.com>
Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
omap: iommu: program constraints based on platform data

IOMMU driver requests and releases constraints in iommu_get
and iommu_put respectively. These constraints are actually
needed only on OMAP4 and beyond for sub-systems that have
an AMMU. The current driver code has these values hard-coded
for all the chips.

A new platform data field has been added now for the constraints
values, and this allows the values to be programmed based on
the OMAP chip and also allow a unique value if needed for each
iommu instance.

The logic in IOMMU driver code is adjusted to request the
constraints only if the relevant platform data field is set.

Change-Id: Iab18cbdde1d7fa7507dbff0b9512c8577b42fefd
Signed-off-by: Subramaniam C.A <subramaniam.ca@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
omap: remoteproc: return -EAGAIN on a suspend time out

Support has been added on the remote processor side to allow
applications to deny the remote processor from going into a
suspend state. If one or more applications on the remote
processor request to avoid suspend, then the suspend flag is
never set by the remote processor while the request is active,
resulting in a timeout on the host side suspend code.

The runtime suspend function for remoteproc returns -EIO at
present in case of a timeout, causing the runtime pm framework
to avoid further runtime pm suspend callbacks. This is not
desired and hence the return value is changed to -EAGAIN. This
allows the runtime pm framework to retry the suspend after the
re-expiration of the timeout. This would allow the applications
on the remote processor to allow or disallow suspend independently
of the host-side.

The inital idea of having -EIO was to avoid callbacks, since a
timeout would mean that the remoteproc is in an error state.
However, if the remoteproc were in a bad state at this point, the
recovery mechanism would kick in and reload the image.

Change-Id: Ic7b9cfa220724e8024b960704598ec93854de86c
Signed-off-by: Subramaniam C.A <subramaniam.ca@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Miguel Vadillo <vadillo@ti.com>
Signed-off-by: Paul Hunt <hunt@ti.com>
OMAP4: Workaround the OCP synchronisation issue with 32K synctimer.

Backport from:
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap.git;
a=commitdiff;h=68523f4233de5f233478dde0a63047b4efb710b8

Original comment:
On OMAP4, recently a synchronisation bug is discovered by hardware
team, which leads to incorrect timer value read from 32K sync timer
IP when the IP is comming out of idle.

The issue is due to the synchronization methodology used in the SYNCTIMER IP.
The value of the counter register in 32kHz domain is synchronized to the OCP
domain register only at count up event, and if the OCP clock is switched off,
the OCP register gets out of synch until the first count up event after the
clock is switched back -at the next falling edge of the 32kHz clock.

Further investigation revealed that it applies to gptimer1 and watchdog timer2
as well which may run on 32KHz. This patch fixes the issue for all the
applicable modules.

The BUG has not made it yet to the OMAP errata list and it is applicable to
OMAP1/2/3/4/5. OMAP1/2/3 it is taken care indirectly by autodeps.

By enabling static depedency of wakeup clockdomain with MPU, as soon as MPU
is woken up from lowpower state(idle) or whenever MPU is active, PRCM forces
the OCP clock to be running and allow the counter value to be updated properly
in the OCP clock domain.

The bug is going to fixed in future OMAP versions.

Change-Id: I3c7ff239c3dcac180fcae50c1b909d417b2b8e16
Reported-Tested-by: dave.long@linaro.org
[dave.long@linaro.org: Reported the oprofile time stamp issue with synctimer
and helped to test this patch]
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Andrii Tseglytskyi <andrii.tseglytskyi@ti.com>
OMAP4: McPDM: Add McPDM pins initialization

Audio Noise Issue may occur due to McPDM_DOUT floating while McPDM_CLK
is generated at the beginning of the Audio transfer to Audio IC (this
situation is created by OMAP4 McPDM module which need some time before
providing the data). A WA is to enable the internal pull-down on OMAP
McPDM_DOUT pin to avoid having the pin floating.

Pins initialization was added to make sure that McPDM pins initialized
correctly.

Change-Id: I04fe52b63bf72da0431099cbedcb7f9669ac4f27
Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com>
gccore: create a separate state for pulse skipping

When a blt has been committed enter a low latency power state

Change-Id: Ie94c15db496f3943317f74e20808fb8393e32734
Signed-off-by: Tony Lofthouse <a0741364@ti.com>
gccore: move power off directly to module exit

In order to remove any doubts about when off state should be achieved
move the power off to the module exit.

Change-Id: I023cb9e9f275c2b6143709dd16a4a839875e6888
Signed-off-by: Tony Lofthouse <a0741364@ti.com>
gccore: Remove Android early suspend late resume handlers

Early suspend/late resume handlers are primarily present for the purpose of getting
the screen into a low power state for Android.

On the OMAP platform the principle means of handling this is that DSSCOMP will
blank the screen.

In order to enter the lowest power state gccore should use the standard Linux
suspend/resume handlers.

Change-Id: I3dded7c5c83bc2f03048d6c8ef32fce697ab847c
Signed-off-by: Tony Lofthouse <a0741364@ti.com>
omap_gcx: enhance to provide omap operations

In order to provide the gccore driver a function to check the state
of the prcm, we will put a function pointer in the gcx platform
device.

The previous platform device entries were not used by the gccore driver.

Change-Id: I7e3f1755261d99fe022964a2a26db6ba7f42092e
Signed-off-by: Tony Lofthouse <a0741364@ti.com>
gccore: enable suspend handler and poll for idle status

When a system level suspend event occurs the gccore driver
will set the GCHOLD bit in the GC320 and wait for the module
to become idle.

Change-Id: I139b57ede6f42c8c08689eec21d2d8d919ea2038
Signed-off-by: Tony Lofthouse <a0741364@ti.com>
gcx: when a surface geometry exceeds the size of the surface, return an error to avoid an mmu fault.

Change-Id: I1e8146c9b8b1c4a8e8d9024e167e4f3e39575f9c
Signed-off-by: Craig Stout <craig.stout@ti.com>
Revert "gcx: moved GC320 pixel cache flush to the end of the batch."

This reverts commit b61754229ee5f663a7445dae29b490d89d8e4f73.

Change-Id: Ia4fc5ac8764e9658885eb996995a2b4c6e39d6bc
Signed-off-by: Craig Stout <craig.stout@ti.com>
Revert "gcx: optimized programming of the destination."

This reverts commit fd2d28aabd51cd835d0339d835fb031ff4386f0e.

Change-Id: I6de8916a42f93856fefb79ed77d1818a28226a5b
Signed-off-by: Craig Stout <craig.stout@ti.com>
gccore: (work-around) attempt to power off gc320 during early suspend

Ideally we would cut clocks after each batch blit however it appears
that frequent off / on of the gc320 is still unstable. So handle
the early suspend anyway.

Change-Id: Ie47600863fcbe670bf67bc00aff8df9f462851b4
Signed-off-by: Tony Lofthouse <a0741364@ti.com>
MFD: twl6040-codec: Add test registers definitions

Add definitions for test registers.

Change-Id: Ic046f4639781981ca2421f5b75c0c5408a3dc976
Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
MFD: twl6040-codec: Add uEvent based event notification

Add initial support for a kobject event based notification mechanism
to inform userspace about TWL6040 events like handsfree overcurrent,
vibrator overcurrent, thermal event.

Since the events can be handled in other drivers apart from the MFD,
a new API (twl6040_report_event) is created so that MFD clients can
notify their events using a single kobject.

Change-Id: I07f71d1693a6eb189ca07fffeb3ebc12e539d4ae
Signed-off-by: Chris Kelly <c-kelly@ti.com>
MFD: twl6040-codec: Add register cache

Add register cache and define register operations (read, write,
set_bits, clear_bits) on cache only. So register operations
performed on I2C registers are now differentiated.

Register operations APIs exported by TWL6040 MFD are a wrapper
to its I2C counterparts at the moment.

Change-Id: I76137099e6264de9ac3213c596f662a50299aa82
Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
Signed-off-by: Gabriel M. Beddingfield <gabrbedd@ti.com>
Signed-off-by: Chris Kelly <c-kelly@ti.com>
MFD: twl6040-codec: Add register supply query APIs

Add a new set of APIs to TWL6040 MFD to query the supply of its
registers: twl6040_get_reg_supply(), twl6040_reg_is_vdd() and
twl6040_reg_is_vio().

Change-Id: Ic320ad7759c66d705f6025361cd6a296ac695dd9
Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
Signed-off-by: Chris Kelly <c-kelly@ti.com>
Signed-off-by: Gabriel M. Beddingfield <gabrbedd@ti.com>
MFD: twl6040-codec: Add register context restore

Add register context restore per supply.

Change-Id: I4918efee4fcc83f4998f59f3d376b798822ca3ce
Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
Signed-off-by: Chris Kelly <c-kelly@ti.com>
Signed-off-by: Gabriel M. Beddingfield <gabrbedd@ti.com>