media: atmel-isi: parse the DT parameters for vsync/hsync/pixclock polarity
Subsystems (2)
PATCH v2 1/1 media: atmel-isi: parse the DT parameters for vsync/hsync/pixclock polarity
This patch will get the DT parameters of vsync/hsync/pixclock polarity, and pass to driver.
Also add a debug information for test purpose.
---
Changes in v2:
- rewrite the debug message and add pix clock polarity setup thanks to Laurent.
- update the commit log.
drivers/media/platform/soc_camera/atmel-isi.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/media/platform/soc_camera/atmel-isi.c +12 -0
@@ -1061,6 +1061,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 active %s, hsync active %s, sampling on pix clock %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 ?"falling" :"rising" ); +if (isi->pdata.has_emb_sync) cfg1 |=ISI_CFG1_EMB_SYNC ;if (isi->pdata.full_mode)
@@ -1148,6 +1153,13 @@ static int atmel_isi_parse_dt(struct atmel_isi *isi,return -EINVAL ; } +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; +if (ep.bus.parallel.flags &V4L2_MBUS_PCLK_SAMPLE_FALLING ) + isi->pdata.pclk_act_falling = true; +return 0 ; }
Signature · 1 line
1.9.1
PATCH v2 1/1 media: atmel-isi: parse the DT parameters for vsync/hsync/pixclock polarity
Hi Josh,
Thank you for the patch.
Quoted 22 lines · On Tuesday 04 August 2015 14:47:07 Josh Wu wrote:
This patch will get the DT parameters of vsync/hsync/pixclock polarity, and pass to driver.
Also add a debug information for test purpose.
Signed-off-by Josh Wu <[email protected]>---
Changes in v2:
- rewrite the debug message and add pix clock polarity setup thanks to Laurent.
- update the commit log.drivers/media/platform/soc_camera/atmel-isi.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)(quoted diff) +0
-0
b/drivers/media/platform/soc_camera/atmel-isi.cindex fead841..d6f8def 100644
drivers/media/platform/soc_camera/atmel-isi.c static int isi_camera_set_bus_param(struct · line 1065
Quoted 5 lines
drivers/media/platform/soc_camera/atmel-isi.c +1
-0@@ -1061,6 +1061,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 active %s, hsync active %s, sampling on pix clock %s\n",
You forgot " edge" right before "\n" :-)
Quoted 8 lines
drivers/media/platform/soc_camera/atmel-isi.c +4
-0+ 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 ? "falling" : "rising"); +if (isi->pdata.has_emb_sync) cfg1 |=ISI_CFG1_EMB_SYNC ;drivers/media/platform/soc_camera/atmel-isi.c +0
-0if (isi->pdata.full_mode)
drivers/media/platform/soc_camera/atmel-isi.c static int atmel_isi_parse_dt(struct atmel_isi *isi, · line 1162
Quoted 10 lines
drivers/media/platform/soc_camera/atmel-isi.c +7
-0@@ -1148,6 +1153,13 @@ static int atmel_isi_parse_dt(struct atmel_isi *isi,return -EINVAL ; } +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; +if (ep.bus.parallel.flags &V4L2_MBUS_PCLK_SAMPLE_FALLING ) + isi->pdata.pclk_act_falling = true; +
How about has_emb_sync, which can be set from ep.bus_type ?
Quoted 2 lines
drivers/media/platform/soc_camera/atmel-isi.c +0
-0return 0 ; }
Signature · 3 lines
Regards, Laurent Pinchart
PATCH v2 1/1 media: atmel-isi: parse the DT parameters for vsync/hsync/pixclock polarity
Hi, Laurent
Quoted 30 lines · Laurent Pinchart
Hi Josh,
Thank you for the patch.
Quoted 25 lines · On Tuesday 04 August 2015 14:47:07 Josh Wu wrote:
This patch will get the DT parameters of vsync/hsync/pixclock polarity, and pass to driver.
Also add a debug information for test purpose.
Signed-off-by Josh Wu <[email protected]>---
Changes in v2:
- rewrite the debug message and add pix clock polarity setup thanks to Laurent.
- update the commit log.drivers/media/platform/soc_camera/atmel-isi.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)(quoted diff) +0
-0
b/drivers/media/platform/soc_camera/atmel-isi.cindex fead841..d6f8def 100644drivers/media/platform/soc_camera/atmel-isi.c +0
-0@@ -1061,6 +1061,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 ;
Quoted 3 lines
drivers/media/platform/soc_camera/atmel-isi.c static int isi_camera_set_bus_param(struct · line 1065
Quoted 2 lines
drivers/media/platform/soc_camera/atmel-isi.c +1
-0+ dev_dbg(icd->parent, "vsync active %s, hsync active %s, sampling on pix clock %s\n",You forgot " edge" right before "\n" :-)
oops, I missed the word.
Quoted 12 lines
Quoted 12 lines
drivers/media/platform/soc_camera/atmel-isi.c +4
-0+ 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 ? "falling" : "rising"); +if (isi->pdata.has_emb_sync) cfg1 |=ISI_CFG1_EMB_SYNC ;if (
isi->pdata.full_mode)drivers/media/platform/soc_camera/atmel-isi.c +0
-0@@ -1148,6 +1153,13 @@ static int atmel_isi_parse_dt(struct atmel_isi *isi,return -EINVAL ; }
Quoted 8 lines
drivers/media/platform/soc_camera/atmel-isi.c static int atmel_isi_parse_dt(struct atmel_isi *isi, · line 1162
Quoted 7 lines
drivers/media/platform/soc_camera/atmel-isi.c +7
-0+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; +if (ep.bus.parallel.flags &V4L2_MBUS_PCLK_SAMPLE_FALLING ) + isi->pdata.pclk_act_falling = true; +How about
has_emb_sync, which can be set from ep.bus_type ?
yes, right. I forgot this as well.
I'll generate a new version of this patch soon. Thanks for the catching.
Best Regards,
Josh Wu
Quoted 3 lines
Quoted 3 lines
drivers/media/platform/soc_camera/atmel-isi.c +0
-0return 0 ; }