Commit 79fdcc0c authored by Ben Dooks's avatar Ben Dooks Committed by Russell King

[ARM PATCH] 2058/2: S3C2410 - Add PWM devices, update ID on existing devices

Patch from Ben Dooks

Add PWM timers 0 through 3

Update ID on single devices to -1

Signed-off-by: Ben Dooks 
parent 38afd9dd
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
* published by the Free Software Foundation. * published by the Free Software Foundation.
* *
* Modifications: * Modifications:
* 29-Aug-2004 BJD Added timers 0 through 3
* 29-Aug-2004 BJD Changed index of devices we only have one of to -1
* 21-Aug-2004 BJD Added IRQ_TICK to RTC resources * 21-Aug-2004 BJD Added IRQ_TICK to RTC resources
* 18-Aug-2004 BJD Created initial version * 18-Aug-2004 BJD Created initial version
*/ */
...@@ -82,7 +84,7 @@ static u64 s3c_device_lcd_dmamask = 0xffffffffUL; ...@@ -82,7 +84,7 @@ static u64 s3c_device_lcd_dmamask = 0xffffffffUL;
struct platform_device s3c_device_lcd = { struct platform_device s3c_device_lcd = {
.name = "s3c2410-lcd", .name = "s3c2410-lcd",
.id = 0, .id = -1,
.num_resources = ARRAY_SIZE(s3c_lcd_resource), .num_resources = ARRAY_SIZE(s3c_lcd_resource),
.resource = s3c_lcd_resource, .resource = s3c_lcd_resource,
.dev = { .dev = {
...@@ -111,7 +113,7 @@ static struct resource s3c_nand_resource[] = { ...@@ -111,7 +113,7 @@ static struct resource s3c_nand_resource[] = {
struct platform_device s3c_device_nand = { struct platform_device s3c_device_nand = {
.name = "s3c2410-nand", .name = "s3c2410-nand",
.id = 0, .id = -1,
.num_resources = ARRAY_SIZE(s3c_nand_resource), .num_resources = ARRAY_SIZE(s3c_nand_resource),
.resource = s3c_nand_resource, .resource = s3c_nand_resource,
}; };
...@@ -136,7 +138,7 @@ static struct resource s3c_usbgadget_resource[] = { ...@@ -136,7 +138,7 @@ static struct resource s3c_usbgadget_resource[] = {
struct platform_device s3c_device_usbgadget = { struct platform_device s3c_device_usbgadget = {
.name = "s3c2410-usbgadget", .name = "s3c2410-usbgadget",
.id = 0, .id = -1,
.num_resources = ARRAY_SIZE(s3c_usbgadget_resource), .num_resources = ARRAY_SIZE(s3c_usbgadget_resource),
.resource = s3c_usbgadget_resource, .resource = s3c_usbgadget_resource,
}; };
...@@ -161,7 +163,7 @@ static struct resource s3c_wdt_resource[] = { ...@@ -161,7 +163,7 @@ static struct resource s3c_wdt_resource[] = {
struct platform_device s3c_device_wdt = { struct platform_device s3c_device_wdt = {
.name = "s3c2410-wdt", .name = "s3c2410-wdt",
.id = 0, .id = -1,
.num_resources = ARRAY_SIZE(s3c_wdt_resource), .num_resources = ARRAY_SIZE(s3c_wdt_resource),
.resource = s3c_wdt_resource, .resource = s3c_wdt_resource,
}; };
...@@ -186,7 +188,7 @@ static struct resource s3c_i2c_resource[] = { ...@@ -186,7 +188,7 @@ static struct resource s3c_i2c_resource[] = {
struct platform_device s3c_device_i2c = { struct platform_device s3c_device_i2c = {
.name = "s3c2410-i2c", .name = "s3c2410-i2c",
.id = 0, .id = -1,
.num_resources = ARRAY_SIZE(s3c_i2c_resource), .num_resources = ARRAY_SIZE(s3c_i2c_resource),
.resource = s3c_i2c_resource, .resource = s3c_i2c_resource,
}; };
...@@ -207,7 +209,7 @@ static u64 s3c_device_iis_dmamask = 0xffffffffUL; ...@@ -207,7 +209,7 @@ static u64 s3c_device_iis_dmamask = 0xffffffffUL;
struct platform_device s3c_device_iis = { struct platform_device s3c_device_iis = {
.name = "s3c2410-iis", .name = "s3c2410-iis",
.id = 0, .id = -1,
.num_resources = ARRAY_SIZE(s3c_iis_resource), .num_resources = ARRAY_SIZE(s3c_iis_resource),
.resource = s3c_iis_resource, .resource = s3c_iis_resource,
.dev = { .dev = {
...@@ -240,7 +242,7 @@ static struct resource s3c_rtc_resource[] = { ...@@ -240,7 +242,7 @@ static struct resource s3c_rtc_resource[] = {
struct platform_device s3c_device_rtc = { struct platform_device s3c_device_rtc = {
.name = "s3c2410-rtc", .name = "s3c2410-rtc",
.id = 0, .id = -1,
.num_resources = ARRAY_SIZE(s3c_rtc_resource), .num_resources = ARRAY_SIZE(s3c_rtc_resource),
.resource = s3c_rtc_resource, .resource = s3c_rtc_resource,
}; };
...@@ -265,7 +267,7 @@ static struct resource s3c_adc_resource[] = { ...@@ -265,7 +267,7 @@ static struct resource s3c_adc_resource[] = {
struct platform_device s3c_device_adc = { struct platform_device s3c_device_adc = {
.name = "s3c2410-adc", .name = "s3c2410-adc",
.id = 0, .id = -1,
.num_resources = ARRAY_SIZE(s3c_adc_resource), .num_resources = ARRAY_SIZE(s3c_adc_resource),
.resource = s3c_adc_resource, .resource = s3c_adc_resource,
}; };
...@@ -288,7 +290,7 @@ static struct resource s3c_sdi_resource[] = { ...@@ -288,7 +290,7 @@ static struct resource s3c_sdi_resource[] = {
struct platform_device s3c_device_sdi = { struct platform_device s3c_device_sdi = {
.name = "s3c2410-sdi", .name = "s3c2410-sdi",
.id = 0, .id = -1,
.num_resources = ARRAY_SIZE(s3c_sdi_resource), .num_resources = ARRAY_SIZE(s3c_sdi_resource),
.resource = s3c_sdi_resource, .resource = s3c_sdi_resource,
}; };
...@@ -344,3 +346,103 @@ struct platform_device s3c_device_spi1 = { ...@@ -344,3 +346,103 @@ struct platform_device s3c_device_spi1 = {
}; };
EXPORT_SYMBOL(s3c_device_spi1); EXPORT_SYMBOL(s3c_device_spi1);
/* pwm timer blocks */
static struct resource s3c_timer0_resource[] = {
[0] = {
.start = S3C2410_PA_TIMER + 0x0C,
.end = S3C2410_PA_TIMER + 0x0C + 0xB,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = IRQ_TIMER0,
.end = IRQ_TIMER0,
.flags = IORESOURCE_IRQ,
}
};
struct platform_device s3c_device_timer0 = {
.name = "s3c2410-timer",
.id = 0,
.num_resources = ARRAY_SIZE(s3c_timer0_resource),
.resource = s3c_timer0_resource,
};
EXPORT_SYMBOL(s3c_device_timer0);
/* timer 1 */
static struct resource s3c_timer1_resource[] = {
[0] = {
.start = S3C2410_PA_TIMER + 0x18,
.end = S3C2410_PA_TIMER + 0x23,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = IRQ_TIMER1,
.end = IRQ_TIMER1,
.flags = IORESOURCE_IRQ,
}
};
struct platform_device s3c_device_timer1 = {
.name = "s3c2410-timer",
.id = 1,
.num_resources = ARRAY_SIZE(s3c_timer1_resource),
.resource = s3c_timer1_resource,
};
EXPORT_SYMBOL(s3c_device_timer1);
/* timer 2 */
static struct resource s3c_timer2_resource[] = {
[0] = {
.start = S3C2410_PA_TIMER + 0x24,
.end = S3C2410_PA_TIMER + 0x2F,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = IRQ_TIMER2,
.end = IRQ_TIMER2,
.flags = IORESOURCE_IRQ,
}
};
struct platform_device s3c_device_timer2 = {
.name = "s3c2410-timer",
.id = 2,
.num_resources = ARRAY_SIZE(s3c_timer2_resource),
.resource = s3c_timer2_resource,
};
EXPORT_SYMBOL(s3c_device_timer2);
/* timer 3 */
static struct resource s3c_timer3_resource[] = {
[0] = {
.start = S3C2410_PA_TIMER + 0x30,
.end = S3C2410_PA_TIMER + 0x3B,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = IRQ_TIMER3,
.end = IRQ_TIMER3,
.flags = IORESOURCE_IRQ,
}
};
struct platform_device s3c_device_timer3 = {
.name = "s3c2410-timer",
.id = 3,
.num_resources = ARRAY_SIZE(s3c_timer3_resource),
.resource = s3c_timer3_resource,
};
EXPORT_SYMBOL(s3c_device_timer3);
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
* published by the Free Software Foundation. * published by the Free Software Foundation.
* *
* Modifications: * Modifications:
* 18-Aug-2004 BJD Created initial version * 18-Aug-2004 BJD Created initial version
* * 27-Aug-2004 BJD Added timers 0 through 3
*/ */
extern struct platform_device s3c_device_usb; extern struct platform_device s3c_device_usb;
...@@ -28,4 +28,9 @@ extern struct platform_device s3c_device_spi1; ...@@ -28,4 +28,9 @@ extern struct platform_device s3c_device_spi1;
extern struct platform_device s3c_device_nand; extern struct platform_device s3c_device_nand;
extern struct platform_device s3c_device_timer0;
extern struct platform_device s3c_device_timer1;
extern struct platform_device s3c_device_timer2;
extern struct platform_device s3c_device_timer3;
extern struct platform_device s3c_device_usbgadget; extern struct platform_device s3c_device_usbgadget;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment