• Home
  • Raw
  • Download

Lines Matching refs:rtap

55 	struct coh901331_port *rtap = data;  in coh901331_interrupt()  local
57 clk_enable(rtap->clk); in coh901331_interrupt()
59 writel(1, rtap->virtbase + COH901331_IRQ_EVENT); in coh901331_interrupt()
67 writel(0, rtap->virtbase + COH901331_IRQ_MASK); in coh901331_interrupt()
68 clk_disable(rtap->clk); in coh901331_interrupt()
71 rtc_update_irq(rtap->rtc, 1, RTC_AF); in coh901331_interrupt()
78 struct coh901331_port *rtap = dev_get_drvdata(dev); in coh901331_read_time() local
80 clk_enable(rtap->clk); in coh901331_read_time()
82 if (readl(rtap->virtbase + COH901331_VALID)) { in coh901331_read_time()
83 rtc_time_to_tm(readl(rtap->virtbase + COH901331_CUR_TIME), tm); in coh901331_read_time()
84 clk_disable(rtap->clk); in coh901331_read_time()
87 clk_disable(rtap->clk); in coh901331_read_time()
93 struct coh901331_port *rtap = dev_get_drvdata(dev); in coh901331_set_mmss() local
95 clk_enable(rtap->clk); in coh901331_set_mmss()
96 writel(secs, rtap->virtbase + COH901331_SET_TIME); in coh901331_set_mmss()
97 clk_disable(rtap->clk); in coh901331_set_mmss()
104 struct coh901331_port *rtap = dev_get_drvdata(dev); in coh901331_read_alarm() local
106 clk_enable(rtap->clk); in coh901331_read_alarm()
107 rtc_time_to_tm(readl(rtap->virtbase + COH901331_ALARM), &alarm->time); in coh901331_read_alarm()
108 alarm->pending = readl(rtap->virtbase + COH901331_IRQ_EVENT) & 1U; in coh901331_read_alarm()
109 alarm->enabled = readl(rtap->virtbase + COH901331_IRQ_MASK) & 1U; in coh901331_read_alarm()
110 clk_disable(rtap->clk); in coh901331_read_alarm()
117 struct coh901331_port *rtap = dev_get_drvdata(dev); in coh901331_set_alarm() local
121 clk_enable(rtap->clk); in coh901331_set_alarm()
122 writel(time, rtap->virtbase + COH901331_ALARM); in coh901331_set_alarm()
123 writel(alarm->enabled, rtap->virtbase + COH901331_IRQ_MASK); in coh901331_set_alarm()
124 clk_disable(rtap->clk); in coh901331_set_alarm()
131 struct coh901331_port *rtap = dev_get_drvdata(dev); in coh901331_alarm_irq_enable() local
133 clk_enable(rtap->clk); in coh901331_alarm_irq_enable()
135 writel(1, rtap->virtbase + COH901331_IRQ_MASK); in coh901331_alarm_irq_enable()
137 writel(0, rtap->virtbase + COH901331_IRQ_MASK); in coh901331_alarm_irq_enable()
138 clk_disable(rtap->clk); in coh901331_alarm_irq_enable()
153 struct coh901331_port *rtap = platform_get_drvdata(pdev); in coh901331_remove() local
155 if (rtap) in coh901331_remove()
156 clk_unprepare(rtap->clk); in coh901331_remove()
165 struct coh901331_port *rtap; in coh901331_probe() local
168 rtap = devm_kzalloc(&pdev->dev, in coh901331_probe()
170 if (!rtap) in coh901331_probe()
174 rtap->virtbase = devm_ioremap_resource(&pdev->dev, res); in coh901331_probe()
175 if (IS_ERR(rtap->virtbase)) in coh901331_probe()
176 return PTR_ERR(rtap->virtbase); in coh901331_probe()
178 rtap->irq = platform_get_irq(pdev, 0); in coh901331_probe()
179 if (devm_request_irq(&pdev->dev, rtap->irq, coh901331_interrupt, 0, in coh901331_probe()
180 "RTC COH 901 331 Alarm", rtap)) in coh901331_probe()
183 rtap->clk = devm_clk_get(&pdev->dev, NULL); in coh901331_probe()
184 if (IS_ERR(rtap->clk)) { in coh901331_probe()
185 ret = PTR_ERR(rtap->clk); in coh901331_probe()
191 ret = clk_prepare_enable(rtap->clk); in coh901331_probe()
196 clk_disable(rtap->clk); in coh901331_probe()
198 platform_set_drvdata(pdev, rtap); in coh901331_probe()
199 rtap->rtc = devm_rtc_device_register(&pdev->dev, "coh901331", in coh901331_probe()
201 if (IS_ERR(rtap->rtc)) { in coh901331_probe()
202 ret = PTR_ERR(rtap->rtc); in coh901331_probe()
209 clk_unprepare(rtap->clk); in coh901331_probe()
216 struct coh901331_port *rtap = dev_get_drvdata(dev); in coh901331_suspend() local
224 enable_irq_wake(rtap->irq); in coh901331_suspend()
226 clk_enable(rtap->clk); in coh901331_suspend()
227 rtap->irqmaskstore = readl(rtap->virtbase + COH901331_IRQ_MASK); in coh901331_suspend()
228 writel(0, rtap->virtbase + COH901331_IRQ_MASK); in coh901331_suspend()
229 clk_disable(rtap->clk); in coh901331_suspend()
231 clk_unprepare(rtap->clk); in coh901331_suspend()
237 struct coh901331_port *rtap = dev_get_drvdata(dev); in coh901331_resume() local
239 clk_prepare(rtap->clk); in coh901331_resume()
241 disable_irq_wake(rtap->irq); in coh901331_resume()
243 clk_enable(rtap->clk); in coh901331_resume()
244 writel(rtap->irqmaskstore, rtap->virtbase + COH901331_IRQ_MASK); in coh901331_resume()
245 clk_disable(rtap->clk); in coh901331_resume()
255 struct coh901331_port *rtap = platform_get_drvdata(pdev); in coh901331_shutdown() local
257 clk_enable(rtap->clk); in coh901331_shutdown()
258 writel(0, rtap->virtbase + COH901331_IRQ_MASK); in coh901331_shutdown()
259 clk_disable_unprepare(rtap->clk); in coh901331_shutdown()