rpmsg: do not kick remote processor upon priming rx buffers

The rpmsg bus driver currently sends a notification to the remote
processor after adding all the receive buffers to the vring. This
is commented out to help support the boot of a non-SMP IPU image.

The non-SMP IPU implementation uses two virtio devices, one per
processor, but represented by a single rproc instance. The rpmsg
probe function would cause the processor to be started for each
virtio device, and then notify the remote processor using the
mailbox (which is created only when the rproc is started) within
the rproc instance. This logic will be adjusted for non-SMP IPU,
wherein the processor would be started only when the second virtio
device is instantiated, and hence the notification cannot be made
prior to starting of the processor.

This change is a quick solution (not so neat) and works for the
most part since the first transmission from the remote processor
is always to announce a rpmsg channel, and the tx packet retrieval
for this announcement will be successful only after the rx buffers
are primed by host. The current notification is used for posting a
semaphore, signalling any tx threads that a new buffer is available.

There is still a small chance wherein a tx buffer retrieval may
happen before the rx buffers are primed, but the image initialization
on the remote processor is long enough to minimize these chances
greatly.

Change-Id: I6f5a4a44e50f3084a102bdeb3d2d235c86cde09a
Signed-off-by: Suman Anna <s-anna@ti.com>
remoteproc: add support for multiple vdevs within a rproc instance

Support has been added to the core remoteproc code to allow multiple
virtio devices per rproc instance. This feature is generic in general,
but is being added primarily to support booting non-smp ipu cores in
OMAP. The feature is designed by processing all the virtio device
resources first, and registering all of them together. The processor
is booted only when the last virtio device is probed.

Change-Id: I9cbd8f4fad6aeadad0878bab15e2fbba8e154e81
Signed-off-by: Suman Anna <s-anna@ti.com>
omap: remoteproc: add support to boot OMAP4 IPU in non-smp mode

IPU would require an additional timer to provide the system tick
for core1 when running in non-SMP mode. GPTimer 4 is added to the
timers data to serve as this additional timer.

The current logic is hardcoded to boot OMAP4 IPU in non-SMP mode,
with OMAP5 IPU unchanged to boot in SMP-mode. The choice was made
at run-time instead of configuration time, since ARCH_OMAP4 and
ARCH_OMAP5 would both be enabled in most common defconfigs like
omap2plus_defconfig.

Change-Id: Iba94b98e7d1d956f193f7394d797a5e08f416c6b
Signed-off-by: Suman Anna <s-anna@ti.com>
ARM: OMAP4: hwmod_data: Add missing section of the control module

The control module core partition is made of 2 parts. Some modules
need to address "pad" part but there is no address space for it. So,
add missing section of the control module, "pad" part.

Change-Id: Icbf1a8fe43a95150b86a892c76211f2ebfe47e1b
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
ARM: OMAP4: hwmod_data: Correct control module clock domain

According to TRMs:
- OMAP4430_ES2.x_Public_TRM_vAJ
- OMAP4460_ES1.x_Public_TRM_vV
- OMAP4470_ES1.0_Public_TRM_vN

The PRCM module provides the CFG_L4_ICLK functional clock to each of
the two core control submodules, the clock is in L4_CFG clock domain.
Currently we have set incorrect clock domain name "ducati_clkdm", so
correct the clock domain name to actual - "l4_cfg_clkdm".

Change-Id: Id1ede121d43f5d68719db3570df2e74d963f88a3
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
mfd: omap: control: Extend framework to use core pad part

The control module allows software control of various static modes
supported by the device. It is composed of two control submodules:
general control module and device (pad configuration) control module.

Currently to address "pad" part, drivers must make hacks like using
big shifts based on "general" part. It is brutal approach and it
leads to many errors.

So add functions to use missing pad part of module:

int omap_control_core_pad_readl(struct device *dev, u32 reg, u32 *val);
int omap_control_core_pad_writel(struct device *dev, u32 val, u32 reg);

Change-Id: Ie5ec9bb8e2ba4e115692c543a12cabede474852a
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
mfd: omap: usb-phy: Correct access to CONTROL_USB2PHYCORE register

Currently, to manipulate CONTROL_USB2PHYCORE we use omap_control_*
functions. The CONTROL_USB2PHYCORE is in core pad part of control
module, so we need to use omap_control_core_pad_* functions.
So rename function and correct CONTROL_USB2PHYCORE value.

Change-Id: I02954eca77bbf865b26d86c6dab25769a21ea0f2
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
mfd: omap: usb-phy: Correct a name of the driver

The USB-PHY device uses a name "omap4-usb-phy". This is incorrect.
The same is corrected to "omap-control-usb".

Change-Id: I3cbc0daf90ea3e2db280504b5067f357aadcf83c
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
mfd: omap: usb-phy: Add OMAP4 support in USB charger detection

OMAP4 and OMAP5 have different addresses of the
OMAP4_CONTROL_USB2PHYCORE register.
So we need to detect OMAP version and use the
appropriate address.

Change-Id: Icf534dc40928894918dbc8db56d6c740d4e0e642
Signed-off-by: Oleg_Kosheliev <oleg.kosheliev@ti.com>
HACK: ASoC: increase OPP from 50 to 100 during audio record

We should increase OPP for ABE during audio record to avoid low volume
level of recorded sound. This change increases OPP from 50 to 100.
This change should be reverted after the root cause fix will be prepared.

Change-Id: Ib689eff20b0f7aeb7cccc3185e50adab24bfb3e1
Signed-off-by: Victor Kleinik <x0150886@ti.com>
OMAPDSS: DISPC: Pipe threshold sizes power optimization.

This patch changes the calculation of thresholds and sets low
threshold to half of buffer size for OMAP4. The memory will
able to sleep between transactions to dss because dss will
read by big chunks.

Change-Id: I3c9e03fa197cc0b6ece01fb1b9a26f607238f15a
Signed-off-by: Artem Rudenko <artemrudenko@ti.com>
usb: musb: omap2430: don't loop indefinitely in interrupt.

When called during resume_irqs, omap2430_musb_set_vbus() is run with
interrupts disabled,  In that case 'jiffies' never changes so the loop
can loop forever.

So impose a maximum loop count and add an 'mdelay' to ensure we wait
a reasonable amount of time for bit to be cleared.

This fixes a hang on resume.

[Ruslan]: cherry-picked from upstream
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;
a=commit;h=12a19b5f836c1a1b838e668f9aa804d017d8c58b

Change-Id: I02aab4597014361a9528d3f90a8f3144057ef51a
Signed-of-by: NeilBrown <neilb@suse.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@ti.com>
ARM: OMAP4: board tablet/blaze: Add device oscillator startup/shutdown timings

Add the device oscillator startup and shutdown timing API call
to the board file to enumerate the values.

3.2 Start-up time
Max. 2.0ms (to 90% of final amplitude)
3.3 Stabilization time
Max. 2.0ms (Within +/-0.5ppm of steady state frequency)

Shutdown is not defined in the data sheet so we give it a 1us
shutdown time.

Change-Id: I4a3db5ba48a67a1db6ed5d410e0b7582d7601d21
Signed-off-by: Dan Murphy <dmurphy@ti.com>
[ivan.khoronzhuk@ti.com: ported from k3.0]
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
ARM: OMAP4470: CLOCKDOMAIN: add 4470 version of l3_dss_clkdm

BB2D hangs when H/W auto idle mode is used for the l3_dss_clkdm,
this patch introduces a 4470 version of l3_dss_clkdm which supports
s/w wakeup and sleep only.

Change-Id: Id9c050894a656d8036ffe59d1cc1c29eaec65dfc
Signed-off-by: Tony Lofthouse <a0741364@ti.com>
[ivan.khoronzhuk@ti.com: ported from p-android-omap-3.0]
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
usb: otg: twl6030-usb: Remove redundant variable comparator

The static variable comparator was used only once in
probe and it's possible to remove it, using directly
the data which was loaded to this var.

Change-Id: Iba46251d867f94e064555ec1f3668b4bde47d3ca
Signed-off-by: Oleg_Kosheliev <oleg.kosheliev@ti.com>