Title: [5329] trunk/drivers/media/video/blackfin: There have been a few requests for using the Blackfin Cam driver with
Revision
5329
Author
hennerich
Date
2008-09-23 06:42:10 -0500 (Tue, 23 Sep 2008)

Log Message

There have been a few requests for using the Blackfin Cam driver with
BF54x EPPI.
This is a simple patch enables EPPI1 instead of PPI.
For further information see:
http://docs.blackfin.uclinux.org/doku.php?id=linux-kernel:drivers:v4l_blackfin_camera

Modified Paths

Diff

Modified: trunk/drivers/media/video/blackfin/blackfin_cam.c (5328 => 5329)


--- trunk/drivers/media/video/blackfin/blackfin_cam.c	2008-09-23 00:12:15 UTC (rev 5328)
+++ trunk/drivers/media/video/blackfin/blackfin_cam.c	2008-09-23 11:42:10 UTC (rev 5329)
@@ -193,7 +193,7 @@
 	bfin_write_PPI_CONTROL(pdev->ppi_control & ~PORT_EN);
 	bfin_write_PPI_DELAY(pdev->ppi_delay);
 #if !defined(USE_ITU656)
-	bfin_write_PPI_COUNT(pdev->pixel_per_line - 1);
+	bfin_write_PPI_COUNT(pdev->pixel_per_line - PPI_COUNT_CORR_OFFSET);
 #endif
 	bfin_write_PPI_FRAME(pdev->lines_per_frame);
 }
@@ -321,9 +321,9 @@
 
 #if !defined(USE_ITU656)
 	if (bcap_dev->ppidev->bpp > 8)
-		bfin_write_PPI_COUNT(bcap_dev->ppidev->pixel_per_line * 2 - 1);
+		bfin_write_PPI_COUNT(bcap_dev->ppidev->pixel_per_line * 2 - PPI_COUNT_CORR_OFFSET);
 	else
-		bfin_write_PPI_COUNT(bcap_dev->ppidev->pixel_per_line - 1);
+		bfin_write_PPI_COUNT(bcap_dev->ppidev->pixel_per_line - PPI_COUNT_CORR_OFFSET);
 #endif
 
 	if (bcap_dev->ppidev->dma_config & WDSIZE_16) {

Modified: trunk/drivers/media/video/blackfin/blackfin_cam.h (5328 => 5329)


--- trunk/drivers/media/video/blackfin/blackfin_cam.h	2008-09-23 00:12:15 UTC (rev 5328)
+++ trunk/drivers/media/video/blackfin/blackfin_cam.h	2008-09-23 11:42:10 UTC (rev 5329)
@@ -56,7 +56,19 @@
 # else
 #  define PPI_BASE PPI0_CONTROL
 # endif
+#elif defined(CONFIG_BF54x)
+#undef CH_PPI
+#define CH_PPI 		CH_EPPI1
+#define PORT_EN		EPPI_EN
+#define PACK_EN 	PACKEN
+#define IRQ_PPI		IRQ_EPPI1
+#define IRQ_PPI_ERROR	IRQ_EPP1_ERROR
+#define CONFIG_VIDEO_BLACKFIN_CAM_PPI1
+#define PPI_COUNT_CORR_OFFSET	0
+#else
+#define PPI_COUNT_CORR_OFFSET	1
 #endif
+
 #ifdef PPI_BASE
 # define bfin_read_PPI_CONTROL()      bfin_read16(PPI_BASE + 0x00)
 # define bfin_write_PPI_CONTROL(val)  bfin_write16(PPI_BASE + 0x00, val)
@@ -70,6 +82,19 @@
 # define bfin_read_PPI_FRAME()        bfin_read16(PPI_BASE + 0x10)
 # define bfin_write_PPI_FRAME(val)    bfin_write16(PPI_BASE + 0x10, val)
 #endif
+#ifdef EPPI1_STATUS
+# define bfin_read_PPI_CONTROL()      bfin_read32(EPPI1_CONTROL)
+# define bfin_write_PPI_CONTROL(val)  bfin_write32(EPPI1_CONTROL, val)
+# define bfin_read_PPI_STATUS()       bfin_read16(EPPI1_STATUS)
+# define bfin_write_PPI_STATUS(val)   bfin_write16(EPPI1_STATUS, val)
+# define bfin_clear_PPI_STATUS()      bfin_write_PPI_STATUS(-1)
+# define bfin_read_PPI_COUNT()        bfin_read16(EPPI1_LINE)
+# define bfin_write_PPI_COUNT(val)    bfin_write16(EPPI1_LINE, val)
+# define bfin_read_PPI_DELAY()        bfin_read16(EPPI1_HDELAY)
+# define bfin_write_PPI_DELAY(val)    bfin_write16(EPPI1_HDELAY, val)
+# define bfin_read_PPI_FRAME()        bfin_read16(EPPI1_FRAME)
+# define bfin_write_PPI_FRAME(val)    bfin_write16(EPPI1_FRAME, val)
+#endif
 
 #define DRV_NAME	"blackfin-cam"
 
@@ -129,7 +154,11 @@
 	unsigned short pixel_per_line;
 	unsigned short lines_per_frame;
 	unsigned short bpp;
+#ifdef CONFIG_BF54x
+	unsigned int ppi_control;
+#else
 	unsigned short ppi_control;
+#endif
 	unsigned short ppi_status;
 	unsigned short ppi_delay;
 	unsigned short ppi_trigger_gpio;

Modified: trunk/drivers/media/video/blackfin/vs6624.h (5328 => 5329)


--- trunk/drivers/media/video/blackfin/vs6624.h	2008-09-23 00:12:15 UTC (rev 5328)
+++ trunk/drivers/media/video/blackfin/vs6624.h	2008-09-23 11:42:10 UTC (rev 5329)
@@ -40,7 +40,11 @@
 
 #define DEFAULT_FORMAT 	3
 
+#ifdef CONFIG_BFIN548_EZKIT
+#define VS6624_PWDN		GPIO_PG6
+#else
 #define VS6624_PWDN		GPIO_PF10
+#endif
 
 #undef USE_ITU656
 #undef USE_2ND_BUF_IN_CACHED_MEM
@@ -48,6 +52,16 @@
 #undef USE_PROC
 #undef USE_GPIO
 
+#ifdef CONFIG_BF54x
+# define POL_C              	0x1800
+# define POL_S              	0x0000
+# define PIXEL_PER_LINE     	640
+# define LINES_PER_FRAME    	480
+# define PPI_DATA_LEN       	DLEN_8
+# define PPI_PACKING        	PACKEN
+# define DMA_FLOW_MODE      	0x0000	/* STOPMODE */
+# define DMA_WDSIZE_16      	WDSIZE_32
+#else
 # define POL_C              	0x0000
 # define POL_S              	0x0000
 # define PIXEL_PER_LINE     	640
@@ -56,6 +70,7 @@
 # define PPI_PACKING        	PACK_EN
 # define DMA_FLOW_MODE      	0x0000	/* STOPMODE */
 # define DMA_WDSIZE_16      	WDSIZE_16
+#endif
 
 #ifdef USE_ITU656
 # define CFG_GP_Input_3Syncs	0x0000
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
http://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to