20 #include <linux/slab.h>
24 #include <asm/cacheflush.h>
31 static void ppi_detach_irq(
struct ppi_if *ppi);
32 static int ppi_start(
struct ppi_if *ppi);
33 static int ppi_stop(
struct ppi_if *ppi);
35 static void ppi_update_addr(
struct ppi_if *ppi,
unsigned long addr);
39 .detach_irq = ppi_detach_irq,
42 .set_params = ppi_set_params,
43 .update_addr = ppi_update_addr,
85 pr_err(
"Unable to allocate DMA channel for PPI\n");
93 pr_err(
"Unable to allocate IRQ for PPI\n");
100 static void ppi_detach_irq(
struct ppi_if *ppi)
109 static int ppi_start(
struct ppi_if *ppi)
118 switch (info->
type) {
139 static int ppi_stop(
struct ppi_if *ppi)
145 switch (info->
type) {
163 clear_dma_irqstat(info->
dma_ch);
174 int dma_config, bytes_per_line, lines_per_frame;
176 bytes_per_line = params->
width * params->
bpp / 8;
177 lines_per_frame = params->
height;
185 switch (info->
type) {
221 set_dma_x_count(info->
dma_ch, bytes_per_line >> 2);
222 set_dma_x_modify(info->
dma_ch, 4);
223 set_dma_y_modify(info->
dma_ch, 4);
226 set_dma_x_count(info->
dma_ch, bytes_per_line >> 1);
227 set_dma_x_modify(info->
dma_ch, 2);
228 set_dma_y_modify(info->
dma_ch, 2);
230 set_dma_y_count(info->
dma_ch, lines_per_frame);
231 set_dma_config(info->
dma_ch, dma_config);
237 static void ppi_update_addr(
struct ppi_if *ppi,
unsigned long addr)
239 set_dma_start_addr(ppi->
info->dma_ch, addr);
250 pr_err(
"request peripheral failed\n");
257 pr_err(
"unable to allocate memory for ppi handle\n");
263 pr_info(
"ppi probe success\n");