Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 18/26] ARM: pxa: MTD_XIP is not actually working any more
From: Arnd Bergmann @ 2011-10-01 20:03 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1317499438-14058-1-git-send-email-arnd@arndb.de>

The headers files required for XIP support have moved around
over the last few years, and the code no longer builds.
Until someone fixes this, let's just disable support, leaving
sa1100 as the only platform still supporting xip.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/Kconfig |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 570c9fd..71b0ccb 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -619,7 +619,6 @@ config ARCH_PNX4008
 config ARCH_PXA
 	bool "PXA2xx/PXA3xx-based"
 	depends on MMU
-	select ARCH_MTD_XIP
 	select ARCH_HAS_CPUFREQ
 	select CLKDEV_LOOKUP
 	select CLKSRC_MMIO
-- 
1.7.5.4

^ permalink raw reply related

* [PATCH 19/26] ARM: pxa: CPU_FREQ_TABLE is needed for CPU_FREQ
From: Arnd Bergmann @ 2011-10-01 20:03 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1317499438-14058-1-git-send-email-arnd@arndb.de>

The pxa specific cpufreq code is based on the cpu_freq_table
module, so we have to select that.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/Kconfig |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 71b0ccb..3b84eda 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1926,6 +1926,7 @@ config CPU_FREQ_PXA
 	bool
 	depends on CPU_FREQ && ARCH_PXA && PXA25x
 	default y
+	select CPU_FREQ_TABLE
 	select CPU_FREQ_DEFAULT_GOV_USERSPACE
 
 config CPU_FREQ_S3C
-- 
1.7.5.4

^ permalink raw reply related

* [PATCH 20/26] ARM: pxa: select FB_PXA on saar and tevorevb
From: Arnd Bergmann @ 2011-10-01 20:03 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1317499438-14058-1-git-send-email-arnd@arndb.de>

The saar and tevorevb platforms call pxafb_smart_flush from board
code, and that function is defined in the framebuffer code, so it
cannot be disabled.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/mach-pxa/Kconfig |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
index bb310d0..cd94f2f 100644
--- a/arch/arm/mach-pxa/Kconfig
+++ b/arch/arm/mach-pxa/Kconfig
@@ -61,11 +61,15 @@ config MACH_TAVOREVB
 	bool "PXA930 Evaluation Board (aka TavorEVB)"
 	select PXA3xx
 	select CPU_PXA930
+	select FB_PXA
+	select FB
 
 config MACH_SAAR
 	bool "PXA930 Handheld Platform (aka SAAR)"
 	select PXA3xx
 	select CPU_PXA930
+	select FB_PXA
+	select FB
 
 comment "Third Party Dev Platforms (sorted by vendor name)"
 
-- 
1.7.5.4

^ permalink raw reply related

* [PATCH 21/26] ARM: pxa: select POWER_SUPPLY on raumfeld
From: Arnd Bergmann @ 2011-10-01 20:03 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1317499438-14058-1-git-send-email-arnd@arndb.de>

The raumfeld platform code calls power_supply_set_battery_charged
which is part of the power supply layer, so that always has
to be enabled.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/mach-pxa/Kconfig |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
index cd94f2f..491c522 100644
--- a/arch/arm/mach-pxa/Kconfig
+++ b/arch/arm/mach-pxa/Kconfig
@@ -453,15 +453,18 @@ config MACH_RAUMFELD_RC
 	bool "Raumfeld Controller"
 	select PXA3xx
 	select CPU_PXA300
+	select POWER_SUPPLY
 	select HAVE_PWM
 
 config MACH_RAUMFELD_CONNECTOR
 	bool "Raumfeld Connector"
+	select POWER_SUPPLY
 	select PXA3xx
 	select CPU_PXA300
 
 config MACH_RAUMFELD_SPEAKER
 	bool "Raumfeld Speaker"
+	select POWER_SUPPLY
 	select PXA3xx
 	select CPU_PXA300
 
-- 
1.7.5.4

^ permalink raw reply related

* [PATCH 22/26] ARM: pxa: only select SMC91x on xcep when networking is enabled
From: Arnd Bergmann @ 2011-10-01 20:03 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1317499438-14058-1-git-send-email-arnd@arndb.de>

The smc91x driver is not strictly required for xcep, but it
can only be enabled if ethernet support is built into the
kernel, so make the dependency more specific.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/mach-pxa/Kconfig |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
index 491c522..ef35ce9 100644
--- a/arch/arm/mach-pxa/Kconfig
+++ b/arch/arm/mach-pxa/Kconfig
@@ -174,7 +174,7 @@ config MACH_XCEP
 	select MTD_CFI_INTELEXT
 	select MTD_CFI
 	select MTD_CHAR
-	select SMC91X
+	select SMC91X if NET_ETHERNET
 	help
 	  PXA255 based Single Board Computer with SMC 91C111 ethernet chip and 64 MB of flash.
 	  Tuned for usage in Libera instruments for particle accelerators.
-- 
1.7.5.4

^ permalink raw reply related

* [PATCH 23/26] ARM: pxa: viper: select I2C_GPIO only when I2C is on
From: Arnd Bergmann @ 2011-10-01 20:03 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1317499438-14058-1-git-send-email-arnd@arndb.de>

The viper platform selects the i2c_gpio driver, but that does
not build when i2c itself is disabled. Rather than also selecting
i2c, this makes the select conditional.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/mach-pxa/Kconfig |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
index ef35ce9..568b7f6 100644
--- a/arch/arm/mach-pxa/Kconfig
+++ b/arch/arm/mach-pxa/Kconfig
@@ -81,7 +81,7 @@ config ARCH_VIPER
 	bool "Arcom/Eurotech VIPER SBC"
 	select PXA25x
 	select ISA
-	select I2C_GPIO
+	select I2C_GPIO if I2C
 	select HAVE_PWM
 	select PXA_HAVE_ISA_IRQS
 	select ARCOM_PCMCIA
-- 
1.7.5.4

^ permalink raw reply related

* [PATCH 24/26] ARM: pxa: centro and treo680 need palm27x
From: Arnd Bergmann @ 2011-10-01 20:03 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1317499438-14058-1-git-send-email-arnd@arndb.de>

The two platforms are part of the palm27x family and use the same
code. Select the palm27x symbol to make sure they can be built
standalone.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/mach-pxa/Kconfig |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
index 568b7f6..da6fca0 100644
--- a/arch/arm/mach-pxa/Kconfig
+++ b/arch/arm/mach-pxa/Kconfig
@@ -431,6 +431,7 @@ config MACH_CENTRO
 	bool "Palm Centro 685 (GSM)"
 	default y
 	depends on ARCH_PXA_PALM
+	select MACH_PALM27X
 	select PXA27x
 	select IWMMXT
 	select PALM_TREO
@@ -442,6 +443,7 @@ config MACH_TREO680
 	bool "Palm Treo 680"
 	default y
 	depends on ARCH_PXA_PALM
+	select MACH_PALM27X
 	select PXA27x
 	select IWMMXT
 	select PALM_TREO
-- 
1.7.5.4

^ permalink raw reply related

* [PATCH 25/26] ARM: pxa: eseries does not require FB
From: Arnd Bergmann @ 2011-10-01 20:03 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1317499438-14058-1-git-send-email-arnd@arndb.de>

It is possible to build a kernel for eseries without framebuffer support,
so it must not select the w100 driver unconditionally.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/mach-pxa/Kconfig |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
index da6fca0..3733971 100644
--- a/arch/arm/mach-pxa/Kconfig
+++ b/arch/arm/mach-pxa/Kconfig
@@ -566,7 +566,7 @@ config MACH_ICONTROL
 config ARCH_PXA_ESERIES
 	bool "PXA based Toshiba e-series PDAs"
 	select PXA25x
-	select FB_W100
+	select FB_W100 if FB=y
 
 config MACH_E330
 	bool "Toshiba e330"
-- 
1.7.5.4

^ permalink raw reply related

* [PATCH 26/26] ARM: pxa: sharpsl pm needs SPI
From: Arnd Bergmann @ 2011-10-01 20:03 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1317499438-14058-1-git-send-email-arnd@arndb.de>

The sharpsl code selects the max1111 spi driver, so it must also
ensure that SPI itself is enabled. The platform does not work
without max1111.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/mach-pxa/Kconfig |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
index 3733971..6dee18e 100644
--- a/arch/arm/mach-pxa/Kconfig
+++ b/arch/arm/mach-pxa/Kconfig
@@ -710,6 +710,8 @@ config SHARPSL_PM
 config SHARPSL_PM_MAX1111
 	bool
 	select HWMON
+	select SPI
+	select SPI_MASTER
 	select SENSORS_MAX1111
 
 config PXA_HAVE_ISA_IRQS
-- 
1.7.5.4

^ permalink raw reply related

* ARM SoC tree: OMAP PM dependency on tip irq/core
From: Rob Herring @ 2011-10-01 20:55 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <87k48pfyvg.fsf@ti.com>

On 09/30/2011 05:29 PM, Kevin Hilman wrote:
> Hi Arnd,
> 
> Kevin Hilman <khilman@ti.com> writes:
> 
>> The upcoming OMAP4 PM series from Santosh[1] that we're planning to
>> queue for v3.2 has a dependency[2] on a patch currently queued for v3.2
>> in the irq/core branch of Thomas' tip tree[3].
>>
>> In the past, I noticed you merged external trees like this to solve
>> dependencies.
>>
>> Could you pull the irq/core branch into your tree to meet this
>> dependency?
> 
> On second thought, since Santosh's branch is the only one with this
> dependency (and we also have a dependency on Russell's devel-stable)
> I'll just build up a branch for Santosh's series that includes
> rmk/devel-stable and tglx/irq-core.
> 

Any new platforms will have a dependency on rmk/devel-stable with the
mach header clean-up. I'll probably have a dependency on tglx's tree as
well.

Rob

^ permalink raw reply

* [PATCH v2] mach-ep93xx: break out GPIO driver specifics
From: Russell King - ARM Linux @ 2011-10-01 22:39 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <CACRpkdazjpKZRfpoYgZ=kC+auEj9q-KMHa6qsWsD+5Hpji+96w@mail.gmail.com>

On Tue, Sep 20, 2011 at 10:32:13PM +0200, Linus Walleij wrote:
> On Tue, Sep 20, 2011 at 7:40 PM, Grant Likely <grant.likely@secretlab.ca> wrote:
> > Which tree will this go through? ?I don't think it should go via the
> > gpio tree since it is mostly within arch/arm.
> 
> It'd dependent on Russells cleanups so it'll go through Russells
> tree and his gpio cleanup branch there.

It's dependent on other stuff elsewhere too:

error: patch failed: drivers/gpio/gpio-ep93xx.c:24
error: drivers/gpio/gpio-ep93xx.c: patch does not apply

According to your patch, line 24 onwards is:

 #include <linux/module.h>
 
 #include <mach/hardware.h>

whereas I have this around line 24:

 #include <linux/basic_mmio_gpio.h>
 
 #include <mach/hardware.h>

So I've applied this with GNU patch instead, accepting the one line of
fuzz:

Hunk #1 succeeded at 23 with fuzz 1 (offset -1 lines).

As a result, I expect sfr will report a trivial merge conflict here.

^ permalink raw reply

* [PATCH 1/2 v2] plat-pxa: move PXA GPIO driver to GPIO subsystem
From: Russell King - ARM Linux @ 2011-10-01 22:44 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1317121005-4716-1-git-send-email-linus.walleij@stericsson.com>

On Tue, Sep 27, 2011 at 12:56:45PM +0200, Linus Walleij wrote:
> diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile
> index a4c8ac9..828e9ab 100644
> --- a/drivers/gpio/Makefile
> +++ b/drivers/gpio/Makefile
> @@ -40,6 +40,7 @@ obj-$(CONFIG_GPIO_PCA953X)	+= gpio-pca953x.o
>  obj-$(CONFIG_GPIO_PCF857X)	+= gpio-pcf857x.o
>  obj-$(CONFIG_GPIO_PCH)		+= gpio-pch.o
>  obj-$(CONFIG_GPIO_PL061)	+= gpio-pl061.o
> +obj-$(CONFIG_PLAT_PXA)		+= gpio-pxa.o
>  obj-$(CONFIG_GPIO_RDC321X)	+= gpio-rdc321x.o
>  obj-$(CONFIG_ARCH_SA1100)	+= gpio-sa1100.o
>  obj-$(CONFIG_PLAT_SAMSUNG)	+= gpio-samsung.o

This is not what my drivers/gpio/Makefile contains.  I've applied this
patch with GNU patch with fuzz 2, resulting in:

diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile
index 84bc738..19c5d27 100644
--- a/drivers/gpio/Makefile
+++ b/drivers/gpio/Makefile
@@ -40,6 +40,7 @@ obj-$(CONFIG_GPIO_PCA953X)    += gpio-pca953x.o
 obj-$(CONFIG_GPIO_PCF857X)     += gpio-pcf857x.o
 obj-$(CONFIG_GPIO_PCH)         += gpio-pch.o
 obj-$(CONFIG_GPIO_PL061)       += gpio-pl061.o
+obj-$(CONFIG_PLAT_PXA)         += gpio-pxa.o
 obj-$(CONFIG_GPIO_RDC321X)     += gpio-rdc321x.o

 obj-$(CONFIG_GPIO_PLAT_SAMSUNG)        += gpio-plat-samsung.o

This will probably conflict with Grant's tree.

^ permalink raw reply related

* [PATCH 2/2 v2] plat-pxa: break out GPIO driver specifics
From: Russell King - ARM Linux @ 2011-10-01 22:46 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1317121014-4749-1-git-send-email-linus.walleij@stericsson.com>

On Tue, Sep 27, 2011 at 12:56:54PM +0200, Linus Walleij wrote:
> diff --git a/arch/arm/mach-mmp/gplugd.c b/arch/arm/mach-mmp/gplugd.c
> index 98e25d9..32776f3 100644
> --- a/arch/arm/mach-mmp/gplugd.c
> +++ b/arch/arm/mach-mmp/gplugd.c
> @@ -9,11 +9,11 @@
>   */
>  
>  #include <linux/init.h>
> +#include <linux/gpio.h>
>  
>  #include <asm/mach/arch.h>
>  #include <asm/mach-types.h>
>  
> -#include <mach/gpio.h>
>  #include <mach/pxa168.h>
>  #include <mach/mfp-pxa168.h>
>  

Mine looks like:

diff --git a/arch/arm/mach-mmp/gplugd.c b/arch/arm/mach-mmp/gplugd.c
index c070c24..ef738de 100644
--- a/arch/arm/mach-mmp/gplugd.c
+++ b/arch/arm/mach-mmp/gplugd.c
@@ -9,11 +9,11 @@
  */

 #include <linux/init.h>
+#include <linux/gpio.h>

 #include <asm/mach/arch.h>
 #include <asm/mach-types.h>

-#include <mach/gpio.h>
 #include <mach/pxa168.h>
 #include <mach/mfp-pxa168.h>
 #include <mach/mfp-gplugd.h>

^ permalink raw reply related

* ARM SoC tree: OMAP PM dependency on tip irq/core
From: Arnd Bergmann @ 2011-10-02  7:03 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <4E877E29.7000309@gmail.com>

On Saturday 01 October 2011 15:55:05 Rob Herring wrote:
> > 
> > Kevin Hilman <khilman@ti.com> writes:
> > 
> >> The upcoming OMAP4 PM series from Santosh[1] that we're planning to
> >> queue for v3.2 has a dependency[2] on a patch currently queued for v3.2
> >> in the irq/core branch of Thomas' tip tree[3].
> >>
> >> In the past, I noticed you merged external trees like this to solve
> >> dependencies.
> >>
> >> Could you pull the irq/core branch into your tree to meet this
> >> dependency?
> > 
> > On second thought, since Santosh's branch is the only one with this
> > dependency (and we also have a dependency on Russell's devel-stable)
> > I'll just build up a branch for Santosh's series that includes
> > rmk/devel-stable and tglx/irq-core.
> > 
> 
> Any new platforms will have a dependency on rmk/devel-stable with the
> mach header clean-up. I'll probably have a dependency on tglx's tree as
> well.

Good point. Also, I think in general it's better if I try to keep track
of the depencies myself, so I don't accidentally submit patches upstream
that belong into someone else's realm.

I haven't come up with a good scheme for that yet. Right now I just
add a depends/* branch and try to remember which branches depend on
that. If it gets harder than this, I'll have to write it down somewhere,
but it would be nice to have some tool that can automatically warn
if I try to submit something that has an unfulfilled dependency.

	Arnd

^ permalink raw reply

* [PATCH v2] ARM: EXYNOS4: Configure MAX8997 PMIC for Origen
From: Kukjin Kim @ 2011-10-02  7:07 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1313995163-31737-1-git-send-email-inderpal.singh@linaro.org>

Inderpal Singh wrote:
> 
> From: Inderpal Singh <inderpal.s@samsung.com>
> 
> Configure MAX8997 PMIC and provide platform specific data
> for origen.
> 
> Signed-off-by: Inderpal Singh <inderpal.singh@linaro.org>
> ---
> Changes from v1:
> 	- Removed soc-audio
> 	- Used macro for GPIO pin
> 	- irq assigned statically
> 	- Rectified mismatches in constraints flags
> 	- Removed assigning of array index
> 
>  arch/arm/mach-exynos4/mach-origen.c |  390
+++++++++++++++++++++++++++++++++++
>  1 files changed, 390 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/mach-exynos4/mach-origen.c
b/arch/arm/mach-exynos4/mach-origen.c
> index ed59f86..ccd2a55 100644
> --- a/arch/arm/mach-exynos4/mach-origen.c
> +++ b/arch/arm/mach-exynos4/mach-origen.c
> @@ -14,6 +14,9 @@
>  #include <linux/platform_device.h>
>  #include <linux/io.h>
>  #include <linux/input.h>
> +#include <linux/i2c.h>
> +#include <linux/regulator/machine.h>
> +#include <linux/mfd/max8997.h>
> 
>  #include <asm/mach/arch.h>
>  #include <asm/mach-types.h>
> @@ -24,6 +27,7 @@
>  #include <plat/devs.h>
>  #include <plat/sdhci.h>
>  #include <plat/iic.h>
> +#include <plat/gpio-cfg.h>
> 
>  #include <mach/map.h>
> 
> @@ -72,6 +76,378 @@ static struct s3c2410_uartcfg origen_uartcfgs[]
__initdata = {
>  	},
>  };
> 
> +static struct regulator_consumer_supply __initdata ldo3_consumer[] = {
> +	REGULATOR_SUPPLY("vdd11", "s5p-mipi-csis.0"), /* MIPI */
> +};
> +static struct regulator_consumer_supply __initdata ldo6_consumer[] = {
> +	REGULATOR_SUPPLY("vdd18", "s5p-mipi-csis.0"), /* MIPI */
> +};
> +static struct regulator_consumer_supply __initdata ldo7_consumer[] = {
> +	REGULATOR_SUPPLY("avdd", "alc5625"), /* Realtek ALC5625 */
> +};
> +static struct regulator_consumer_supply __initdata ldo8_consumer[] = {
> +	REGULATOR_SUPPLY("vdd", "s5p-adc"), /* ADC */
> +};
> +static struct regulator_consumer_supply __initdata ldo9_consumer[] = {
> +	REGULATOR_SUPPLY("dvdd", "swb-a31"), /* AR6003 WLAN & CSR 8810 BT */
> +};
> +static struct regulator_consumer_supply __initdata ldo11_consumer[] = {
> +	REGULATOR_SUPPLY("dvdd", "alc5625"), /* Realtek ALC5625 */
> +};
> +static struct regulator_consumer_supply __initdata ldo14_consumer[] = {
> +	REGULATOR_SUPPLY("avdd18", "swb-a31"), /* AR6003 WLAN & CSR 8810 BT
*/
> +};
> +static struct regulator_consumer_supply __initdata ldo17_consumer[] = {
> +	REGULATOR_SUPPLY("vdd33", "swb-a31"), /* AR6003 WLAN & CSR 8810 BT
*/
> +};
> +static struct regulator_consumer_supply __initdata buck1_consumer[] = {
> +	REGULATOR_SUPPLY("vdd_arm", NULL), /* CPUFREQ */
> +};
> +static struct regulator_consumer_supply __initdata buck2_consumer[] = {
> +	REGULATOR_SUPPLY("vdd_int", NULL), /* CPUFREQ */
> +};
> +static struct regulator_consumer_supply __initdata buck3_consumer[] = {
> +	REGULATOR_SUPPLY("vdd_g3d", "mali_drm"), /* G3D */
> +};
> +static struct regulator_consumer_supply __initdata buck7_consumer[] = {
> +	REGULATOR_SUPPLY("vcc", "platform-lcd"), /* LCD */
> +};
> +
> +static struct regulator_init_data __initdata max8997_ldo1_data = {
> +	.constraints	= {
> +		.name		= "VDD_ABB_3.3V",
> +		.min_uV		= 3300000,
> +		.max_uV		= 3300000,
> +		.apply_uV	= 1,
> +		.state_mem	= {
> +			.disabled	= 1,
> +		},
> +	},
> +};
> +
> +static struct regulator_init_data __initdata max8997_ldo2_data	= {
> +	.constraints	= {
> +		.name		= "VDD_ALIVE_1.1V",
> +		.min_uV		= 1100000,
> +		.max_uV		= 1100000,
> +		.apply_uV	= 1,
> +		.always_on	= 1,
> +		.state_mem	= {
> +			.enabled	= 1,
> +		},
> +	},
> +};
> +
> +static struct regulator_init_data __initdata max8997_ldo3_data = {
> +	.constraints	= {
> +		.name		= "VMIPI_1.1V",
> +		.min_uV		= 1100000,
> +		.max_uV		= 1100000,
> +		.apply_uV	= 1,
> +		.valid_ops_mask	= REGULATOR_CHANGE_STATUS,
> +		.state_mem	= {
> +			.disabled	= 1,
> +		},
> +	},
> +	.num_consumer_supplies	= ARRAY_SIZE(ldo3_consumer),
> +	.consumer_supplies	= ldo3_consumer,
> +};
> +
> +static struct regulator_init_data __initdata max8997_ldo4_data = {
> +	.constraints	= {
> +		.name		= "VDD_RTC_1.8V",
> +		.min_uV		= 1800000,
> +		.max_uV		= 1800000,
> +		.apply_uV	= 1,
> +		.always_on	= 1,
> +		.state_mem	= {
> +			.disabled	= 1,
> +		},
> +	},
> +};
> +
> +static struct regulator_init_data __initdata max8997_ldo6_data = {
> +	.constraints	= {
> +		.name		= "VMIPI_1.8V",
> +		.min_uV		= 1800000,
> +		.max_uV		= 1800000,
> +		.apply_uV	= 1,
> +		.valid_ops_mask	= REGULATOR_CHANGE_STATUS,
> +		.state_mem	= {
> +			.disabled	= 1,
> +		},
> +	},
> +	.num_consumer_supplies	= ARRAY_SIZE(ldo6_consumer),
> +	.consumer_supplies	= ldo6_consumer,
> +};
> +
> +static struct regulator_init_data __initdata max8997_ldo7_data = {
> +	.constraints	= {
> +		.name		= "VDD_AUD_1.8V",
> +		.min_uV		= 1800000,
> +		.max_uV		= 1800000,
> +		.apply_uV	= 1,
> +		.valid_ops_mask	= REGULATOR_CHANGE_STATUS,
> +		.state_mem	= {
> +			.disabled	= 1,
> +		},
> +	},
> +	.num_consumer_supplies	= ARRAY_SIZE(ldo7_consumer),
> +	.consumer_supplies	= ldo7_consumer,
> +};
> +
> +static struct regulator_init_data __initdata max8997_ldo8_data = {
> +	.constraints	= {
> +		.name		= "VADC_3.3V",
> +		.min_uV		= 3300000,
> +		.max_uV		= 3300000,
> +		.apply_uV	= 1,
> +		.valid_ops_mask	= REGULATOR_CHANGE_STATUS,
> +		.state_mem	= {
> +			.disabled	= 1,
> +		},
> +	},
> +	.num_consumer_supplies	= ARRAY_SIZE(ldo8_consumer),
> +	.consumer_supplies	= ldo8_consumer,
> +};
> +
> +static struct regulator_init_data __initdata max8997_ldo9_data = {
> +	.constraints	= {
> +		.name		= "DVDD_SWB_2.8V",
> +		.min_uV		= 2800000,
> +		.max_uV		= 2800000,
> +		.apply_uV	= 1,
> +		.valid_ops_mask	= REGULATOR_CHANGE_STATUS,
> +		.state_mem	= {
> +			.disabled	= 1,
> +		},
> +	},
> +	.num_consumer_supplies	= ARRAY_SIZE(ldo9_consumer),
> +	.consumer_supplies	= ldo9_consumer,
> +};
> +
> +static struct regulator_init_data __initdata max8997_ldo10_data = {
> +	.constraints	= {
> +		.name		= "VDD_PLL_1.1V",
> +		.min_uV		= 1100000,
> +		.max_uV		= 1100000,
> +		.apply_uV	= 1,
> +		.always_on	= 1,
> +		.state_mem	= {
> +			.disabled	= 1,
> +		},
> +	},
> +};
> +
> +static struct regulator_init_data __initdata max8997_ldo11_data = {
> +	.constraints	= {
> +		.name		= "VDD_AUD_3V",
> +		.min_uV		= 3000000,
> +		.max_uV		= 3000000,
> +		.apply_uV	= 1,
> +		.valid_ops_mask	= REGULATOR_CHANGE_STATUS,
> +		.state_mem	= {
> +			.disabled	= 1,
> +		},
> +	},
> +	.num_consumer_supplies	= ARRAY_SIZE(ldo11_consumer),
> +	.consumer_supplies	= ldo11_consumer,
> +};
> +
> +static struct regulator_init_data __initdata max8997_ldo14_data = {
> +	.constraints	= {
> +		.name		= "AVDD18_SWB_1.8V",
> +		.min_uV		= 1800000,
> +		.max_uV		= 1800000,
> +		.apply_uV	= 1,
> +		.valid_ops_mask	= REGULATOR_CHANGE_STATUS,
> +		.state_mem	= {
> +			.disabled	= 1,
> +		},
> +	},
> +	.num_consumer_supplies	= ARRAY_SIZE(ldo14_consumer),
> +	.consumer_supplies	= ldo14_consumer,
> +};
> +
> +static struct regulator_init_data __initdata max8997_ldo17_data = {
> +	.constraints	= {
> +		.name		= "VDD_SWB_3.3V",
> +		.min_uV		= 3300000,
> +		.max_uV		= 3300000,
> +		.apply_uV	= 1,
> +		.valid_ops_mask	= REGULATOR_CHANGE_STATUS,
> +		.state_mem	= {
> +			.disabled	= 1,
> +		},
> +	},
> +	.num_consumer_supplies	= ARRAY_SIZE(ldo17_consumer),
> +	.consumer_supplies	= ldo17_consumer,
> +};
> +
> +static struct regulator_init_data __initdata max8997_ldo21_data = {
> +	.constraints	= {
> +		.name		= "VDD_MIF_1.2V",
> +		.min_uV		= 1200000,
> +		.max_uV		= 1200000,
> +		.apply_uV	= 1,
> +		.always_on	= 1,
> +		.state_mem	= {
> +			.disabled	= 1,
> +		},
> +	},
> +};
> +
> +static struct regulator_init_data __initdata max8997_buck1_data = {
> +	.constraints	= {
> +		.name		= "VDD_ARM_1.2V",
> +		.min_uV		= 950000,
> +		.max_uV		= 1350000,
> +		.always_on	= 1,
> +		.boot_on	= 1,
> +		.valid_ops_mask	= REGULATOR_CHANGE_VOLTAGE,
> +		.state_mem	= {
> +			.disabled	= 1,
> +		},
> +	},
> +	.num_consumer_supplies	= ARRAY_SIZE(buck1_consumer),
> +	.consumer_supplies	= buck1_consumer,
> +};
> +
> +static struct regulator_init_data __initdata max8997_buck2_data = {
> +	.constraints	= {
> +		.name		= "VDD_INT_1.1V",
> +		.min_uV		= 900000,
> +		.max_uV		= 1100000,
> +		.always_on	= 1,
> +		.boot_on	= 1,
> +		.valid_ops_mask	= REGULATOR_CHANGE_VOLTAGE,
> +		.state_mem	= {
> +			.disabled	= 1,
> +		},
> +	},
> +	.num_consumer_supplies	= ARRAY_SIZE(buck2_consumer),
> +	.consumer_supplies	= buck2_consumer,
> +};
> +
> +static struct regulator_init_data __initdata max8997_buck3_data = {
> +	.constraints	= {
> +		.name		= "VDD_G3D_1.1V",
> +		.min_uV		= 900000,
> +		.max_uV		= 1100000,
> +		.valid_ops_mask	= REGULATOR_CHANGE_VOLTAGE |
> +					REGULATOR_CHANGE_STATUS,
> +		.state_mem	= {
> +			.disabled	= 1,
> +		},
> +	},
> +	.num_consumer_supplies	= ARRAY_SIZE(buck3_consumer),
> +	.consumer_supplies	= buck3_consumer,
> +};
> +
> +static struct regulator_init_data __initdata max8997_buck5_data = {
> +	.constraints	= {
> +		.name		= "VDDQ_M1M2_1.2V",
> +		.min_uV		= 1200000,
> +		.max_uV		= 1200000,
> +		.apply_uV	= 1,
> +		.always_on	= 1,
> +		.state_mem	= {
> +			.disabled	= 1,
> +		},
> +	},
> +};
> +
> +static struct regulator_init_data __initdata max8997_buck7_data = {
> +	.constraints	= {
> +		.name		= "VDD_LCD_3.3V",
> +		.min_uV		= 3300000,
> +		.max_uV		= 3300000,
> +		.boot_on	= 1,
> +		.apply_uV	= 1,
> +		.valid_ops_mask	= REGULATOR_CHANGE_STATUS,
> +		.state_mem	= {
> +			.disabled	= 1
> +		},
> +	},
> +	.num_consumer_supplies	= ARRAY_SIZE(buck7_consumer),
> +	.consumer_supplies	= buck7_consumer,
> +};
> +
> +static struct max8997_regulator_data __initdata
origen_max8997_regulators[] = {
> +	{ MAX8997_LDO1,		&max8997_ldo1_data },
> +	{ MAX8997_LDO2,		&max8997_ldo2_data },
> +	{ MAX8997_LDO3,		&max8997_ldo3_data },
> +	{ MAX8997_LDO4,		&max8997_ldo4_data },
> +	{ MAX8997_LDO6,		&max8997_ldo6_data },
> +	{ MAX8997_LDO7,		&max8997_ldo7_data },
> +	{ MAX8997_LDO8,		&max8997_ldo8_data },
> +	{ MAX8997_LDO9,		&max8997_ldo9_data },
> +	{ MAX8997_LDO10,	&max8997_ldo10_data },
> +	{ MAX8997_LDO11,	&max8997_ldo11_data },
> +	{ MAX8997_LDO14,	&max8997_ldo14_data },
> +	{ MAX8997_LDO17,	&max8997_ldo17_data },
> +	{ MAX8997_LDO21,	&max8997_ldo21_data },
> +	{ MAX8997_BUCK1,	&max8997_buck1_data },
> +	{ MAX8997_BUCK2,	&max8997_buck2_data },
> +	{ MAX8997_BUCK3,	&max8997_buck3_data },
> +	{ MAX8997_BUCK5,	&max8997_buck5_data },
> +	{ MAX8997_BUCK7,	&max8997_buck7_data },
> +};
> +
> +struct max8997_platform_data __initdata origen_max8997_pdata = {
> +	.num_regulators = ARRAY_SIZE(origen_max8997_regulators),
> +	.regulators	= origen_max8997_regulators,
> +
> +	.wakeup	= true,
> +	.buck1_gpiodvs	= false,
> +	.buck2_gpiodvs	= false,
> +	.buck5_gpiodvs	= false,
> +	.irq_base	= IRQ_GPIO_END + 1,
> +
> +	.ignore_gpiodvs_side_effect = true,
> +	.buck125_default_idx = 0x0,
> +
> +	.buck125_gpios[0]	= EXYNOS4_GPX0(0),
> +	.buck125_gpios[1]	= EXYNOS4_GPX0(1),
> +	.buck125_gpios[2]	= EXYNOS4_GPX0(2),
> +
> +	.buck1_voltage[0]	= 1350000,
> +	.buck1_voltage[1]	= 1300000,
> +	.buck1_voltage[2]	= 1250000,
> +	.buck1_voltage[3]	= 1200000,
> +	.buck1_voltage[4]	= 1150000,
> +	.buck1_voltage[5]	= 1100000,
> +	.buck1_voltage[6]	= 1000000,
> +	.buck1_voltage[7]	= 950000,
> +
> +	.buck2_voltage[0]	= 1100000,
> +	.buck2_voltage[1]	= 1100000,
> +	.buck2_voltage[2]	= 1100000,
> +	.buck2_voltage[3]	= 1100000,
> +	.buck2_voltage[4]	= 1000000,
> +	.buck2_voltage[5]	= 1000000,
> +	.buck2_voltage[6]	= 1000000,
> +	.buck2_voltage[7]	= 1000000,
> +
> +	.buck5_voltage[0]	= 1200000,
> +	.buck5_voltage[1]	= 1200000,
> +	.buck5_voltage[2]	= 1200000,
> +	.buck5_voltage[3]	= 1200000,
> +	.buck5_voltage[4]	= 1200000,
> +	.buck5_voltage[5]	= 1200000,
> +	.buck5_voltage[6]	= 1200000,
> +	.buck5_voltage[7]	= 1200000,
> +};
> +
> +/* I2C0 */
> +static struct i2c_board_info i2c0_devs[] __initdata = {
> +	{
> +		I2C_BOARD_INFO("max8997", (0xCC >> 1)),
> +		.platform_data	= &origen_max8997_pdata,
> +		.irq		= IRQ_EINT(4),
> +	},
> +};
> +
>  static struct s3c_sdhci_platdata origen_hsmmc2_pdata __initdata = {
>  	.cd_type		= S3C_SDHCI_CD_GPIO,
>  	.ext_cd_gpio		= EXYNOS4_GPK2(2),
> @@ -80,6 +456,7 @@ static struct s3c_sdhci_platdata origen_hsmmc2_pdata
__initdata = {
>  };
> 
>  static struct platform_device *origen_devices[] __initdata = {
> +	&s3c_device_i2c0,
>  	&s3c_device_hsmmc2,
>  	&s3c_device_rtc,
>  	&s3c_device_wdt,
> @@ -92,8 +469,21 @@ static void __init origen_map_io(void)
>  	s3c24xx_init_uarts(origen_uartcfgs, ARRAY_SIZE(origen_uartcfgs));
>  }
> 
> +#define	ORIGEN_PMIC_GPIO	EXYNOS4_GPX0(4)
> +static void __init origen_power_init(void)
> +{
> +	gpio_request(ORIGEN_PMIC_GPIO, "PMIC_IRQ");
> +	s3c_gpio_cfgpin(ORIGEN_PMIC_GPIO, S3C_GPIO_SFN(0xf));
> +	s3c_gpio_setpull(ORIGEN_PMIC_GPIO, S3C_GPIO_PULL_NONE);
> +}
> +
>  static void __init origen_machine_init(void)
>  {
> +	origen_power_init();
> +
> +	s3c_i2c0_set_platdata(NULL);
> +	i2c_register_board_info(0, i2c0_devs, ARRAY_SIZE(i2c0_devs));
> +
>  	s3c_sdhci2_set_platdata(&origen_hsmmc2_pdata);
>  	platform_add_devices(origen_devices, ARRAY_SIZE(origen_devices));
>  }
> --
> 1.7.4.1

OK, will apply.
Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

^ permalink raw reply

* [PATCH V2 0/3] S5P64X0 PM Support
From: Kukjin Kim @ 2011-10-02  7:07 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1317154964-22600-1-git-send-email-a.kesavan@samsung.com>

Abhilash Kesavan wrote:
> 
> The patchset adds Power Mangement support for S5P64X0. The first
> two patches lay the groundwork for adding PM support, while the
> final patch adds the SoC specific PM code.
> 
> Changes since V1:
> - Changed register naming as per User Manual.
> - Dropped the pm-gpio warning patch as it will be taken care in the gpio
>   movement patch by Kukjin Kim.
> - Used soc_is_* for differentiating between 6440 and 6450.
> - Merged all the sleep files of S5P SoCs while leaving the S3C64XX sleep
>   code as is.
> 
> Abhilash Kesavan (3):
>   ARM: S5P: Make the common S5P PM code conditionally compile
>   ARM: S5P: Make the sleep code common for S5P series SoCs
>   ARM: S5P64X0: Add Power Management support
> 
>  arch/arm/Kconfig                                |    2 +-
>  arch/arm/mach-exynos4/Kconfig                   |    4 +
>  arch/arm/mach-exynos4/Makefile                  |    2 +-
>  arch/arm/mach-s5p64x0/Kconfig                   |    4 +
>  arch/arm/mach-s5p64x0/Makefile                  |    1 +
>  arch/arm/mach-s5p64x0/include/mach/map.h        |    1 +
>  arch/arm/mach-s5p64x0/include/mach/pm-core.h    |  117 +++++++++++++
>  arch/arm/mach-s5p64x0/include/mach/regs-clock.h |   33 ++++
>  arch/arm/mach-s5p64x0/include/mach/regs-gpio.h  |   19 ++
>  arch/arm/mach-s5p64x0/irq-eint.c                |    2 +
>  arch/arm/mach-s5p64x0/irq-pm.c                  |   92 ++++++++++
>  arch/arm/mach-s5p64x0/pm.c                      |  204
+++++++++++++++++++++++
>  arch/arm/mach-s5pv210/Kconfig                   |    2 +
>  arch/arm/mach-s5pv210/Makefile                  |    2 +-
>  arch/arm/mach-s5pv210/sleep.S                   |   52 ------
>  arch/arm/plat-s5p/Kconfig                       |   12 ++
>  arch/arm/plat-s5p/Makefile                      |    4 +-
>  arch/arm/{mach-exynos4 => plat-s5p}/sleep.S     |   13 +-
>  18 files changed, 500 insertions(+), 66 deletions(-)
>  create mode 100644 arch/arm/mach-s5p64x0/include/mach/pm-core.h
>  create mode 100644 arch/arm/mach-s5p64x0/irq-pm.c
>  create mode 100644 arch/arm/mach-s5p64x0/pm.c
>  delete mode 100644 arch/arm/mach-s5pv210/sleep.S
>  rename arch/arm/{mach-exynos4 => plat-s5p}/sleep.S (81%)

Looks ok to me, will apply.
Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

^ permalink raw reply

* [PATCH 0/4] ARM: EXYNOS4: Support generic Power domain framework for EXYNOS4210
From: Kukjin Kim @ 2011-10-02  7:07 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <201108140139.46434.rjw@sisk.pl>

Rafael J. Wysocki wrote:
> 
> On Saturday, August 13, 2011, Russell King - ARM Linux wrote:
> > On Sat, Aug 13, 2011 at 11:24:07PM +0200, Rafael J. Wysocki wrote:
> > > On Thursday, August 11, 2011, Chanwoo Choi wrote:
> > > > The following patch set use the generic Power domain Framework
instead of
> > > > power domain code depend of Samsung SoC.
> > > >
> > > > Chanwoo Choi (4):
> > > >   ARM: EXYNOS4: Support for generic I/O power domains on EXYNOS4210
> > > >   ARM: EXYNOS4: Support for generic Clock manipulation PM callbacks
> > > >   ARM: EXYNOS4: Delete the power-domain code depend on Samsung SoC
> > > >   ARM: EXYNOS4: Add power domain to use generic Power domain
Framework
> > > >
> > > >  arch/arm/mach-exynos4/Kconfig                      |   10 +-
> > > >  arch/arm/mach-exynos4/Makefile                     |    4 +-
> > > >  arch/arm/mach-exynos4/dev-pd.c                     |  139
--------------
> > > >  arch/arm/mach-exynos4/include/mach/pm-exynos4210.h |   52 ++++++
> > > >  arch/arm/mach-exynos4/include/mach/regs-clock.h    |    8 +
> > > >  arch/arm/mach-exynos4/mach-nuri.c                  |   21 ++-
> > > >  arch/arm/mach-exynos4/mach-smdkc210.c              |   26 ++-
> > > >  arch/arm/mach-exynos4/mach-smdkv310.c              |   23 ++-
> > > >  arch/arm/mach-exynos4/mach-universal_c210.c        |   21 ++-
> > > >  arch/arm/mach-exynos4/pm-exynos4210.c              |  189
++++++++++++++++++++
> > > >  arch/arm/mach-exynos4/pm-runtime.c                 |   56 ++++++
> > > >  arch/arm/plat-samsung/Kconfig                      |    8 -
> > > >  arch/arm/plat-samsung/Makefile                     |    4 -
> > > >  arch/arm/plat-samsung/include/plat/pd.h            |   30 ---
> > > >  arch/arm/plat-samsung/pd.c                         |   95
----------
> > > >  15 files changed, 377 insertions(+), 309 deletions(-)
> > > >  delete mode 100644 arch/arm/mach-exynos4/dev-pd.c
> > > >  create mode 100644
arch/arm/mach-exynos4/include/mach/pm-exynos4210.h
> > > >  create mode 100644 arch/arm/mach-exynos4/pm-exynos4210.c
> > > >  create mode 100644 arch/arm/mach-exynos4/pm-runtime.c
> > > >  delete mode 100644 arch/arm/plat-samsung/include/plat/pd.h
> > > >  delete mode 100644 arch/arm/plat-samsung/pd.c
> > >
> > > The patchset looks good to me, but please note that some code it
> > > is based on will most likely change in 3.2 due to this patchset:
> > >
> > > https://lkml.org/lkml/2011/8/8/420
> >
> > Err, isn't all that pm_clk stuff just duplicating what the clk API does?
> 
> I'm not sure it's duplicating anything.  Maybe it does, but it came into
> being by moving some code that were duplicated in a few places throughout
> the ARM and sh trees into one place.
> 
> > IOW, drivers _can_ (and should be) calling clk_disable() when they don't
> > need the clock running.
> 
> Drivers may not know about what to do in a given situation.  For example,
> if the system has power domains, it may be better to switch a power domain
> off instead of or in addition to disabling the clock and the driver
usually
> doesn't know about that.
> 
Hmm... Even though each driver cannot know the given situation, the driver
can know each own clock should be alive or not. I think, if clock gating
(enable, disable clock) is required, it should be handled in each driver. In
addition, the clock and power are not always one-on-one match.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

^ permalink raw reply

* [PATCH 2/4] ARM: EXYNOS4: Support for generic Clock manipulation PM callbacks
From: Kukjin Kim @ 2011-10-02  7:08 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <4E4360B5.3050203@samsung.com>

Chanwoo Choi wrote:
> 
> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
>  arch/arm/mach-exynos4/Makefile     |    2 +-
>  arch/arm/mach-exynos4/pm-runtime.c |   56 ++++++++++++++++++++++++++++++++++++
>  2 files changed, 57 insertions(+), 1 deletions(-)
>  create mode 100644 arch/arm/mach-exynos4/pm-runtime.c
> 
> diff --git a/arch/arm/mach-exynos4/Makefile b/arch/arm/mach-exynos4/Makefile
> index 97c31ce..28cdb8b 100644
> --- a/arch/arm/mach-exynos4/Makefile
> +++ b/arch/arm/mach-exynos4/Makefile
> @@ -5,7 +5,7 @@
>  #
>  # Licensed under GPLv2
> 
> -obj-y				:=
> +obj-y				:= pm-runtime.o

To move under depending CONFIG_ARCH_EXYNOS4 like others is better.

>  obj-m				:=
>  obj-n				:=
>  obj-				:=
> diff --git a/arch/arm/mach-exynos4/pm-runtime.c b/arch/arm/mach-exynos4/pm-runtime.c
> new file mode 100644
> index 0000000..4fe9f73
> --- /dev/null
> +++ b/arch/arm/mach-exynos4/pm-runtime.c
> @@ -0,0 +1,56 @@
> +/* linux/arch/arm/mach-exynos4/pm-runtime.c
> +
> + * Exynos4210 Power management support
> + *
> + * Copyright (c) 2011 Samsung Electronics Co., Ltd.
> + *		http://www.samsung.com
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> +*/
> +
> +#include <linux/init.h>
> +#include <linux/kernel.h>
> +#include <linux/io.h>
> +#include <linux/pm_runtime.h>
> +#include <linux/platform_device.h>
> +#include <linux/clk.h>
> +#include <linux/bitmap.h>
> +#include <linux/slab.h>
> +
> +#ifdef CONFIG_PM_RUNTIME
> +
> +static int default_platform_runtime_idle(struct device *dev)
> +{
> +	return pm_runtime_suspend(dev);
> +}
> +
> +static struct dev_pm_domain default_pm_domain = {
> +	.ops = {
> +		.runtime_suspend = pm_clk_suspend,
> +		.runtime_resume = pm_clk_resume,
> +		.runtime_idle = default_platform_runtime_idle,
> +		USE_PLATFORM_PM_SLEEP_OPS
> +	},
> +};
> +
> +#define DEFAULT_PM_DOMAIN_PTR	(&default_pm_domain)
> +
> +#else
> +
> +#define DEFAULT_PM_DOMAIN_PTR	NULL
> +
> +#endif /* CONFIG_PM_RUNTIME */
> +
> +static struct pm_clk_notifier_block platform_bus_notifier = {
> +	.pm_domain = DEFAULT_PM_DOMAIN_PTR,
> +	.con_ids = { NULL, },
> +};
> +
> +static int __init exynos4_pm_runtime_init(void)
> +{
> +	pm_clk_add_notifier(&platform_bus_type, &platform_bus_notifier);
> +	return 0;
> +}
> +core_initcall(exynos4_pm_runtime_init);
> --
> 1.7.0.4

How about to make common stuff in ARM instead of each platform has their own...

I think you can consolidate this pm_runtime with other ARM platform like omap, shmobile.

arch/arm/mach-omap1/pm_bus.c
arch/arm/mach-shmobile/pm_runtime.c

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

^ permalink raw reply

* [PATCH 4/4] ARM: EXYNOS4: Add power domain to use generic Power domain Framework
From: Kukjin Kim @ 2011-10-02  7:08 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <4E4360BA.3020208@samsung.com>

Chanwoo Choi wrote:
> 
> This patch initializes the power domain of EXYNOS4210. The devices
> which suppot runtime-PM have to be added in specific power domain.
> 
> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
>  arch/arm/mach-exynos4/mach-nuri.c           |   18 ++++++++++++++++++
>  arch/arm/mach-exynos4/mach-smdkc210.c       |   18
> ++++++++++++++++++
>  arch/arm/mach-exynos4/mach-smdkv310.c       |   15 +++++++++++++++
>  arch/arm/mach-exynos4/mach-universal_c210.c |   18 ++++++++++++++++++
>  4 files changed, 69 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/mach-exynos4/mach-nuri.c b/arch/arm/mach-exynos4/mach-
> nuri.c
> index 4c358cb..5844c55 100644
> --- a/arch/arm/mach-exynos4/mach-nuri.c
> +++ b/arch/arm/mach-exynos4/mach-nuri.c
> @@ -44,6 +44,7 @@
>  #include <plat/mfc.h>
> 
>  #include <mach/map.h>
> +#include <mach/pm-exynos4210.h>
> 
>  /* Following are default values for UCON, ULCON and UFCON UART registers */
>  #define NURI_UCON_DEFAULT	(S3C2410_UCON_TXILEVEL |	\
> @@ -1125,6 +1126,21 @@ static void __init nuri_reserve(void)
>  	s5p_mfc_reserve_mem(0x43000000, 8 << 20, 0x51000000, 8 << 20);
>  }
> 
> +static void __init nuri_power_domain_init(void)
> +{
> +	/* Initialize Power domain */
> +	exynos4210_init_pm_domain(&exynos4210_pd_mfc);
> +	exynos4210_init_pm_domain(&exynos4210_pd_g3d);
> +	exynos4210_init_pm_domain(&exynos4210_pd_lcd0);
> +	exynos4210_init_pm_domain(&exynos4210_pd_lcd1);
> +	exynos4210_init_pm_domain(&exynos4210_pd_tv);
> +	exynos4210_init_pm_domain(&exynos4210_pd_cam);
> +	exynos4210_init_pm_domain(&exynos4210_pd_gps);

As you know, the EXYNOS421 boards have same power domains so how about to make array of struct exynos4210_pm_domain and just one calling exynos4210_init_pm_domain()?

> +
> +	/* Add device to MFC power domain */
> +	exynos4210_add_device_to_domain(&exynos4210_pd_mfc,
> &s5p_device_mfc);
> +}
> +
>  static void __init nuri_machine_init(void)
>  {
>  	nuri_sdhci_init();
> @@ -1145,6 +1161,8 @@ static void __init nuri_machine_init(void)
> 
>  	/* Last */
>  	platform_add_devices(nuri_devices, ARRAY_SIZE(nuri_devices));
> +
> +	nuri_power_domain_init();
>  }
> 
>  MACHINE_START(NURI, "NURI")
> diff --git a/arch/arm/mach-exynos4/mach-smdkc210.c b/arch/arm/mach-
> exynos4/mach-smdkc210.c
> index 4d1976c..0a3b2a9 100644
> --- a/arch/arm/mach-exynos4/mach-smdkc210.c
> +++ b/arch/arm/mach-exynos4/mach-smdkc210.c

The mach-smdkc210.c and mach-smdkv310.c are merged one mach-smdkv310.c file.

> @@ -37,6 +37,7 @@
>  #include <plat/backlight.h>
> 
>  #include <mach/map.h>
> +#include <mach/pm-exynos4210.h>
> 
>  /* Following are default values for UCON, ULCON and UFCON UART registers */
>  #define SMDKC210_UCON_DEFAULT	(S3C2410_UCON_TXILEVEL |	\
> @@ -273,6 +274,21 @@ static void __init smdkc210_map_io(void)
>  	s3c24xx_init_uarts(smdkc210_uartcfgs,
> ARRAY_SIZE(smdkc210_uartcfgs));
>  }
> 
> +static void __init smdkc210_power_domain_init(void)
> +{
> +	/* Initialize Power domain */
> +	exynos4210_init_pm_domain(&exynos4210_pd_mfc);
> +	exynos4210_init_pm_domain(&exynos4210_pd_g3d);
> +	exynos4210_init_pm_domain(&exynos4210_pd_lcd0);
> +	exynos4210_init_pm_domain(&exynos4210_pd_lcd1);
> +	exynos4210_init_pm_domain(&exynos4210_pd_tv);
> +	exynos4210_init_pm_domain(&exynos4210_pd_cam);
> +	exynos4210_init_pm_domain(&exynos4210_pd_gps);
> +
> +	/* Add device to LCD0 power domain */
> +	exynos4210_add_device_to_domain(&exynos4210_pd_lcd0,
> &s5p_device_fimd0);
> +}
> +
>  static void __init smdkc210_machine_init(void)
>  {
>  	s3c_i2c1_set_platdata(NULL);
> @@ -289,6 +305,8 @@ static void __init smdkc210_machine_init(void)
>  	s5p_fimd0_set_platdata(&smdkc210_lcd0_pdata);
> 
>  	platform_add_devices(smdkc210_devices,
> ARRAY_SIZE(smdkc210_devices));
> +
> +	smdkc210_power_domain_init();
>  }
> 
>  MACHINE_START(SMDKC210, "SMDKC210")
> diff --git a/arch/arm/mach-exynos4/mach-smdkv310.c b/arch/arm/mach-
> exynos4/mach-smdkv310.c
> index 8c2819b..320c7f3 100644
> --- a/arch/arm/mach-exynos4/mach-smdkv310.c
> +++ b/arch/arm/mach-exynos4/mach-smdkv310.c
> @@ -33,6 +33,7 @@
>  #include <plat/backlight.h>
> 
>  #include <mach/map.h>
> +#include <mach/pm-exynos4210.h>
> 
>  /* Following are default values for UCON, ULCON and UFCON UART registers */
>  #define SMDKV310_UCON_DEFAULT	(S3C2410_UCON_TXILEVEL |	\
> @@ -225,6 +226,18 @@ static void __init smdkv310_map_io(void)
>  	s3c24xx_init_uarts(smdkv310_uartcfgs,
> ARRAY_SIZE(smdkv310_uartcfgs));
>  }
> 
> +static void __init smdkv310_power_domain_init(void)
> +{
> +	/* Initialize Power domain */
> +	exynos4210_init_pm_domain(&exynos4210_pd_mfc);
> +	exynos4210_init_pm_domain(&exynos4210_pd_g3d);
> +	exynos4210_init_pm_domain(&exynos4210_pd_lcd0);
> +	exynos4210_init_pm_domain(&exynos4210_pd_lcd1);
> +	exynos4210_init_pm_domain(&exynos4210_pd_tv);
> +	exynos4210_init_pm_domain(&exynos4210_pd_cam);
> +	exynos4210_init_pm_domain(&exynos4210_pd_gps);
> +}
> +
>  static void __init smdkv310_machine_init(void)
>  {
>  	s3c_i2c1_set_platdata(NULL);
> @@ -242,6 +255,8 @@ static void __init smdkv310_machine_init(void)
>  	samsung_bl_set(&smdkv310_bl_gpio_info, &smdkv310_bl_data);
> 
>  	platform_add_devices(smdkv310_devices,
> ARRAY_SIZE(smdkv310_devices));
> +
> +	smdkv310_power_domain_init();
>  }
> 
>  MACHINE_START(SMDKV310, "SMDKV310")
> diff --git a/arch/arm/mach-exynos4/mach-universal_c210.c b/arch/arm/mach-
> exynos4/mach-universal_c210.c
> index 43998f0..1ebc907 100644
> --- a/arch/arm/mach-exynos4/mach-universal_c210.c
> +++ b/arch/arm/mach-exynos4/mach-universal_c210.c
> @@ -36,6 +36,7 @@
>  #include <plat/s5p-time.h>
> 
>  #include <mach/map.h>
> +#include <mach/pm-exynos4210.h>
> 
>  /* Following are default values for UCON, ULCON and UFCON UART registers */
>  #define UNIVERSAL_UCON_DEFAULT	(S3C2410_UCON_TXILEVEL |	\
> @@ -737,6 +738,21 @@ static void __init universal_reserve(void)
>  	s5p_mfc_reserve_mem(0x43000000, 8 << 20, 0x51000000, 8 << 20);
>  }
> 
> +static void __init universal_power_domain_init(void)
> +{
> +	/* Initialize Power domain */
> +	exynos4210_init_pm_domain(&exynos4210_pd_mfc);
> +	exynos4210_init_pm_domain(&exynos4210_pd_g3d);
> +	exynos4210_init_pm_domain(&exynos4210_pd_lcd0);
> +	exynos4210_init_pm_domain(&exynos4210_pd_lcd1);
> +	exynos4210_init_pm_domain(&exynos4210_pd_tv);
> +	exynos4210_init_pm_domain(&exynos4210_pd_cam);
> +	exynos4210_init_pm_domain(&exynos4210_pd_gps);
> +
> +	/* Add device to MFC power domain */
> +	exynos4210_add_device_to_domain(&exynos4210_pd_mfc,
> &s5p_device_mfc);
> +}
> +
>  static void __init universal_machine_init(void)
>  {
>  	universal_sdhci_init();
> @@ -757,6 +773,8 @@ static void __init universal_machine_init(void)
> 
>  	/* Last */
>  	platform_add_devices(universal_devices,
> ARRAY_SIZE(universal_devices));
> +
> +	universal_power_domain_init();
>  }
> 
>  MACHINE_START(UNIVERSAL_C210, "UNIVERSAL_C210")
> --
> 1.7.0.4


Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

^ permalink raw reply

* [PATCH 2/7] s3c-adc: describe features via quirk constants
From: Kukjin Kim @ 2011-10-02  7:38 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <201109211504.03287.heiko@sntech.de>

Heiko St?bner wrote:
> 
> Hi,
> 
> Am Mittwoch, 21. September 2011, 14:32:14 schrieben Sie:
> > Heiko St?bner wrote:
> > > The adc blocks of S3C2410 through S5P have a multitude of
> > > quirks, i.e. moved bits or whole new registers.
> > >
> > > This patch tries to describe these individual features
> > > through constants which can be used to describe an adc.
> > >
> > > As SoCs sometimes share only some of these quirks defining
> > > TYPE_ADCVx values for each one wouldn't scale well when
> > > adding more variants.
> >
> > Hi Heiko,
> >
> > I don't have idea we really need to use QUIRK in this case...as I know,
the
> > QUIRK is used on other situation...
> >
> > In addition, the TYPE_ADCVx can support each Samsung SoCs' ADC...but I
> need
> > to check again.
> The current types could not support the features of the 2443 and 2416/2450
- I
> checked the datasheets.
> 
> The mux register in base+0x18 does not exist on any of the current
platforms.
> Also the bit 3 in ADCCON to select the resolution is specific to the
2416/2450
> (see comments above constants and quirk definitions in patches 6 and 7).
> 
> So to support these SoCs would require the definition of two new types.
> Including these new types in the existing conditionals would introduce a
lot
> of statements like
> 	if ( (TYPE_X || TYPE_Y) && !TYPE_Z)
> 
> In my opinion testing for specific features also describes the difference
> between implementations better if one reads the code later on.
> 
> 
> I will change the styling of the "<<"s but am wondering why checkpatch did
not
> complain, i.e. it complains for all other whitespace mistakes one can make
but
> not these.
> 

Hi Heiko,

How about following? I think following is also not bad...

diff --git a/arch/arm/plat-samsung/adc.c b/arch/arm/plat-samsung/adc.c
index ee8deef..f5c6703 100644
--- a/arch/arm/plat-samsung/adc.c
+++ b/arch/arm/plat-samsung/adc.c
@@ -41,6 +41,8 @@
 
 enum s3c_cpu_type {
 	TYPE_ADCV1, /* S3C24XX */
+	TYPE_ADCV11, /* S3C2416 */
+	TYPE_ADCV12, /* S3C2443 */
 	TYPE_ADCV2, /* S3C64XX, S5P64X0, S5PC100 */
 	TYPE_ADCV3, /* S5PV210, S5PC110, EXYNOS4210 */
 };
@@ -98,13 +100,17 @@ static inline void s3c_adc_select(struct adc_device
*adc,
 
 	client->select_cb(client, 1);
 
-	con &= ~S3C2410_ADCCON_MUXMASK;
+	if (cpu == TYPE_ADCV1 || cpu == TYPE_ADCV2)
+		con &= ~S3C2410_ADCCON_MUXMASK;
 	con &= ~S3C2410_ADCCON_STDBM;
 	con &= ~S3C2410_ADCCON_STARTMASK;
 
 	if (!client->is_ts) {
 		if (cpu == TYPE_ADCV3)
 			writel(client->channel & 0xf, adc->regs +
S5P_ADCMUX);
+		elif (cpu == TYPE_ADCV12)
+			writel(client->channel & 0xf,
+				adc->regs + S3C2443_ADCMUX);
 		else
 			con |= S3C2410_ADCCON_SELMUX(client->channel);
 	}
@@ -293,13 +299,13 @@ static irqreturn_t s3c_adc_irq(int irq, void *pw)
 
 	client->nr_samples--;
 
-	if (cpu != TYPE_ADCV1) {
-		/* S3C64XX/S5P ADC resolution is 12-bit */
-		data0 &= 0xfff;
-		data1 &= 0xfff;
-	} else {
+	if (cpu == TYPE_ADCV1 || cpu == TYPE_ADCV12) {
 		data0 &= 0x3ff;
 		data1 &= 0x3ff;
+	} else {
+		/* S3C2416, S3C64XX/S5P ADC resolution is 12-bit */
+		data0 &= 0xfff;
+		data1 &= 0xfff;
 	}
 
 	if (client->convert_cb)
@@ -320,7 +326,7 @@ static irqreturn_t s3c_adc_irq(int irq, void *pw)
 	}
 
 exit:
-	if (cpu != TYPE_ADCV1) {
+	if (cpu == TYPE_ADCV2 || cpu == TYPE_ADCV3) {
 		/* Clear ADC interrupt */
 		writel(0, adc->regs + S3C64XX_ADCCLRINT);
 	}
@@ -332,6 +338,7 @@ static int s3c_adc_probe(struct platform_device *pdev)
 	struct device *dev = &pdev->dev;
 	struct adc_device *adc;
 	struct resource *regs;
+	enum s3c_cpu_type cpu = platform_get_device_id(pdev)->driver_data;
 	int ret;
 	unsigned tmp;
 
@@ -394,10 +401,13 @@ static int s3c_adc_probe(struct platform_device *pdev)
 	clk_enable(adc->clk);
 
 	tmp = adc->prescale | S3C2410_ADCCON_PRSCEN;
-	if (platform_get_device_id(pdev)->driver_data != TYPE_ADCV1) {
-		/* Enable 12-bit ADC resolution */
+
+	/* Enable 12-bit ADC resolution */
+	if (cpu == TYPE_ADCV11)
+		tmp |= S3C2416_ADCCON_RESSEL;
+	if (cpu == TYPE_ADCV2 || cpu == TYPE_ADCV3)
 		tmp |= S3C64XX_ADCCON_RESSEL;
-	}
+
 	writel(tmp, adc->regs + S3C2410_ADCCON);
 
 	dev_info(dev, "attached adc driver\n");
@@ -464,6 +474,7 @@ static int s3c_adc_resume(struct device *dev)
 	struct platform_device *pdev = container_of(dev,
 			struct platform_device, dev);
 	struct adc_device *adc = platform_get_drvdata(pdev);
+	enum s3c_cpu_type cpu = platform_get_device_id(pdev)->driver_data;
 	int ret;
 	unsigned long tmp;
 
@@ -474,9 +485,13 @@ static int s3c_adc_resume(struct device *dev)
 	enable_irq(adc->irq);
 
 	tmp = adc->prescale | S3C2410_ADCCON_PRSCEN;
+
 	/* Enable 12-bit ADC resolution */
-	if (platform_get_device_id(pdev)->driver_data != TYPE_ADCV1)
+	if (cpu == TYPE_ADCV11)
+		tmp |= S3C2416_ADCCON_RESSEL;
+	if (cpu == TYPE_ADCV2 || cpu == TYPE_ADCV3)
 		tmp |= S3C64XX_ADCCON_RESSEL;
+
 	writel(tmp, adc->regs + S3C2410_ADCCON);
 
 	return 0;
@@ -492,6 +507,12 @@ static struct platform_device_id s3c_adc_driver_ids[] =
{
 		.name           = "s3c24xx-adc",
 		.driver_data    = TYPE_ADCV1,
 	}, {
+		.name		= "s3c2416-adc",
+		.driver_data	= TYPE_ADCV11
+	}, {
+		.name		= "s3c2443-adc",
+		.driver_data	= TYPE_ADCV12
+	}, {
 		.name           = "s3c64xx-adc",
 		.driver_data    = TYPE_ADCV2,
 	}, {

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

> Heiko
> 
> >
> > > Signed-off-by: Heiko Stuebner <heiko@sntech.de>
> > > ---
> > >
> > >  arch/arm/plat-samsung/adc.c |   29 +++++++++++++++++++++++++++++
> > >  1 files changed, 29 insertions(+), 0 deletions(-)
> > >
> > > diff --git a/arch/arm/plat-samsung/adc.c b/arch/arm/plat-samsung/adc.c
> > > index ee8deef..b209d58 100644
> > > --- a/arch/arm/plat-samsung/adc.c
> > > +++ b/arch/arm/plat-samsung/adc.c
> > > @@ -45,6 +45,35 @@ enum s3c_cpu_type {
> > >
> > >  	TYPE_ADCV3, /* S5PV210, S5PC110, EXYNOS4210 */
> > >
> > >  };
> > >
> > > +/*
> > > + * Resolution of the ADC - 10 or 12 bit
> > > + */
> >
> > /* ... */
> >
> > > +#define S3C_ADC_QUIRK_10BIT		0
> > > +#define S3C_ADC_QUIRK_12BIT		(1<<0)
> >
> > According to coding style, should be added blank around <<.
> >
> > > +
> > > +/*
> > > + * 12bit ADC can switch resolution between 10 bit and 12 bit
> > > + * ADCCON bit 03 for S3C2416
> > > + * ADCCON bit 16 for S3C64XX and up
> > > + */
> > > +#define S3C_ADC_QUIRK_RESSEL03		(1<<1)
> > > +#define S3C_ADC_QUIRK_RESSEL16		(1<<2)
> >
> > Same as above.
> >
> > > +
> > > +/*
> > > + * Input channel select can either be in
> > > + * - reg ADCCON, bit for S3C24XX and S3C64XX
> > > + * - reg base+0x18 for 2443/2416/2450
> > > + * - reg base+0x1C for S5P
> > > + */
> > > +#define S3C_ADC_QUIRK_MUXADCCON		(1<<3)
> > > +#define S3C_ADC_QUIRK_MUX18		(1<<4)
> > > +#define S3C_ADC_QUIRK_MUX1C		(1<<5)
> >
> > Same.
> >
> > > +
> > > +/*
> > > + * CLRINT register on S3C64xx
> > > + */
> >
> > /* ... */
> >
> > > +#define S3C_ADC_QUIRK_CLRINT		(1<<6)
> >
> > Same.
> >
> > > +
> > >
> > >  struct s3c_adc_client {
> > >
> > >  	struct platform_device	*pdev;
> > >  	struct list_head	 pend;
> > >
> > > --
> > > 1.7.2.3
> >
> > Thanks.
> >
> > Best regards,
> > Kgene.
> > --
> > Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
> > SW Solution Development Team, Samsung Electronics Co., Ltd.

^ permalink raw reply related

* [PATCH v2] ARM: localtimer: add header linux/errno.h explicitly
From: Shawn Guo @ 2011-10-02  8:20 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1316798545-21128-1-git-send-email-shawn.guo@linaro.org>

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>
---
Changes since v1:
 * Move the include towards the top of the file

 arch/arm/include/asm/localtimer.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/arm/include/asm/localtimer.h b/arch/arm/include/asm/localtimer.h
index 080d74f..ff66638 100644
--- a/arch/arm/include/asm/localtimer.h
+++ b/arch/arm/include/asm/localtimer.h
@@ -10,6 +10,8 @@
 #ifndef __ASM_ARM_LOCALTIMER_H
 #define __ASM_ARM_LOCALTIMER_H
 
+#include <linux/errno.h>
+
 struct clock_event_device;
 
 /*
-- 
1.7.4.1

^ permalink raw reply related

* [PATCH 0/2] Make IPI and localtimer handlers callable from C code
From: Shawn Guo @ 2011-10-02  8:56 UTC (permalink / raw)
  To: linux-arm-kernel

[Sorry for send you twice, Russell, Marc.  I forgot cc LAKML last time.]

With imx sub-architecture is moving to MULTI_IRQ_HANDLER, imx6q has to
get a local gic_handler_irq() implementation calling IPI and localtimer
handlers from C code, before Marc's global gic_handler_irq() series gets
merged.

This patch series changes the original __exception_irq_entry to a
wrapper for actual IPI and localtimer handlers which are callable from
C code now.

Marc Zyngier (1):
     ARM: smp: Add an IPI handler callable from C code

Shawn Guo (1):
     ARM: smp: Add a localtimer handler callable from C code

 arch/arm/include/asm/localtimer.h |    4 ++++
 arch/arm/include/asm/smp.h        |    5 +++++
 arch/arm/kernel/smp.c             |   10 ++++++++++
 3 files changed, 19 insertions(+), 0 deletions(-)

^ permalink raw reply

* [PATCH 1/2] ARM: smp: Add an IPI handler callable from C code
From: Shawn Guo @ 2011-10-02  8:57 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1317545821-23194-1-git-send-email-shawn.guo@linaro.org>

From: Marc Zyngier <marc.zyngier@arm.com>

In order to be able to handle IPI directly from C code instead of
assembly code, introduce handle_IPI(), which is modeled after handle_IRQ().

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 arch/arm/include/asm/smp.h |    5 +++++
 arch/arm/kernel/smp.c      |    5 +++++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/arch/arm/include/asm/smp.h b/arch/arm/include/asm/smp.h
index 674ebcd..0a17b62 100644
--- a/arch/arm/include/asm/smp.h
+++ b/arch/arm/include/asm/smp.h
@@ -33,6 +33,11 @@ extern void show_ipi_list(struct seq_file *, int);
 asmlinkage void do_IPI(int ipinr, struct pt_regs *regs);
 
 /*
+ * Called from C code, this handles an IPI.
+ */
+void handle_IPI(int ipinr, struct pt_regs *regs);
+
+/*
  * Setup the set of possible CPUs (via set_cpu_possible)
  */
 extern void smp_init_cpus(void);
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index 3f12ce9..2e49f18 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -587,6 +587,11 @@ static void ipi_cpu_stop(unsigned int cpu)
  */
 asmlinkage void __exception_irq_entry do_IPI(int ipinr, struct pt_regs *regs)
 {
+	handle_IPI(ipinr, regs);
+}
+
+void handle_IPI(int ipinr, struct pt_regs *regs)
+{
 	unsigned int cpu = smp_processor_id();
 	struct pt_regs *old_regs = set_irq_regs(regs);
 
-- 
1.7.4.1

^ permalink raw reply related

* [PATCH 2/2] ARM: smp: Add a localtimer handler callable from C code
From: Shawn Guo @ 2011-10-02  8:57 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1317545821-23194-1-git-send-email-shawn.guo@linaro.org>

In order to be able to handle localtimer directly from C code instead of
assembly code, introduce handle_local_timer(), which is modeled after
handle_IRQ().

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
 arch/arm/include/asm/localtimer.h |    4 ++++
 arch/arm/kernel/smp.c             |    5 +++++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/arch/arm/include/asm/localtimer.h b/arch/arm/include/asm/localtimer.h
index 080d74f..3306f28 100644
--- a/arch/arm/include/asm/localtimer.h
+++ b/arch/arm/include/asm/localtimer.h
@@ -22,6 +22,10 @@ void percpu_timer_setup(void);
  */
 asmlinkage void do_local_timer(struct pt_regs *);
 
+/*
+ * Called from C code
+ */
+void handle_local_timer(struct pt_regs *);
 
 #ifdef CONFIG_LOCAL_TIMERS
 
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index 2e49f18..0949007 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -480,6 +480,11 @@ static void ipi_timer(void)
 #ifdef CONFIG_LOCAL_TIMERS
 asmlinkage void __exception_irq_entry do_local_timer(struct pt_regs *regs)
 {
+	handle_local_timer(regs);
+}
+
+void handle_local_timer(struct pt_regs *regs)
+{
 	struct pt_regs *old_regs = set_irq_regs(regs);
 	int cpu = smp_processor_id();
 
-- 
1.7.4.1

^ permalink raw reply related

* [PATCH 2/2] ARM: SAMSUNG: Cleanup resources by using macro
From: Kukjin Kim @ 2011-10-02  9:24 UTC (permalink / raw)
  To: linux-arm-kernel

This patch adds macro SAMSUNG_RES_MEM and SAMSUNG_RES_IRQ to cleanup
regarding 'struct resource'

Cc: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
---
 arch/arm/mach-s3c2410/include/mach/map.h  |    1 +
 arch/arm/plat-samsung/devs.c              |  670 +++++------------------------
 arch/arm/plat-samsung/include/plat/devs.h |   10 +
 3 files changed, 122 insertions(+), 559 deletions(-)

diff --git a/arch/arm/mach-s3c2410/include/mach/map.h b/arch/arm/mach-s3c2410/include/mach/map.h
index 4cf495f..78ae807 100644
--- a/arch/arm/mach-s3c2410/include/mach/map.h
+++ b/arch/arm/mach-s3c2410/include/mach/map.h
@@ -149,6 +149,7 @@
 #define S3C24XX_PA_RTC      S3C2410_PA_RTC
 #define S3C24XX_PA_ADC      S3C2410_PA_ADC
 #define S3C24XX_PA_SPI      S3C2410_PA_SPI
+#define S3C24XX_PA_SPI1		(S3C2410_PA_SPI + S3C2410_SPI1)
 #define S3C24XX_PA_SDI      S3C2410_PA_SDI
 #define S3C24XX_PA_NAND	    S3C2410_PA_NAND
 
diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c
index 83c3cf9..fc72476 100644
--- a/arch/arm/plat-samsung/devs.c
+++ b/arch/arm/plat-samsung/devs.c
@@ -66,16 +66,8 @@ static u64 samsung_device_dma_mask = DMA_BIT_MASK(32);
 /* AC97 */
 #ifdef CONFIG_CPU_S3C2440
 static struct resource s3c_ac97_resource[] = {
-	[0] = {
-		.start	= S3C2440_PA_AC97,
-		.end	= S3C2440_PA_AC97 + S3C2440_SZ_AC97 - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start	= IRQ_S3C244x_AC97,
-		.end	= IRQ_S3C244x_AC97,
-		.flags	= IORESOURCE_IRQ,
-	},
+	[0] = { SAMSUNG_RES_MEM(S3C2440, AC97, S3C2440_SZ_AC97) },
+	[1] = { SAMSUNG_RES_IRQ(S3C244x_AC97) },
 	[2] = {
 		.name	= "PCM out",
 		.start	= DMACH_PCM_OUT,
@@ -112,21 +104,9 @@ struct platform_device s3c_device_ac97 = {
 
 #ifdef CONFIG_PLAT_S3C24XX
 static struct resource s3c_adc_resource[] = {
-	[0] = {
-		.start	= S3C24XX_PA_ADC,
-		.end	= S3C24XX_PA_ADC + S3C24XX_SZ_ADC - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start	= IRQ_TC,
-		.end	= IRQ_TC,
-		.flags	= IORESOURCE_IRQ,
-	},
-	[2] = {
-		.start	= IRQ_ADC,
-		.end	= IRQ_ADC,
-		.flags	= IORESOURCE_IRQ,
-	}
+	[0] = { SAMSUNG_RES_MEM(S3C24XX, ADC, S3C24XX_SZ_ADC) },
+	[1] = { SAMSUNG_RES_IRQ(TC) },
+	[2] = { SAMSUNG_RES_IRQ(ADC) },
 };
 
 struct platform_device s3c_device_adc = {
@@ -139,21 +119,9 @@ struct platform_device s3c_device_adc = {
 
 #if defined(CONFIG_SAMSUNG_DEV_ADC)
 static struct resource s3c_adc_resource[] = {
-	[0] = {
-		.start	= SAMSUNG_PA_ADC,
-		.end	= SAMSUNG_PA_ADC + SZ_256 - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start	= IRQ_TC,
-		.end	= IRQ_TC,
-		.flags	= IORESOURCE_IRQ,
-	},
-	[2] = {
-		.start	= IRQ_ADC,
-		.end	= IRQ_ADC,
-		.flags	= IORESOURCE_IRQ,
-	},
+	[0] = { SAMSUNG_RES_MEM(SAMSUNG, ADC, SZ_256) },
+	[1] = { SAMSUNG_RES_IRQ(TC) },
+	[2] = { SAMSUNG_RES_IRQ(ADC) },
 };
 
 struct platform_device s3c_device_adc = {
@@ -168,16 +136,8 @@ struct platform_device s3c_device_adc = {
 
 #ifdef CONFIG_CPU_S3C2440
 static struct resource s3c_camif_resource[] = {
-	[0] = {
-		.start	= S3C2440_PA_CAMIF,
-		.end	= S3C2440_PA_CAMIF + S3C2440_SZ_CAMIF - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start	= IRQ_CAM,
-		.end	= IRQ_CAM,
-		.flags	= IORESOURCE_IRQ,
-	}
+	[0] = { SAMSUNG_RES_MEM(S3C2440, CAMIF, S3C2440_SZ_CAMIF) },
+	[1] = { SAMSUNG_RES_IRQ(CAM) },
 };
 
 struct platform_device s3c_device_camif = {
@@ -216,26 +176,10 @@ struct platform_device samsung_asoc_idma = {
 
 #ifdef CONFIG_S3C_DEV_FB
 static struct resource s3c_fb_resource[] = {
-	[0] = {
-		.start	= S3C_PA_FB,
-		.end	= S3C_PA_FB + SZ_16K - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start	= IRQ_LCD_VSYNC,
-		.end	= IRQ_LCD_VSYNC,
-		.flags	= IORESOURCE_IRQ,
-	},
-	[2] = {
-		.start	= IRQ_LCD_FIFO,
-		.end	= IRQ_LCD_FIFO,
-		.flags	= IORESOURCE_IRQ,
-	},
-	[3] = {
-		.start	= IRQ_LCD_SYSTEM,
-		.end	= IRQ_LCD_SYSTEM,
-		.flags	= IORESOURCE_IRQ,
-	},
+	[0] = { SAMSUNG_RES_MEM(S3C, FB, SZ_16K) },
+	[1] = { SAMSUNG_RES_IRQ(LCD_VSYNC) },
+	[2] = { SAMSUNG_RES_IRQ(LCD_FIFO) },
+	[3] = { SAMSUNG_RES_IRQ(LCD_SYSTEM) },
 };
 
 struct platform_device s3c_device_fb = {
@@ -260,16 +204,8 @@ void __init s3c_fb_set_platdata(struct s3c_fb_platdata *pd)
 
 #ifdef CONFIG_S5P_DEV_FIMC0
 static struct resource s5p_fimc0_resource[] = {
-	[0] = {
-		.start	= S5P_PA_FIMC0,
-		.end	= S5P_PA_FIMC0 + SZ_4K - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start	= IRQ_FIMC0,
-		.end	= IRQ_FIMC0,
-		.flags	= IORESOURCE_IRQ,
-	},
+	[0] = { SAMSUNG_RES_MEM(S5P, FIMC0, SZ_4K) },
+	[1] = { SAMSUNG_RES_IRQ(FIMC0) },
 };
 
 struct platform_device s5p_device_fimc0 = {
@@ -286,16 +222,8 @@ struct platform_device s5p_device_fimc0 = {
 
 #ifdef CONFIG_S5P_DEV_FIMC1
 static struct resource s5p_fimc1_resource[] = {
-	[0] = {
-		.start	= S5P_PA_FIMC1,
-		.end	= S5P_PA_FIMC1 + SZ_4K - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start	= IRQ_FIMC1,
-		.end	= IRQ_FIMC1,
-		.flags	= IORESOURCE_IRQ,
-	},
+	[0] = { SAMSUNG_RES_MEM(S5P, FIMC1, SZ_4K) },
+	[1] = { SAMSUNG_RES_IRQ(FIMC1) },
 };
 
 struct platform_device s5p_device_fimc1 = {
@@ -312,16 +240,8 @@ struct platform_device s5p_device_fimc1 = {
 
 #ifdef CONFIG_S5P_DEV_FIMC2
 static struct resource s5p_fimc2_resource[] = {
-	[0] = {
-		.start	= S5P_PA_FIMC2,
-		.end	= S5P_PA_FIMC2 + SZ_4K - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start	= IRQ_FIMC2,
-		.end	= IRQ_FIMC2,
-		.flags	= IORESOURCE_IRQ,
-	},
+	[0] = { SAMSUNG_RES_MEM(S5P, FIMC2, SZ_4K) },
+	[1] = { SAMSUNG_RES_IRQ(FIMC2) },
 };
 
 struct platform_device s5p_device_fimc2 = {
@@ -338,16 +258,8 @@ struct platform_device s5p_device_fimc2 = {
 
 #ifdef CONFIG_S5P_DEV_FIMC3
 static struct resource s5p_fimc3_resource[] = {
-	[0] = {
-		.start	= S5P_PA_FIMC3,
-		.end	= S5P_PA_FIMC3 + SZ_4K - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start	= IRQ_FIMC3,
-		.end	= IRQ_FIMC3,
-		.flags	= IORESOURCE_IRQ,
-	},
+	[0] = { SAMSUNG_RES_MEM(S5P, FIMC3, SZ_4K) },
+	[1] = { SAMSUNG_RES_IRQ(FIMC3) },
 };
 
 struct platform_device s5p_device_fimc3 = {
@@ -366,26 +278,10 @@ struct platform_device s5p_device_fimc3 = {
 
 #ifdef CONFIG_S5P_DEV_FIMD0
 static struct resource s5p_fimd0_resource[] = {
-	[0] = {
-		.start	= S5P_PA_FIMD0,
-		.end	= S5P_PA_FIMD0 + SZ_32K - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start	= IRQ_FIMD0_VSYNC,
-		.end	= IRQ_FIMD0_VSYNC,
-		.flags	= IORESOURCE_IRQ,
-	},
-	[2] = {
-		.start	= IRQ_FIMD0_FIFO,
-		.end	= IRQ_FIMD0_FIFO,
-		.flags	= IORESOURCE_IRQ,
-	},
-	[3] = {
-		.start	= IRQ_FIMD0_SYSTEM,
-		.end	= IRQ_FIMD0_SYSTEM,
-		.flags	= IORESOURCE_IRQ,
-	},
+	[0] = { SAMSUNG_RES_MEM(S5P, FIMD0, SZ_32K) },
+	[1] = { SAMSUNG_RES_IRQ(FIMD0_VSYNC) },
+	[2] = { SAMSUNG_RES_IRQ(FIMD0_FIFO) },
+	[3] = { SAMSUNG_RES_IRQ(FIMD0_SYSTEM) },
 };
 
 struct platform_device s5p_device_fimd0 = {
@@ -424,20 +320,10 @@ void __init s3c_hwmon_set_platdata(struct s3c_hwmon_pdata *pd)
 
 /* HSMMC */
 
-#define S3C_SZ_HSMMC	0x1000
-
 #ifdef CONFIG_S3C_DEV_HSMMC
 static struct resource s3c_hsmmc_resource[] = {
-	[0] = {
-		.start	= S3C_PA_HSMMC0,
-		.end	= S3C_PA_HSMMC0 + S3C_SZ_HSMMC - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start	= IRQ_HSMMC0,
-		.end	= IRQ_HSMMC0,
-		.flags	= IORESOURCE_IRQ,
-	}
+	[0] = { SAMSUNG_RES_MEM(S3C, HSMMC0, SZ_4K) },
+	[1] = { SAMSUNG_RES_IRQ(HSMMC0) },
 };
 
 struct s3c_sdhci_platdata s3c_hsmmc0_def_platdata = {
@@ -467,16 +353,8 @@ void s3c_sdhci0_set_platdata(struct s3c_sdhci_platdata *pd)
 
 #ifdef CONFIG_S3C_DEV_HSMMC1
 static struct resource s3c_hsmmc1_resource[] = {
-	[0] = {
-		.start	= S3C_PA_HSMMC1,
-		.end	= S3C_PA_HSMMC1 + S3C_SZ_HSMMC - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start	= IRQ_HSMMC1,
-		.end	= IRQ_HSMMC1,
-		.flags	= IORESOURCE_IRQ,
-	}
+	[0] = { SAMSUNG_RES_MEM(S3C, HSMMC1, SZ_4K) },
+	[1] = { SAMSUNG_RES_IRQ(HSMMC1) },
 };
 
 struct s3c_sdhci_platdata s3c_hsmmc1_def_platdata = {
@@ -508,16 +386,8 @@ void s3c_sdhci1_set_platdata(struct s3c_sdhci_platdata *pd)
 
 #ifdef CONFIG_S3C_DEV_HSMMC2
 static struct resource s3c_hsmmc2_resource[] = {
-	[0] = {
-		.start	= S3C_PA_HSMMC2,
-		.end	= S3C_PA_HSMMC2 + S3C_SZ_HSMMC - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start	= IRQ_HSMMC2,
-		.end	= IRQ_HSMMC2,
-		.flags	= IORESOURCE_IRQ,
-	}
+	[0] = { SAMSUNG_RES_MEM(S3C, HSMMC2, SZ_4K) },
+	[1] = { SAMSUNG_RES_IRQ(HSMMC2) },
 };
 
 struct s3c_sdhci_platdata s3c_hsmmc2_def_platdata = {
@@ -547,16 +417,8 @@ void s3c_sdhci2_set_platdata(struct s3c_sdhci_platdata *pd)
 
 #ifdef CONFIG_S3C_DEV_HSMMC3
 static struct resource s3c_hsmmc3_resource[] = {
-	[0] = {
-		.start	= S3C_PA_HSMMC3,
-		.end	= S3C_PA_HSMMC3 + S3C_SZ_HSMMC - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start	= IRQ_HSMMC3,
-		.end	= IRQ_HSMMC3,
-		.flags	= IORESOURCE_IRQ,
-	}
+	[0] = { SAMSUNG_RES_MEM(S3C, HSMMC3, SZ_4K) },
+	[1] = { SAMSUNG_RES_IRQ(HSMMC3) },
 };
 
 struct s3c_sdhci_platdata s3c_hsmmc3_def_platdata = {
@@ -587,16 +449,8 @@ void s3c_sdhci3_set_platdata(struct s3c_sdhci_platdata *pd)
 /* I2C */
 
 static struct resource s3c_i2c0_resource[] = {
-	[0] = {
-		.start	= S3C_PA_IIC,
-		.end	= S3C_PA_IIC + SZ_4K - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start	= IRQ_IIC,
-		.end	= IRQ_IIC,
-		.flags	= IORESOURCE_IRQ,
-	},
+	[0] = { SAMSUNG_RES_MEM(S3C, IIC, SZ_4K) },
+	[1] = { SAMSUNG_RES_IRQ(IIC) },
 };
 
 struct platform_device s3c_device_i2c0 = {
@@ -633,16 +487,8 @@ void __init s3c_i2c0_set_platdata(struct s3c2410_platform_i2c *pd)
 
 #ifdef CONFIG_S3C_DEV_I2C1
 static struct resource s3c_i2c1_resource[] = {
-	[0] = {
-		.start	= S3C_PA_IIC1,
-		.end	= S3C_PA_IIC1 + SZ_4K - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start	= IRQ_IIC1,
-		.end	= IRQ_IIC1,
-		.flags	= IORESOURCE_IRQ,
-	},
+	[0] = { SAMSUNG_RES_MEM(S3C, IIC1, SZ_4K) },
+	[1] = { SAMSUNG_RES_IRQ(IIC1) },
 };
 
 struct platform_device s3c_device_i2c1 = {
@@ -671,16 +517,8 @@ void __init s3c_i2c1_set_platdata(struct s3c2410_platform_i2c *pd)
 
 #ifdef CONFIG_S3C_DEV_I2C2
 static struct resource s3c_i2c2_resource[] = {
-	[0] = {
-		.start	= S3C_PA_IIC2,
-		.end	= S3C_PA_IIC2 + SZ_4K - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start	= IRQ_IIC2,
-		.end	= IRQ_IIC2,
-		.flags	= IORESOURCE_IRQ,
-	},
+	[0] = { SAMSUNG_RES_MEM(S3C, IIC2, SZ_4K) },
+	[1] = { SAMSUNG_RES_IRQ(IIC2) },
 };
 
 struct platform_device s3c_device_i2c2 = {
@@ -709,16 +547,8 @@ void __init s3c_i2c2_set_platdata(struct s3c2410_platform_i2c *pd)
 
 #ifdef CONFIG_S3C_DEV_I2C3
 static struct resource s3c_i2c3_resource[] = {
-	[0] = {
-		.start	= S3C_PA_IIC3,
-		.end	= S3C_PA_IIC3 + SZ_4K - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start	= IRQ_IIC3,
-		.end	= IRQ_IIC3,
-		.flags	= IORESOURCE_IRQ,
-	},
+	[0] = { SAMSUNG_RES_MEM(S3C, IIC3, SZ_4K) },
+	[1] = { SAMSUNG_RES_IRQ(IIC3) },
 };
 
 struct platform_device s3c_device_i2c3 = {
@@ -747,16 +577,8 @@ void __init s3c_i2c3_set_platdata(struct s3c2410_platform_i2c *pd)
 
 #ifdef CONFIG_S3C_DEV_I2C4
 static struct resource s3c_i2c4_resource[] = {
-	[0] = {
-		.start	= S3C_PA_IIC4,
-		.end	= S3C_PA_IIC4 + SZ_4K - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start	= IRQ_IIC4,
-		.end	= IRQ_IIC4,
-		.flags	= IORESOURCE_IRQ,
-	},
+	[0] = { SAMSUNG_RES_MEM(S3C, IIC4, SZ_4K) },
+	[1] = { SAMSUNG_RES_IRQ(IIC4) },
 };
 
 struct platform_device s3c_device_i2c4 = {
@@ -785,16 +607,8 @@ void __init s3c_i2c4_set_platdata(struct s3c2410_platform_i2c *pd)
 
 #ifdef CONFIG_S3C_DEV_I2C5
 static struct resource s3c_i2c5_resource[] = {
-	[0] = {
-		.start	= S3C_PA_IIC5,
-		.end	= S3C_PA_IIC5 + SZ_4K - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start	= IRQ_IIC5,
-		.end	= IRQ_IIC5,
-		.flags	= IORESOURCE_IRQ,
-	},
+	[0] = { SAMSUNG_RES_MEM(S3C, IIC5, SZ_4K) },
+	[1] = { SAMSUNG_RES_IRQ(IIC5) },
 };
 
 struct platform_device s3c_device_i2c5 = {
@@ -823,16 +637,8 @@ void __init s3c_i2c5_set_platdata(struct s3c2410_platform_i2c *pd)
 
 #ifdef CONFIG_S3C_DEV_I2C6
 static struct resource s3c_i2c6_resource[] = {
-	[0] = {
-		.start	= S3C_PA_IIC6,
-		.end	= S3C_PA_IIC6 + SZ_4K - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start	= IRQ_IIC6,
-		.end	= IRQ_IIC6,
-		.flags	= IORESOURCE_IRQ,
-	},
+	[0] = { SAMSUNG_RES_MEM(S3C, IIC6, SZ_4K) },
+	[1] = { SAMSUNG_RES_IRQ(IIC6) },
 };
 
 struct platform_device s3c_device_i2c6 = {
@@ -861,16 +667,8 @@ void __init s3c_i2c6_set_platdata(struct s3c2410_platform_i2c *pd)
 
 #ifdef CONFIG_S3C_DEV_I2C7
 static struct resource s3c_i2c7_resource[] = {
-	[0] = {
-		.start	= S3C_PA_IIC7,
-		.end	= S3C_PA_IIC7 + SZ_4K - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start	= IRQ_IIC7,
-		.end	= IRQ_IIC7,
-		.flags	= IORESOURCE_IRQ,
-	},
+	[0] = { SAMSUNG_RES_MEM(S3C, IIC7, SZ_4K) },
+	[1] = { SAMSUNG_RES_IRQ(IIC7) },
 };
 
 struct platform_device s3c_device_i2c7 = {
@@ -899,16 +697,8 @@ void __init s3c_i2c7_set_platdata(struct s3c2410_platform_i2c *pd)
 
 #ifdef CONFIG_S5P_DEV_I2C_HDMIPHY
 static struct resource s5p_i2c_resource[] = {
-	[0] = {
-		.start	= S5P_PA_IIC_HDMIPHY,
-		.end	= S5P_PA_IIC_HDMIPHY + SZ_4K - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start	= IRQ_IIC_HDMIPHY,
-		.end	= IRQ_IIC_HDMIPHY,
-		.flags	= IORESOURCE_IRQ,
-	},
+	[0] = { SAMSUNG_RES_MEM(S5P, IIC_HDMIPHY, SZ_4K) },
+	[1] = { SAMSUNG_RES_IRQ(IIC_HDMIPHY) },
 };
 
 struct platform_device s5p_device_i2c_hdmiphy = {
@@ -942,11 +732,7 @@ void __init s5p_i2c_hdmiphy_set_platdata(struct s3c2410_platform_i2c *pd)
 
 #ifdef CONFIG_PLAT_S3C24XX
 static struct resource s3c_iis_resource[] = {
-	[0] = {
-		.start	= S3C24XX_PA_IIS,
-		.end	= S3C24XX_PA_IIS + S3C24XX_SZ_IIS - 1,
-		.flags	= IORESOURCE_MEM,
-	}
+	[0] = { SAMSUNG_RES_MEM(S3C24XX, IIS, S3C24XX_SZ_IIS) },
 };
 
 struct platform_device s3c_device_iis = {
@@ -976,16 +762,8 @@ struct platform_device s3c2412_device_iis = {
 
 #ifdef CONFIG_SAMSUNG_DEV_IDE
 static struct resource s3c_cfcon_resource[] = {
-	[0] = {
-		.start	= SAMSUNG_PA_CFCON,
-		.end	= SAMSUNG_PA_CFCON + SZ_16K - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start	= IRQ_CFCON,
-		.end	= IRQ_CFCON,
-		.flags	= IORESOURCE_IRQ,
-	},
+	[0] = { SAMSUNG_RES_MEM(SAMSUNG, CFCON, SZ_16K) },
+	[1] = { SAMSUNG_RES_IRQ(CFCON) },
 };
 
 struct platform_device s3c_device_cfcon = {
@@ -1005,16 +783,8 @@ void s3c_ide_set_platdata(struct s3c_ide_platdata *pdata)
 
 #ifdef CONFIG_SAMSUNG_DEV_KEYPAD
 static struct resource samsung_keypad_resources[] = {
-	[0] = {
-		.start	= SAMSUNG_PA_KEYPAD,
-		.end	= SAMSUNG_PA_KEYPAD + 0x20 - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start	= IRQ_KEYPAD,
-		.end	= IRQ_KEYPAD,
-		.flags	= IORESOURCE_IRQ,
-	},
+	[0] = { SAMSUNG_RES_MEM(SAMSUNG, KEYPAD, SZ_32) },
+	[1] = { SAMSUNG_RES_IRQ(KEYPAD) },
 };
 
 struct platform_device samsung_device_keypad = {
@@ -1040,16 +810,8 @@ void __init samsung_keypad_set_platdata(struct samsung_keypad_platdata *pd)
 
 #ifdef CONFIG_PLAT_S3C24XX
 static struct resource s3c_lcd_resource[] = {
-	[0] = {
-		.start	= S3C24XX_PA_LCD,
-		.end	= S3C24XX_PA_LCD + S3C24XX_SZ_LCD - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start	= IRQ_LCD,
-		.end	= IRQ_LCD,
-		.flags	= IORESOURCE_IRQ,
-	}
+	[0] = { SAMSUNG_RES_MEM(S3C24XX, LCD, S3C24XX_SZ_LCD) },
+	[1] = { SAMSUNG_RES_IRQ(LCD) },
 };
 
 struct platform_device s3c_device_lcd = {
@@ -1084,16 +846,8 @@ void __init s3c24xx_fb_set_platdata(struct s3c2410fb_mach_info *pd)
 
 #ifdef CONFIG_S5P_DEV_MFC
 static struct resource s5p_mfc_resource[] = {
-	[0] = {
-		.start	= S5P_PA_MFC,
-		.end	= S5P_PA_MFC + SZ_64K - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start	= IRQ_MFC,
-		.end	= IRQ_MFC,
-		.flags	= IORESOURCE_IRQ,
-	}
+	[0] = { SAMSUNG_RES_MEM(S5P, MFC, SZ_64K) },
+	[1] = { SAMSUNG_RES_IRQ(MFC) },
 };
 
 struct platform_device s5p_device_mfc = {
@@ -1136,16 +890,8 @@ struct platform_device s5p_device_mfc_r = {
 
 #ifdef CONFIG_S5P_DEV_CSIS0
 static struct resource s5p_mipi_csis0_resource[] = {
-	[0] = {
-		.start	= S5P_PA_MIPI_CSIS0,
-		.end	= S5P_PA_MIPI_CSIS0 + SZ_4K - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start	= IRQ_MIPI_CSIS0,
-		.end	= IRQ_MIPI_CSIS0,
-		.flags	= IORESOURCE_IRQ,
-	}
+	[0] = { SAMSUNG_RES_MEM(S5P, MIPI_CSIS0, SZ_4K) },
+	[1] = { SAMSUNG_RES_IRQ(MIPI_CSIS0) },
 };
 
 struct platform_device s5p_device_mipi_csis0 = {
@@ -1158,16 +904,8 @@ struct platform_device s5p_device_mipi_csis0 = {
 
 #ifdef CONFIG_S5P_DEV_CSIS1
 static struct resource s5p_mipi_csis1_resource[] = {
-	[0] = {
-		.start	= S5P_PA_MIPI_CSIS1,
-		.end	= S5P_PA_MIPI_CSIS1 + SZ_4K - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start	= IRQ_MIPI_CSIS1,
-		.end	= IRQ_MIPI_CSIS1,
-		.flags	= IORESOURCE_IRQ,
-	},
+	[0] = { SAMSUNG_RES_MEM(S5P, MIPI_CSIS1, SZ_4K) },
+	[1] = { SAMSUNG_RES_IRQ(MIPI_CSIS1) },
 };
 
 struct platform_device s5p_device_mipi_csis1 = {
@@ -1182,11 +920,7 @@ struct platform_device s5p_device_mipi_csis1 = {
 
 #ifdef CONFIG_S3C_DEV_NAND
 static struct resource s3c_nand_resource[] = {
-	[0] = {
-		.start	= S3C_PA_NAND,
-		.end	= S3C_PA_NAND + SZ_1M,
-		.flags	= IORESOURCE_MEM,
-	}
+	[0] = { SAMSUNG_RES_MEM(S3C, NAND, SZ_1M) },
 };
 
 struct platform_device s3c_device_nand = {
@@ -1291,21 +1025,9 @@ void __init s3c_nand_set_platdata(struct s3c2410_platform_nand *nand)
 
 #ifdef CONFIG_S3C_DEV_ONENAND
 static struct resource s3c_onenand_resources[] = {
-	[0] = {
-		.start	= S3C_PA_ONENAND,
-		.end	= S3C_PA_ONENAND + 0x400 - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start	= S3C_PA_ONENAND_BUF,
-		.end	= S3C_PA_ONENAND_BUF + S3C_SZ_ONENAND_BUF - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	[2] = {
-		.start	= IRQ_ONENAND,
-		.end	= IRQ_ONENAND,
-		.flags	= IORESOURCE_IRQ,
-	},
+	[0] = { SAMSUNG_RES_MEM(S3C, ONENAND, SZ_1K) },
+	[1] = { SAMSUNG_RES_MEM(S3C, ONENAND_BUF, S3C_SZ_ONENAND_BUF) },
+	[2] = { SAMSUNG_RES_IRQ(ONENAND) },
 };
 
 struct platform_device s3c_device_onenand = {
@@ -1318,21 +1040,9 @@ struct platform_device s3c_device_onenand = {
 
 #ifdef CONFIG_S3C64XX_DEV_ONENAND1
 static struct resource s3c64xx_onenand1_resources[] = {
-	[0] = {
-		.start	= S3C64XX_PA_ONENAND1,
-		.end	= S3C64XX_PA_ONENAND1 + 0x400 - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start	= S3C64XX_PA_ONENAND1_BUF,
-		.end	= S3C64XX_PA_ONENAND1_BUF + S3C64XX_SZ_ONENAND1_BUF - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	[2] = {
-		.start	= IRQ_ONENAND1,
-		.end	= IRQ_ONENAND1,
-		.flags	= IORESOURCE_IRQ,
-	},
+	[0] = { SAMSUNG_RES_MEM(S3C64XX, ONENAND1, SZ_1K) },
+	[1] = { SAMSUNG_RES_MEM(S3C64XX, ONENAND1_BUF, S3C64XX_SZ_ONENAND1_BUF) },
+	[2] = { SAMSUNG_RES_IRQ(ONENAND1) },
 };
 
 struct platform_device s3c64xx_device_onenand1 = {
@@ -1351,21 +1061,9 @@ void s3c64xx_onenand1_set_platdata(struct onenand_platform_data *pdata)
 
 #ifdef CONFIG_S5P_DEV_ONENAND
 static struct resource s5p_onenand_resources[] = {
-	[0] = {
-		.start	= S5P_PA_ONENAND,
-		.end	= S5P_PA_ONENAND + SZ_128K - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start	= S5P_PA_ONENAND_DMA,
-		.end	= S5P_PA_ONENAND_DMA + SZ_8K - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	[2] = {
-		.start	= IRQ_ONENAND_AUDI,
-		.end	= IRQ_ONENAND_AUDI,
-		.flags	= IORESOURCE_IRQ,
-	},
+	[0] = { SAMSUNG_RES_MEM(S5P, ONENAND, SZ_128K) },
+	[1] = { SAMSUNG_RES_MEM(S5P, ONENAND_DMA, SZ_8K) },
+	[2] = { SAMSUNG_RES_IRQ(ONENAND_AUDI) },
 };
 
 struct platform_device s5p_device_onenand = {
@@ -1380,9 +1078,7 @@ struct platform_device s5p_device_onenand = {
 
 #ifdef CONFIG_PLAT_S5P
 static struct resource s5p_pmu_resource = {
-	.start	= IRQ_PMU,
-	.end	= IRQ_PMU,
-	.flags	= IORESOURCE_IRQ,
+	SAMSUNG_RES_IRQ(PMU)
 };
 
 struct platform_device s5p_device_pmu = {
@@ -1439,21 +1135,9 @@ struct platform_device s3c_device_timer[] = {
 
 #ifdef CONFIG_PLAT_S3C24XX
 static struct resource s3c_rtc_resource[] = {
-	[0] = {
-		.start	= S3C24XX_PA_RTC,
-		.end	= S3C24XX_PA_RTC + 0xff,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start	= IRQ_RTC,
-		.end	= IRQ_RTC,
-		.flags	= IORESOURCE_IRQ,
-	},
-	[2] = {
-		.start	= IRQ_TICK,
-		.end	= IRQ_TICK,
-		.flags	= IORESOURCE_IRQ
-	}
+	[0] = { SAMSUNG_RES_MEM(S3C24XX, RTC, SZ_256) },
+	[1] = { SAMSUNG_RES_IRQ(RTC) },
+	[2] = { SAMSUNG_RES_IRQ(TICK) },
 };
 
 struct platform_device s3c_device_rtc = {
@@ -1466,21 +1150,9 @@ struct platform_device s3c_device_rtc = {
 
 #ifdef CONFIG_S3C_DEV_RTC
 static struct resource s3c_rtc_resource[] = {
-	[0] = {
-		.start	= S3C_PA_RTC,
-		.end	= S3C_PA_RTC + 0xff,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start	= IRQ_RTC_ALARM,
-		.end	= IRQ_RTC_ALARM,
-		.flags	= IORESOURCE_IRQ,
-	},
-	[2] = {
-		.start	= IRQ_RTC_TIC,
-		.end	= IRQ_RTC_TIC,
-		.flags	= IORESOURCE_IRQ
-	}
+	[0] = { SAMSUNG_RES_MEM(S3C, RTC, SZ_256) },
+	[1] = { SAMSUNG_RES_IRQ(RTC_ALARM) },
+	[2] = { SAMSUNG_RES_IRQ(RTC_TIC) },
 };
 
 struct platform_device s3c_device_rtc = {
@@ -1495,16 +1167,8 @@ struct platform_device s3c_device_rtc = {
 
 #ifdef CONFIG_PLAT_S3C24XX
 static struct resource s3c_sdi_resource[] = {
-	[0] = {
-		.start	= S3C24XX_PA_SDI,
-		.end	= S3C24XX_PA_SDI + S3C24XX_SZ_SDI - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start	= IRQ_SDI,
-		.end	= IRQ_SDI,
-		.flags	= IORESOURCE_IRQ,
-	}
+	[0] = { SAMSUNG_RES_MEM(S3C24XX, SDI, S3C24XX_SZ_SDI) },
+	[1] = { SAMSUNG_RES_IRQ(SDI) },
 };
 
 struct platform_device s3c_device_sdi = {
@@ -1525,16 +1189,8 @@ void __init s3c24xx_mci_set_platdata(struct s3c24xx_mci_pdata *pdata)
 
 #ifdef CONFIG_PLAT_S3C24XX
 static struct resource s3c_spi0_resource[] = {
-	[0] = {
-		.start	= S3C24XX_PA_SPI,
-		.end	= S3C24XX_PA_SPI + 0x1f,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start	= IRQ_SPI0,
-		.end	= IRQ_SPI0,
-		.flags	= IORESOURCE_IRQ,
-	}
+	[0] = { SAMSUNG_RES_MEM(S3C24XX, SPI, SZ_32) },
+	[1] = { SAMSUNG_RES_IRQ(SPI0) },
 };
 
 struct platform_device s3c_device_spi0 = {
@@ -1549,16 +1205,8 @@ struct platform_device s3c_device_spi0 = {
 };
 
 static struct resource s3c_spi1_resource[] = {
-	[0] = {
-		.start	= S3C24XX_PA_SPI + S3C2410_SPI1,
-		.end	= S3C24XX_PA_SPI + S3C2410_SPI1 + 0x1f,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start	= IRQ_SPI1,
-		.end	= IRQ_SPI1,
-		.flags	= IORESOURCE_IRQ,
-	}
+	[0] = { SAMSUNG_RES_MEM(S3C24XX, SPI1, SZ_32) },
+	[1] = { SAMSUNG_RES_IRQ(SPI1) },
 };
 
 struct platform_device s3c_device_spi1 = {
@@ -1577,17 +1225,8 @@ struct platform_device s3c_device_spi1 = {
 
 #ifdef CONFIG_PLAT_S3C24XX
 static struct resource s3c_ts_resource[] = {
-	[0] = {
-		.start	= S3C24XX_PA_ADC,
-		.end	= S3C24XX_PA_ADC + S3C24XX_SZ_ADC - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start	= IRQ_TC,
-		.end	= IRQ_TC,
-		.flags	= IORESOURCE_IRQ,
-	},
-
+	[0] = { SAMSUNG_RES_MEM(S3C24XX, ADC, S3C24XX_SZ_ADC) },
+	[1] = { SAMSUNG_RES_IRQ(TC) },
 };
 
 struct platform_device s3c_device_ts = {
@@ -1607,16 +1246,8 @@ void __init s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info *hard_s3c2410ts_
 
 #ifdef CONFIG_SAMSUNG_DEV_TS
 static struct resource s3c_ts_resource[] = {
-	[0] = {
-		.start	= SAMSUNG_PA_ADC,
-		.end	= SAMSUNG_PA_ADC + SZ_256 - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start	= IRQ_TC,
-		.end	= IRQ_TC,
-		.flags	= IORESOURCE_IRQ,
-	},
+	[0] = { SAMSUNG_RES_MEM(SAMSUNG, ADC, SZ_256) },
+	[1] = { SAMSUNG_RES_IRQ(TC) },
 };
 
 static struct s3c2410_ts_mach_info default_ts_data __initdata = {
@@ -1647,16 +1278,8 @@ void __init s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info *pd)
 #ifdef CONFIG_S5P_DEV_TV
 
 static struct resource s5p_hdmi_resources[] = {
-	[0] = {
-		.start	= S5P_PA_HDMI,
-		.end	= S5P_PA_HDMI + SZ_1M - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start	= IRQ_HDMI,
-		.end	= IRQ_HDMI,
-		.flags	= IORESOURCE_IRQ,
-	},
+	[0] = { SAMSUNG_RES_MEM(S5P, HDMI, SZ_1M) },
+	[1] = { SAMSUNG_RES_IRQ(HDMI) },
 };
 
 struct platform_device s5p_device_hdmi = {
@@ -1667,16 +1290,8 @@ struct platform_device s5p_device_hdmi = {
 };
 
 static struct resource s5p_sdo_resources[] = {
-	[0] = {
-		.start	= S5P_PA_SDO,
-		.end	= S5P_PA_SDO + SZ_64K - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start	= IRQ_SDO,
-		.end	= IRQ_SDO,
-		.flags	= IORESOURCE_IRQ,
-	}
+	[0] = { SAMSUNG_RES_MEM(S5P, SDO, SZ_64K) },
+	[1] = { SAMSUNG_RES_IRQ(SDO) },
 };
 
 struct platform_device s5p_device_sdo = {
@@ -1687,24 +1302,9 @@ struct platform_device s5p_device_sdo = {
 };
 
 static struct resource s5p_mixer_resources[] = {
-	[0] = {
-		.start	= S5P_PA_MIXER,
-		.end	= S5P_PA_MIXER + SZ_64K - 1,
-		.flags	= IORESOURCE_MEM,
-		.name	= "mxr"
-	},
-	[1] = {
-		.start	= S5P_PA_VP,
-		.end	= S5P_PA_VP + SZ_64K - 1,
-		.flags	= IORESOURCE_MEM,
-		.name	= "vp"
-	},
-	[2] = {
-		.start	= IRQ_MIXER,
-		.end	= IRQ_MIXER,
-		.flags	= IORESOURCE_IRQ,
-		.name	= "irq"
-	}
+	[0] = { SAMSUNG_RES_MEM(S5P, MIXER, SZ_64K) .name = "mxr" },
+	[1] = { SAMSUNG_RES_MEM(S5P, VP, SZ_64K) .name = "vp" },
+	[2] = { SAMSUNG_RES_IRQ(MIXER) .name = "irq" },
 };
 
 struct platform_device s5p_device_mixer = {
@@ -1723,16 +1323,8 @@ struct platform_device s5p_device_mixer = {
 
 #ifdef CONFIG_S3C_DEV_USB_HOST
 static struct resource s3c_usb_resource[] = {
-	[0] = {
-		.start	= S3C_PA_USBHOST,
-		.end	= S3C_PA_USBHOST + 0x100 - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start	= IRQ_USBH,
-		.end	= IRQ_USBH,
-		.flags	= IORESOURCE_IRQ,
-	}
+	[0] = { SAMSUNG_RES_MEM(S3C, USBHOST, SZ_256) },
+	[1] = { SAMSUNG_RES_IRQ(USBH) },
 };
 
 struct platform_device s3c_device_ohci = {
@@ -1766,16 +1358,8 @@ void __init s3c_ohci_set_platdata(struct s3c2410_hcd_info *info)
 
 #ifdef CONFIG_PLAT_S3C24XX
 static struct resource s3c_usbgadget_resource[] = {
-	[0] = {
-		.start	= S3C24XX_PA_USBDEV,
-		.end	= S3C24XX_PA_USBDEV + S3C24XX_SZ_USBDEV - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start	= IRQ_USBD,
-		.end	= IRQ_USBD,
-		.flags	= IORESOURCE_IRQ,
-	}
+	[0] = { SAMSUNG_RES_MEM(S3C24XX, USBDEV, S3C24XX_SZ_USBDEV) },
+	[1] = { SAMSUNG_RES_IRQ(USBD) },
 };
 
 struct platform_device s3c_device_usbgadget = {
@@ -1795,16 +1379,8 @@ void __init s3c24xx_udc_set_platdata(struct s3c2410_udc_mach_info *pd)
 
 #ifdef CONFIG_S5P_DEV_USB_EHCI
 static struct resource s5p_ehci_resource[] = {
-	[0] = {
-		.start	= S5P_PA_EHCI,
-		.end	= S5P_PA_EHCI + SZ_256 - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start	= IRQ_USB_HOST,
-		.end	= IRQ_USB_HOST,
-		.flags	= IORESOURCE_IRQ,
-	}
+	[0] = { SAMSUNG_RES_MEM(S5P, EHCI, SZ_256) },
+	[1] = { SAMSUNG_RES_IRQ(USB_HOST) },
 };
 
 struct platform_device s5p_device_ehci = {
@@ -1836,16 +1412,8 @@ void __init s5p_ehci_set_platdata(struct s5p_ehci_platdata *pd)
 
 #ifdef CONFIG_S3C_DEV_USB_HSOTG
 static struct resource s3c_usb_hsotg_resources[] = {
-	[0] = {
-		.start	= S3C_PA_USB_HSOTG,
-		.end	= S3C_PA_USB_HSOTG + 0x10000 - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start	= IRQ_OTG,
-		.end	= IRQ_OTG,
-		.flags	= IORESOURCE_IRQ,
-	},
+	[0] = { SAMSUNG_RES_MEM(S3C, USB_HSOTG, SZ_16K) },
+	[1] = { SAMSUNG_RES_IRQ(OTG) },
 };
 
 struct platform_device s3c_device_usb_hsotg = {
@@ -1864,16 +1432,8 @@ struct platform_device s3c_device_usb_hsotg = {
 
 #ifdef CONFIG_PLAT_S3C24XX
 static struct resource s3c_hsudc_resource[] = {
-	[0] = {
-		.start	= S3C2416_PA_HSUDC,
-		.end	= S3C2416_PA_HSUDC + S3C2416_SZ_HSUDC - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start	= IRQ_USBD,
-		.end	= IRQ_USBD,
-		.flags	= IORESOURCE_IRQ,
-	}
+	[0] = { SAMSUNG_RES_MEM(S3C2416, HSUDC, S3C2416_SZ_HSUDC) },
+	[1] = { SAMSUNG_RES_IRQ(USBD) },
 };
 
 struct platform_device s3c_device_usb_hsudc = {
@@ -1897,16 +1457,8 @@ void __init s3c24xx_hsudc_set_platdata(struct s3c24xx_hsudc_platdata *pd)
 
 #ifdef CONFIG_S3C_DEV_WDT
 static struct resource s3c_wdt_resource[] = {
-	[0] = {
-		.start	= S3C_PA_WDT,
-		.end	= S3C_PA_WDT + SZ_1K,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start	= IRQ_WDT,
-		.end	= IRQ_WDT,
-		.flags	= IORESOURCE_IRQ,
-	}
+	[0] = { SAMSUNG_RES_MEM(S3C, WDT, SZ_1K) },
+	[1] = { SAMSUNG_RES_IRQ(WDT) },
 };
 
 struct platform_device s3c_device_wdt = {
diff --git a/arch/arm/plat-samsung/include/plat/devs.h b/arch/arm/plat-samsung/include/plat/devs.h
index 8f19241..8b8bd1c 100644
--- a/arch/arm/plat-samsung/include/plat/devs.h
+++ b/arch/arm/plat-samsung/include/plat/devs.h
@@ -18,6 +18,16 @@
 
 #include <linux/platform_device.h>
 
+#define SAMSUNG_RES_MEM(soc, ip, sz)			\
+		.start	= soc##_PA_##ip,		\
+		.end	= soc##_PA_##ip + sz - 1,	\
+		.flags	= IORESOURCE_MEM,
+
+#define SAMSUNG_RES_IRQ(ip)				\
+		.start	= IRQ_##ip,			\
+		.end	= IRQ_##ip,			\
+		.flags	= IORESOURCE_IRQ,
+
 struct s3c24xx_uart_resources {
 	struct resource		*resources;
 	unsigned long		 nr_resources;
-- 
1.7.1

^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox