Lines Matching refs:pdev

148 static int xgene_rtc_probe(struct platform_device *pdev)  in xgene_rtc_probe()  argument
155 pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); in xgene_rtc_probe()
158 platform_set_drvdata(pdev, pdata); in xgene_rtc_probe()
159 pdata->dev = &pdev->dev; in xgene_rtc_probe()
161 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); in xgene_rtc_probe()
162 pdata->csr_base = devm_ioremap_resource(&pdev->dev, res); in xgene_rtc_probe()
166 irq = platform_get_irq(pdev, 0); in xgene_rtc_probe()
168 dev_err(&pdev->dev, "No IRQ resource\n"); in xgene_rtc_probe()
171 ret = devm_request_irq(&pdev->dev, irq, xgene_rtc_interrupt, 0, in xgene_rtc_probe()
172 dev_name(&pdev->dev), pdata); in xgene_rtc_probe()
174 dev_err(&pdev->dev, "Could not request IRQ\n"); in xgene_rtc_probe()
178 pdata->clk = devm_clk_get(&pdev->dev, NULL); in xgene_rtc_probe()
180 dev_err(&pdev->dev, "Couldn't get the clock for RTC\n"); in xgene_rtc_probe()
188 device_init_wakeup(&pdev->dev, 1); in xgene_rtc_probe()
190 pdata->rtc = devm_rtc_device_register(&pdev->dev, pdev->name, in xgene_rtc_probe()
203 static int xgene_rtc_remove(struct platform_device *pdev) in xgene_rtc_remove() argument
205 struct xgene_rtc_dev *pdata = platform_get_drvdata(pdev); in xgene_rtc_remove()
207 xgene_rtc_alarm_irq_enable(&pdev->dev, 0); in xgene_rtc_remove()
208 device_init_wakeup(&pdev->dev, 0); in xgene_rtc_remove()
216 struct platform_device *pdev = to_platform_device(dev); in xgene_rtc_suspend() local
217 struct xgene_rtc_dev *pdata = platform_get_drvdata(pdev); in xgene_rtc_suspend()
220 irq = platform_get_irq(pdev, 0); in xgene_rtc_suspend()
221 if (device_may_wakeup(&pdev->dev)) { in xgene_rtc_suspend()
234 struct platform_device *pdev = to_platform_device(dev); in xgene_rtc_resume() local
235 struct xgene_rtc_dev *pdata = platform_get_drvdata(pdev); in xgene_rtc_resume()
238 irq = platform_get_irq(pdev, 0); in xgene_rtc_resume()
239 if (device_may_wakeup(&pdev->dev)) { in xgene_rtc_resume()