2013-08-02 16:10:30 +02:00
|
|
|
#ifndef __READCLOCK_H
|
|
|
|
#define __READCLOCK_H
|
|
|
|
|
|
|
|
#include <time.h>
|
|
|
|
|
|
|
|
/* implementations provided by arch/${MACHINE_ARCH}/arch_readclock.c */
|
2013-08-07 03:34:08 +02:00
|
|
|
struct rtc {
|
|
|
|
int (*init)(void);
|
|
|
|
int (*get_time)(struct tm *t, int flags);
|
|
|
|
int (*set_time)(struct tm *t, int flags);
|
|
|
|
int (*pwr_off)(void);
|
|
|
|
void (*exit)(void);
|
|
|
|
};
|
2013-08-02 16:10:30 +02:00
|
|
|
|
2013-08-07 03:34:08 +02:00
|
|
|
int arch_setup(struct rtc *r);
|
2013-08-02 16:10:30 +02:00
|
|
|
|
|
|
|
/* utility functions provided by readclock.c */
|
|
|
|
int bcd_to_dec(int n);
|
|
|
|
int dec_to_bcd(int n);
|
|
|
|
|
|
|
|
#endif /* __READCLOCK_H */
|