ARM: SAMSUNG: Cleanup resources by using macro
Subsystems (3)
PATCH v2 2/2 ARM: SAMSUNG: Cleanup resources by using macro
This patch adds macro SAMSUNG_RES_MEM, SAMSUNG_RES_IRQ and so on to cleanup regarding 'struct resource' by using defined helpers at <linux/ioport.h>.
---
Changes since v1:
- Address comments from Russell King
Using defined helpers to define resource
arch/arm/mach-s3c2410/include/mach/map.h | 1 + arch/arm/plat-samsung/devs.c | 697 +++++------------------------ arch/arm/plat-samsung/include/plat/devs.h | 11 + 3 files changed, 129 insertions(+), 580 deletions(-)
arch/arm/mach-s3c2410/include/mach/map.h +1 -0
@@ -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
arch/arm/plat-samsung/devs.c +117 -580
1,010 lines not on this page · raw message
arch/arm/plat-samsung/include/plat/devs.h +11 -0
@@ -18,6 +18,17 @@#include <linux/platform_device.h> +#define SAMSUNG_RES_MEM (soc, ip, sz) DEFINE_RES_MEM(soc##_PA_##ip, sz) +#define SAMSUNG_RES_IRQ (ip) DEFINE_RES_IRQ(IRQ_##ip) + +#define SAMSUNG_RES_MEM_NAMED (soc, ip, sz, name) \ + DEFINE_RES_MEM_NAMED(soc##_PA_##ip, sz, name) +#define SAMSUNG_RES_IRQ_NAMED (ip, name) \ + DEFINE_RES_IRQ_NAMED(IRQ_##ip, name) +#define SAMSUNG_RES_DMA_NAMED (ch, name) \ + DEFINE_RES_DMA_NAMED(DMACH_##ch, name) + +struct s3c24xx_uart_resources {struct resource *resources;unsigned long nr_resources;
Signature · 1 line
1.7.1
PATCH v2 2/2 ARM: SAMSUNG: Cleanup resources by using macro
Quoted 1,101 lines · Kukjin Kim
This patch adds macro
SAMSUNG_RES_MEM,SAMSUNG_RES_IRQand so on to cleanup regarding 'struct resource' by using defined helpers at <linux/ioport.h>.Cc Ben Dooks <[email protected]>Signed-off-by Kukjin Kim <[email protected]>---
Changes since v1:
- Address comments from Russell King
?Using defined helpers to define resource?arch/arm/mach-s3c2410/include/mach/map.h ?| ? ?1 + ?arch/arm/plat-samsung/devs.c ? ? ? ? ? ? ?| ?697 +++++------------------------ ?arch/arm/plat-samsung/include/plat/devs.h | ? 11 +?3 files changed, 129 insertions(+), 580 deletions(-)
arch/arm/mach-s3c2410/include/mach/map.h +0
-0@@ -149,6 +149,7 @@?#define
S3C24XX_PA_RTC? ? ?S3C2410_PA_RTC
?#defineS3C24XX_PA_ADC? ? ?S3C2410_PA_ADC
?#defineS3C24XX_PA_SPI? ? ?S3C2410_PA_SPI
+#defineS3C24XX_PA_SPI1? ? ? ? ? ? ? ?(S3C2410_PA_SPI +S3C2410_SPI1) ?#defineS3C24XX_PA_SDI? ? ?S3C2410_PA_SDI
?#defineS3C24XX_PA_NAND? ? ? ? ? ?S3C2410_PA_NANDarch/arm/plat-samsung/devs.c +0
-0@@ -67,34 +67,11 @@ static u64 samsung_device_dma_mask = DMA_BIT_MASK(32);?/* AC97 */
?#ifdefCONFIG_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,
- ? ? ? },
- ? ? ? [2] = {
- ? ? ? ? ? ? ? .name ? = "PCM out",
- ? ? ? ? ? ? ? .start ?=DMACH_PCM_OUT,
- ? ? ? ? ? ? ? .end ? ?=DMACH_PCM_OUT,
- ? ? ? ? ? ? ? .flags ?=IORESOURCE_DMA,
- ? ? ? },
- ? ? ? [3] = {
- ? ? ? ? ? ? ? .name ? = "PCM in",
- ? ? ? ? ? ? ? .start ?=DMACH_PCM_IN,
- ? ? ? ? ? ? ? .end ? ?=DMACH_PCM_IN,
- ? ? ? ? ? ? ? .flags ?=IORESOURCE_DMA,
- ? ? ? },
- ? ? ? [4] = {
- ? ? ? ? ? ? ? .name ? = "Mic in",
- ? ? ? ? ? ? ? .start ?=DMACH_MIC_IN,
- ? ? ? ? ? ? ? .end ? ?=DMACH_MIC_IN,
- ? ? ? ? ? ? ? .flags ?=IORESOURCE_DMA,
- ? ? ? },
+ ? ? ? [0] =SAMSUNG_RES_MEM(S3C2440, AC97, S3C2440_SZ_AC97),
+ ? ? ? [1] =SAMSUNG_RES_IRQ(S3C244x_AC97),
+ ? ? ? [2] =SAMSUNG_RES_DMA_NAMED(PCM_OUT, "PCM out"),
+ ? ? ? [3] =SAMSUNG_RES_DMA_NAMED(PCM_IN, "PCM in"),
+ ? ? ? [4] =SAMSUNG_RES_DMA_NAMED(MIC_IN, "Mic in"), ?};?struct
platform_devices3c_device_ac97= {arch/arm/plat-samsung/devs.c +0
-0@@ -113,21 +90,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_devices3c_device_adc= {arch/arm/plat-samsung/devs.c +3
-15@@ -140,21 +105,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 = {@@ -169,16 +122,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_devices3c_device_camif= {arch/arm/plat-samsung/devs.c +0
-0@@ -217,26 +162,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_devices3c_device_fb= {arch/arm/plat-samsung/devs.c +0
-0@@ -261,16 +190,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_devices5p_device_fimc0= {arch/arm/plat-samsung/devs.c +0
-0@@ -287,16 +208,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_devices5p_device_fimc1= {arch/arm/plat-samsung/devs.c +0
-0@@ -313,16 +226,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_devices5p_device_fimc2= {arch/arm/plat-samsung/devs.c +0
-0@@ -339,16 +244,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_devices5p_device_fimc3= {arch/arm/plat-samsung/devs.c +0
-0@@ -367,26 +264,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_devices5p_device_fimd0= {arch/arm/plat-samsung/devs.c +0
-0@@ -425,20 +306,10 @@ void __init s3c_hwmon_set_platdata(struct s3c_hwmon_pdata *pd)?/* HSMMC */
arch/arm/plat-samsung/devs.c +0
-2-#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_platdatas3c_hsmmc0_def_platdata= {arch/arm/plat-samsung/devs.c +0
-0@@ -468,16 +339,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_platdatas3c_hsmmc1_def_platdata= {arch/arm/plat-samsung/devs.c +0
-0@@ -509,16 +372,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_platdatas3c_hsmmc2_def_platdata= {arch/arm/plat-samsung/devs.c +0
-0@@ -548,16 +403,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_platdatas3c_hsmmc3_def_platdata= {arch/arm/plat-samsung/devs.c +0
-0@@ -588,16 +435,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_devices3c_device_i2c0= {arch/arm/plat-samsung/devs.c +0
-0@@ -634,16 +473,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_devices3c_device_i2c1= {arch/arm/plat-samsung/devs.c +0
-0@@ -672,16 +503,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_devices3c_device_i2c2= {arch/arm/plat-samsung/devs.c +0
-0@@ -710,16 +533,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_devices3c_device_i2c3= {arch/arm/plat-samsung/devs.c +0
-0@@ -748,16 +563,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_devices3c_device_i2c4= {arch/arm/plat-samsung/devs.c +0
-0@@ -786,16 +593,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_devices3c_device_i2c5= {arch/arm/plat-samsung/devs.c +0
-0@@ -824,16 +623,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_devices3c_device_i2c6= {arch/arm/plat-samsung/devs.c +0
-0@@ -862,16 +653,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_devices3c_device_i2c7= {arch/arm/plat-samsung/devs.c +0
-0@@ -902,16 +685,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_devices5p_device_i2c_hdmiphy= {arch/arm/plat-samsung/devs.c +0
-0@@ -945,11 +720,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_devices3c_device_iis= {arch/arm/plat-samsung/devs.c +0
-0@@ -979,16 +750,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_devices3c_device_cfcon= {arch/arm/plat-samsung/devs.c +0
-0@@ -1008,16 +771,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_devicesamsung_device_keypad= {arch/arm/plat-samsung/devs.c +0
-0@@ -1043,16 +798,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_devices3c_device_lcd= {arch/arm/plat-samsung/devs.c +0
-0@@ -1087,16 +834,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_devices5p_device_mfc= {arch/arm/plat-samsung/devs.c +0
-0@@ -1139,16 +878,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_devices5p_device_mipi_csis0= {arch/arm/plat-samsung/devs.c +0
-0@@ -1161,16 +892,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_devices5p_device_mipi_csis1= {arch/arm/plat-samsung/devs.c +0
-0@@ -1185,11 +908,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_devices3c_device_nand= {arch/arm/plat-samsung/devs.c +0
-0@@ -1294,21 +1013,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_devices3c_device_onenand= {arch/arm/plat-samsung/devs.c +0
-0@@ -1321,21 +1028,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_devices3c64xx_device_onenand1= {arch/arm/plat-samsung/devs.c +0
-0@@ -1354,21 +1049,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_devices5p_device_onenand= {arch/arm/plat-samsung/devs.c +0
-0@@ -1382,17 +1065,15 @@ struct platform_device s5p_device_onenand = {?/* PMU */
?#ifdef
CONFIG_PLAT_S5Parch/arm/plat-samsung/devs.c +2
-4-static struct resource s5p_pmu_resource = { - ? ? ? .start ?= IRQ_PMU, - ? ? ? .end ? ?= IRQ_PMU, - ? ? ? .flags ?= IORESOURCE_IRQ, +static struct resource s5p_pmu_resource[] = { + ? ? ? SAMSUNG_RES_IRQ(PMU)?};
?struct
platform_devices5p_device_pmu= {
? ? ? ?.name ? ? ? ? ? = "arm-pmu",
? ? ? ?.id ? ? ? ? ? ? =ARM_PMU_DEVICE_CPU,
- ? ? ? .num_resources ?= 1,
- ? ? ? .resource ? ? ? =&s5p_pmu_resource,
+ ? ? ? .num_resources ?=ARRAY_SIZE(s5p_pmu_resource),
+ ? ? ? .resource ? ? ? =s5p_pmu_resource, ?};?static int
__inits5p_pmu_init(void)arch/arm/plat-samsung/devs.c +0
-0@@ -1442,21 +1123,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_devices3c_device_rtc= {arch/arm/plat-samsung/devs.c +0
-0@@ -1469,21 +1138,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_devices3c_device_rtc= {arch/arm/plat-samsung/devs.c +0
-0@@ -1498,16 +1155,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_devices3c_device_sdi= {arch/arm/plat-samsung/devs.c +0
-0@@ -1528,16 +1177,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_devices3c_device_spi0= {arch/arm/plat-samsung/devs.c +2
-10@@ -1552,16 +1193,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 = {@@ -1580,17 +1213,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_devices3c_device_ts= {arch/arm/plat-samsung/devs.c +0
-0@@ -1610,16 +1234,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_infodefault_ts_data__initdata= {arch/arm/plat-samsung/devs.c +0
-0@@ -1650,16 +1266,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_devices5p_device_hdmi= {arch/arm/plat-samsung/devs.c +5
-28@@ -1670,16 +1278,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 = {@@ -1690,24 +1290,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_NAMED(S5P, MIXER, SZ_64K, "mxr"), + ? ? ? [1] = SAMSUNG_RES_MEM_NAMED(S5P, VP, SZ_64K, "vp"), + ? ? ? [2] = SAMSUNG_RES_IRQ_NAMED(MIXER, "irq"), ?}; ?struct platform_device s5p_device_mixer = {@@ -1726,16 +1311,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_devices3c_device_ohci= {arch/arm/plat-samsung/devs.c +0
-0@@ -1769,16 +1346,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_devices3c_device_usbgadget= {arch/arm/plat-samsung/devs.c +0
-0@@ -1798,16 +1367,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_devices5p_device_ehci= {arch/arm/plat-samsung/devs.c +0
-0@@ -1839,16 +1400,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_devices3c_device_usb_hsotg= {arch/arm/plat-samsung/devs.c +0
-0@@ -1867,16 +1420,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_devices3c_device_usb_hsudc= {arch/arm/plat-samsung/devs.c +0
-0@@ -1900,16 +1445,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_devices3c_device_wdt= {arch/arm/plat-samsung/include/plat/devs.h +0
-0@@ -18,6 +18,17 @@?#include <
linux/platform_device.h>
arch/arm/plat-samsung/include/plat/devs.h
Quoted 9 lines
arch/arm/plat-samsung/include/plat/devs.h +9
-0+#define SAMSUNG_RES_MEM (soc, ip, sz) ? DEFINE_RES_MEM(soc##_PA_##ip, sz) +#define SAMSUNG_RES_IRQ (ip) ? ? ? ? ? ?DEFINE_RES_IRQ(IRQ_##ip) + +#define SAMSUNG_RES_MEM_NAMED (soc, ip, sz, name) ? ? ? \ + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? DEFINE_RES_MEM_NAMED(soc##_PA_##ip, sz, name) +#define SAMSUNG_RES_IRQ_NAMED (ip, name) ? ? ? ? ? ? ? ? ? ? ? ?\ + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? DEFINE_RES_IRQ_NAMED(IRQ_##ip, name) +#define SAMSUNG_RES_DMA_NAMED (ch, name) ? ? ? ? ? ? ? ? ? ? ? ?\ + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? DEFINE_RES_DMA_NAMED(DMACH_##ch, name)
It's good for readability. but do you think that it's hard to find out defined macros are used at real place?
e.g., Now I want to find out the S3C_PA_USB_HSOTG. it's difficult if you use the SAMSUNG_RES_* series macro.
but if you use the DEFINED_RES_* series directly. it's easy to find out at real codes.
Thank you,
Kyungmin Park
Quoted 14 lines
arch/arm/plat-samsung/include/plat/devs.h +2
-0+ +?struct
s3c24xx_uart_resources{
? ? ? ?struct resource ? ? ? ? *resources;
? ? ? ?unsigned long ? ? ? ? ? ?nr_resources;
--
1.7.1--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo at vger.kernel.org
More majordomo info at ?http://vger.kernel.org/majordomo-info.html
PATCH v2 2/2 ARM: SAMSUNG: Cleanup resources by using macro
Quoted 17 lines · Kyungmin Park
Quoted 16 lines · Kukjin Kim
This patch adds macro
SAMSUNG_RES_MEM,SAMSUNG_RES_IRQand so on to cleanup regarding 'struct resource' by using defined helpers at<linux/ioport.h>.Cc Ben Dooks<[email protected]>Signed-off-by Kukjin Kim<[email protected]>---
Changes since v1:
- Address comments from Russell King
Using defined helpers to define resourcearch/arm/mach-s3c2410/include/mach/map.h | 1 + arch/arm/plat-samsung/devs.c | 697 +++++------------------------ arch/arm/plat-samsung/include/plat/devs.h | 11 + 3 files changed, 129 insertions(+), 580 deletions(-)
(snip)
Quoted 18 lines
arch/arm/plat-samsung/include/plat/devs.h line 29
Quoted 10 lines
arch/arm/plat-samsung/include/plat/devs.h +9
-0+#define SAMSUNG_RES_MEM (soc, ip, sz) DEFINE_RES_MEM(soc##_PA_##ip, sz) +#define SAMSUNG_RES_IRQ (ip) DEFINE_RES_IRQ(IRQ_##ip) + +#define SAMSUNG_RES_MEM_NAMED (soc, ip, sz, name) \ + DEFINE_RES_MEM_NAMED(soc##_PA_##ip, sz, name) +#define SAMSUNG_RES_IRQ_NAMED (ip, name) \ + DEFINE_RES_IRQ_NAMED(IRQ_##ip, name) +#define SAMSUNG_RES_DMA_NAMED (ch, name) \ + DEFINE_RES_DMA_NAMED(DMACH_##ch, name)It's good for readability. but do you think that it's hard to find out defined macros are used at real place?
e.g., Now I want to find out theS3C_PA_USB_HSOTG. it's difficult if you use the SAMSUNG_RES_* series macro.
but if you use the DEFINED_RES_* series directly. it's easy to find out at real codes.
Well, I don't think so because the XXX_PA_XXX addresses are defined in each mach/map.h and they are usually used in here so it's not hard to find it.
And now the 'S3C', 'S5P' and 'SAMSUNG' are used in the 'soc' part. I'm preparing to consolidate the name and to remove duplicated resources.
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.
PATCH v2 2/2 ARM: SAMSUNG: Cleanup resources by using macro
Quoted 20 lines · Kukjin Kim
Quoted 19 lines · Kyungmin Park
arch/arm/plat-samsung/include/plat/devs.h line 29
Quoted 10 lines · Kukjin Kim
arch/arm/plat-samsung/include/plat/devs.h +9
-0+#define SAMSUNG_RES_MEM (soc, ip, sz) DEFINE_RES_MEM(soc##_PA_##ip, sz) +#define SAMSUNG_RES_IRQ (ip) DEFINE_RES_IRQ(IRQ_##ip) + +#define SAMSUNG_RES_MEM_NAMED (soc, ip, sz, name) \ + DEFINE_RES_MEM_NAMED(soc##_PA_##ip, sz, name) +#define SAMSUNG_RES_IRQ_NAMED (ip, name) \ + DEFINE_RES_IRQ_NAMED(IRQ_##ip, name) +#define SAMSUNG_RES_DMA_NAMED (ch, name) \ + DEFINE_RES_DMA_NAMED(DMACH_##ch, name)It's good for readability. but do you think that it's hard to find out defined macros are used at real place?
e.g., Now I want to find out theS3C_PA_USB_HSOTG. it's difficult if you use the SAMSUNG_RES_* series macro.
but if you use the DEFINED_RES_* series directly. it's easy to find out at real codes.
Quoted 2 lines
Well, I don't think so because the
XXX_PA_XXXaddresses are defined in eachmach/map.hand they are usually used in here so it's not hard to find it.
Some minor disadvantage is that tagging tools like e.g. gtags don't handle these things properly. But I don't think it's really important.
Quoted 3 lines
And now the 'S3C', 'S5P' and 'SAMSUNG' are used in the 'soc' part. I'm preparing to consolidate the name and to remove duplicated resources.
Do you also have any specific plans for supporting single image build for multiple SoC's while working on this ?
Thanks,
Signature · 1 line
Sylwester
PATCH v2 2/2 ARM: SAMSUNG: Cleanup resources by using macro
Quoted 13 lines · Sylwester Nawrocki
Quoted 2 lines · Kukjin Kim
Quoted 1 line · Kyungmin Park
On Mon, Oct 3, 2011 at 12:41 PM, Kukjin Kim<[email protected]>
Quoted 2 lines · wrote:
Quoted 2 lines
Quoted 2 lines
+#define
SAMSUNG_RES_MEM(soc, ip, sz)
DEFINE_RES_MEM(soc##_PA_##ip, sz)Quoted 4 lines
Quoted 4 lines
arch/arm/plat-samsung/include/plat/devs.h line 30
Quoted 4 lines
arch/arm/plat-samsung/include/plat/devs.h +4
-0+#define SAMSUNG_RES_IRQ (ip) DEFINE_RES_IRQ(IRQ_##ip) + +#define SAMSUNG_RES_MEM_NAMED (soc, ip, sz, name) \ +
DEFINE_RES_MEM_NAMED(soc##_PA_##ip, sz, name)
Quoted 17 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
+#define
SAMSUNG_RES_IRQ_NAMED(ip, name)\
Quoted 1 line
Quoted 1 line
Quoted 1 line
+ DEFINE_RES_IRQ_NAMED(IRQ_##ip,
name)
Quoted 1 line
Quoted 1 line
Quoted 1 line
+#define
SAMSUNG_RES_DMA_NAMED(ch, name)\
Quoted 1 line
Quoted 1 line
Quoted 1 line
+
DEFINE_RES_DMA_NAMED(DMACH_##ch, name)Quoted 9 lines
Quoted 8 lines
It's good for readability. but do you think that it's hard to find out defined macros are used at real place?
e.g., Now I want to find out theS3C_PA_USB_HSOTG. it's difficult if you use the SAMSUNG_RES_* series macro.
but if you use the DEFINED_RES_* series directly. it's easy to find out at real codes.Well, I don't think so because the
XXX_PA_XXXaddresses are defined in
each
Quoted 1 line
Quoted 1 line
mach/map.hand they are usually used in here so it's not hard to find
it.
Quoted 10 lines
Some minor disadvantage is that tagging tools like e.g. gtags don't handle these things properly. But I don't think it's really important.
Quoted 3 lines
And now the 'S3C', 'S5P' and 'SAMSUNG' are used in the 'soc' part. I'm preparing to consolidate the name and to remove duplicated resources.
Do you also have any specific plans for supporting single image build for multiple SoC's while working on this ?
Hmm, you could see through my plan :)
As you know, we need to sort out resources and platform data to support single kernel image so I'm preparing it after this.
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.
PATCH v2 2/2 ARM: SAMSUNG: Cleanup resources by using macro
In reply to Kukjin KimQuoted 6 lines · On Monday 03 October 2011 12:41:22 Kukjin Kim wrote:
This patch adds macro
SAMSUNG_RES_MEM,SAMSUNG_RES_IRQand so on to cleanup regarding 'struct resource' by using defined helpers at <linux/ioport.h>.Cc Ben Dooks <[email protected]>Signed-off-by Kukjin Kim <[email protected]>
When we introduced those macros, it was specifically so that platforms would be migrated to use them instead of providing their own.
Quoted 6 lines
index 8f19241..a506831 100644
arch/arm/plat-samsung/include/plat/devs.h +0
-0@@ -18,6 +18,17 @@#include <linux/platform_device.h>
arch/arm/plat-samsung/include/plat/devs.h line 29
Quoted 10 lines
arch/arm/plat-samsung/include/plat/devs.h +9
-0+#define SAMSUNG_RES_MEM (soc, ip, sz) DEFINE_RES_MEM(soc##_PA_##ip, sz) +#define SAMSUNG_RES_IRQ (ip) DEFINE_RES_IRQ(IRQ_##ip) + +#define SAMSUNG_RES_MEM_NAMED (soc, ip, sz, name) \ + DEFINE_RES_MEM_NAMED(soc##_PA_##ip, sz, name) +#define SAMSUNG_RES_IRQ_NAMED (ip, name) \ + DEFINE_RES_IRQ_NAMED(IRQ_##ip, name) +#define SAMSUNG_RES_DMA_NAMED (ch, name) \ + DEFINE_RES_DMA_NAMED(DMACH_##ch, name)
I think the string concatenation really just obfuscates the code, and it does not actually save much at all. When you replace
+ [0] = SAMSUNG_RES_MEM(S3C, WDT, SZ_1K),
+ [1] = SAMSUNG_RES_IRQ(WDT),
with
+ [0] = DEFINE_RES_MEM(S3C_PA_WDT, SZ_1K),
+ [1] = DEFINE_RES_IRQ(IRQ_WDT),
you need practically no extra space, but you gain the advantages that
* Someone using grep for DEFINE_RES_MEM finds all memory resources without having to look up what your macros do an where they are used.
* Someone using grep to look for S3C_PA_WDT finds the place where it is used.
* Someone reading the resource definition immediately knows what the macro does if familiar with other platforms using that macro.
Arnd
PATCH v2 2/2 ARM: SAMSUNG: Cleanup resources by using macro
Quoted 45 lines · Arnd Bergmann
Quoted 6 lines · On Monday 03 October 2011 12:41:22 Kukjin Kim wrote:
This patch adds macro
SAMSUNG_RES_MEM,SAMSUNG_RES_IRQand so on to cleanup regarding 'struct resource' by using defined helpers at <linux/ioport.h>.Cc Ben Dooks <[email protected]>Signed-off-by Kukjin Kim <[email protected]>When we introduced those macros, it was specifically so that platforms would be migrated to use them instead of providing their own.
arch/arm/plat-samsung/include/plat/devs.h line 21
Quoted 8 lines
index 8f19241..a506831 100644
arch/arm/plat-samsung/include/plat/devs.h +1
-0@@ -18,6 +18,17 @@#include <linux/platform_device.h> +#define SAMSUNG_RES_MEM (soc, ip, sz)
DEFINE_RES_MEM(soc##_PA_##ip, sz)arch/arm/plat-samsung/include/plat/devs.h line 30
Quoted 4 lines
arch/arm/plat-samsung/include/plat/devs.h +4
-0+#define SAMSUNG_RES_IRQ (ip) DEFINE_RES_IRQ(IRQ_##ip) + +#define SAMSUNG_RES_MEM_NAMED (soc, ip, sz, name) \ +
DEFINE_RES_MEM_NAMED(soc##_PA_##ip, sz, name)arch/arm/plat-samsung/include/plat/devs.h line 27
Quoted 2 lines
arch/arm/plat-samsung/include/plat/devs.h +2
-0+#define SAMSUNG_RES_IRQ_NAMED (ip, name) \ + DEFINE_RES_IRQ_NAMED(IRQ_##ip,name)
arch/arm/plat-samsung/include/plat/devs.h line 28
Quoted 1 line
arch/arm/plat-samsung/include/plat/devs.h +1
-0+#define SAMSUNG_RES_DMA_NAMED (ch, name)\
arch/arm/plat-samsung/include/plat/devs.h line 29
Quoted 1 line
arch/arm/plat-samsung/include/plat/devs.h +1
-0+
DEFINE_RES_DMA_NAMED(DMACH_##ch, name)I think the string concatenation really just obfuscates the code, and it does not actually save much at all. When you replace
arch/arm/plat-samsung/devs.c +2
-0+ [0] = SAMSUNG_RES_MEM(S3C, WDT, SZ_1K), + [1] = SAMSUNG_RES_IRQ(WDT),with
(quoted diff) +2
-0+ [0] = DEFINE_RES_MEM(S3C_PA_WDT, SZ_1K), + [1] = DEFINE_RES_IRQ(IRQ_WDT),
Quoted 5 lines
you need practically no extra space, but you gain the advantages that
* Someone using grep for
DEFINE_RES_MEMfinds all memory resources without having to look up what your macros do an where they are used.
* Someone using grep to look forS3C_PA_WDTfinds the place where it is
used.
Quoted 2 lines
* Someone reading the resource definition immediately knows what the macro does if familiar with other platforms using that macro.
Yes, right. But I'm preparing to reduce the 'soc' part to consolidate some duplicated resources and platform data after this and the new SAMSUNG_RES macro will be used.
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.
PATCH v2 2/2 ARM: SAMSUNG: Cleanup resources by using macro
Quoted 16 lines · Kukjin Kim
Quoted 11 lines
I think the string concatenation really just obfuscates the code, and it does not actually save much at all. When you replace
arch/arm/plat-samsung/devs.c +2
-0+ [0] = SAMSUNG_RES_MEM(S3C, WDT, SZ_1K), + [1] = SAMSUNG_RES_IRQ(WDT),with
(quoted diff) +2
-0+ [0] = DEFINE_RES_MEM(S3C_PA_WDT, SZ_1K), + [1] = DEFINE_RES_IRQ(IRQ_WDT),Quoted 5 lines
you need practically no extra space, but you gain the advantages that
* Someone using grep for
DEFINE_RES_MEMfinds all memory resources without having to look up what your macros do an where they are used.
* Someone using grep to look forS3C_PA_WDTfinds the place where it is
Quoted 7 lines
used.
Quoted 2 lines
* Someone reading the resource definition immediately knows what the macro does if familiar with other platforms using that macro.
Yes, right. But I'm preparing to reduce the 'soc' part to consolidate some duplicated resources and platform data after this and the new
SAMSUNG_RESmacro will be used.
Hmm, can't you instead change the names of these constants to be always the same? That would let you use the regular DEFINE_RES_* definitions without having to introduce your own.
Arnd
PATCH v2 2/2 ARM: SAMSUNG: Cleanup resources by using macro
Quoted 17 lines · Arnd Bergmann
Quoted 16 lines · Kukjin Kim
Quoted 16 lines
I think the string concatenation really just obfuscates the code, and it does not actually save much at all. When you replace
+ ? ? ? [0] =
SAMSUNG_RES_MEM(S3C, WDT, SZ_1K),
+ ? ? ? [1] =SAMSUNG_RES_IRQ(WDT),with
+ ? ? ? [0] =
DEFINE_RES_MEM(S3C_PA_WDT, SZ_1K),
+ ? ? ? [1] =DEFINE_RES_IRQ(IRQ_WDT),you need practically no extra space, but you gain the advantages that
* Someone using grep for
DEFINE_RES_MEMfinds all memory resources without ? having to look up what your macros do an where they are used.
* Someone using grep to look forS3C_PA_WDTfinds the place where it is
Quoted 7 lines
Quoted 7 lines
used.
Quoted 2 lines
* Someone reading the resource definition immediately knows what the ? macro does if familiar with other platforms using that macro.
Yes, right. But I'm preparing to reduce the 'soc' part to consolidate some duplicated resources and platform data after this and the new
SAMSUNG_RESmacro will be used.
There are tools for source browsing e.g., ctags, cscope, grep, git grep and so on.
If you create new SAMSUNG_RES, these tools can't find macro and symbols properly.
Please use the existing macros for own purpose.
Thank you,
Kyungmin Park
Quoted 12 lines
Hmm, can't you instead change the names of these constants to be always the same? That would let you use the regular DEFINE_RES_* definitions without having to introduce your own.
? ? ? ?Arnd
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v2 2/2 ARM: SAMSUNG: Cleanup resources by using macro
Quoted 11 lines · Kyungmin Park
Quoted 9 lines · Arnd Bergmann
Quoted 8 lines · Kukjin Kim
Quoted 8 lines
I think the string concatenation really just obfuscates the code, and it does not actually save much at all. When you replace
+ ? ? ? [0] =
SAMSUNG_RES_MEM(S3C, WDT, SZ_1K),
+ ? ? ? [1] =SAMSUNG_RES_IRQ(WDT),with
Quoted 9 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
+ ? ? ? [0] =
DEFINE_RES_MEM(S3C_PA_WDT, SZ_1K),
+ ? ? ? [1] =DEFINE_RES_IRQ(IRQ_WDT),you need practically no extra space, but you gain the advantages that
* Someone using grep for
DEFINE_RES_MEMfinds all memory resourceswithout
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
? having to look up what your macros do an where they are used.
* Someone using grep to look forS3C_PA_WDTfinds the place where it
is
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
used.
Quoted 2 lines
* Someone reading the resource definition immediately knows what the ? macro does if familiar with other platforms using that macro.
Yes, right. But I'm preparing to reduce the 'soc' part to consolidate
some
Quoted 1 line
Quoted 1 line
Quoted 1 line
duplicated resources and platform data after this and the new
SAMSUNG_RES
Quoted 8 lines
Quoted 1 line
Quoted 1 line
macro will be used.
There are tools for source browsing e.g., ctags, cscope, grep, git grep and so on.
If you create newSAMSUNG_RES, these tools can't find macro and symbols properly.Please use the existing macros for own purpose.
OK, it makes sense to me.
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.
Quoted 6 lines
Thank you,
Kyungmin ParkQuoted 4 lines
Hmm, can't you instead change the names of these constants to be always the same? That would let you use the regular DEFINE_RES_* definitions without having to introduce your own.
PATCH v2 2/2 ARM: SAMSUNG: Cleanup resources by using macro
In reply to Arnd BergmannQuoted 10 lines · Arnd Bergmann
Quoted 8 lines · Kukjin Kim
Quoted 8 lines
I think the string concatenation really just obfuscates the code, and it does not actually save much at all. When you replace
arch/arm/plat-samsung/devs.c +2
-0+ [0] = SAMSUNG_RES_MEM(S3C, WDT, SZ_1K), + [1] = SAMSUNG_RES_IRQ(WDT),with
Quoted 9 lines
Quoted 6 lines
Quoted 6 lines
(quoted diff) +2
-0+ [0] = DEFINE_RES_MEM(S3C_PA_WDT, SZ_1K), + [1] = DEFINE_RES_IRQ(IRQ_WDT),you need practically no extra space, but you gain the advantages that
* Someone using grep for
DEFINE_RES_MEMfinds all memory resourceswithout
Quoted 2 lines
Quoted 2 lines
having to look up what your macros do an where they are used.
* Someone using grep to look forS3C_PA_WDTfinds the place where it
is
Quoted 5 lines
Quoted 5 lines
used.
Quoted 2 lines
* Someone reading the resource definition immediately knows what the macro does if familiar with other platforms using that macro.
Yes, right. But I'm preparing to reduce the 'soc' part to consolidate
some
Quoted 1 line
Quoted 1 line
duplicated resources and platform data after this and the new
SAMSUNG_RES
Quoted 6 lines
Quoted 1 line
macro will be used.
Hmm, can't you instead change the names of these constants to be always the same? That would let you use the regular DEFINE_RES_* definitions without having to introduce your own.
OK, I agree with you. And if introducing Samsung own is required, will do it later.
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.