Lines Matching refs:plat_dev
157 struct platform_device *plat_dev = dev_id; in sp_rtc_irq_handler() local
158 struct sunplus_rtc *sp_rtc = dev_get_drvdata(&plat_dev->dev); in sp_rtc_irq_handler()
161 dev_dbg(&plat_dev->dev, "[RTC] ALARM INT\n"); in sp_rtc_irq_handler()
229 static int sp_rtc_probe(struct platform_device *plat_dev) in sp_rtc_probe() argument
234 sp_rtc = devm_kzalloc(&plat_dev->dev, sizeof(*sp_rtc), GFP_KERNEL); in sp_rtc_probe()
238 sp_rtc->res = platform_get_resource_byname(plat_dev, IORESOURCE_MEM, RTC_REG_NAME); in sp_rtc_probe()
239 sp_rtc->reg_base = devm_ioremap_resource(&plat_dev->dev, sp_rtc->res); in sp_rtc_probe()
241 return dev_err_probe(&plat_dev->dev, PTR_ERR(sp_rtc->reg_base), in sp_rtc_probe()
243 dev_dbg(&plat_dev->dev, "res = 0x%x, reg_base = 0x%lx\n", in sp_rtc_probe()
246 sp_rtc->irq = platform_get_irq(plat_dev, 0); in sp_rtc_probe()
248 return dev_err_probe(&plat_dev->dev, sp_rtc->irq, "platform_get_irq failed\n"); in sp_rtc_probe()
250 ret = devm_request_irq(&plat_dev->dev, sp_rtc->irq, sp_rtc_irq_handler, in sp_rtc_probe()
251 IRQF_TRIGGER_RISING, "rtc irq", plat_dev); in sp_rtc_probe()
253 return dev_err_probe(&plat_dev->dev, ret, "devm_request_irq failed:\n"); in sp_rtc_probe()
255 sp_rtc->rtcclk = devm_clk_get(&plat_dev->dev, NULL); in sp_rtc_probe()
257 return dev_err_probe(&plat_dev->dev, PTR_ERR(sp_rtc->rtcclk), in sp_rtc_probe()
260 sp_rtc->rstc = devm_reset_control_get_exclusive(&plat_dev->dev, NULL); in sp_rtc_probe()
262 return dev_err_probe(&plat_dev->dev, PTR_ERR(sp_rtc->rstc), in sp_rtc_probe()
273 device_init_wakeup(&plat_dev->dev, 1); in sp_rtc_probe()
274 dev_set_drvdata(&plat_dev->dev, sp_rtc); in sp_rtc_probe()
276 sp_rtc->rtc = devm_rtc_allocate_device(&plat_dev->dev); in sp_rtc_probe()
291 if (plat_dev->dev.of_node) in sp_rtc_probe()
292 sp_rtc_set_trickle_charger(plat_dev->dev); in sp_rtc_probe()
307 static int sp_rtc_remove(struct platform_device *plat_dev) in sp_rtc_remove() argument
309 struct sunplus_rtc *sp_rtc = dev_get_drvdata(&plat_dev->dev); in sp_rtc_remove()
311 device_init_wakeup(&plat_dev->dev, 0); in sp_rtc_remove()