* [PATCH] media: atmel-isi: parse the DT parameters for vsync/hsync polarity
@ 2015-07-31 10:33 Josh Wu
2015-08-01 9:11 ` Laurent Pinchart
0 siblings, 1 reply; 3+ messages in thread
From: Josh Wu @ 2015-07-31 10:33 UTC (permalink / raw)
To: Linux Media Mailing List, Guennadi Liakhovetski, linux-arm-kernel
Cc: Laurent Pinchart, Josh Wu
This patch will get the DT parameters of vsync/hsync polarity, and pass to
the platform data.
Also add a debug information for test purpose.
Signed-off-by: Josh Wu <josh.wu@atmel.com>
---
drivers/media/platform/soc_camera/atmel-isi.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/media/platform/soc_camera/atmel-isi.c b/drivers/media/platform/soc_camera/atmel-isi.c
index fe9247a..a7de55c 100644
--- a/drivers/media/platform/soc_camera/atmel-isi.c
+++ b/drivers/media/platform/soc_camera/atmel-isi.c
@@ -811,6 +811,11 @@ static int isi_camera_set_bus_param(struct soc_camera_device *icd)
if (common_flags & V4L2_MBUS_PCLK_SAMPLE_FALLING)
cfg1 |= ISI_CFG1_PIXCLK_POL_ACTIVE_FALLING;
+ dev_dbg(icd->parent, "vsync is active %s, hsyc is active %s, pix clock is sampling %s\n",
+ common_flags & V4L2_MBUS_VSYNC_ACTIVE_LOW ? "low" : "high",
+ common_flags & V4L2_MBUS_HSYNC_ACTIVE_LOW ? "low" : "high",
+ common_flags & V4L2_MBUS_PCLK_SAMPLE_FALLING ? "fall" : "rise");
+
if (isi->pdata.has_emb_sync)
cfg1 |= ISI_CFG1_EMB_SYNC;
if (isi->pdata.full_mode)
@@ -898,6 +903,11 @@ static int atmel_isi_probe_dt(struct atmel_isi *isi,
goto err_probe_dt;
}
+ if (ep.bus.parallel.flags & V4L2_MBUS_HSYNC_ACTIVE_LOW)
+ isi->pdata.hsync_act_low = true;
+ if (ep.bus.parallel.flags & V4L2_MBUS_VSYNC_ACTIVE_LOW)
+ isi->pdata.vsync_act_low = true;
+
err_probe_dt:
of_node_put(np);
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] media: atmel-isi: parse the DT parameters for vsync/hsync polarity
2015-07-31 10:33 [PATCH] media: atmel-isi: parse the DT parameters for vsync/hsync polarity Josh Wu
@ 2015-08-01 9:11 ` Laurent Pinchart
2015-08-04 6:21 ` Josh Wu
0 siblings, 1 reply; 3+ messages in thread
From: Laurent Pinchart @ 2015-08-01 9:11 UTC (permalink / raw)
To: Josh Wu; +Cc: Linux Media Mailing List, Guennadi Liakhovetski, linux-arm-kernel
Hi Josh,
Thank you for the patch.
On Friday 31 July 2015 18:33:32 Josh Wu wrote:
> This patch will get the DT parameters of vsync/hsync polarity, and pass to
> the platform data.
>
> Also add a debug information for test purpose.
>
> Signed-off-by: Josh Wu <josh.wu@atmel.com>
> ---
>
> drivers/media/platform/soc_camera/atmel-isi.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/drivers/media/platform/soc_camera/atmel-isi.c
> b/drivers/media/platform/soc_camera/atmel-isi.c index fe9247a..a7de55c
> 100644
> --- a/drivers/media/platform/soc_camera/atmel-isi.c
> +++ b/drivers/media/platform/soc_camera/atmel-isi.c
> @@ -811,6 +811,11 @@ static int isi_camera_set_bus_param(struct
> soc_camera_device *icd) if (common_flags & V4L2_MBUS_PCLK_SAMPLE_FALLING)
> cfg1 |= ISI_CFG1_PIXCLK_POL_ACTIVE_FALLING;
>
> + dev_dbg(icd->parent, "vsync is active %s, hsyc is active %s, pix clock is
> sampling %s\n",
s/hsyc/hsync/
I'd write it as "vsync active %s, hsync active %s, sampling on pix clock %s
edge\n" with "falling" and "rising" instead of "fall" and "rise".
> + common_flags & V4L2_MBUS_VSYNC_ACTIVE_LOW ? "low" : "high",
> + common_flags & V4L2_MBUS_HSYNC_ACTIVE_LOW ? "low" : "high",
> + common_flags & V4L2_MBUS_PCLK_SAMPLE_FALLING ? "fall" : "rise");
> +
> if (isi->pdata.has_emb_sync)
> cfg1 |= ISI_CFG1_EMB_SYNC;
> if (isi->pdata.full_mode)
> @@ -898,6 +903,11 @@ static int atmel_isi_probe_dt(struct atmel_isi *isi,
> goto err_probe_dt;
> }
>
> + if (ep.bus.parallel.flags & V4L2_MBUS_HSYNC_ACTIVE_LOW)
> + isi->pdata.hsync_act_low = true;
> + if (ep.bus.parallel.flags & V4L2_MBUS_VSYNC_ACTIVE_LOW)
> + isi->pdata.vsync_act_low = true;
While you're at it, how about setting has_emb_sync based on ep.bus_type and
pclk_act_falling from flags & V4L2_MBUS_PCLK_SAMPLE_FALLING ?
> err_probe_dt:
> of_node_put(np);
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] media: atmel-isi: parse the DT parameters for vsync/hsync polarity
2015-08-01 9:11 ` Laurent Pinchart
@ 2015-08-04 6:21 ` Josh Wu
0 siblings, 0 replies; 3+ messages in thread
From: Josh Wu @ 2015-08-04 6:21 UTC (permalink / raw)
To: Laurent Pinchart
Cc: Linux Media Mailing List, Guennadi Liakhovetski, linux-arm-kernel
Hi, Laurent
On 8/1/2015 5:11 PM, Laurent Pinchart wrote:
> Hi Josh,
>
> Thank you for the patch.
>
> On Friday 31 July 2015 18:33:32 Josh Wu wrote:
>> This patch will get the DT parameters of vsync/hsync polarity, and pass to
>> the platform data.
>>
>> Also add a debug information for test purpose.
>>
>> Signed-off-by: Josh Wu <josh.wu@atmel.com>
>> ---
>>
>> drivers/media/platform/soc_camera/atmel-isi.c | 10 ++++++++++
>> 1 file changed, 10 insertions(+)
>>
>> diff --git a/drivers/media/platform/soc_camera/atmel-isi.c
>> b/drivers/media/platform/soc_camera/atmel-isi.c index fe9247a..a7de55c
>> 100644
>> --- a/drivers/media/platform/soc_camera/atmel-isi.c
>> +++ b/drivers/media/platform/soc_camera/atmel-isi.c
>> @@ -811,6 +811,11 @@ static int isi_camera_set_bus_param(struct
>> soc_camera_device *icd) if (common_flags & V4L2_MBUS_PCLK_SAMPLE_FALLING)
>> cfg1 |= ISI_CFG1_PIXCLK_POL_ACTIVE_FALLING;
>>
>> + dev_dbg(icd->parent, "vsync is active %s, hsyc is active %s, pix clock is
>> sampling %s\n",
> s/hsyc/hsync/
>
> I'd write it as "vsync active %s, hsync active %s, sampling on pix clock %s
> edge\n" with "falling" and "rising" instead of "fall" and "rise".
Thanks, I'll correct it.
>
>> + common_flags & V4L2_MBUS_VSYNC_ACTIVE_LOW ? "low" : "high",
>> + common_flags & V4L2_MBUS_HSYNC_ACTIVE_LOW ? "low" : "high",
>> + common_flags & V4L2_MBUS_PCLK_SAMPLE_FALLING ? "fall" : "rise");
>> +
>> if (isi->pdata.has_emb_sync)
>> cfg1 |= ISI_CFG1_EMB_SYNC;
>> if (isi->pdata.full_mode)
>> @@ -898,6 +903,11 @@ static int atmel_isi_probe_dt(struct atmel_isi *isi,
>> goto err_probe_dt;
>> }
>>
>> + if (ep.bus.parallel.flags & V4L2_MBUS_HSYNC_ACTIVE_LOW)
>> + isi->pdata.hsync_act_low = true;
>> + if (ep.bus.parallel.flags & V4L2_MBUS_VSYNC_ACTIVE_LOW)
>> + isi->pdata.vsync_act_low = true;
> While you're at it, how about setting has_emb_sync based on ep.bus_type and
> pclk_act_falling from flags & V4L2_MBUS_PCLK_SAMPLE_FALLING ?
I will add the pclk_act_falling handling code as well. And rebase this
patch on top of your dt modifications.
Best Regards
Josh Wu
>
>> err_probe_dt:
>> of_node_put(np);
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-08-04 6:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-31 10:33 [PATCH] media: atmel-isi: parse the DT parameters for vsync/hsync polarity Josh Wu
2015-08-01 9:11 ` Laurent Pinchart
2015-08-04 6:21 ` Josh Wu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).