diff options
author | Kumar Gala <galak@kernel.crashing.org> | 2007-08-17 00:44:00 -0400 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2007-08-17 14:18:58 -0400 |
commit | ada3ea6fcde45abc55e2af0e564455fd7f943a79 (patch) | |
tree | 1c08937ddd5e7dfacbb1a087cc00284c7965c443 /arch | |
parent | 28e8351ac22de25034e048c680014ad824323c65 (diff) |
[POWERPC] Add interrupt resource for RTC CMOS driver
The RTC CMOS driver expects the interrupt to be a resource of the platform
device. Use a fixed interrupt value of 8 since on PPC if we are using this
its off an i8259 which we ensure has interrupt numbers 0..15.
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/sysdev/rtc_cmos_setup.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/arch/powerpc/sysdev/rtc_cmos_setup.c b/arch/powerpc/sysdev/rtc_cmos_setup.c index e276048b8c5f..0c9ac7ee08fb 100644 --- a/arch/powerpc/sysdev/rtc_cmos_setup.c +++ b/arch/powerpc/sysdev/rtc_cmos_setup.c | |||
@@ -20,14 +20,16 @@ static int __init add_rtc(void) | |||
20 | { | 20 | { |
21 | struct device_node *np; | 21 | struct device_node *np; |
22 | struct platform_device *pd; | 22 | struct platform_device *pd; |
23 | struct resource res; | 23 | struct resource res[2]; |
24 | int ret; | 24 | int ret; |
25 | 25 | ||
26 | memset(&res, 0, sizeof(res)); | ||
27 | |||
26 | np = of_find_compatible_node(NULL, NULL, "pnpPNP,b00"); | 28 | np = of_find_compatible_node(NULL, NULL, "pnpPNP,b00"); |
27 | if (!np) | 29 | if (!np) |
28 | return -ENODEV; | 30 | return -ENODEV; |
29 | 31 | ||
30 | ret = of_address_to_resource(np, 0, &res); | 32 | ret = of_address_to_resource(np, 0, &res[0]); |
31 | of_node_put(np); | 33 | of_node_put(np); |
32 | if (ret) | 34 | if (ret) |
33 | return ret; | 35 | return ret; |
@@ -36,11 +38,18 @@ static int __init add_rtc(void) | |||
36 | * RTC_PORT(x) is hardcoded in asm/mc146818rtc.h. Verify that the | 38 | * RTC_PORT(x) is hardcoded in asm/mc146818rtc.h. Verify that the |
37 | * address provided by the device node matches. | 39 | * address provided by the device node matches. |
38 | */ | 40 | */ |
39 | if (res.start != RTC_PORT(0)) | 41 | if (res[0].start != RTC_PORT(0)) |
40 | return -EINVAL; | 42 | return -EINVAL; |
41 | 43 | ||
44 | /* Use a fixed interrupt value of 8 since on PPC if we are using this | ||
45 | * its off an i8259 which we ensure has interrupt numbers 0..15. */ | ||
46 | res[1].start = 8; | ||
47 | res[1].end = 8; | ||
48 | res[1].flags = IORESOURCE_IRQ; | ||
49 | |||
42 | pd = platform_device_register_simple("rtc_cmos", -1, | 50 | pd = platform_device_register_simple("rtc_cmos", -1, |
43 | &res, 1); | 51 | &res[0], 2); |
52 | |||
44 | if (IS_ERR(pd)) | 53 | if (IS_ERR(pd)) |
45 | return PTR_ERR(pd); | 54 | return PTR_ERR(pd); |
46 | 55 | ||