ARM: mach-imx: avic: Staticize *avic_base

Fix the following sparse warning:

arch/arm/mach-imx/avic.c:54:14: warning: symbol 'avic_base' was not declared. Should it be static?

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
ARM: mach-imx: gpc: Include "common.h"

Fix the following sparse warnings:

arch/arm/mach-imx/gpc.c:29:6: warning: symbol 'imx_gpc_pre_suspend' was not declared. Should it be static?
arch/arm/mach-imx/gpc.c:43:6: warning: symbol 'imx_gpc_post_resume' was not declared. Should it be static?
arch/arm/mach-imx/gpc.c:71:6: warning: symbol 'imx_gpc_mask_all' was not declared. Should it be static?
arch/arm/mach-imx/gpc.c:83:6: warning: symbol 'imx_gpc_restore_all' was not declared. Should it be static?
arch/arm/mach-imx/gpc.c:122:13: warning: symbol 'imx_gpc_init' was not declared. Should it be static?

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
ARM: mach-imx: src: Include "common.h

Fix the following sparse warnings:

arch/arm/mach-imx/src.c:28:6: warning: symbol 'imx_enable_cpu' was not declared. Should it be static?
arch/arm/mach-imx/src.c:39:6: warning: symbol 'imx_set_cpu_jump' was not declared. Should it be static?
arch/arm/mach-imx/src.c:46:6: warning: symbol 'imx_src_prepare_restart' was not declared. Should it be static?
arch/arm/mach-imx/src.c:59:13: warning: symbol 'imx_src_init' was not declared. Should it be static?

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
ARM: mach-imx: mach-imx6q: Fix sparse warnings

Fix the following sparse warnings:

arch/arm/mach-imx/mach-imx6q.c:60:6: warning: symbol 'imx6q_restart' was not declared. Should it be static?
arch/arm/mach-imx/mach-imx6q.c:223:24: warning: symbol 'imx6q_cpufreq_pdev' was not declared. Should it be static?

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Merge remote-tracking branch 'arm-soc/clksrc/cleanup' into mxs/cleanup
ARM: mxs: use CLKSRC_OF helper to initialize timer

Select CLKSRC_OF and use clocksource_of_init() to initialize timer, so
that the call to mxs_timer_init() in clock driver can be removed.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
ARM: mxs: look up timrot clock from device tree

Change call clk_get_sys() to of_clk_get() to look up timrot clock from
device tree, so that the clk_register_clkdev() call for timrot can be
saved in clock driver.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
ARM: mxs: get timrot base address from device tree

Instead of using static defines, it gets timrot base address with
mapping from device tree.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
ARM: mxs: remove cpu_is_mx23() call from timer code

Remove cpu_is_mx23() call from timer code by using
of_device_is_compatible() instead.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
ARM: mxs: select STMP_DEVICE and use it for timer code

Select STMP_DEVICE and in timer code replace mxs_reset_block() with
stmp_reset_block(), use STMP_OFFSET_REG_SET/CLR to replace
__mxs_setl/clrl.

As the result, <mach/mxs.h> and <mach/common.h> includsion can be
removed from timer.c now.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
ARM: mxs: move timer driver into drivers/clocksource

Move mxs timer driver into drivers/clocksource as mxs_timer.c.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
ARM: mxs: get icoll base address from device tree

Rather than using the static definition, it gets icoll base address
with mapping from device tree.

As the result, <mach/mxs.h> inclusion can be removed from the driver
now.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
ARM: mxs: call stmp_reset_block() in icoll

Call stmp_reset_block() rather than mxs_reset_block(), so that
<mach/common.h> inclusion can be removed from icoll driver.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
ARM: mxs: move icoll driver into drivers/irqchip

Move icoll.c into drivers/irqchip as irq-mxs.c, and along with the
renaming, change the driver to use IRQCHIP_DECLARE.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
ARM: mxs: remove unneeded mach-types.h inclusion

Remove the unneeded mach-types.h inclusion from mxs.h, which is a
leftover from commit 845da6b (ARM: mxs: detect SoC by checking CHIPID
register).

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
clk: mxs: get base address from device tree

Instead of using the static definitions, get clkctrl and digctl base
addresses with mapping from device tree.

Use macro on variable is not nice, but it's done here to save huge
pointless diff stat.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Mike Turquette <mturquette@linaro.org>
clk: mxs: remove the use of mach level IO accessor

It removes the use of mach level IO accessor __mxs_setl/clrl, and hence
removes mach header inclusion from clock driver.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Mike Turquette <mturquette@linaro.org>
rtc: stmp3xxx: use stmp_reset_block() instead

The function stmp_reset_block() provides the exactly same functionality
as mxs_reset_block().  So use stmp_reset_block() instead, so that
<mach/common.h> inclusion can be removed.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: rtc-linux@googlegroups.com
iio: mxs-lradc: remove unneeded mach header inclusion

Headers <mach/mxs.h> and <mach/common.h> are not used in the driver
at all.  Removed the inclusions.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Jonathan Cameron <jic23@kernel.org>
ARM: mxs: Select ARM_CPU_SUSPEND

Select ARM_CPU_SUSPEND so that suspend/resume can be tested on mxs platforms.

Tested on a mx28evk board:

$ echo enabled > /sys/devices/80000000.apb/80040000.apbx/80074000.serial/tty/ttyAMA0/power/wakeup
$ echo mem > /sys/power/state
[  507.040000] PM: Syncing filesystems ... done.
[  507.060000] mmc0: card e624 removed
[  507.160000] Freezing user space processes ... (elapsed 0.01 seconds) done.
[  507.180000] Freezing remaining freezable tasks ... (elapsed 0.01 seconds) done.
[  507.200000] Suspending console(s) (use no_console_suspend to debug)

(Then send any character via DUART to wakeup the system).

[  507.220000] PM: suspend of devices complete after 10.468 msecs
[  507.220000] PM: late suspend of devices complete after 3.531 msecs
[  507.230000] PM: noirq suspend of devices complete after 5.187 msecs
[  507.230000] PM: noirq resume of devices complete after 2.312 msecs
[  507.230000] PM: early resume of devices complete after 2.437 msecs
[  507.320000] PM: resume of devices complete after 81.312 msecs
[  507.360000] Restarting tasks ... done.
[  507.530000] mmc0: new SDHC card at address e624
[  507.550000] mmcblk0: mmc0:e624 SU04G 3.69 GiB
[  507.560000]  mmcblk0: p1 p2 p3
[  509.240000] libphy: 800f0000.etherne:01 - Link is Down
[  511.240000] libphy: 800f0000.etherne:01 - Link is Up

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>