ARM: 7128/1: vic: Don't write to the read-only register VIC_IRQ_STATUS

This is unneeded and causes an abort on the SPMP8000 platform.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Zoltan Devai <zoss@devai.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
ARM: 7122/1: localtimer: add header linux/errno.h explicitly

Per the text in  Documentation/SubmitChecklist as below, we should
explicitly have header linux/errno.h in localtimer.h for ENXIO
reference.

1: If you use a facility then #include the file that defines/declares
   that facility.  Don't depend on other header files pulling in ones
   that you use.

Otherwise, we may run into some compiling error like the following one,
if any file includes localtimer.h without CONFIG_LOCAL_TIMERS defined.

  arch/arm/include/asm/localtimer.h: In function ‘local_timer_setup’:
  arch/arm/include/asm/localtimer.h:53:10: error: ‘ENXIO’ undeclared (first use in this function)

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
ARM: mm: Optimise the v7 Dcache flush all routine.

The current algorithm flushes using the SET and WAY, where it iterates over
a given SET in all the WAYS and to the next SET. Change this so that every
successive flush address will go to in to the alternate EMIF(1/2), there by
utilising the full bandwidth. Also iterating all the SETS of a given WAY,
and then switching to the next way can reduce the possibility of frequent
change in the row bits during successive transactions of the DDR memory.
This will help in reducing the ROW open/close time.

Signed-off-by: Marquette Anderson <m-anderson13@ti.com>
ARM: mm: Add v7_flush_dcache_by_level() API.

On ARMv7 based SOC with an integrated L2 cache, there is a need to have a flush
api to operate on each cache level. In few low power modes, L2 cache is retained
where as L1 is lost. The current v7_flush_dcache_all(), flushes all the levels
and it would be quite expensive.

So introduce v7_flush_dcache_by_level() API which takes a parameter (cache
level), and flush only on that level.

The set/way loops can be shared between v7_flush_dcache_by_level() and
v7_flush_dcache_all(). I didn't do that in this version to avoid indirections
and primiarily not to touch the existing and widely used API.

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Sricharan R <r.sricharan@ti.com>
ASoC: Trivial formatting fix in soc-core.c

Utterly trivial but it annoys me.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
OMAP4: DSS: Fix to correct the manager index for VSYNC irq handler

Patch to fix the Manager id in dss_completion_irq_handler.
DSSCOMP is expecting the manager id 1 to be mapped to HDMI display.
This patch fixes the DSSCOMP_STATE_DISPLAYED callback in DSSCOMP.

Change-Id: I0aab3e494cb305d75a64fabc4cd6919def636285
Signed-off-by: Muralidhar Dixit <murali.dixit@ti.com>
Signed-off-by: Varadarajan Charulatha <charu@ti.com>
OMAP4:DSS2: Avoid VID/GFX underflow errors

FIFO threshold calculations do not work for some scenarios.
Adjusted FIFO low threshold empirically to avoid underflow errors.

Change-Id: Ib979050acaeca206fa4ad26ed53659869495e010
Signed-off-by: Erik Gilling <konkers@android.com>
Signed-off-by: Lajos Molnar <lajos@ti.com>
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>