Lines Matching refs:rtc

54 #define	DS1307_DEVICE_TYPE	"rtc"
74 static int todds1307_prom_getdate(struct rtc_t *rtc);
75 static int todds1307_prom_setdate(struct rtc_t *rtc);
375 struct rtc_t rtc;
387 bcopy(&soft_rtc, &rtc, sizeof (rtc));
393 tod.tod_year = rtc.rtc_year;
394 if (rtc.rtc_year <= 68)
396 tod.tod_month = rtc.rtc_mon;
397 tod.tod_day = rtc.rtc_dom;
398 tod.tod_dow = rtc.rtc_dow;
399 tod.tod_hour = rtc.rtc_hrs;
400 tod.tod_min = rtc.rtc_min;
401 tod.tod_sec = rtc.rtc_sec;
420 struct rtc_t rtc;
437 rtc.rtc_year = int2bcd(year);
438 rtc.rtc_mon = int2bcd(tod.tod_month);
439 rtc.rtc_dom = int2bcd(tod.tod_day);
440 rtc.rtc_dow = int2bcd(tod.tod_dow);
441 rtc.rtc_hrs = int2bcd(tod.tod_hour);
442 rtc.rtc_min = int2bcd(tod.tod_min);
443 rtc.rtc_sec = int2bcd(tod.tod_sec);
445 (void) todds1307_write_rtc(&rtc);
482 todds1307_read_rtc(struct rtc_t *rtc)
490 return (todds1307_prom_getdate(rtc));
557 rtc->rtc_year = bcd2int(i2c_tp->i2c_rbuf[6]);
558 rtc->rtc_mon = bcd2int(i2c_tp->i2c_rbuf[5]);
559 rtc->rtc_dom = bcd2int(i2c_tp->i2c_rbuf[4]);
560 rtc->rtc_dow = bcd2int(i2c_tp->i2c_rbuf[3]);
561 rtc->rtc_hrs = bcd2int(i2c_tp->i2c_rbuf[2]);
562 rtc->rtc_min = bcd2int(i2c_tp->i2c_rbuf[1]);
563 rtc->rtc_sec = bcd2int(i2c_tp->i2c_rbuf[0]);
574 todds1307_write_rtc(struct rtc_t *rtc)
582 return (todds1307_prom_setdate(rtc));
598 i2c_tp->i2c_wbuf[1] = rtc->rtc_sec;
599 i2c_tp->i2c_wbuf[2] = rtc->rtc_min;
600 i2c_tp->i2c_wbuf[3] = rtc->rtc_hrs;
601 i2c_tp->i2c_wbuf[4] = rtc->rtc_dow;
602 i2c_tp->i2c_wbuf[5] = rtc->rtc_dom;
603 i2c_tp->i2c_wbuf[6] = rtc->rtc_mon;
604 i2c_tp->i2c_wbuf[7] = rtc->rtc_year;
667 * Finds the device node with device_type "rtc" and opens it to
681 * We now have the phandle of the rtc node, we need to open the
711 * Read the date using "get-time" method in rtc node
716 todds1307_prom_getdate(struct rtc_t *rtc)
732 rtc->rtc_mon = p1275_cell2int(ci[7]);
733 rtc->rtc_dom = p1275_cell2int(ci[8]);
734 rtc->rtc_dow = 0;
735 rtc->rtc_hrs = p1275_cell2int(ci[9]);
736 rtc->rtc_min = p1275_cell2int(ci[10]);
737 rtc->rtc_sec = p1275_cell2int(ci[11]);
742 rtc->rtc_year = year;
748 * Read the date using "set-time" method in rtc node
753 todds1307_prom_setdate(struct rtc_t *rtc)
758 year = rtc->rtc_year;
764 year = rtc->rtc_year + 2000;
766 year = rtc->rtc_year + 1900;
774 ci[6] = p1275_int2cell(rtc->rtc_mon);
775 ci[7] = p1275_int2cell(rtc->rtc_dom);
776 ci[8] = p1275_int2cell(rtc->rtc_hrs);
777 ci[9] = p1275_int2cell(rtc->rtc_min);
778 ci[10] = p1275_int2cell(rtc->rtc_sec);