of: fix incorrect return value of of_find_matching_node_and_match()

The of_find_matching_node_and_match() function incorrectly sets the matched
entry to 'matches' when the compatible value of a node matches one of the
possible values. This results in incorrectly selecting the the first entry in
the 'matches' list as the matched entry. Fix this by noting down the result of
the call to of_match_node() and setting that as the matched entry.

Signed-off-by: Thomas Abraham <thomas.abraham@linaro.org>
ARM: SAMSUNG: Move samsung-time to drivers/clocksource

This patch moves the Samsung PWM-based high resolution timer support
code from arch/arm/plat-samsung to drivers/clocksource.

This is a prerequisite for further work on making the driver more
multiplatform and Device Tree friendly.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
clocksource: samsung-time: Set platform-specific parameters at runtime

This patch removes static platform-specific defines from samsung-time
implementation and introduces an interface to configure
platform-specific timer parameters from platform code.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
clocksource: samsung-time: Drop useless defines from public header

This patch cleans up public header from useless definitions.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
clocksource: samsung-time: Move samsung-time.h header to include/linux

This patch moves the samsung-time.h header file to include/linux
directory and fixes all references to it.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
clocksource: samsung-time: Use local register definitions

This patch copies PWM timer register definitions to samsung-time.c. The
original header in plat is being kept for now, since it is also used by
other code that also needs to be reworked to be multiplatform-friendly.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
clocksource: samsung-time: Remove use of static register mapping

This patch brings the samsung-time driver one step closer to
multiplatform by replacing references to statically mapped registers
with dynamic mapping using ioremap.

The helper struct samsung_timer_variant is extended with reg_base field,
which is used to pass platform-specific base address to the driver.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
clocksource: samsung-time: Use clk_get_sys for getting clocks

This patch removes the need to reference platform_device structs defined
in platform code, by using clk_get_sys instead of clk_get for getting
necessary clocks.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
ARM: SAMSUNG: devs: Drop unnecessary IRQ resources of timer devices

Devices from s3c_device_timer array are used only for PWM driver, which
does not need interrupts. This patch removes IRQ resources of those
devices.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
clocksource: samsung-time: Do not use static IRQ definition

As another step towards multiplatform support, this patch modifies the
samsung-time clocksource driver and its users to pass timer IRQ numbers
through the samsung_timer_variant structure.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
clocksource: samsung-time: Move IRQ mask/ack handling to the driver

Since the clocksource driver is the only user of PWM timer interrupts,
there is no need to create an IRQ chip for handling them.

This patch the way of PWM timer interrupt handling to use real VIC/GIC
interrupt signals and handle PWM mask/ack register internally in
samsung-time driver.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
ARM: SAMSUNG: Remove unused PWM timer IRQ chip code

As the need for an IRQ chip handling PWM timer interrupt chaining is
gone now, this patch removes all the code made unnecessary.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
clocksource: samsung-time: Add Device Tree support

This patch adds support for parsing all platform-specific data from
Device Tree and instantiation using clocksource_of_init to samsung-time
clocksource driver.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
ARM: common: vic: Parse interrupt and resume masks from device tree

This patch extends vic_of_init to parse valid interrupt sources
and resume sources masks from device tree.

If mask values are not specified in device tree, all sources
are assumed to be valid, as before this patch.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
ARM: s3c64xx: Add board file for boot using Device Tree

This patch adds board file that will be used to boot S3C64xx-based boards
using Device Tree.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
ARM: dts: Add basic dts include files for Samsung S3C64xx SoCs

This patch adds basic device tree definitions for Samsung S3C64xx SoCs.

Since all the SoCs in the series are very similar, the files are created
hierarchically - one file for the whole series and then separate files
for particular SoCs including the common one.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
ARM: dts: Add dts file for S3C6410-based Mini6410 board

This patch adds basic device tree sources for FriendlyARM Mini6410 board
based on Samsung S3C6410 SoC.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>