[1/2,media] blackfin: add display support in ppi driver

Message ID 1365810779-24335-1-git-send-email-scott.jiang.linux@gmail.com (mailing list archive)
State Accepted, archived
Delegated to: Hans Verkuil
Headers

Commit Message

Scott Jiang April 12, 2013, 11:52 p.m. UTC
  Signed-off-by: Scott Jiang <scott.jiang.linux@gmail.com>
---
 drivers/media/platform/blackfin/ppi.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
  

Comments

Hans Verkuil April 12, 2013, 11:32 a.m. UTC | #1
On Sat April 13 2013 01:52:57 Scott Jiang wrote:
> Signed-off-by: Scott Jiang <scott.jiang.linux@gmail.com>

Is it OK if I postpone these two patches for 3.11? They don't make sense
AFAICT without the new display driver, and that will definitely not make it
for 3.10.

Regards,

	Hans

> ---
>  drivers/media/platform/blackfin/ppi.c |   12 ++++++++++++
>  1 files changed, 12 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/media/platform/blackfin/ppi.c b/drivers/media/platform/blackfin/ppi.c
> index 01b5b50..15e9c2b 100644
> --- a/drivers/media/platform/blackfin/ppi.c
> +++ b/drivers/media/platform/blackfin/ppi.c
> @@ -266,6 +266,18 @@ static int ppi_set_params(struct ppi_if *ppi, struct ppi_params *params)
>  		bfin_write32(&reg->vcnt, params->height);
>  		if (params->int_mask)
>  			bfin_write32(&reg->imsk, params->int_mask & 0xFF);
> +		if (ppi->ppi_control & PORT_DIR) {
> +			u32 hsync_width, vsync_width, vsync_period;
> +
> +			hsync_width = params->hsync
> +					* params->bpp / params->dlen;
> +			vsync_width = params->vsync * samples_per_line;
> +			vsync_period = samples_per_line * params->frame;
> +			bfin_write32(&reg->fs1_wlhb, hsync_width);
> +			bfin_write32(&reg->fs1_paspl, samples_per_line);
> +			bfin_write32(&reg->fs2_wlvb, vsync_width);
> +			bfin_write32(&reg->fs2_palpf, vsync_period);
> +		}
>  		break;
>  	}
>  	default:
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
  
Scott Jiang April 15, 2013, 2:59 a.m. UTC | #2
2013/4/12 Hans Verkuil <hverkuil@xs4all.nl>:
> On Sat April 13 2013 01:52:57 Scott Jiang wrote:
>> Signed-off-by: Scott Jiang <scott.jiang.linux@gmail.com>
>
> Is it OK if I postpone these two patches for 3.11? They don't make sense
> AFAICT without the new display driver, and that will definitely not make it
> for 3.10.
>
OK.

Scott
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
  

Patch

diff --git a/drivers/media/platform/blackfin/ppi.c b/drivers/media/platform/blackfin/ppi.c
index 01b5b50..15e9c2b 100644
--- a/drivers/media/platform/blackfin/ppi.c
+++ b/drivers/media/platform/blackfin/ppi.c
@@ -266,6 +266,18 @@  static int ppi_set_params(struct ppi_if *ppi, struct ppi_params *params)
 		bfin_write32(&reg->vcnt, params->height);
 		if (params->int_mask)
 			bfin_write32(&reg->imsk, params->int_mask & 0xFF);
+		if (ppi->ppi_control & PORT_DIR) {
+			u32 hsync_width, vsync_width, vsync_period;
+
+			hsync_width = params->hsync
+					* params->bpp / params->dlen;
+			vsync_width = params->vsync * samples_per_line;
+			vsync_period = samples_per_line * params->frame;
+			bfin_write32(&reg->fs1_wlhb, hsync_width);
+			bfin_write32(&reg->fs1_paspl, samples_per_line);
+			bfin_write32(&reg->fs2_wlvb, vsync_width);
+			bfin_write32(&reg->fs2_palpf, vsync_period);
+		}
 		break;
 	}
 	default: