OMAP4: EMIF: Add processing of memory overheating.

We need to turn the device off if memory is overheated.
This patch makes shutdown device if memory overheated in run-time
and makes reboot if memory overheated during booting.
In last case bootloader should process overheating

Change-Id: I28a0bfcd79a4018a628ffc099e3715b17b7034c1
Signed-off-by: Dan Murphy <dmurphy@ti.com>
plat-omap: mcbsp: Move WAKEUPEN configuration to omap_mcbsp_config

Configure the WAKEUPEN register at the same time we configure the rest of
the McBSP registers.
In case of OMAP2+, if the sysclock has been reconfigured we are going to
disable McBSP for the duration of the clock change, which will reset the
McBSP registers. The WAKEUPEN register need to be configured later, so
the changes will be effective during runtime.

Change-Id: I4085feb2c73a71856aaca47f3ecce06518ffb401
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
ASoC: ABE HAL: Set proper physical ID for MM_EXT port

Correct logical to physical port mapping for MM_EXT ports.

Change-Id: Ia617ec5cc9fcba85bcdedbb29aa3fe8ce9307985
Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
Signed-off-by: Axel Castaneda Gonzalez <x0055901@ti.com>
ASoC: sdp4430: Correct stream name for FM BE DAI

Correct stream name for OMAP_ABE_BE_MM_EXT0 backend DAI

Change-Id: I7e29dbda5a35f35a614fc45f3f7e3172444f89be
Signed-off-by: Manjunatha Halli <x0130808@ti.com>
Signed-off-by: Axel Castaneda Gonzalez <x0055901@ti.com>
omap: clock: implement clock notifier registration infrastructure

This patch implements notifier registration and unregistration
functions for clock rate changes.

The implementation is via a blocking notifier, called with the
clockfw spinlock held.  Callback functions must not re-enter the
clock framework.

There are likely to be few users of these notifiers, compared to
the total number of clocks.  So, rather than storing one notifier
per struct clk, notifiers are stored in a separate, dynamically
allocated list, effectively trading execution speed (in terms of
a sequential scan of the notifier list) for memory savings. The
implementation is completely hidden from the callbacks and can
be easily changed.

Until prototypes for these functions are made available in
include/linux/clk.h, drivers should pass function pointers to
clk_notifier_register() and clk_notifier_unregister() via their
platform_data struct.

Ported from kernel 35.

Change-Id: I30279a72ce04831d6ec88354a6215539be674fc3
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Mike Turquette <mturquette@ti.com>
Signed-off-by: Margarita Olaya <magi.olaya@ti.com>
omap: clock: add pre/post clock notifiers

This patch was adapted from Paul Walmsley's original patch introducting
clock notifiers: https://patchwork.kernel.org/patch/13320/

The original comment message is below:

"Call clock notifier blocks before and after rate and parent changes.
If the rate change fails for any reason after the notifier is called with
a pre-rate-change message, call the notifier again with an abort message.

Pre-rate-change notifiers are passed the current clock rate and the
desired clock rate.  For this to work with parent changes, additional
architecture-specific support was needed to predict the clock rate
after the parent change, so a "clk_round_rate_parent" function pointer
was added to struct clk_functions for this purpose, and this was
defined for the OMAP2/3 architecture.

(To minimize performance and code impact, post-rate-change notifiers,
however, are passed only the desired clock rate, i.e., the clock rate
after the rate change.)

The notifiers are called even if the clock rate does not change.  This
is because reprogramming a clock's parent or rate may briefly disrupt
the clock."

Changes to the original patchset include using a new "speculate" function
pointer to walk the list for the PRE change notifier instead of a temporary
storage in struct clk, as well as re-use of some existing clock framework
APIs for determining fieldvals properly.

Change-Id: Ic28fb7349c6a7ca85bb4a05cf5fae4516358ebdb
Signed-off-by: Mike Turquette <mturquette@ti.com>
Signed-off-by: Margarita Olaya <magi.olaya@ti.com>
omap: clock: not all clocks have .round_rate

Protect clk_set_rate function from the case where a clock does
not have a round_rate function pointer.  In such a case we simply
continue with the assumption that the rate passed into clk_set_rate
is OK.

This seems a bit dubious but if a clock does not have a round_rate
it is assumed it also does not have a set_rate function and will be
handled properly by clk_set_rate.

Change-Id: Ib0cce595fe42bbb450cb91196727b14823900bfe
Signed-off-by: Mike Turquette <mturquette@ti.com>
Signed-off-by: Margarita Olaya <magi.olaya@ti.com>
omap: clock: populate "speculate" function ptrs

Every clock must now support the "speculate" function pointer if
it is going to use the new clock notifier framework.  This patch
exports the speculate function and populates the pointer for every
OMAP4 clock.

Change-Id: I4724f0f33886e4ed0bf06164e1743cd98e24e413
Signed-off-by: Mike Turquette <mturquette@ti.com>
Signed-off-by: Margarita Olaya <magi.olaya@ti.com>
omap: clock: bypassed DPLL clkout recalc

The output clocks for bypassed DPLLs follow the bypass
rate without MN dividers applied.  Simply using omap2_clksel_recalc
for the recalc function of these clocks will cause the bypassed
rates to have the divider programmed in HW to be applied to that
rate, which is wrong.  Patch introduces a new recalc function
meant to handle these clocks specifically, and replaces the
.recalc function pointer of each of the affected clocks.

Change-Id: I9546868fb4a656e18206f3ea82b5caa6316e0b73
Signed-off-by: Mike Turquette <mturquette@ti.com>
Signed-off-by: Margarita Olaya <magi.olaya@ti.com>