Lines Matching defs:rtc
52 #define DS1337_DEVICE_TYPE "rtc"
72 static int todds1337_prom_getdate(struct rtc_t *rtc);
73 static int todds1337_prom_setdate(struct rtc_t *rtc);
397 struct rtc_t rtc;
409 bcopy(&soft_rtc, &rtc, sizeof (rtc));
415 tod.tod_year = rtc.rtc_year;
416 if (rtc.rtc_year <= 68)
418 tod.tod_month = rtc.rtc_mon;
419 tod.tod_day = rtc.rtc_dom;
420 tod.tod_dow = rtc.rtc_dow;
421 tod.tod_hour = rtc.rtc_hrs;
422 tod.tod_min = rtc.rtc_min;
423 tod.tod_sec = rtc.rtc_sec;
442 struct rtc_t rtc;
459 rtc.rtc_year = (uint8_t)year;
460 rtc.rtc_mon = (uint8_t)tod.tod_month;
461 rtc.rtc_dom = (uint8_t)tod.tod_day;
462 rtc.rtc_dow = (uint8_t)tod.tod_dow;
463 rtc.rtc_hrs = (uint8_t)tod.tod_hour;
464 rtc.rtc_min = (uint8_t)tod.tod_min;
465 rtc.rtc_sec = (uint8_t)tod.tod_sec;
467 (void) todds1337_write_rtc(&rtc);
733 todds1337_read_rtc(struct rtc_t *rtc)
741 return (todds1337_prom_getdate(rtc));
806 rtc->rtc_year = BCD_TO_BYTE(i2c_tp->i2c_rbuf[6]);
807 rtc->rtc_mon = BCD_TO_BYTE(i2c_tp->i2c_rbuf[5]);
808 rtc->rtc_dom = BCD_TO_BYTE(i2c_tp->i2c_rbuf[4]);
809 rtc->rtc_dow = BCD_TO_BYTE(i2c_tp->i2c_rbuf[3]);
810 rtc->rtc_hrs = BCD_TO_BYTE(i2c_tp->i2c_rbuf[2]);
811 rtc->rtc_min = BCD_TO_BYTE(i2c_tp->i2c_rbuf[1]);
812 rtc->rtc_sec = BCD_TO_BYTE(i2c_tp->i2c_rbuf[0]);
823 todds1337_write_rtc(struct rtc_t *rtc)
831 return (todds1337_prom_setdate(rtc));
847 i2c_tp->i2c_wbuf[1] = BYTE_TO_BCD(rtc->rtc_sec);
848 i2c_tp->i2c_wbuf[2] = BYTE_TO_BCD(rtc->rtc_min);
849 i2c_tp->i2c_wbuf[3] = BYTE_TO_BCD(rtc->rtc_hrs);
850 i2c_tp->i2c_wbuf[4] = BYTE_TO_BCD(rtc->rtc_dow);
851 i2c_tp->i2c_wbuf[5] = BYTE_TO_BCD(rtc->rtc_dom);
852 i2c_tp->i2c_wbuf[6] = BYTE_TO_BCD(rtc->rtc_mon);
853 i2c_tp->i2c_wbuf[7] = BYTE_TO_BCD(rtc->rtc_year);
897 * Finds the device node with device_type "rtc" and opens it to
911 * We now have the phandle of the rtc node, we need to open the
941 * Read the date using "get-time" method in rtc node
946 todds1337_prom_getdate(struct rtc_t *rtc)
962 rtc->rtc_mon = p1275_cell2int(ci[7]);
963 rtc->rtc_dom = p1275_cell2int(ci[8]);
964 rtc->rtc_dow = 0;
965 rtc->rtc_hrs = p1275_cell2int(ci[9]);
966 rtc->rtc_min = p1275_cell2int(ci[10]);
967 rtc->rtc_sec = p1275_cell2int(ci[11]);
972 rtc->rtc_year = year;
978 * Read the date using "set-time" method in rtc node
983 todds1337_prom_setdate(struct rtc_t *rtc)
988 year = rtc->rtc_year;
994 year = rtc->rtc_year + 2000;
996 year = rtc->rtc_year + 1900;
1004 ci[6] = p1275_int2cell(rtc->rtc_mon);
1005 ci[7] = p1275_int2cell(rtc->rtc_dom);
1006 ci[8] = p1275_int2cell(rtc->rtc_hrs);
1007 ci[9] = p1275_int2cell(rtc->rtc_min);
1008 ci[10] = p1275_int2cell(rtc->rtc_sec);