Lines Matching refs:ioaddr
62 void __iomem *ioaddr = pdata->ioaddr_rtc; in ds1742_rtc_set_time() local
67 writeb(RTC_WRITE, ioaddr + RTC_CONTROL); in ds1742_rtc_set_time()
69 writeb(bin2bcd(tm->tm_year % 100), ioaddr + RTC_YEAR); in ds1742_rtc_set_time()
70 writeb(bin2bcd(tm->tm_mon + 1), ioaddr + RTC_MONTH); in ds1742_rtc_set_time()
71 writeb(bin2bcd(tm->tm_wday) & RTC_DAY_MASK, ioaddr + RTC_DAY); in ds1742_rtc_set_time()
72 writeb(bin2bcd(tm->tm_mday), ioaddr + RTC_DATE); in ds1742_rtc_set_time()
73 writeb(bin2bcd(tm->tm_hour), ioaddr + RTC_HOURS); in ds1742_rtc_set_time()
74 writeb(bin2bcd(tm->tm_min), ioaddr + RTC_MINUTES); in ds1742_rtc_set_time()
75 writeb(bin2bcd(tm->tm_sec) & RTC_SECONDS_MASK, ioaddr + RTC_SECONDS); in ds1742_rtc_set_time()
78 writeb(RTC_WRITE | (century & RTC_CENTURY_MASK), ioaddr + RTC_CENTURY); in ds1742_rtc_set_time()
79 writeb(century & RTC_CENTURY_MASK, ioaddr + RTC_CONTROL); in ds1742_rtc_set_time()
86 void __iomem *ioaddr = pdata->ioaddr_rtc; in ds1742_rtc_read_time() local
94 writeb(RTC_READ, ioaddr + RTC_CONTROL); in ds1742_rtc_read_time()
95 second = readb(ioaddr + RTC_SECONDS) & RTC_SECONDS_MASK; in ds1742_rtc_read_time()
96 minute = readb(ioaddr + RTC_MINUTES); in ds1742_rtc_read_time()
97 hour = readb(ioaddr + RTC_HOURS); in ds1742_rtc_read_time()
98 day = readb(ioaddr + RTC_DATE); in ds1742_rtc_read_time()
99 week = readb(ioaddr + RTC_DAY) & RTC_DAY_MASK; in ds1742_rtc_read_time()
100 month = readb(ioaddr + RTC_MONTH); in ds1742_rtc_read_time()
101 year = readb(ioaddr + RTC_YEAR); in ds1742_rtc_read_time()
102 century = readb(ioaddr + RTC_CENTURY) & RTC_CENTURY_MASK; in ds1742_rtc_read_time()
103 writeb(0, ioaddr + RTC_CONTROL); in ds1742_rtc_read_time()
125 void __iomem *ioaddr = pdata->ioaddr_nvram; in ds1742_nvram_read() local
129 *buf++ = readb(ioaddr + pos++); in ds1742_nvram_read()
137 void __iomem *ioaddr = pdata->ioaddr_nvram; in ds1742_nvram_write() local
141 writeb(*buf++, ioaddr + pos++); in ds1742_nvram_write()
151 void __iomem *ioaddr; in ds1742_rtc_probe() local
165 ioaddr = devm_ioremap_resource(&pdev->dev, res); in ds1742_rtc_probe()
166 if (IS_ERR(ioaddr)) in ds1742_rtc_probe()
167 return PTR_ERR(ioaddr); in ds1742_rtc_probe()
169 pdata->ioaddr_nvram = ioaddr; in ds1742_rtc_probe()
170 pdata->ioaddr_rtc = ioaddr + resource_size(res) - RTC_SIZE; in ds1742_rtc_probe()
176 ioaddr = pdata->ioaddr_rtc; in ds1742_rtc_probe()
177 sec = readb(ioaddr + RTC_SECONDS); in ds1742_rtc_probe()
180 cen = readb(ioaddr + RTC_CENTURY) & RTC_CENTURY_MASK; in ds1742_rtc_probe()
181 writeb(RTC_WRITE, ioaddr + RTC_CONTROL); in ds1742_rtc_probe()
182 writeb(sec, ioaddr + RTC_SECONDS); in ds1742_rtc_probe()
183 writeb(cen & RTC_CENTURY_MASK, ioaddr + RTC_CONTROL); in ds1742_rtc_probe()
185 if (!(readb(ioaddr + RTC_DAY) & RTC_BATT_FLAG)) in ds1742_rtc_probe()