Lines Matching refs:ldata

96 	struct pl031_local *ldata = dev_get_drvdata(dev);  in pl031_alarm_irq_enable()  local
100 writel(RTC_BIT_AI, ldata->base + RTC_ICR); in pl031_alarm_irq_enable()
102 imsc = readl(ldata->base + RTC_IMSC); in pl031_alarm_irq_enable()
105 writel(imsc | RTC_BIT_AI, ldata->base + RTC_IMSC); in pl031_alarm_irq_enable()
107 writel(imsc & ~RTC_BIT_AI, ldata->base + RTC_IMSC); in pl031_alarm_irq_enable()
168 struct pl031_local *ldata = dev_get_drvdata(dev); in pl031_stv2_read_time() local
170 pl031_stv2_time_to_tm(readl(ldata->base + RTC_DR), in pl031_stv2_read_time()
171 readl(ldata->base + RTC_YDR), tm); in pl031_stv2_read_time()
180 struct pl031_local *ldata = dev_get_drvdata(dev); in pl031_stv2_set_time() local
185 writel(bcd_year, ldata->base + RTC_YLR); in pl031_stv2_set_time()
186 writel(time, ldata->base + RTC_LR); in pl031_stv2_set_time()
194 struct pl031_local *ldata = dev_get_drvdata(dev); in pl031_stv2_read_alarm() local
197 ret = pl031_stv2_time_to_tm(readl(ldata->base + RTC_MR), in pl031_stv2_read_alarm()
198 readl(ldata->base + RTC_YMR), &alarm->time); in pl031_stv2_read_alarm()
200 alarm->pending = readl(ldata->base + RTC_RIS) & RTC_BIT_AI; in pl031_stv2_read_alarm()
201 alarm->enabled = readl(ldata->base + RTC_IMSC) & RTC_BIT_AI; in pl031_stv2_read_alarm()
208 struct pl031_local *ldata = dev_get_drvdata(dev); in pl031_stv2_set_alarm() local
216 writel(bcd_year, ldata->base + RTC_YMR); in pl031_stv2_set_alarm()
217 writel(time, ldata->base + RTC_MR); in pl031_stv2_set_alarm()
227 struct pl031_local *ldata = dev_id; in pl031_interrupt() local
231 rtcmis = readl(ldata->base + RTC_MIS); in pl031_interrupt()
233 writel(RTC_BIT_AI, ldata->base + RTC_ICR); in pl031_interrupt()
235 rtc_update_irq(ldata->rtc, 1, events); in pl031_interrupt()
245 struct pl031_local *ldata = dev_get_drvdata(dev); in pl031_read_time() local
247 rtc_time64_to_tm(readl(ldata->base + RTC_DR), tm); in pl031_read_time()
254 struct pl031_local *ldata = dev_get_drvdata(dev); in pl031_set_time() local
256 writel(rtc_tm_to_time64(tm), ldata->base + RTC_LR); in pl031_set_time()
263 struct pl031_local *ldata = dev_get_drvdata(dev); in pl031_read_alarm() local
265 rtc_time64_to_tm(readl(ldata->base + RTC_MR), &alarm->time); in pl031_read_alarm()
267 alarm->pending = readl(ldata->base + RTC_RIS) & RTC_BIT_AI; in pl031_read_alarm()
268 alarm->enabled = readl(ldata->base + RTC_IMSC) & RTC_BIT_AI; in pl031_read_alarm()
275 struct pl031_local *ldata = dev_get_drvdata(dev); in pl031_set_alarm() local
277 writel(rtc_tm_to_time64(&alarm->time), ldata->base + RTC_MR); in pl031_set_alarm()
285 struct pl031_local *ldata = dev_get_drvdata(&adev->dev); in pl031_remove() local
290 free_irq(adev->irq[0], ldata); in pl031_remove()
297 struct pl031_local *ldata; in pl031_probe() local
306 ldata = devm_kzalloc(&adev->dev, sizeof(struct pl031_local), in pl031_probe()
310 if (!ldata || !ops) { in pl031_probe()
315 ldata->vendor = vendor; in pl031_probe()
316 ldata->base = devm_ioremap(&adev->dev, adev->res.start, in pl031_probe()
318 if (!ldata->base) { in pl031_probe()
323 amba_set_drvdata(adev, ldata); in pl031_probe()
328 data = readl(ldata->base + RTC_CR); in pl031_probe()
334 writel(data, ldata->base + RTC_CR); in pl031_probe()
341 if (readl(ldata->base + RTC_YDR) == 0x2000) { in pl031_probe()
342 time = readl(ldata->base + RTC_DR); in pl031_probe()
347 writel(0x2000, ldata->base + RTC_YLR); in pl031_probe()
348 writel(time, ldata->base + RTC_LR); in pl031_probe()
354 ldata->rtc = devm_rtc_allocate_device(&adev->dev); in pl031_probe()
355 if (IS_ERR(ldata->rtc)) { in pl031_probe()
356 ret = PTR_ERR(ldata->rtc); in pl031_probe()
361 clear_bit(RTC_FEATURE_ALARM, ldata->rtc->features); in pl031_probe()
363 ldata->rtc->ops = ops; in pl031_probe()
364 ldata->rtc->range_min = vendor->range_min; in pl031_probe()
365 ldata->rtc->range_max = vendor->range_max; in pl031_probe()
367 ret = devm_rtc_register_device(ldata->rtc); in pl031_probe()
373 vendor->irqflags, "rtc-pl031", ldata); in pl031_probe()