minix/drivers/readclock/arch/earm/arch_readclock.c
Thomas Cort 039c8db774 readclock.drv: add support for the TPS65950 RTC
On the BeagleBoard-xM, the RTC is located on the Power Management IC
(PMIC). To keep things consistent, access to the PMIC's RTC is done
through the readclock driver. The readclock driver forwards the request
on to the TPS65950 driver which does the work of manipulating the
registers on the chip.

Change-Id: I53cefbb59c5a9ab87fab90df3cc1a75a6e430f58
2013-08-09 12:41:58 +02:00

42 lines
756 B
C

#include <minix/syslib.h>
#include <minix/drvlib.h>
#include <minix/sysutil.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <errno.h>
#include <assert.h>
#include <time.h>
#include "omap_rtc.h"
#include "forward.h"
#include "readclock.h"
int
arch_setup(struct rtc *r)
{
#ifdef AM335X
r->init = omap_rtc_init;
r->get_time = omap_rtc_get_time;
r->set_time = omap_rtc_set_time;
r->pwr_off = omap_rtc_pwr_off;
r->exit = omap_rtc_exit;
return OK;
#elif DM37XX
fwd_set_label("tps65950.1.48");
r->init = fwd_init;
r->get_time = fwd_get_time;
r->set_time = fwd_set_time;
r->pwr_off = fwd_pwr_off;
r->exit = fwd_exit;
return OK;
#else
return ENOSYS;
#endif
}