Lines Matching refs:p

50 static void __ebus_dma_reset(struct ebus_dma_info *p, int no_drain)  in __ebus_dma_reset()  argument
55 writel(EBDMA_CSR_RESET, p->regs + EBDMA_CSR); in __ebus_dma_reset()
62 val = readl(p->regs + EBDMA_CSR); in __ebus_dma_reset()
72 struct ebus_dma_info *p = dev_id; in ebus_dma_irq() local
76 spin_lock_irqsave(&p->lock, flags); in ebus_dma_irq()
77 csr = readl(p->regs + EBDMA_CSR); in ebus_dma_irq()
78 writel(csr, p->regs + EBDMA_CSR); in ebus_dma_irq()
79 spin_unlock_irqrestore(&p->lock, flags); in ebus_dma_irq()
82 printk(KERN_CRIT "ebus_dma(%s): DMA error!\n", p->name); in ebus_dma_irq()
83 p->callback(p, EBUS_DMA_EVENT_ERROR, p->client_cookie); in ebus_dma_irq()
86 p->callback(p, in ebus_dma_irq()
89 p->client_cookie); in ebus_dma_irq()
97 int ebus_dma_register(struct ebus_dma_info *p) in ebus_dma_register() argument
101 if (!p->regs) in ebus_dma_register()
103 if (p->flags & ~(EBUS_DMA_FLAG_USE_EBDMA_HANDLER | in ebus_dma_register()
106 if ((p->flags & EBUS_DMA_FLAG_USE_EBDMA_HANDLER) && !p->callback) in ebus_dma_register()
108 if (!strlen(p->name)) in ebus_dma_register()
111 __ebus_dma_reset(p, 1); in ebus_dma_register()
115 if (p->flags & EBUS_DMA_FLAG_TCI_DISABLE) in ebus_dma_register()
118 writel(csr, p->regs + EBDMA_CSR); in ebus_dma_register()
124 int ebus_dma_irq_enable(struct ebus_dma_info *p, int on) in ebus_dma_irq_enable() argument
130 if (p->flags & EBUS_DMA_FLAG_USE_EBDMA_HANDLER) { in ebus_dma_irq_enable()
131 if (request_irq(p->irq, ebus_dma_irq, IRQF_SHARED, p->name, p)) in ebus_dma_irq_enable()
135 spin_lock_irqsave(&p->lock, flags); in ebus_dma_irq_enable()
136 csr = readl(p->regs + EBDMA_CSR); in ebus_dma_irq_enable()
138 writel(csr, p->regs + EBDMA_CSR); in ebus_dma_irq_enable()
139 spin_unlock_irqrestore(&p->lock, flags); in ebus_dma_irq_enable()
141 spin_lock_irqsave(&p->lock, flags); in ebus_dma_irq_enable()
142 csr = readl(p->regs + EBDMA_CSR); in ebus_dma_irq_enable()
144 writel(csr, p->regs + EBDMA_CSR); in ebus_dma_irq_enable()
145 spin_unlock_irqrestore(&p->lock, flags); in ebus_dma_irq_enable()
147 if (p->flags & EBUS_DMA_FLAG_USE_EBDMA_HANDLER) { in ebus_dma_irq_enable()
148 free_irq(p->irq, p); in ebus_dma_irq_enable()
156 void ebus_dma_unregister(struct ebus_dma_info *p) in ebus_dma_unregister() argument
162 spin_lock_irqsave(&p->lock, flags); in ebus_dma_unregister()
163 csr = readl(p->regs + EBDMA_CSR); in ebus_dma_unregister()
166 writel(csr, p->regs + EBDMA_CSR); in ebus_dma_unregister()
169 spin_unlock_irqrestore(&p->lock, flags); in ebus_dma_unregister()
172 free_irq(p->irq, p); in ebus_dma_unregister()
176 int ebus_dma_request(struct ebus_dma_info *p, dma_addr_t bus_addr, size_t len) in ebus_dma_request() argument
185 spin_lock_irqsave(&p->lock, flags); in ebus_dma_request()
186 csr = readl(p->regs + EBDMA_CSR); in ebus_dma_request()
194 writel(len, p->regs + EBDMA_COUNT); in ebus_dma_request()
195 writel(bus_addr, p->regs + EBDMA_ADDR); in ebus_dma_request()
199 spin_unlock_irqrestore(&p->lock, flags); in ebus_dma_request()
205 void ebus_dma_prepare(struct ebus_dma_info *p, int write) in ebus_dma_prepare() argument
210 spin_lock_irqsave(&p->lock, flags); in ebus_dma_prepare()
211 __ebus_dma_reset(p, 0); in ebus_dma_prepare()
220 if (p->flags & EBUS_DMA_FLAG_TCI_DISABLE) in ebus_dma_prepare()
223 writel(csr, p->regs + EBDMA_CSR); in ebus_dma_prepare()
225 spin_unlock_irqrestore(&p->lock, flags); in ebus_dma_prepare()
229 unsigned int ebus_dma_residue(struct ebus_dma_info *p) in ebus_dma_residue() argument
231 return readl(p->regs + EBDMA_COUNT); in ebus_dma_residue()
235 unsigned int ebus_dma_addr(struct ebus_dma_info *p) in ebus_dma_addr() argument
237 return readl(p->regs + EBDMA_ADDR); in ebus_dma_addr()
241 void ebus_dma_enable(struct ebus_dma_info *p, int on) in ebus_dma_enable() argument
246 spin_lock_irqsave(&p->lock, flags); in ebus_dma_enable()
247 orig_csr = csr = readl(p->regs + EBDMA_CSR); in ebus_dma_enable()
254 writel(csr, p->regs + EBDMA_CSR); in ebus_dma_enable()
255 spin_unlock_irqrestore(&p->lock, flags); in ebus_dma_enable()