Lines Matching refs:p
51 static void parport_sunbpp_disable_irq(struct parport *p) in parport_sunbpp_disable_irq() argument
53 struct bpp_regs __iomem *regs = (struct bpp_regs __iomem *)p->base; in parport_sunbpp_disable_irq()
61 static void parport_sunbpp_enable_irq(struct parport *p) in parport_sunbpp_enable_irq() argument
63 struct bpp_regs __iomem *regs = (struct bpp_regs __iomem *)p->base; in parport_sunbpp_enable_irq()
71 static void parport_sunbpp_write_data(struct parport *p, unsigned char d) in parport_sunbpp_write_data() argument
73 struct bpp_regs __iomem *regs = (struct bpp_regs __iomem *)p->base; in parport_sunbpp_write_data()
79 static unsigned char parport_sunbpp_read_data(struct parport *p) in parport_sunbpp_read_data() argument
81 struct bpp_regs __iomem *regs = (struct bpp_regs __iomem *)p->base; in parport_sunbpp_read_data()
86 static unsigned char status_sunbpp_to_pc(struct parport *p) in status_sunbpp_to_pc() argument
88 struct bpp_regs __iomem *regs = (struct bpp_regs __iomem *)p->base; in status_sunbpp_to_pc()
109 static unsigned char control_sunbpp_to_pc(struct parport *p) in control_sunbpp_to_pc() argument
111 struct bpp_regs __iomem *regs = (struct bpp_regs __iomem *)p->base; in control_sunbpp_to_pc()
130 static unsigned char parport_sunbpp_read_control(struct parport *p) in parport_sunbpp_read_control() argument
132 return control_sunbpp_to_pc(p); in parport_sunbpp_read_control()
135 static unsigned char parport_sunbpp_frob_control(struct parport *p, in parport_sunbpp_frob_control() argument
139 struct bpp_regs __iomem *regs = (struct bpp_regs __iomem *)p->base; in parport_sunbpp_frob_control()
178 return parport_sunbpp_read_control(p); in parport_sunbpp_frob_control()
181 static void parport_sunbpp_write_control(struct parport *p, unsigned char d) in parport_sunbpp_write_control() argument
188 parport_sunbpp_frob_control (p, wm, d & wm); in parport_sunbpp_write_control()
191 static unsigned char parport_sunbpp_read_status(struct parport *p) in parport_sunbpp_read_status() argument
193 return status_sunbpp_to_pc(p); in parport_sunbpp_read_status()
196 static void parport_sunbpp_data_forward (struct parport *p) in parport_sunbpp_data_forward() argument
198 struct bpp_regs __iomem *regs = (struct bpp_regs __iomem *)p->base; in parport_sunbpp_data_forward()
206 static void parport_sunbpp_data_reverse (struct parport *p) in parport_sunbpp_data_reverse() argument
208 struct bpp_regs __iomem *regs = (struct bpp_regs __iomem *)p->base; in parport_sunbpp_data_reverse()
222 static void parport_sunbpp_save_state(struct parport *p, struct parport_state *s) in parport_sunbpp_save_state() argument
224 s->u.pc.ctr = parport_sunbpp_read_control(p); in parport_sunbpp_save_state()
227 static void parport_sunbpp_restore_state(struct parport *p, struct parport_state *s) in parport_sunbpp_restore_state() argument
229 parport_sunbpp_write_control(p, s->u.pc.ctr); in parport_sunbpp_restore_state()
276 struct parport *p; in bpp_probe() local
296 if (!(p = parport_register_port((unsigned long)base, irq, dma, ops))) { in bpp_probe()
301 p->size = size; in bpp_probe()
302 p->dev = &op->dev; in bpp_probe()
304 if ((err = request_irq(p->irq, parport_irq_handler, in bpp_probe()
305 IRQF_SHARED, p->name, p)) != 0) { in bpp_probe()
309 parport_sunbpp_enable_irq(p); in bpp_probe()
311 regs = (struct bpp_regs __iomem *)p->base; in bpp_probe()
317 pr_info("%s: sunbpp at 0x%lx\n", p->name, p->base); in bpp_probe()
319 dev_set_drvdata(&op->dev, p); in bpp_probe()
321 parport_announce_port(p); in bpp_probe()
326 parport_put_port(p); in bpp_probe()
339 struct parport *p = dev_get_drvdata(&op->dev); in bpp_remove() local
340 struct parport_operations *ops = p->ops; in bpp_remove()
342 parport_remove_port(p); in bpp_remove()
344 if (p->irq != PARPORT_IRQ_NONE) { in bpp_remove()
345 parport_sunbpp_disable_irq(p); in bpp_remove()
346 free_irq(p->irq, p); in bpp_remove()
349 of_iounmap(&op->resource[0], (void __iomem *) p->base, p->size); in bpp_remove()
350 parport_put_port(p); in bpp_remove()