Lines Matching refs:ioaddr
64 void __iomem *ioaddr; member
79 void __iomem *ioaddr = pdata->ioaddr; in stk17ta8_rtc_set_time() local
82 flags = readb(pdata->ioaddr + RTC_FLAGS); in stk17ta8_rtc_set_time()
83 writeb(flags | RTC_WRITE, pdata->ioaddr + RTC_FLAGS); in stk17ta8_rtc_set_time()
85 writeb(bin2bcd(tm->tm_year % 100), ioaddr + RTC_YEAR); in stk17ta8_rtc_set_time()
86 writeb(bin2bcd(tm->tm_mon + 1), ioaddr + RTC_MONTH); in stk17ta8_rtc_set_time()
87 writeb(bin2bcd(tm->tm_wday) & RTC_DAY_MASK, ioaddr + RTC_DAY); in stk17ta8_rtc_set_time()
88 writeb(bin2bcd(tm->tm_mday), ioaddr + RTC_DATE); in stk17ta8_rtc_set_time()
89 writeb(bin2bcd(tm->tm_hour), ioaddr + RTC_HOURS); in stk17ta8_rtc_set_time()
90 writeb(bin2bcd(tm->tm_min), ioaddr + RTC_MINUTES); in stk17ta8_rtc_set_time()
91 writeb(bin2bcd(tm->tm_sec) & RTC_SECONDS_MASK, ioaddr + RTC_SECONDS); in stk17ta8_rtc_set_time()
92 writeb(bin2bcd((tm->tm_year + 1900) / 100), ioaddr + RTC_CENTURY); in stk17ta8_rtc_set_time()
94 writeb(flags & ~RTC_WRITE, pdata->ioaddr + RTC_FLAGS); in stk17ta8_rtc_set_time()
102 void __iomem *ioaddr = pdata->ioaddr; in stk17ta8_rtc_read_time() local
112 flags = readb(pdata->ioaddr + RTC_FLAGS); in stk17ta8_rtc_read_time()
113 writeb(flags | RTC_READ, ioaddr + RTC_FLAGS); in stk17ta8_rtc_read_time()
114 second = readb(ioaddr + RTC_SECONDS) & RTC_SECONDS_MASK; in stk17ta8_rtc_read_time()
115 minute = readb(ioaddr + RTC_MINUTES); in stk17ta8_rtc_read_time()
116 hour = readb(ioaddr + RTC_HOURS); in stk17ta8_rtc_read_time()
117 day = readb(ioaddr + RTC_DATE); in stk17ta8_rtc_read_time()
118 week = readb(ioaddr + RTC_DAY) & RTC_DAY_MASK; in stk17ta8_rtc_read_time()
119 month = readb(ioaddr + RTC_MONTH); in stk17ta8_rtc_read_time()
120 year = readb(ioaddr + RTC_YEAR); in stk17ta8_rtc_read_time()
121 century = readb(ioaddr + RTC_CENTURY); in stk17ta8_rtc_read_time()
122 writeb(flags & ~RTC_READ, ioaddr + RTC_FLAGS); in stk17ta8_rtc_read_time()
141 void __iomem *ioaddr = pdata->ioaddr; in stk17ta8_rtc_update_alarm() local
147 flags = readb(ioaddr + RTC_FLAGS); in stk17ta8_rtc_update_alarm()
148 writeb(flags | RTC_WRITE, ioaddr + RTC_FLAGS); in stk17ta8_rtc_update_alarm()
152 ioaddr + RTC_DATE_ALARM); in stk17ta8_rtc_update_alarm()
155 ioaddr + RTC_HOURS_ALARM); in stk17ta8_rtc_update_alarm()
158 ioaddr + RTC_MINUTES_ALARM); in stk17ta8_rtc_update_alarm()
161 ioaddr + RTC_SECONDS_ALARM); in stk17ta8_rtc_update_alarm()
162 writeb(pdata->irqen ? RTC_INTS_AIE : 0, ioaddr + RTC_INTERRUPTS); in stk17ta8_rtc_update_alarm()
163 readb(ioaddr + RTC_FLAGS); /* clear interrupts */ in stk17ta8_rtc_update_alarm()
164 writeb(flags & ~RTC_WRITE, ioaddr + RTC_FLAGS); in stk17ta8_rtc_update_alarm()
204 void __iomem *ioaddr = pdata->ioaddr; in stk17ta8_rtc_interrupt() local
209 if (readb(ioaddr + RTC_FLAGS) & RTC_FLAGS_AF) { in stk17ta8_rtc_interrupt()
211 if (readb(ioaddr + RTC_SECONDS_ALARM) & 0x80) in stk17ta8_rtc_interrupt()
252 void __iomem *ioaddr = pdata->ioaddr; in stk17ta8_nvram_read() local
256 *buf++ = readb(ioaddr + pos++); in stk17ta8_nvram_read()
267 void __iomem *ioaddr = pdata->ioaddr; in stk17ta8_nvram_write() local
271 writeb(*buf++, ioaddr + pos++); in stk17ta8_nvram_write()
291 void __iomem *ioaddr; in stk17ta8_rtc_probe() local
299 ioaddr = devm_ioremap_resource(&pdev->dev, res); in stk17ta8_rtc_probe()
300 if (IS_ERR(ioaddr)) in stk17ta8_rtc_probe()
301 return PTR_ERR(ioaddr); in stk17ta8_rtc_probe()
302 pdata->ioaddr = ioaddr; in stk17ta8_rtc_probe()
306 cal = readb(ioaddr + RTC_CALIBRATION); in stk17ta8_rtc_probe()
309 flags = readb(ioaddr + RTC_FLAGS); in stk17ta8_rtc_probe()
310 writeb(flags | RTC_WRITE, ioaddr + RTC_FLAGS); in stk17ta8_rtc_probe()
311 writeb(cal, ioaddr + RTC_CALIBRATION); in stk17ta8_rtc_probe()
312 writeb(flags & ~RTC_WRITE, ioaddr + RTC_FLAGS); in stk17ta8_rtc_probe()
314 if (readb(ioaddr + RTC_FLAGS) & RTC_FLAGS_PF) in stk17ta8_rtc_probe()
321 writeb(0, ioaddr + RTC_INTERRUPTS); in stk17ta8_rtc_probe()
347 writeb(0, pdata->ioaddr + RTC_INTERRUPTS); in stk17ta8_rtc_remove()