Skip to contentSkip to conversation

media: atmel-isi: parse the DT parameters for vsync/hsync/pixclock polarity

PATCH Superseded Josh Wu 4 participants 6 messages Aug 4, 2015 – Sep 18, 2015

Subsystems (2)
lore
Share & tools
lore

Josh Wu

author
#0 lore raw

PATCH v3 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 v3:
- add embedded sync dt property support.

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 | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
drivers/media/platform/soc_camera/atmel-isi.c +15 -0
index fead841..4efc939 100644
@@ -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 edge\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,16 @@ 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;
+
+	if (ep.bus_type == V4L2_MBUS_BT656)
+		isi->pdata.has_emb_sync = true;
+
 	return 0;
 }
 
Signature · 1 line
1.9.1
#1 lore raw

PATCH v3 1/1 media: atmel-isi: parse the DT parameters for vsync/hsync/pixclock polarity

Hi Josh,

Thank you for the patch.

Quoted 6 lines · On Tuesday 04 August 2015 17:37:49 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.

Quoted 47 lines

---

Changes in v3:
- add embedded sync dt property support.

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 | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
(quoted diff) +0 -0

b/drivers/media/platform/soc_camera/atmel-isi.c index fead841..4efc939 100644

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 edge\n", + common_flags & V4L2_MBUS_VSYNC_ACTIVE_LOW ? "low" :
"high",

drivers/media/platform/soc_camera/atmel-isi.c +13 -0
+		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,16 @@ 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;
+
+	if (ep.bus_type == V4L2_MBUS_BT656)
+		isi->pdata.has_emb_sync = true;
+
 	return 0;
 }
Signature · 3 lines
Regards,

Laurent Pinchart
#2 lore raw

PATCH v3 1/1 media: atmel-isi: parse the DT parameters for vsync/hsync/pixclock polarity

Le 04/08/2015 13:22, Laurent Pinchart a ?crit :

Quoted 5 lines

Hi Josh,

Thank you for the patch.

On Tuesday 04 August 2015 17:37:49 Josh Wu wrote:

Quoted 8 lines
Quoted 6 lines

This patch will get the DT parameters of vsync/hsync/pixclock polarity, and pass to driver.

Also add a debug information for test purpose.

Guennadi, Mauro,

I don't see this patch in Linux-next and I'm not so used to
http://git.linuxtv.org but didn't find it either.

Well in fact it's just a lengthy version of "ping" ;-)

Bye,

Quoted 48 lines
Quoted 47 lines

---

Changes in v3:
- add embedded sync dt property support.

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 | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
(quoted diff) +0 -0

b/drivers/media/platform/soc_camera/atmel-isi.c index fead841..4efc939 100644

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 edge\n", + common_flags & V4L2_MBUS_VSYNC_ACTIVE_LOW ? "low" :
"high",

drivers/media/platform/soc_camera/atmel-isi.c +13 -0
+		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,16 @@ 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;
+
+	if (ep.bus_type == V4L2_MBUS_BT656)
+		isi->pdata.has_emb_sync = true;
+
 	return 0;
 }
Signature · 1 line
Nicolas Ferre
#3 lore raw

PATCH v3 1/1 media: atmel-isi: parse the DT parameters for vsync/hsync/pixclock polarity

Hi Nicolas,

Patch handling is on my todo for the coming weekend...

Thanks
Guennadi

Quoted 77 lines · Nicolas Ferre

Le 04/08/2015 13:22, Laurent Pinchart a ?crit :

Quoted 5 lines

Hi Josh,

Thank you for the patch.

On Tuesday 04 August 2015 17:37:49 Josh Wu wrote:

Quoted 8 lines
Quoted 6 lines

This patch will get the DT parameters of vsync/hsync/pixclock polarity, and pass to driver.

Also add a debug information for test purpose.

Guennadi, Mauro,

I don't see this patch in Linux-next and I'm not so used to
http://git.linuxtv.org but didn't find it either.

Well in fact it's just a lengthy version of "ping" ;-)

Bye,

Quoted 48 lines
Quoted 47 lines

---

Changes in v3:
- add embedded sync dt property support.

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 | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
(quoted diff) +0 -0

b/drivers/media/platform/soc_camera/atmel-isi.c index fead841..4efc939 100644

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 edge\n", + common_flags & V4L2_MBUS_VSYNC_ACTIVE_LOW ? "low" :
"high",

drivers/media/platform/soc_camera/atmel-isi.c +13 -0
+		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,16 @@ 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;
+
+	if (ep.bus_type == V4L2_MBUS_BT656)
+		isi->pdata.has_emb_sync = true;
+
 	return 0;
 }
Signature · 1 line
Nicolas Ferre
author
#4 lore raw

PATCH v3 1/1 media: atmel-isi: parse the DT parameters for vsync/hsync/pixclock polarity

Hi, Guennadi

Quoted 3 lines · Guennadi Liakhovetski

Hi Nicolas,

Patch handling is on my todo for the coming weekend...

Beside this patch, Atmel-isi still have server other patches in the patchwork for a long time. So some patch may need to rebase.

Just for your convenience I create a branch here:
https://github.com/JoshWu/linux-at91/commits/atmel-isi-v4.3,
which collected all the Atmel-isi patches that still not merged. You can take it as a reference.

Of cause, if you want I can sent out a pull request for it. thanks.

Best Regards,
Josh Wu

Quoted 79 lines

Thanks
Guennadi

Quoted 73 lines · Nicolas Ferre

Le 04/08/2015 13:22, Laurent Pinchart a ?crit :

Quoted 4 lines

Hi Josh,

Thank you for the patch.

Quoted 8 lines
Quoted 6 lines · On Tuesday 04 August 2015 17:37:49 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.

Guennadi, Mauro,

I don't see this patch in Linux-next and I'm not so used to
http://git.linuxtv.org but didn't find it either.

Well in fact it's just a lengthy version of "ping" ;-)

Bye,

Quoted 47 lines
Quoted 47 lines

---

Changes in v3:
- add embedded sync dt property support.

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 | 15 +++++++++++++++
  1 file changed, 15 insertions(+)
(quoted diff) +0 -0

b/drivers/media/platform/soc_camera/atmel-isi.c index fead841..4efc939 100644

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 edge\n", + common_flags & V4L2_MBUS_VSYNC_ACTIVE_LOW ? "low" :
"high",

drivers/media/platform/soc_camera/atmel-isi.c +13 -0
+		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,16 @@ 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;
+
+	if (ep.bus_type == V4L2_MBUS_BT656)
+		isi->pdata.has_emb_sync = true;
+
  	return 0;
  }
Signature · 1 line
Nicolas Ferre
#5 lore raw

PATCH v3 1/1 media: atmel-isi: parse the DT parameters for vsync/hsync/pixclock polarity

Hi Josh,

Quoted 5 lines · Josh Wu

Hi, Guennadi

Quoted 2 lines · Guennadi Liakhovetski

Hi Nicolas,

Quoted 7 lines
Quoted 1 line

Patch handling is on my todo for the coming weekend...

Beside this patch, Atmel-isi still have server other patches in the patchwork for a long time. So some patch may need to rebase.

Just for your convenience I create a branch here:
https://github.com/JoshWu/linux-at91/commits/atmel-isi-v4.3,

Thanks, that will help!

Quoted 4 lines

which collected all the Atmel-isi patches that still not merged. You can take it as a reference.

Of cause, if you want I can sent out a pull request for it. thanks.

No need, the branch info above should be enough.

Thanks
Guennadi

Quoted 90 lines

Best Regards,
Josh Wu

Quoted 86 lines

Thanks
Guennadi

Quoted 80 lines · Nicolas Ferre

Le 04/08/2015 13:22, Laurent Pinchart a ?crit :

Quoted 5 lines

Hi Josh,

Thank you for the patch.

On Tuesday 04 August 2015 17:37:49 Josh Wu wrote:

Quoted 8 lines
Quoted 7 lines

This patch will get the DT parameters of vsync/hsync/pixclock polarity, and
pass to driver.

Also add a debug information for test purpose.

Guennadi, Mauro,

I don't see this patch in Linux-next and I'm not so used to
http://git.linuxtv.org but didn't find it either.

Well in fact it's just a lengthy version of "ping" ;-)

Bye,

Quoted 53 lines
Quoted 53 lines

---

Changes in v3:
- add embedded sync dt property support.

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 | 15 +++++++++++++++
  1 file changed, 15 insertions(+)
(quoted diff) +0 -0

b/drivers/media/platform/soc_camera/atmel-isi.c index fead841..4efc939 100644

drivers/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;

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 edge\n", + common_flags &
V4L2_MBUS_VSYNC_ACTIVE_LOW ? "low" :
"high",

drivers/media/platform/soc_camera/atmel-isi.c +1 -0
+		common_flags & V4L2_MBUS_HSYNC_ACTIVE_LOW ? "low" :

"high",

drivers/media/platform/soc_camera/atmel-isi.c +1 -0
+		common_flags & V4L2_MBUS_PCLK_SAMPLE_FALLING ?

"falling" : "rising");

drivers/media/platform/soc_camera/atmel-isi.c +11 -0
+
  	if (isi->pdata.has_emb_sync)
  		cfg1 |= ISI_CFG1_EMB_SYNC;
  	if (isi->pdata.full_mode)
@@ -1148,6 +1153,16 @@ 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;
+
+	if (ep.bus_type == V4L2_MBUS_BT656)
+		isi->pdata.has_emb_sync = true;
+
  	return 0;
  }
Signature · 1 line
Nicolas Ferre