09db2a8c67
Add support for getting/setting the am335x SoC's internal real time clock. Also, allow the power off alarm to be set. Make readclock an "always on" driver. This is needed for setting power-off alarms whenever the power button is pressed on the BBB. Replace the readclock.sh script & single run driver with a readclock program that takes the same arguments and forwards the requests on to the always up readclock driver. Change-Id: Ifd6c2acd80ae4b5e79d83df510df445c24e24a71
22 lines
702 B
C
22 lines
702 B
C
#ifndef __READCLOCK_H
|
|
#define __READCLOCK_H
|
|
|
|
#include <time.h>
|
|
|
|
/* implementations provided by arch/${MACHINE_ARCH}/arch_readclock.c */
|
|
int arch_init(void); /* setup */
|
|
int arch_get_time(struct tm *t, int flags); /* read the hardware clock into t */
|
|
int arch_set_time(struct tm *t, int flags); /* set the hardware clock to t */
|
|
int arch_pwr_off(void); /* set the power off alarm to 5 sec from now. */
|
|
void arch_exit(void); /* clean up */
|
|
|
|
/* arch specific driver related functions */
|
|
int arch_sef_cb_lu_state_save(int);
|
|
int arch_lu_state_restore(void);
|
|
void arch_announce(void);
|
|
|
|
/* utility functions provided by readclock.c */
|
|
int bcd_to_dec(int n);
|
|
int dec_to_bcd(int n);
|
|
|
|
#endif /* __READCLOCK_H */
|