Lines Matching refs:r
33 static void clear_sbcr(struct pxa930_rotary *r) in clear_sbcr() argument
35 uint32_t sbcr = __raw_readl(r->mmio_base + SBCR); in clear_sbcr()
37 __raw_writel(sbcr | SBCR_ERSB, r->mmio_base + SBCR); in clear_sbcr()
38 __raw_writel(sbcr & ~SBCR_ERSB, r->mmio_base + SBCR); in clear_sbcr()
43 struct pxa930_rotary *r = dev_id; in rotary_irq() local
44 struct pxa930_rotary_platform_data *pdata = r->pdata; in rotary_irq()
47 ercr = __raw_readl(r->mmio_base + ERCR) & 0xf; in rotary_irq()
48 clear_sbcr(r); in rotary_irq()
50 delta = ercr - r->last_ercr; in rotary_irq()
54 r->last_ercr = ercr; in rotary_irq()
58 input_report_key(r->input_dev, key, 1); in rotary_irq()
59 input_sync(r->input_dev); in rotary_irq()
60 input_report_key(r->input_dev, key, 0); in rotary_irq()
62 input_report_rel(r->input_dev, pdata->rel_code, delta); in rotary_irq()
64 input_sync(r->input_dev); in rotary_irq()
71 struct pxa930_rotary *r = input_get_drvdata(dev); in pxa930_rotary_open() local
73 clear_sbcr(r); in pxa930_rotary_open()
80 struct pxa930_rotary *r = input_get_drvdata(dev); in pxa930_rotary_close() local
82 clear_sbcr(r); in pxa930_rotary_close()
88 struct pxa930_rotary *r; in pxa930_rotary_probe() local
111 r = kzalloc(sizeof(struct pxa930_rotary), GFP_KERNEL); in pxa930_rotary_probe()
112 if (!r) in pxa930_rotary_probe()
115 r->mmio_base = ioremap_nocache(res->start, resource_size(res)); in pxa930_rotary_probe()
116 if (r->mmio_base == NULL) { in pxa930_rotary_probe()
122 r->pdata = pdata; in pxa930_rotary_probe()
123 platform_set_drvdata(pdev, r); in pxa930_rotary_probe()
148 r->input_dev = input_dev; in pxa930_rotary_probe()
149 input_set_drvdata(input_dev, r); in pxa930_rotary_probe()
152 "enhanced rotary", r); in pxa930_rotary_probe()
167 free_irq(irq, r); in pxa930_rotary_probe()
171 iounmap(r->mmio_base); in pxa930_rotary_probe()
173 kfree(r); in pxa930_rotary_probe()
179 struct pxa930_rotary *r = platform_get_drvdata(pdev); in pxa930_rotary_remove() local
181 free_irq(platform_get_irq(pdev, 0), r); in pxa930_rotary_remove()
182 input_unregister_device(r->input_dev); in pxa930_rotary_remove()
183 iounmap(r->mmio_base); in pxa930_rotary_remove()
185 kfree(r); in pxa930_rotary_remove()