2009-05-03 Joel Sherrill <joel.sherrill@oarcorp.com>

* libchip/rtc/ds1375.c, libchip/rtc/mc146818a.c: Fix warnings. Reformat
	as needed.
This commit is contained in:
Joel Sherrill
2009-05-04 00:53:45 +00:00
parent 81fb3d3646
commit 9c2eacafea
3 changed files with 255 additions and 236 deletions

View File

@@ -1,3 +1,8 @@
2009-05-03 Joel Sherrill <joel.sherrill@oarcorp.com>
* libchip/rtc/ds1375.c, libchip/rtc/mc146818a.c: Fix warnings. Reformat
as needed.
2009-04-29 Chris Johns <chrisj@rtems.org> 2009-04-29 Chris Johns <chrisj@rtems.org>
* libchip/ide/ata.c: Remove a detection test that fails in qemu. * libchip/ide/ata.c: Remove a detection test that fails in qemu.

View File

@@ -8,13 +8,13 @@
* This software was created by * This software was created by
* *
* Till Straumann <strauman@slac.stanford.edu>, 2005-2007, * Till Straumann <strauman@slac.stanford.edu>, 2005-2007,
* Stanford Linear Accelerator Center, Stanford University. * Stanford Linear Accelerator Center, Stanford University.
* *
* Acknowledgement of sponsorship * Acknowledgement of sponsorship
* ------------------------------ * ------------------------------
* The software was produced by * The software was produced by
* the Stanford Linear Accelerator Center, Stanford University, * the Stanford Linear Accelerator Center, Stanford University,
* under Contract DE-AC03-76SFO0515 with the Department of Energy. * under Contract DE-AC03-76SFO0515 with the Department of Energy.
* *
* Government disclaimer of liability * Government disclaimer of liability
* ---------------------------------- * ----------------------------------
@@ -70,29 +70,29 @@
* (printf, perror etc.). * (printf, perror etc.).
* Our file descriptors may even be 0..2 * Our file descriptors may even be 0..2
*/ */
#define STDIOSAFE(fmt,args...) \ #define STDIOSAFE(fmt,args...) \
do { \ do { \
if ( _System_state_Is_up( _System_state_Get() ) ) { \ if ( _System_state_Is_up( _System_state_Get() ) ) { \
fprintf(stderr,fmt,args); \ fprintf(stderr,fmt,args); \
} else { \ } else { \
printk(fmt,args); \ printk(fmt,args); \
} \ } \
} while (0) } while (0)
STATIC uint8_t ds1375_bcd2bin(uint8_t x) STATIC uint8_t ds1375_bcd2bin(uint8_t x)
{ {
uint8_t h = x & 0xf0; uint8_t h = x & 0xf0;
/* 8*hi + 2*hi + lo */ /* 8*hi + 2*hi + lo */
return ( h >> 1 ) + ( h >> 3 ) + ( x & 0xf ); return ( h >> 1 ) + ( h >> 3 ) + ( x & 0xf );
} }
STATIC uint8_t ds1375_bin2bcd(uint8_t x) STATIC uint8_t ds1375_bin2bcd(uint8_t x)
{ {
uint8_t h = x/10; uint8_t h = x/10;
return ( h << 4 ) + ( x - ( ( h << 3 ) + ( h << 1 ) ) ); return ( h << 4 ) + ( x - ( ( h << 3 ) + ( h << 1 ) ) );
} }
/* /*
@@ -103,227 +103,240 @@ uint8_t h = x/10;
* starting at the seconds (for the 1375 both, * starting at the seconds (for the 1375 both,
* _REG and _OFF happen to be identical). * _REG and _OFF happen to be identical).
*/ */
#define DS1375_SEC_REG 0x0
#define DS1375_SEC_OFF (DS1375_SEC_REG-DS1375_SEC_REG)
#define DS1375_SEC_REG 0x0
#define DS1375_SEC_OFF (DS1375_SEC_REG-DS1375_SEC_REG)
/* Extract seconds and convert to binary */ /* Extract seconds and convert to binary */
#define DS1375_SEC(x) ds1375_bcd2bin( ((x)[DS1375_SEC_OFF]) & 0x7f ) #define DS1375_SEC(x) ds1375_bcd2bin( ((x)[DS1375_SEC_OFF]) & 0x7f )
#define DS1375_MIN_REG 0x1 #define DS1375_MIN_REG 0x1
#define DS1375_MIN_OFF (DS1375_MIN_REG-DS1375_SEC_REG) #define DS1375_MIN_OFF (DS1375_MIN_REG-DS1375_SEC_REG)
/* Extract minutes and convert to binary */ /* Extract minutes and convert to binary */
#define DS1375_MIN(x) ds1375_bcd2bin( ((x)[DS1375_MIN_OFF]) & 0x7f ) #define DS1375_MIN(x) ds1375_bcd2bin( ((x)[DS1375_MIN_OFF]) & 0x7f )
#define DS1375_HR_REG 0x2 #define DS1375_HR_REG 0x2
#define DS1375_HR_OFF (DS1375_HR_REG-DS1375_SEC_REG) #define DS1375_HR_OFF (DS1375_HR_REG-DS1375_SEC_REG)
#define DS1375_HR_1224 (1<<6) #define DS1375_HR_1224 (1<<6)
#define DS1375_HR_AMPM (1<<5) #define DS1375_HR_AMPM (1<<5)
/* Are hours in AM/PM representation ? */ /* Are hours in AM/PM representation ? */
#define DS1375_IS_AMPM(x) (DS1375_HR_1224 & ((x)[DS1375_HR_OFF])) #define DS1375_IS_AMPM(x) (DS1375_HR_1224 & ((x)[DS1375_HR_OFF]))
/* Are we PM ? */ /* Are we PM ? */
#define DS1375_IS_PM(x) (DS1375_HR_AMPM & ((x)[DS1375_HR_OFF])) #define DS1375_IS_PM(x) (DS1375_HR_AMPM & ((x)[DS1375_HR_OFF]))
/* Extract hours (12h mode) and convert to binary */ /* Extract hours (12h mode) and convert to binary */
#define DS1375_HR_12(x) ds1375_bcd2bin( ((x)[DS1375_HR_OFF]) & 0x1f ) #define DS1375_HR_12(x) ds1375_bcd2bin( ((x)[DS1375_HR_OFF]) & 0x1f )
/* Extract hours (24h mode) and convert to binary */ /* Extract hours (24h mode) and convert to binary */
#define DS1375_HR_24(x) ds1375_bcd2bin( ((x)[DS1375_HR_OFF]) & 0x3f ) #define DS1375_HR_24(x) ds1375_bcd2bin( ((x)[DS1375_HR_OFF]) & 0x3f )
#define DS1375_DAY_REG 0x3 #define DS1375_DAY_REG 0x3
#define DS1375_DAY_OFF (DS1375_DAY_REG-DS1375_SEC_REG) #define DS1375_DAY_OFF (DS1375_DAY_REG-DS1375_SEC_REG)
#define DS1375_DAT_REG 0x4 #define DS1375_DAT_REG 0x4
#define DS1375_DAT_OFF (DS1375_DAT_REG-DS1375_SEC_REG) #define DS1375_DAT_OFF (DS1375_DAT_REG-DS1375_SEC_REG)
/* Extract date and convert to binary */ /* Extract date and convert to binary */
#define DS1375_DAT(x) ds1375_bcd2bin( ((x)[DS1375_DAT_OFF]) & 0x3f ) #define DS1375_DAT(x) ds1375_bcd2bin( ((x)[DS1375_DAT_OFF]) & 0x3f )
#define DS1375_MON_REG 0x5 #define DS1375_MON_REG 0x5
#define DS1375_MON_OFF (DS1375_MON_REG-DS1375_SEC_REG) #define DS1375_MON_OFF (DS1375_MON_REG-DS1375_SEC_REG)
#define DS1375_MON_CTRY (1<<7) #define DS1375_MON_CTRY (1<<7)
/* Is century bit set ? */ /* Is century bit set ? */
#define DS1375_IS_CTRY(x) (((x)[DS1375_MON_OFF]) & DS1375_MON_CTRY) #define DS1375_IS_CTRY(x) (((x)[DS1375_MON_OFF]) & DS1375_MON_CTRY)
/* Extract month and convert to binary */ /* Extract month and convert to binary */
#define DS1375_MON(x) ds1375_bcd2bin( ((x)[DS1375_MON_OFF]) & 0x1f ) #define DS1375_MON(x) ds1375_bcd2bin( ((x)[DS1375_MON_OFF]) & 0x1f )
#define DS1375_YR_REG 0x6 #define DS1375_YR_REG 0x6
#define DS1375_YR_OFF (DS1375_YR_REG-DS1375_SEC_REG) #define DS1375_YR_OFF (DS1375_YR_REG-DS1375_SEC_REG)
/* Extract year and convert to binary */ /* Extract year and convert to binary */
#define DS1375_YR(x) ds1375_bcd2bin( ((x)[DS1375_YR_OFF]) & 0xff ) #define DS1375_YR(x) ds1375_bcd2bin( ((x)[DS1375_YR_OFF]) & 0xff )
/* CR Register and bit definitions */ /* CR Register and bit definitions */
#define DS1375_CR_REG 0xe #define DS1375_CR_REG 0xe
#define DS1375_CR_ECLK (1<<7) #define DS1375_CR_ECLK (1<<7)
#define DS1375_CR_CLKSEL1 (1<<6) #define DS1375_CR_CLKSEL1 (1<<6)
#define DS1375_CR_CLKSEL0 (1<<5) #define DS1375_CR_CLKSEL0 (1<<5)
#define DS1375_CR_RS2 (1<<4) #define DS1375_CR_RS2 (1<<4)
#define DS1375_CR_RS1 (1<<3) #define DS1375_CR_RS1 (1<<3)
#define DS1375_CR_INTCN (1<<2) #define DS1375_CR_INTCN (1<<2)
#define DS1375_CR_A2IE (1<<1) #define DS1375_CR_A2IE (1<<1)
#define DS1375_CR_A1IE (1<<0) #define DS1375_CR_A1IE (1<<0)
#define DS1375_CSR_REG 0xf #define DS1375_CSR_REG 0xf
/* User SRAM (8 bytes) */ /* User SRAM (8 bytes) */
#define DS1375_RAM 0x10 /* start of 8 bytes user ram */ #define DS1375_RAM 0x10 /* start of 8 bytes user ram */
/* Access Primitives */ /* Access Primitives */
STATIC int STATIC int rd_bytes(
rd_bytes( int fd, uint32_t off, uint8_t *buf, int len ) int fd,
uint32_t off,
uint8_t *buf,
int len
)
{ {
uint8_t ptr = off; uint8_t ptr = off;
return 1 == write( fd, &ptr, 1 ) && len == read( fd, buf, len ) ? 0 : -1; return 1 == write( fd, &ptr, 1 ) && len == read( fd, buf, len ) ? 0 : -1;
} }
STATIC int STATIC int wr_bytes(
wr_bytes( int fd, uint32_t off, uint8_t *buf, int len ) int fd,
uint32_t off,
uint8_t *buf,
int len
)
{ {
uint8_t d[ len + 1 ]; uint8_t d[ len + 1 ];
/* Must not break up writing of the register pointer and /* Must not break up writing of the register pointer and
* the data to-be-written into multiple write() calls * the data to-be-written into multiple write() calls
* because every 'write()' operation sends START and * because every 'write()' operation sends START and
* the chip interprets the first byte after START as * the chip interprets the first byte after START as
* the register pointer. * the register pointer.
*/ */
d[0] = off; d[0] = off;
memcpy( d + 1, buf, len ); memcpy( d + 1, buf, len );
return len + 1 == write( fd, d, len + 1 ) ? 0 : -1; return len + 1 == write( fd, d, len + 1 ) ? 0 : -1;
} }
/* Helpers */ /* Helpers */
static int static int getfd(
getfd( int minor ) int minor
)
{ {
return open( (const char *)RTC_Table[minor].ulCtrlPort1, O_RDWR ); return open( (const char *)RTC_Table[minor].ulCtrlPort1, O_RDWR );
} }
/* Driver Access Functions */ /* Driver Access Functions */
STATIC void STATIC void ds1375_initialize(
ds1375_initialize( int minor ) int minor
)
{ {
int fd; int fd;
uint8_t cr; uint8_t cr;
if ( ( fd = getfd( minor ) ) >= 0 ) { if ( ( fd = getfd( minor ) ) >= 0 ) {
if ( 0 == rd_bytes( fd, DS1375_CR_REG, &cr, 1 ) ) { if ( 0 == rd_bytes( fd, DS1375_CR_REG, &cr, 1 ) ) {
/* make sure clock is enabled */ /* make sure clock is enabled */
if ( ! ( DS1375_CR_ECLK & cr ) ) { if ( ! ( DS1375_CR_ECLK & cr ) ) {
cr |= DS1375_CR_ECLK; cr |= DS1375_CR_ECLK;
wr_bytes( fd, DS1375_CR_REG, &cr, 1 ); wr_bytes( fd, DS1375_CR_REG, &cr, 1 );
} }
} }
close( fd ); close( fd );
} }
} }
STATIC int STATIC int ds1375_get_time(
ds1375_get_time( int minor, rtems_time_of_day *time ) int minor,
rtems_time_of_day *time
)
{ {
int rval = -1; int rval = -1;
int fd; int fd;
uint8_t buf[DS1375_YR_REG + 1 - DS1375_SEC_REG]; uint8_t buf[DS1375_YR_REG + 1 - DS1375_SEC_REG];
if ( time && ( ( fd = getfd( minor ) ) >= 0 ) ) { if ( time && ( ( fd = getfd( minor ) ) >= 0 ) ) {
if ( 0 == rd_bytes( fd, DS1375_SEC_REG, buf, sizeof(buf) ) ) { if ( 0 == rd_bytes( fd, DS1375_SEC_REG, buf, sizeof(buf) ) ) {
time->year = DS1375_IS_CTRY( buf ) ? 2000 : 1900; time->year = DS1375_IS_CTRY( buf ) ? 2000 : 1900;
time->year += DS1375_YR ( buf ); time->year += DS1375_YR ( buf );
time->month = DS1375_MON( buf ); time->month = DS1375_MON( buf );
time->day = DS1375_DAT( buf ); /* DAY is weekday */ time->day = DS1375_DAT( buf ); /* DAY is weekday */
if ( DS1375_IS_AMPM( buf ) ) { if ( DS1375_IS_AMPM( buf ) ) {
time->hour = DS1375_HR_12 ( buf ); time->hour = DS1375_HR_12 ( buf );
if ( DS1375_IS_PM( buf ) ) if ( DS1375_IS_PM( buf ) )
time->hour += 12; time->hour += 12;
} else { } else {
time->hour = DS1375_HR_24 ( buf ); time->hour = DS1375_HR_24 ( buf );
} }
time->minute = DS1375_MIN( buf ); time->minute = DS1375_MIN( buf );
time->second = DS1375_SEC( buf ); time->second = DS1375_SEC( buf );
time->ticks = 0; time->ticks = 0;
rval = 0; rval = 0;
} }
close( fd ); close( fd );
} }
return rval; return rval;
} }
STATIC int STATIC int ds1375_set_time(
ds1375_set_time( int minor, rtems_time_of_day *time ) int minor,
const rtems_time_of_day *time
)
{ {
int rval = -1; int rval = -1;
int fd = -1; int fd = -1;
time_t secs; time_t secs;
struct tm tm; struct tm tm;
uint8_t buf[DS1375_YR_REG + 1 - DS1375_SEC_REG]; uint8_t buf[DS1375_YR_REG + 1 - DS1375_SEC_REG];
uint8_t cr = 0xff; uint8_t cr = 0xff;
/*
* The clock hardware maintains the day-of-week as a separate counter
* so we must compute it ourselves (rtems_time_of_day doesn't come
* with a day of week).
*/
secs = _TOD_To_seconds( time );
/* we're only interested in tm_wday... */
gmtime_r( &secs, &tm );
buf[DS1375_SEC_OFF] = ds1375_bin2bcd( time->second ); /*
buf[DS1375_MIN_OFF] = ds1375_bin2bcd( time->minute ); * The clock hardware maintains the day-of-week as a separate counter
/* bin2bcd(hour) implicitly selects 24h mode since ms-bit is clear */ * so we must compute it ourselves (rtems_time_of_day doesn't come
buf[DS1375_HR_OFF] = ds1375_bin2bcd( time->hour ); * with a day of week).
buf[DS1375_DAY_OFF] = tm.tm_wday + 1; */
buf[DS1375_DAT_OFF] = ds1375_bin2bcd( time->day ); secs = _TOD_To_seconds( time );
buf[DS1375_MON_OFF] = ds1375_bin2bcd( time->month ); /* we're only interested in tm_wday... */
gmtime_r( &secs, &tm );
if ( time->year >= 2000 ) {
buf[DS1375_YR_OFF] = ds1375_bin2bcd( time->year - 2000 );
buf[DS1375_MON_OFF] |= DS1375_MON_CTRY;
} else {
buf[DS1375_YR_OFF] = ds1375_bin2bcd( time->year - 1900 );
}
/* buf[DS1375_SEC_OFF] = ds1375_bin2bcd( time->second );
* Stop clock; update registers and restart. This is slightly buf[DS1375_MIN_OFF] = ds1375_bin2bcd( time->minute );
* slower than just writing everyting but if we did that we /* bin2bcd(hour) implicitly selects 24h mode since ms-bit is clear */
* could get inconsistent registers if this routine would not buf[DS1375_HR_OFF] = ds1375_bin2bcd( time->hour );
* complete in less than 1s (says the datasheet) and we don't buf[DS1375_DAY_OFF] = tm.tm_wday + 1;
* know if we are going to be pre-empted for some time... buf[DS1375_DAT_OFF] = ds1375_bin2bcd( time->day );
*/ buf[DS1375_MON_OFF] = ds1375_bin2bcd( time->month );
if ( ( fd = getfd( minor ) ) < 0 ) {
goto cleanup; if ( time->year >= 2000 ) {
} buf[DS1375_YR_OFF] = ds1375_bin2bcd( time->year - 2000 );
buf[DS1375_MON_OFF] |= DS1375_MON_CTRY;
} else {
buf[DS1375_YR_OFF] = ds1375_bin2bcd( time->year - 1900 );
}
if ( rd_bytes( fd, DS1375_CR_REG, &cr, 1 ) ) /*
goto cleanup; * Stop clock; update registers and restart. This is slightly
* slower than just writing everyting but if we did that we
* could get inconsistent registers if this routine would not
* complete in less than 1s (says the datasheet) and we don't
* know if we are going to be pre-empted for some time...
*/
if ( ( fd = getfd( minor ) ) < 0 ) {
goto cleanup;
}
cr &= ~DS1375_CR_ECLK; if ( rd_bytes( fd, DS1375_CR_REG, &cr, 1 ) )
goto cleanup;
/* This stops the clock */ cr &= ~DS1375_CR_ECLK;
if ( wr_bytes( fd, DS1375_CR_REG, &cr, 1 ) )
goto cleanup;
/* write new contents */ /* This stops the clock */
if ( wr_bytes( fd, DS1375_SEC_REG, buf, sizeof(buf) ) ) if ( wr_bytes( fd, DS1375_CR_REG, &cr, 1 ) )
goto cleanup; goto cleanup;
rval = 0; /* write new contents */
if ( wr_bytes( fd, DS1375_SEC_REG, buf, sizeof(buf) ) )
goto cleanup;
rval = 0;
cleanup: cleanup:
if ( fd >= 0 ) { if ( fd >= 0 ) {
if ( ! ( DS1375_CR_ECLK & cr ) ) { if ( ! ( DS1375_CR_ECLK & cr ) ) {
/* start clock; this handles some cases of failure /* start clock; this handles some cases of failure
* after stopping the clock by restarting it again * after stopping the clock by restarting it again
*/ */
cr |= DS1375_CR_ECLK; cr |= DS1375_CR_ECLK;
if ( wr_bytes( fd, DS1375_CR_REG, &cr, 1 ) ) if ( wr_bytes( fd, DS1375_CR_REG, &cr, 1 ) )
rval = -1; rval = -1;
} }
close( fd ); close( fd );
} }
return rval; return rval;
} }
/* Debugging / Testing */ /* Debugging / Testing */
@@ -339,11 +352,11 @@ ds1375_get_time_tst()
{ {
rtems_time_of_day rtod; rtems_time_of_day rtod;
time_t secs; time_t secs;
ds1375_get_time( 0, &rtod ); ds1375_get_time( 0, &rtod );
secs = _TOD_To_seconds( &rtod ); secs = _TOD_To_seconds( &rtod );
printf( "%s\n", ctime( &secs ) ); printf( "%s\n", ctime( &secs ) );
return secs; return secs;
} }
int int
@@ -353,29 +366,29 @@ struct tm tm;
time_t secs; time_t secs;
rtems_time_of_day rt; rtems_time_of_day rt;
if ( !datstr ) if ( !datstr )
return -1; return -1;
if ( ! strptime( datstr, "%Y-%m-%d/%T", &tm ) ) if ( ! strptime( datstr, "%Y-%m-%d/%T", &tm ) )
return -2; return -2;
if ( ! prt ) if ( ! prt )
prt = &rt; prt = &rt;
secs = mktime( &tm ); secs = mktime( &tm );
/* convert to UTC */ /* convert to UTC */
gmtime_r( &secs, &tm ); gmtime_r( &secs, &tm );
printf("Y: %"PRIu32" ", (prt->year = tm.tm_year + 1900) ); printf("Y: %"PRIu32" ", (prt->year = tm.tm_year + 1900) );
printf("M: %"PRIu32" ", (prt->month = tm.tm_mon + 1) ); printf("M: %"PRIu32" ", (prt->month = tm.tm_mon + 1) );
printf("D: %"PRIu32" ", (prt->day = tm.tm_mday ) ); printf("D: %"PRIu32" ", (prt->day = tm.tm_mday ) );
printf("h: %"PRIu32" ", (prt->hour = tm.tm_hour ) ); printf("h: %"PRIu32" ", (prt->hour = tm.tm_hour ) );
printf("m: %"PRIu32" ", (prt->minute = tm.tm_min ) ); printf("m: %"PRIu32" ", (prt->minute = tm.tm_min ) );
printf("s: %"PRIu32"\n", (prt->second = tm.tm_sec ) ); printf("s: %"PRIu32"\n", (prt->second = tm.tm_sec ) );
prt->ticks = 0; prt->ticks = 0;
return ( prt == &rt ) ? ds1375_set_time( 0, &rt ) : 0; return ( prt == &rt ) ? ds1375_set_time( 0, &rt ) : 0;
} }
#endif #endif
@@ -388,15 +401,15 @@ int fd;
uint8_t v; uint8_t v;
uint32_t rval = -1; uint32_t rval = -1;
if ( ( fd = open( (const char*)port, O_RDWR ) ) >= 0 ) { if ( ( fd = open( (const char*)port, O_RDWR ) ) >= 0 ) {
if ( 0 == rd_bytes( fd, reg, &v, 1 ) ) { if ( 0 == rd_bytes( fd, reg, &v, 1 ) ) {
rval = v; rval = v;
} }
close( fd ); close( fd );
} }
return rval; return rval;
} }
void void
@@ -404,41 +417,42 @@ rtc_ds1375_set_register( uint32_t port, uint8_t reg, uint32_t value )
{ {
int fd; int fd;
uint8_t v = value; uint8_t v = value;
if ( ( fd = open( (const char*)port, O_RDWR ) ) >= 0 ) { if ( ( fd = open( (const char*)port, O_RDWR ) ) >= 0 ) {
wr_bytes( fd, reg, &v, 1 ); wr_bytes( fd, reg, &v, 1 );
close( fd ); close( fd );
} }
} }
bool bool rtc_ds1375_device_probe(
rtc_ds1375_device_probe( int minor ) int minor
)
{ {
int fd; int fd;
if ( ( fd = getfd( minor ) ) < 0 ) { if ( ( fd = getfd( minor ) ) < 0 ) {
STDIOSAFE( "ds1375_probe (open): %s\n", strerror( errno ) ); STDIOSAFE( "ds1375_probe (open): %s\n", strerror( errno ) );
return false; return false;
} }
/* Try to set file pointer */ /* Try to set file pointer */
if ( 0 != wr_bytes( fd, DS1375_SEC_REG, 0, 0 ) ) { if ( 0 != wr_bytes( fd, DS1375_SEC_REG, 0, 0 ) ) {
STDIOSAFE( "ds1375_probe (wr_bytes): %s\n", strerror( errno ) ); STDIOSAFE( "ds1375_probe (wr_bytes): %s\n", strerror( errno ) );
close( fd ); close( fd );
return false; return false;
} }
if ( close( fd ) ) { if ( close( fd ) ) {
STDIOSAFE( "ds1375_probe (close): %s\n", strerror( errno ) ); STDIOSAFE( "ds1375_probe (close): %s\n", strerror( errno ) );
return false; return false;
} }
return true; return true;
} }
rtc_fns rtc_ds1375_fns = { rtc_fns rtc_ds1375_fns = {
deviceInitialize: ds1375_initialize, deviceInitialize: ds1375_initialize,
deviceGetTime: ds1375_get_time, deviceGetTime: ds1375_get_time,
deviceSetTime: ds1375_set_time, deviceSetTime: ds1375_set_time,
}; };

View File

@@ -134,8 +134,8 @@ int mc146818a_get_time(
* Set time into chip * Set time into chip
*/ */
int mc146818a_set_time( int mc146818a_set_time(
int minor, int minor,
rtems_time_of_day *time const rtems_time_of_day *time
) )
{ {
uint32_t mc146818a; uint32_t mc146818a;