ARM: cleanup: OMAP hwmod error checking

omap_hwmod_lookup() only returns NULL on error, never an error pointer.
Checking the returned pointer using IS_ERR_OR_NULL() is needless
overhead.  Use a simple !ptr check instead.

OMAP devices (oh->od) always have a valid platform device attached (see
omap_device_alloc()) so there's no point validating the platform device
pointer (we will have already oopsed long before if this is not the
case here.)

Lastly, oh->od is only ever NULL or a valid omap device pointer - 'oh'
comes from the statically declared hwmod tables, and the pointer is
only filled in by omap_device_alloc() at a point where the omap device
pointer must be valid.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
ARM: dts: cleanup exynos5440.dtsi

remove duplicated compatible

Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
ARM: SAMSUNG: Rename s5p-time to samsung-time

Signed-off-by: Naour Romain <romain.naour@openwide.fr>
Reviewed-by: Tomasz Figa <tomasz.figa@gmail.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
ARM: S3C24XX: Add samsung-time support for s3c24xx

Signed-off-by: Naour Romain <romain.naour@openwide.fr>
Reviewed-by: Tomasz Figa <tomasz.figa@gmail.com>
[heiko@sntech.de: tested on a s3c2416 based machine]
Reviewed-and-Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
ARM: S3C64XX: Add samsung-time support for s3c64xx

Signed-off-by: Naour Romain <romain.naour@openwide.fr>
[tomasz.figa@gmail.com: tested on a Tiny6410 board]
Reviewed-and-Tested-by: Tomasz Figa <tomasz.figa@gmail.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
ARM: S5PC100: Add samsung-time support for s5pc100

Signed-off-by: Naour Romain <romain.naour@openwide.fr>
Reviewed-by: Tomasz Figa <tomasz.figa@gmail.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
ARM: SAMSUNG: Remove unused plat-samsung/time.c

Signed-off-by: Naour Romain <romain.naour@openwide.fr>
Reviewed-by: Tomasz Figa <tomasz.figa@gmail.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
ARM: S3C24XX: move s3c244x irq init to common irq code

Base for further modifications.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
ARM: S3C24XX: create dedicated irq init functions for s3c2440 and s3c2442

s3c2440 and s3c2442 need separate init functions, as the s3c2440 contains
even more differing irqs that will be moved in the following patch.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
ARM: S3C24XX: move s3c2440 irqs to common irq code

Will be integrated in the following patch.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
ARM: S3C24XX: integrate s3c2440 irqs into common init

Now all the arch_initcalls for s3c244x irqs are gone.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
ARM: S3C24XX: transform s3c2442 irqs into new structure

Simply declare a correct mapping structure to use the common irq code.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
ARM: S3C24XX: transform s3c2440 irqs into new structure

As always a mapping structure is everything needed.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
ARM: S3C24XX: use samsung_sync_wakemask in s3c2412 pm

Originally the s3c2412 used a overidden irq chip to set the rtc wakeup flag.
But with using the samsung_sync_wakemask function the same can be achieved
without introducing soc specific irq functions.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
ARM: S3C24XX: move s3c2412 irq init to common code

Base for further cleanups

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
ARM: S3C24XX: modify s3c2412 irq init to initialize all irqs

Combines the two independent init steps for the irqs into one.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
ARM: S3C24XX: transform s3c2412 irqs into new structure

Contains only the new mapping structure. The special handling
of the eint0 to eint3 interrupts still needs to be solved.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
ARM: S3C24XX: include first 4 bits of the eint register in irq mapping

This patch moves the irq numbers starting with EINT4 4 points down to
enable the inclusion of the first 4 bits of EINT register into the mapping
removing the need for special offset handling.

For most S3C24XX architectures this will simply create 4 additional unused
interrupts, but enables the S3C2412 to make use of the new infrastructure
to realize its special handling of the EINT0 to EINT3 interrupts.

All affected parts of the Samsung code (arch + drivers) seem to use the
real interrupt defines (IRQ_something) and not any form of S3C2410_IRQ(x)
whose numbering is changed here starting from S3C2410_IRQ(32).

This patch was runtime-tested on a s3c2416 based board.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
ARM: S3C24XX: add soc_is_s3c2412 option

Makes it possible to identify s3c2412 SoCs.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
ARM: S3C24XX: handle s3c2412 eints using new infrastructure

The s3c2412 handles the eints 0 to 3 different than all the other SoCs
of the 24xx range. These eints must be acked and masked in the regular
bits as well as the bits 0 to 3 of the eint registers, which are unused
on the other SoCs.

This of course can be realized using the new infrastructure with the
eint bits in the main register being the parent interrupts of the
same bits in the eint register.

The s3c2412 therefore gets its own IRQ_EINT0 to 4 constants that
reside in the newly created gap before IRQ_EINT4. gpio-samsung, as the
only user of these is modified to return the correct values when
handling gpio_to_irq requests on s3c2412 based machines.

Due to lack of hardware this is compile tested only, but should
hopefully work as intended.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>