commit: http://blackfin.uclinux.org/git/?p=linux-kernel;a=commitdiff;h=9a87ad0b5a4003813490cf1b46197ff4eccdb06b branch: http://blackfin.uclinux.org/git/?p=linux-kernel;a=shortlog;h=refs/heads/trunk
let board config write ppi control directly Signed-off-by: Scott Jiang <[email protected]> --- arch/blackfin/mach-bf537/boards/stamp.c | 2 +- drivers/media/video/blackfin/bfin_capture.c | 2 +- drivers/media/video/blackfin/ppi.c | 64 +-------------------------- include/media/blackfin/bfin_capture.h | 4 +- include/media/blackfin/ppi.h | 21 +-------- 5 files changed, 6 insertions(+), 87 deletions(-) diff --git a/arch/blackfin/mach-bf537/boards/stamp.c b/arch/blackfin/mach-bf537/boards/stamp.c index 688f8e3..027aec1 100644 --- a/arch/blackfin/mach-bf537/boards/stamp.c +++ b/arch/blackfin/mach-bf537/boards/stamp.c @@ -1620,7 +1620,7 @@ static struct bfin_capture_config bfin_capture_data = { .board_info = { I2C_BOARD_INFO("vs6624", 0x10) }, - .flags = PPI_FLAG_PACK_EN, + .ppi_control = (PACK_EN | DLEN_8 | XFR_TYPE | 0x0020), }; #endif diff --git a/drivers/media/video/blackfin/bfin_capture.c b/drivers/media/video/blackfin/bfin_capture.c index 4b25629..7d16a4a 100644 --- a/drivers/media/video/blackfin/bfin_capture.c +++ b/drivers/media/video/blackfin/bfin_capture.c @@ -350,7 +350,7 @@ static int bcap_start_streaming(struct vb2_queue *vq) params.width = bcap_dev->fmt.width; params.height = bcap_dev->fmt.height; params.bpp = bcap_dev->bpp; - params.flags = bcap_dev->cfg->flags; + params.ppi_control = bcap_dev->cfg->ppi_control; ret = ppi->ops->set_params(ppi, ¶ms); if (ret < 0) { v4l2_err(&bcap_dev->v4l2_dev, diff --git a/drivers/media/video/blackfin/ppi.c b/drivers/media/video/blackfin/ppi.c index ac6f5f8..3274ce7 100644 --- a/drivers/media/video/blackfin/ppi.c +++ b/drivers/media/video/blackfin/ppi.c @@ -135,8 +135,6 @@ static int ppi_stop(struct ppi_if *intf) static int ppi_set_params(struct ppi_if *intf, struct ppi_params *params) { - int ck_skip = 0; - intf->bytes_per_line = params->width * params->bpp; intf->lines_per_frame = params->height; @@ -149,67 +147,7 @@ static int ppi_set_params(struct ppi_if *intf, struct ppi_params *params) set_dma_config(intf->dma_ch, intf->dma_config); /* config PPI */ - if (params->flags & PPI_FLAG_TX_MOD) { - /* ppi in transmit mode */ - intf->ppi_control = 0x0002; - /* set xfer type */ - if (!(params->flags & PPI_FLAG_NO_SYNC)) - intf->ppi_control |= 0x000c; - /* set port cfg */ - else if (params->flags & PPI_FLAG_ONE_SYNC) - intf->ppi_control |= 0x0000; - else if (params->flags & PPI_FLAG_FS2_ASSERT) - intf->ppi_control |= 0x0030; - else - intf->ppi_control |= 0x0010; - } else { - /* ppi in receive mode */ - intf->ppi_control = 0x0000; - /* set xfer type */ - if (params->flags & PPI_FLAG_BT656) { - if (params->flags & PPI_FLAG_ACTIVE_FLD) - intf->ppi_control |= 0x0000; - else if (params->flags & PPI_FLAG_ENTIRE_FLD) - intf->ppi_control |= 0x0004; - else - intf->ppi_control |= 0x0008; - ck_skip = 1; - } else { - intf->ppi_control |= 0x000C; - /* set port cfg */ - if (params->flags & PPI_FLAG_NO_SYNC) - intf->ppi_control |= 0x0030; - else if (params->flags & PPI_FLAG_ONE_SYNC) { - intf->ppi_control |= 0x0000; - ck_skip = 1; - } else if (params->flags & PPI_FLAG_INTER_SYNC) - /* 2 or 3 internal frame syncs */ - intf->ppi_control |= 0x0010; - else { - /* 2 or 3 external frame syncs */ - intf->ppi_control |= 0x0020; - ck_skip = 1; - } - } - } - if (params->flags & PPI_FLAG_FLD_SEL) - intf->ppi_control |= FLD_SEL; - if (params->flags & PPI_FLAG_PACK_EN) - intf->ppi_control |= PACK_EN; - if (params->flags & PPI_FLAG_DMA32) - intf->ppi_control |= DMA32; - if (params->flags & PPI_FLAG_CLK_FALL) - intf->ppi_control |= POLC; - if (params->flags & PPI_FLAG_FS_FALL) - intf->ppi_control |= POLS; - if (ck_skip) { - if (params->flags & PPI_FLAG_SKIP_EN) { - intf->ppi_control |= SKIP_EN; - if (params->flags & PPI_FLAG_SKIP_EVEN) - intf->ppi_control |= SKIP_EO; - } - } - intf->ppi_control |= DLEN_8; + intf->ppi_control = params->ppi_control & ~PORT_EN; regw(intf->ppi_control, REG_PPI_CONTROL); regw(intf->bytes_per_line - 1, REG_PPI_COUNT); regw(intf->lines_per_frame, REG_PPI_FRAME); diff --git a/include/media/blackfin/bfin_capture.h b/include/media/blackfin/bfin_capture.h index a62bc1c..f4f8510 100644 --- a/include/media/blackfin/bfin_capture.h +++ b/include/media/blackfin/bfin_capture.h @@ -24,8 +24,8 @@ struct bfin_capture_config { int i2c_adapter_id; /* i2c subdevice board info */ struct i2c_board_info board_info; - /* ppi control flag */ - unsigned long flags; + /* ppi control */ + unsigned short ppi_control; }; #endif diff --git a/include/media/blackfin/ppi.h b/include/media/blackfin/ppi.h index 75ca5b8..055b7f3 100644 --- a/include/media/blackfin/ppi.h +++ b/include/media/blackfin/ppi.h @@ -22,32 +22,13 @@ #include <linux/interrupt.h> -/* control flags*/ -#define PPI_FLAG_TX_MOD 0x0001 /* ppi in transmit mode */ -#define PPI_FLAG_ACTIVE_FLD 0x0002 /* BT656 active field only */ -#define PPI_FLAG_ENTIRE_FLD 0x0004 /* BT656 entire field */ -#define PPI_FLAG_VBI 0x0008 /* BT656 VBI only */ -#define PPI_FLAG_NO_SYNC 0x0010 /* no frame syncs */ -#define PPI_FLAG_ONE_SYNC 0x0020 /* one frame sync */ -#define PPI_FLAG_INTER_SYNC 0x0040 /* internal frame sync */ -#define PPI_FLAG_FS2_ASSERT 0x0080 /* FS3 sync to FS2 assertion */ -#define PPI_FLAG_FLD_SEL 0x0100 /* select both fields or internal trigger */ -#define PPI_FLAG_PACK_EN 0x0200 /* packing mode enable */ -#define PPI_FLAG_DMA32 0x0400 /* 32-bit DMA width enable */ -#define PPI_FLAG_SKIP_EN 0x0800 /* skipping enabled */ -#define PPI_FLAG_SKIP_EVEN 0x1000 /* skip even-numbered elements */ -#define PPI_FLAG_CLK_FALL 0x2000 /* sample data on falling edge of PPI_CLK */ -#define PPI_FLAG_FS_FALL 0x4000 /* FS1 and FS2 are falling edge asserted */ -#define PPI_FLAG_BT656 \ - (PPI_FLAG_ACTIVE_FLD | PPI_FLAG_ENTIRE_FLD | PPI_FLAG_VBI) - struct ppi_if; struct ppi_params { int width; int height; int bpp; - unsigned long flags; + unsigned short ppi_control; }; struct ppi_ops {
_______________________________________________ Linux-kernel-commits mailing list [email protected] https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits
