Revert "ARM: shmobile: koelsch: Add support HSCIF1"

This reverts commit 4c9cf9dc4a08331e29965993669217dc353c5e88.
ARM: shmobile: Move intc.h, cleanup sh_intc.h usage

Change location of intc.h so it can be used as #include "intc.h"
instead of the old style #include <mach/intc.h>. Also clean up
some code to get rid of redundant #include <linux/sh_intc.h>.

Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 6200e2c1847b2282db13877b2398a5bee9e42254)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
ARM: shmobile: Move dma-register.h

Change location of dma-register.h so it can be used as #include
"dma-register.h" instead of the old style #include <mach/dma-register.h>.

Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 74ac0de8b7ee41246b8d6aae1df0618a64451435)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
ARM: shmobile: Move clock.h

Change location of clock.h so it can be used as #include "clock.h"
instead of the old style #include <mach/clock.h>.

Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit ad6ffa0b59dc2c81474d7642fa2188e25cce99d6)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>

Conflicts:
	arch/arm/mach-shmobile/clock-r8a7779.c
	arch/arm/mach-shmobile/board-koelsch-reference.c
	arch/arm/mach-shmobile/board-lager-reference.c
ARM: shmobile: Move most of irqs.h, keep some for pinctl

Move most of irqs.h so it can be used as #include "irqs.h"
instead of the old style #include <mach/irqs.h>.

Legacy code in drivers/pinctrl needs more work to get rid
of the "mach" portion of the include path, so some part
is left in the original location.

Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
[horms+renesas@verge.net.au: Do not add trailing blank line to irqs.h]
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>

(cherry picked from commit b6bab1263c61e39cfc3427f54baff6f683f54298)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>

Conflicts:
	arch/arm/mach-shmobile/setup-r8a7791.c
ARM: shmobile: Move common.h

Change location for common.h so it can be used as #include "common.h"
instead of the old style #include <mach/common.h>.

Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit fd44aa5e570d1d8c7d361dcbf94c2b8cd25cfe92)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>

Conflicts:
	arch/arm/mach-shmobile/board-armadillo800eva.c
	arch/arm/mach-shmobile/board-koelsch-reference.c
	arch/arm/mach-shmobile/board-lager-reference.c
	arch/arm/mach-shmobile/board-marzen-reference.c
	arch/arm/mach-shmobile/clock-r8a7779.c
	arch/arm/mach-shmobile/platsmp-apmu.c
	arch/arm/mach-shmobile/setup-emev2.c
	arch/arm/mach-shmobile/setup-r8a7791.c
	arch/arm/mach-shmobile/setup-rcar-gen2.c
ARM: shmobile: Move pm-rmobile.h, cleanup sh73xx.h

Change location of pm-rmobile.h so it can be used as #include "pm-rmobile.h"
instead of the old style #include <mach/pm-rmobile.h>. Also clean up
the sh7372 and sh73a0 header files to get rid of unused include files.

Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 6b8b0cb477b3e77721982effae3415f3c5f58fee)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
ARM: shmobile: Move pm-rcar.h, cleanup r8a7779 case

Change location of pm-rcar.h so it can be used as #include "pm-rcar.h"
instead of the old style #include <mach/pm-rcar.h>. Also clean up
the r8a7779 case to move some unused header file cruft into a C
file.

Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 585c09df3738d4f72cee36eb0b975351fd9a339a)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>

Conflicts:
	arch/arm/mach-shmobile/include/mach/r8a7779.h
ARM: shmobile: Move rcar-gen2.h, cleanup r8a7790 case

Change location of rcar-gen2.h so it can be used as #include "rcar-gen2.h"
instead of the old style #include <mach/rcar-gen2.h>. Also clean up
the r8a7790 case to follow the same style as r8a7791.

Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 62872989bdbf1245d7239b9f4c05a8ee7c775ed5)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>

Conflicts:
	arch/arm/mach-shmobile/board-koelsch-reference.c
	arch/arm/mach-shmobile/board-lager-reference.c
	arch/arm/mach-shmobile/setup-rcar-gen2.c
ARM: shmobile: rcar-gen2: Use "1ULL" instead of "(u64)1"

Casts are evil

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Magnus Damm <damm+renesas@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit b69f47c00f2eff19b532cf0142d81b993e587bf0)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
ARM: shmobile: rcar-gen2: Remove useless copied section for LongTrail

Open Firmware in the CHRP LongTrail does not support plugging in ARM CPUs
in its PPC 603e/604e-compatible CPU socket ;-)

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Magnus Damm <damm+renesas@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit ea2a0d581a3e742c2fb2bc520c8c8887fe1dafa6)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
ARM: shmobile: rcar-gen2: correct return value of shmobile_smp_apmu_suspend_init

The dummy shmobile_smp_apmu_suspend_init() function provided when
CPU_IDLE is not set should not return a value as per the signature
of the function.

This problem appears to have been introduced by
867ba81f728f1daa ("ARM: shmobile: APMU: Add Core-Standby-state for Suspend
to RAM").

Cc: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit ecdaca48629bd99609fdc612685363330967dce2)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
PM / Runtime: Rework the "runtime idle" helper routine

The "runtime idle" helper routine, rpm_idle(), currently ignores
return values from .runtime_idle() callbacks executed by it.
However, it turns out that many subsystems use
pm_generic_runtime_idle() which checks the return value of the
driver's callback and executes pm_runtime_suspend() for the device
unless that value is not 0.  If that logic is moved to rpm_idle()
instead, pm_generic_runtime_idle() can be dropped and its users
will not need any .runtime_idle() callbacks any more.

Moreover, the PCI, SCSI, and SATA subsystems' .runtime_idle()
routines, pci_pm_runtime_idle(), scsi_runtime_idle(), and
ata_port_runtime_idle(), respectively, as well as a few drivers'
ones may be simplified if rpm_idle() calls rpm_suspend() after 0 has
been returned by the .runtime_idle() callback executed by it.

To reduce overall code bloat, make the changes described above.

Tested-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Tested-by: Kevin Hilman <khilman@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Kevin Hilman <khilman@linaro.org>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
(cherry picked from commit 45f0a85c8258741d11bda25c0a5669c06267204a)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
sh: intc: Enable driver compilation with COMPILE_TEST

This helps increasing build testing coverage.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 4f3068f60503e08bc9e729528d9e54289980fa96)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
sh: clk: Use cpufreq_for_each_valid_entry macro for iteration

The cpufreq core now supports the cpufreq_for_each_valid_entry macro
helper for iteration over the cpufreq_frequency_table, so use it.

It should have no functional changes.

Signed-off-by: Stratos Karafotis <stratosk@semaphore.gr>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
(cherry picked from commit 4229e1c61a4a7ac21d5d0790f6add1c9b98d33e7)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
sh: intc: Remove pointless irq_reserve_irqs() invocation

The preceding call to irq_create_identity_mapping() marks the
interrupt as allocated already. Remove the leftover.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Grant Likely <grant.likely@linaro.org>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Acked-by: Simon Horman <horms@verge.net.au>
Cc: linux-sh@vger.kernel.org
Link: http://lkml.kernel.org/r/20140507154339.189047829@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
(cherry picked from commit 3670802223e164f1089287d1c223d34d3c5dc3da)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
drivers: sh: pm_runtime does not need idle callback

In the runtime_pm idle callback the code assumes that a NULL .runtime_idle
entry is the same as a .runtime_idle entry that returns 0 as a result. This
means the entry in drivers/sh/pm_runtime can be removed in favour of just
leaving the entry NULL.

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> [r8a7779 legacy]
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit fe95c932a31e7f12bcb6a4e07434462da2ac6e1d)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
drivers: sh: Restrict INTC_USERIMASK to SH4A

register_intc_userimask() is called from sh4a code only.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> [r8a7779 legacy]
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 39c5abbc54179998bf04368a11c561e19220d7d4)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
drivers: sh: pm_runtime implementation needs to suspend and resume devices

If we override the platform bus calls for pm_runtime then we end up
with the calls to the devices' suspend and resume methods ignored
in favour of the bus ones.

Change to calling the pm_runtime calls to suspend and resume the
devices specifically in the drivers/sh/pm_runtime.c implementation
to allow any device that may want to run power management to do so.

Note, all the current sh driver implementations do not use their
own power management code so this is not a major implementation
issues.

This also brings the implementation into line with the versions
used by the Davinci and Keystone PM domain code, so once fully
tested these implementations could be merged together.

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 8255fe169232364e5a01bd062e8037b8c1a9adec)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
drivers: sh: Enable PM runtime for new R-Car Gen2 SoCs

The PM runtime code should also be enabled for:
  - r8a7792 (R-Car V2H)
  - r8a7793 (R-Car M2-N)
  - r8a7794 (R-Car E2)

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 2f35fb3c8a6018a0a5fe4a7fb0948b853c157256)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>