diff options
author | Randy Vinson <rvinson@mvista.com> | 2005-06-03 17:43:56 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-06-22 00:52:06 -0400 |
commit | bdca3f0aedde85552099aa95ab1449bf81e4f6f5 (patch) | |
tree | 1016146e6b110707163777101436eb5b339d39bc /arch/ppc | |
parent | c124a78d8c7475ecc43f385f34112b638c4228d9 (diff) |
[PATCH] I2C: Add support for Maxim/Dallas DS1374 Real-Time Clock Chip (2/2)
This change provides support for the DS1374 Real-Time Clock chip present
on the MPC8349ADS board. It depends on a previous patch which adds I2C
support for the DS1374.
Signed-off-by: Randy Vinson <rvinson@mvista.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'arch/ppc')
-rw-r--r-- | arch/ppc/platforms/83xx/mpc834x_sys.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/ppc/platforms/83xx/mpc834x_sys.c b/arch/ppc/platforms/83xx/mpc834x_sys.c index 86ca5cf81263..37ece1542799 100644 --- a/arch/ppc/platforms/83xx/mpc834x_sys.c +++ b/arch/ppc/platforms/83xx/mpc834x_sys.c | |||
@@ -185,6 +185,26 @@ mpc834x_sys_init_IRQ(void) | |||
185 | ipic_set_default_priority(); | 185 | ipic_set_default_priority(); |
186 | } | 186 | } |
187 | 187 | ||
188 | #if defined(CONFIG_I2C_MPC) && defined(CONFIG_SENSORS_DS1374) | ||
189 | extern ulong ds1374_get_rtc_time(void); | ||
190 | extern int ds1374_set_rtc_time(ulong); | ||
191 | |||
192 | static int __init | ||
193 | mpc834x_rtc_hookup(void) | ||
194 | { | ||
195 | struct timespec tv; | ||
196 | |||
197 | ppc_md.get_rtc_time = ds1374_get_rtc_time; | ||
198 | ppc_md.set_rtc_time = ds1374_set_rtc_time; | ||
199 | |||
200 | tv.tv_nsec = 0; | ||
201 | tv.tv_sec = (ppc_md.get_rtc_time)(); | ||
202 | do_settimeofday(&tv); | ||
203 | |||
204 | return 0; | ||
205 | } | ||
206 | late_initcall(mpc834x_rtc_hookup); | ||
207 | #endif | ||
188 | static __inline__ void | 208 | static __inline__ void |
189 | mpc834x_sys_set_bat(void) | 209 | mpc834x_sys_set_bat(void) |
190 | { | 210 | { |