diff options
author | Linus Torvalds <torvalds@woody.osdl.org> | 2006-11-21 21:42:44 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-11-21 21:42:44 -0500 |
commit | 0f9005a6f7a82f4aacbd72f7b92322a8ca1c3f97 (patch) | |
tree | 8b63f4a8add7f1bfbba02f9ddbbe26e7943afb21 | |
parent | c5dd27337a70b34cc400120e70a80fcb84c4fd7a (diff) | |
parent | 8746ed3dae14e87e9f7ad8e44649b72e22b33274 (diff) |
Merge branch 'merge' of master.kernel.org:/pub/scm/linux/kernel/git/paulus/powerpc
* 'merge' of master.kernel.org:/pub/scm/linux/kernel/git/paulus/powerpc:
[POWERPC] Fix ucc_geth of_device discovery on mpc832x
[POWERPC] Revert "[POWERPC] Add powerpc get/set_rtc_time interface to new generic rtc class"
[POWERPC] Revert "[POWERPC] Enable generic rtc hook for the MPC8349 mITX"
-rw-r--r-- | arch/powerpc/kernel/time.c | 42 | ||||
-rw-r--r-- | arch/powerpc/platforms/83xx/mpc832x_mds.c | 19 | ||||
-rw-r--r-- | arch/powerpc/platforms/83xx/mpc834x_itx.c | 4 | ||||
-rw-r--r-- | include/asm-powerpc/time.h | 4 |
4 files changed, 19 insertions, 50 deletions
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c index a1b5e4b16151..46a24de36fec 100644 --- a/arch/powerpc/kernel/time.c +++ b/arch/powerpc/kernel/time.c | |||
@@ -1014,48 +1014,6 @@ void __init time_init(void) | |||
1014 | set_dec(tb_ticks_per_jiffy); | 1014 | set_dec(tb_ticks_per_jiffy); |
1015 | } | 1015 | } |
1016 | 1016 | ||
1017 | #ifdef CONFIG_RTC_CLASS | ||
1018 | static int set_rtc_class_time(struct rtc_time *tm) | ||
1019 | { | ||
1020 | int err; | ||
1021 | struct class_device *class_dev = | ||
1022 | rtc_class_open(CONFIG_RTC_HCTOSYS_DEVICE); | ||
1023 | |||
1024 | if (class_dev == NULL) | ||
1025 | return -ENODEV; | ||
1026 | |||
1027 | err = rtc_set_time(class_dev, tm); | ||
1028 | |||
1029 | rtc_class_close(class_dev); | ||
1030 | |||
1031 | return 0; | ||
1032 | } | ||
1033 | |||
1034 | static void get_rtc_class_time(struct rtc_time *tm) | ||
1035 | { | ||
1036 | int err; | ||
1037 | struct class_device *class_dev = | ||
1038 | rtc_class_open(CONFIG_RTC_HCTOSYS_DEVICE); | ||
1039 | |||
1040 | if (class_dev == NULL) | ||
1041 | return; | ||
1042 | |||
1043 | err = rtc_read_time(class_dev, tm); | ||
1044 | |||
1045 | rtc_class_close(class_dev); | ||
1046 | |||
1047 | return; | ||
1048 | } | ||
1049 | |||
1050 | int __init rtc_class_hookup(void) | ||
1051 | { | ||
1052 | ppc_md.get_rtc_time = get_rtc_class_time; | ||
1053 | ppc_md.set_rtc_time = set_rtc_class_time; | ||
1054 | |||
1055 | return 0; | ||
1056 | } | ||
1057 | #endif /* CONFIG_RTC_CLASS */ | ||
1058 | |||
1059 | 1017 | ||
1060 | #define FEBRUARY 2 | 1018 | #define FEBRUARY 2 |
1061 | #define STARTOFTIME 1970 | 1019 | #define STARTOFTIME 1970 |
diff --git a/arch/powerpc/platforms/83xx/mpc832x_mds.c b/arch/powerpc/platforms/83xx/mpc832x_mds.c index 54dea9d42dc9..a43ac71ab740 100644 --- a/arch/powerpc/platforms/83xx/mpc832x_mds.c +++ b/arch/powerpc/platforms/83xx/mpc832x_mds.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/root_dev.h> | 24 | #include <linux/root_dev.h> |
25 | #include <linux/initrd.h> | 25 | #include <linux/initrd.h> |
26 | 26 | ||
27 | #include <asm/of_device.h> | ||
27 | #include <asm/system.h> | 28 | #include <asm/system.h> |
28 | #include <asm/atomic.h> | 29 | #include <asm/atomic.h> |
29 | #include <asm/time.h> | 30 | #include <asm/time.h> |
@@ -136,6 +137,24 @@ static void __init mpc832x_sys_setup_arch(void) | |||
136 | #endif | 137 | #endif |
137 | } | 138 | } |
138 | 139 | ||
140 | static int __init mpc832x_declare_of_platform_devices(void) | ||
141 | { | ||
142 | struct device_node *np; | ||
143 | |||
144 | for (np = NULL; (np = of_find_compatible_node(np, "network", | ||
145 | "ucc_geth")) != NULL;) { | ||
146 | int ucc_num; | ||
147 | char bus_id[BUS_ID_SIZE]; | ||
148 | |||
149 | ucc_num = *((uint *) get_property(np, "device-id", NULL)) - 1; | ||
150 | snprintf(bus_id, BUS_ID_SIZE, "ucc_geth.%u", ucc_num); | ||
151 | of_platform_device_create(np, bus_id, NULL); | ||
152 | } | ||
153 | |||
154 | return 0; | ||
155 | } | ||
156 | device_initcall(mpc832x_declare_of_platform_devices); | ||
157 | |||
139 | void __init mpc832x_sys_init_IRQ(void) | 158 | void __init mpc832x_sys_init_IRQ(void) |
140 | { | 159 | { |
141 | 160 | ||
diff --git a/arch/powerpc/platforms/83xx/mpc834x_itx.c b/arch/powerpc/platforms/83xx/mpc834x_itx.c index 5446bab08eca..e2bcaaf6b329 100644 --- a/arch/powerpc/platforms/83xx/mpc834x_itx.c +++ b/arch/powerpc/platforms/83xx/mpc834x_itx.c | |||
@@ -108,10 +108,6 @@ static int __init mpc834x_itx_probe(void) | |||
108 | return 1; | 108 | return 1; |
109 | } | 109 | } |
110 | 110 | ||
111 | #ifdef CONFIG_RTC_CLASS | ||
112 | late_initcall(rtc_class_hookup); | ||
113 | #endif | ||
114 | |||
115 | define_machine(mpc834x_itx) { | 111 | define_machine(mpc834x_itx) { |
116 | .name = "MPC834x ITX", | 112 | .name = "MPC834x ITX", |
117 | .probe = mpc834x_itx_probe, | 113 | .probe = mpc834x_itx_probe, |
diff --git a/include/asm-powerpc/time.h b/include/asm-powerpc/time.h index a78285010d62..4cff977ad526 100644 --- a/include/asm-powerpc/time.h +++ b/include/asm-powerpc/time.h | |||
@@ -39,10 +39,6 @@ extern void generic_calibrate_decr(void); | |||
39 | extern void wakeup_decrementer(void); | 39 | extern void wakeup_decrementer(void); |
40 | extern void snapshot_timebase(void); | 40 | extern void snapshot_timebase(void); |
41 | 41 | ||
42 | #ifdef CONFIG_RTC_CLASS | ||
43 | extern int __init rtc_class_hookup(void); | ||
44 | #endif | ||
45 | |||
46 | /* Some sane defaults: 125 MHz timebase, 1GHz processor */ | 42 | /* Some sane defaults: 125 MHz timebase, 1GHz processor */ |
47 | extern unsigned long ppc_proc_freq; | 43 | extern unsigned long ppc_proc_freq; |
48 | #define DEFAULT_PROC_FREQ (DEFAULT_TB_FREQ * 8) | 44 | #define DEFAULT_PROC_FREQ (DEFAULT_TB_FREQ * 8) |