Lines Matching defs:ppi

2  * ppi.c Analog Devices Parallel Peripheral Interface driver
30 #include <media/blackfin/ppi.h>
32 static int ppi_attach_irq(struct ppi_if *ppi, irq_handler_t handler);
33 static void ppi_detach_irq(struct ppi_if *ppi);
34 static int ppi_start(struct ppi_if *ppi);
35 static int ppi_stop(struct ppi_if *ppi);
36 static int ppi_set_params(struct ppi_if *ppi, struct ppi_params *params);
37 static void ppi_update_addr(struct ppi_if *ppi, unsigned long addr);
50 struct ppi_if *ppi = dev_id;
51 const struct ppi_info *info = ppi->info;
64 ppi->err = true;
75 ppi->err = true;
86 ppi->err = true;
97 static int ppi_attach_irq(struct ppi_if *ppi, irq_handler_t handler)
99 const struct ppi_info *info = ppi->info;
108 set_dma_callback(info->dma_ch, handler, ppi);
110 if (ppi->err_int) {
111 ret = request_irq(info->irq_err, ppi_irq_err, 0, "PPI ERROR", ppi);
120 static void ppi_detach_irq(struct ppi_if *ppi)
122 const struct ppi_info *info = ppi->info;
124 if (ppi->err_int)
125 free_irq(info->irq_err, ppi);
129 static int ppi_start(struct ppi_if *ppi)
131 const struct ppi_info *info = ppi->info;
137 ppi->ppi_control |= PORT_EN;
142 bfin_write16(&reg->control, ppi->ppi_control);
148 bfin_write32(&reg->control, ppi->ppi_control);
154 bfin_write32(&reg->ctl, ppi->ppi_control);
165 static int ppi_stop(struct ppi_if *ppi)
167 const struct ppi_info *info = ppi->info;
170 ppi->ppi_control &= ~PORT_EN;
175 bfin_write16(&reg->control, ppi->ppi_control);
181 bfin_write32(&reg->control, ppi->ppi_control);
187 bfin_write32(&reg->ctl, ppi->ppi_control);
202 static int ppi_set_params(struct ppi_if *ppi, struct ppi_params *params)
204 const struct ppi_info *info = ppi->info;
216 pctrl = devm_pinctrl_get(ppi->dev);
229 ppi->err_int = false;
231 ppi->err_int = true;
234 ppi->ppi_control = params->ppi_control & ~PORT_EN;
235 if (!(ppi->ppi_control & PORT_DIR))
245 bfin_write16(&reg->control, ppi->ppi_control);
258 bfin_write32(&reg->control, ppi->ppi_control);
275 bfin_write32(&reg->ctl, ppi->ppi_control);
284 if (ppi->ppi_control & PORT_DIR) {
320 static void ppi_update_addr(struct ppi_if *ppi, unsigned long addr)
322 set_dma_start_addr(ppi->info->dma_ch, addr);
328 struct ppi_if *ppi;
340 ppi = kzalloc(sizeof(*ppi), GFP_KERNEL);
341 if (!ppi) {
343 dev_err(&pdev->dev, "unable to allocate memory for ppi handle\n");
346 ppi->ops = &ppi_ops;
347 ppi->info = info;
348 ppi->dev = &pdev->dev;
350 pr_info("ppi probe success\n");
351 return ppi;
355 void ppi_delete_instance(struct ppi_if *ppi)
357 peripheral_free_list(ppi->info->pin_req);
358 kfree(ppi);