• Home
  • Raw
  • Download

Lines Matching refs:rc_dev

28 	struct rc_dev			*rdev;
68 static void st_rc_send_lirc_timeout(struct rc_dev *rdev) in st_rc_send_lirc_timeout()
193 struct st_rc_device *rc_dev = platform_get_drvdata(pdev); in st_rc_remove() local
197 clk_disable_unprepare(rc_dev->sys_clock); in st_rc_remove()
198 rc_unregister_device(rc_dev->rdev); in st_rc_remove()
202 static int st_rc_open(struct rc_dev *rdev) in st_rc_open()
215 static void st_rc_close(struct rc_dev *rdev) in st_rc_close()
226 struct rc_dev *rdev; in st_rc_probe()
229 struct st_rc_device *rc_dev; in st_rc_probe() local
233 rc_dev = devm_kzalloc(dev, sizeof(struct st_rc_device), GFP_KERNEL); in st_rc_probe()
235 if (!rc_dev) in st_rc_probe()
246 rc_dev->rxuhfmode = true; in st_rc_probe()
248 rc_dev->rxuhfmode = false; in st_rc_probe()
258 rc_dev->sys_clock = devm_clk_get(dev, NULL); in st_rc_probe()
259 if (IS_ERR(rc_dev->sys_clock)) { in st_rc_probe()
261 ret = PTR_ERR(rc_dev->sys_clock); in st_rc_probe()
265 rc_dev->irq = platform_get_irq(pdev, 0); in st_rc_probe()
266 if (rc_dev->irq < 0) { in st_rc_probe()
267 ret = rc_dev->irq; in st_rc_probe()
273 rc_dev->base = devm_ioremap_resource(dev, res); in st_rc_probe()
274 if (IS_ERR(rc_dev->base)) { in st_rc_probe()
275 ret = PTR_ERR(rc_dev->base); in st_rc_probe()
279 if (rc_dev->rxuhfmode) in st_rc_probe()
280 rc_dev->rx_base = rc_dev->base + 0x40; in st_rc_probe()
282 rc_dev->rx_base = rc_dev->base; in st_rc_probe()
285 rc_dev->rstc = reset_control_get_optional(dev, NULL); in st_rc_probe()
286 if (IS_ERR(rc_dev->rstc)) in st_rc_probe()
287 rc_dev->rstc = NULL; in st_rc_probe()
289 rc_dev->dev = dev; in st_rc_probe()
290 platform_set_drvdata(pdev, rc_dev); in st_rc_probe()
291 st_rc_hardware_init(rc_dev); in st_rc_probe()
298 rdev->priv = rc_dev; in st_rc_probe()
309 rc_dev->rdev = rdev; in st_rc_probe()
310 if (devm_request_irq(dev, rc_dev->irq, st_rc_rx_interrupt, in st_rc_probe()
311 0, IR_ST_NAME, rc_dev) < 0) { in st_rc_probe()
312 dev_err(dev, "IRQ %d register failed\n", rc_dev->irq); in st_rc_probe()
319 dev_pm_set_wake_irq(dev, rc_dev->irq); in st_rc_probe()
327 dev_info(dev, "setup in %s mode\n", rc_dev->rxuhfmode ? "UHF" : "IR"); in st_rc_probe()
334 clk_disable_unprepare(rc_dev->sys_clock); in st_rc_probe()
344 struct st_rc_device *rc_dev = dev_get_drvdata(dev); in st_rc_suspend() local
347 if (!enable_irq_wake(rc_dev->irq)) in st_rc_suspend()
348 rc_dev->irq_wake = 1; in st_rc_suspend()
353 writel(0x00, rc_dev->rx_base + IRB_RX_EN); in st_rc_suspend()
354 writel(0x00, rc_dev->rx_base + IRB_RX_INT_EN); in st_rc_suspend()
355 clk_disable_unprepare(rc_dev->sys_clock); in st_rc_suspend()
356 if (rc_dev->rstc) in st_rc_suspend()
357 reset_control_assert(rc_dev->rstc); in st_rc_suspend()
365 struct st_rc_device *rc_dev = dev_get_drvdata(dev); in st_rc_resume() local
366 struct rc_dev *rdev = rc_dev->rdev; in st_rc_resume()
368 if (rc_dev->irq_wake) { in st_rc_resume()
369 disable_irq_wake(rc_dev->irq); in st_rc_resume()
370 rc_dev->irq_wake = 0; in st_rc_resume()
373 st_rc_hardware_init(rc_dev); in st_rc_resume()
375 writel(IRB_RX_INTS, rc_dev->rx_base + IRB_RX_INT_EN); in st_rc_resume()
376 writel(0x01, rc_dev->rx_base + IRB_RX_EN); in st_rc_resume()