Lines Matching refs:drvdata
86 static int xps2_recv(struct xps2data *drvdata, u8 *byte) in xps2_recv() argument
92 sr = in_be32(drvdata->base_address + XPS2_STATUS_OFFSET); in xps2_recv()
94 *byte = in_be32(drvdata->base_address + XPS2_RX_DATA_OFFSET); in xps2_recv()
106 struct xps2data *drvdata = dev_id; in xps2_interrupt() local
112 intr_sr = in_be32(drvdata->base_address + XPS2_IPISR_OFFSET); in xps2_interrupt()
113 out_be32(drvdata->base_address + XPS2_IPISR_OFFSET, intr_sr); in xps2_interrupt()
117 dev_warn(drvdata->dev, "receive overrun error\n"); in xps2_interrupt()
120 drvdata->flags |= SERIO_PARITY; in xps2_interrupt()
123 drvdata->flags |= SERIO_TIMEOUT; in xps2_interrupt()
126 status = xps2_recv(drvdata, &c); in xps2_interrupt()
130 dev_err(drvdata->dev, in xps2_interrupt()
133 serio_interrupt(drvdata->serio, c, drvdata->flags); in xps2_interrupt()
134 drvdata->flags = 0; in xps2_interrupt()
157 struct xps2data *drvdata = pserio->port_data; in sxps2_write() local
162 spin_lock_irqsave(&drvdata->lock, flags); in sxps2_write()
165 sr = in_be32(drvdata->base_address + XPS2_STATUS_OFFSET); in sxps2_write()
167 out_be32(drvdata->base_address + XPS2_TX_DATA_OFFSET, c); in sxps2_write()
171 spin_unlock_irqrestore(&drvdata->lock, flags); in sxps2_write()
184 struct xps2data *drvdata = pserio->port_data; in sxps2_open() local
188 error = request_irq(drvdata->irq, &xps2_interrupt, 0, in sxps2_open()
189 DRIVER_NAME, drvdata); in sxps2_open()
191 dev_err(drvdata->dev, in sxps2_open()
192 "Couldn't allocate interrupt %d\n", drvdata->irq); in sxps2_open()
197 out_be32(drvdata->base_address + XPS2_GIER_OFFSET, XPS2_GIER_GIE_MASK); in sxps2_open()
198 out_be32(drvdata->base_address + XPS2_IPIER_OFFSET, XPS2_IPIXR_RX_ALL); in sxps2_open()
199 (void)xps2_recv(drvdata, &c); in sxps2_open()
212 struct xps2data *drvdata = pserio->port_data; in sxps2_close() local
215 out_be32(drvdata->base_address + XPS2_GIER_OFFSET, 0x00); in sxps2_close()
216 out_be32(drvdata->base_address + XPS2_IPIER_OFFSET, 0x00); in sxps2_close()
217 free_irq(drvdata->irq, drvdata); in sxps2_close()
233 struct xps2data *drvdata; in xps2_of_probe() local
256 drvdata = kzalloc(sizeof(struct xps2data), GFP_KERNEL); in xps2_of_probe()
258 if (!drvdata || !serio) { in xps2_of_probe()
263 spin_lock_init(&drvdata->lock); in xps2_of_probe()
264 drvdata->irq = irq; in xps2_of_probe()
265 drvdata->serio = serio; in xps2_of_probe()
266 drvdata->dev = dev; in xps2_of_probe()
278 drvdata->base_address = ioremap(phys_addr, remap_size); in xps2_of_probe()
279 if (drvdata->base_address == NULL) { in xps2_of_probe()
287 out_be32(drvdata->base_address + XPS2_IPIER_OFFSET, 0); in xps2_of_probe()
293 out_be32(drvdata->base_address + XPS2_SRST_OFFSET, XPS2_SRST_RESET); in xps2_of_probe()
296 (unsigned long long)phys_addr, drvdata->base_address, in xps2_of_probe()
297 drvdata->irq); in xps2_of_probe()
303 serio->port_data = drvdata; in xps2_of_probe()
312 platform_set_drvdata(ofdev, drvdata); in xps2_of_probe()
319 kfree(drvdata); in xps2_of_probe()
334 struct xps2data *drvdata = platform_get_drvdata(of_dev); in xps2_of_remove() local
337 serio_unregister_port(drvdata->serio); in xps2_of_remove()
338 iounmap(drvdata->base_address); in xps2_of_remove()
342 dev_err(drvdata->dev, "invalid address\n"); in xps2_of_remove()
346 kfree(drvdata); in xps2_of_remove()