Lines Matching refs:rc_dev

25 	struct rc_dev			*rdev;
65 static void st_rc_send_lirc_timeout(struct rc_dev *rdev) in st_rc_send_lirc_timeout()
200 struct st_rc_device *rc_dev = platform_get_drvdata(pdev); in st_rc_remove() local
204 clk_disable_unprepare(rc_dev->sys_clock); in st_rc_remove()
205 rc_unregister_device(rc_dev->rdev); in st_rc_remove()
208 static int st_rc_open(struct rc_dev *rdev) in st_rc_open()
221 static void st_rc_close(struct rc_dev *rdev) in st_rc_close()
232 struct rc_dev *rdev; in st_rc_probe()
234 struct st_rc_device *rc_dev; in st_rc_probe() local
238 rc_dev = devm_kzalloc(dev, sizeof(struct st_rc_device), GFP_KERNEL); in st_rc_probe()
240 if (!rc_dev) in st_rc_probe()
251 rc_dev->rxuhfmode = true; in st_rc_probe()
253 rc_dev->rxuhfmode = false; in st_rc_probe()
263 rc_dev->sys_clock = devm_clk_get(dev, NULL); in st_rc_probe()
264 if (IS_ERR(rc_dev->sys_clock)) { in st_rc_probe()
266 ret = PTR_ERR(rc_dev->sys_clock); in st_rc_probe()
270 rc_dev->irq = platform_get_irq(pdev, 0); in st_rc_probe()
271 if (rc_dev->irq < 0) { in st_rc_probe()
272 ret = rc_dev->irq; in st_rc_probe()
276 rc_dev->base = devm_platform_ioremap_resource(pdev, 0); in st_rc_probe()
277 if (IS_ERR(rc_dev->base)) { in st_rc_probe()
278 ret = PTR_ERR(rc_dev->base); in st_rc_probe()
282 if (rc_dev->rxuhfmode) in st_rc_probe()
283 rc_dev->rx_base = rc_dev->base + 0x40; in st_rc_probe()
285 rc_dev->rx_base = rc_dev->base; in st_rc_probe()
287 rc_dev->rstc = reset_control_get_optional_exclusive(dev, NULL); in st_rc_probe()
288 if (IS_ERR(rc_dev->rstc)) { in st_rc_probe()
289 ret = PTR_ERR(rc_dev->rstc); in st_rc_probe()
293 rc_dev->dev = dev; in st_rc_probe()
294 platform_set_drvdata(pdev, rc_dev); in st_rc_probe()
295 ret = st_rc_hardware_init(rc_dev); in st_rc_probe()
303 rdev->priv = rc_dev; in st_rc_probe()
314 rc_dev->rdev = rdev; in st_rc_probe()
315 if (devm_request_irq(dev, rc_dev->irq, st_rc_rx_interrupt, in st_rc_probe()
316 0, IR_ST_NAME, rc_dev) < 0) { in st_rc_probe()
317 dev_err(dev, "IRQ %d register failed\n", rc_dev->irq); in st_rc_probe()
324 dev_pm_set_wake_irq(dev, rc_dev->irq); in st_rc_probe()
332 dev_info(dev, "setup in %s mode\n", rc_dev->rxuhfmode ? "UHF" : "IR"); in st_rc_probe()
339 clk_disable_unprepare(rc_dev->sys_clock); in st_rc_probe()
349 struct st_rc_device *rc_dev = dev_get_drvdata(dev); in st_rc_suspend() local
352 if (!enable_irq_wake(rc_dev->irq)) in st_rc_suspend()
353 rc_dev->irq_wake = 1; in st_rc_suspend()
358 writel(0x00, rc_dev->rx_base + IRB_RX_EN); in st_rc_suspend()
359 writel(0x00, rc_dev->rx_base + IRB_RX_INT_EN); in st_rc_suspend()
360 clk_disable_unprepare(rc_dev->sys_clock); in st_rc_suspend()
361 reset_control_assert(rc_dev->rstc); in st_rc_suspend()
370 struct st_rc_device *rc_dev = dev_get_drvdata(dev); in st_rc_resume() local
371 struct rc_dev *rdev = rc_dev->rdev; in st_rc_resume()
373 if (rc_dev->irq_wake) { in st_rc_resume()
374 disable_irq_wake(rc_dev->irq); in st_rc_resume()
375 rc_dev->irq_wake = 0; in st_rc_resume()
378 ret = st_rc_hardware_init(rc_dev); in st_rc_resume()
383 writel(IRB_RX_INTS, rc_dev->rx_base + IRB_RX_INT_EN); in st_rc_resume()
384 writel(0x01, rc_dev->rx_base + IRB_RX_EN); in st_rc_resume()