LinuxTV Patchwork [v1,1/2] media: atmel-isc: Add support for BT656 with CRC decoding

login
register
mail settings
Submitter Ken Sloat
Date Dec. 28, 2018, 4:59 p.m.
Message ID <20181228165934.36393-1-ksloat@aampglobal.com>
Download mbox | patch
Permalink /patch/53660/
State Superseded
Delegated to: Hans Verkuil
Headers show

Comments

Ken Sloat - Dec. 28, 2018, 4:59 p.m.
From: Ken Sloat <ksloat@aampglobal.com>

The ISC driver currently supports ITU-R 601 encoding which
utilizes the external hysync and vsync signals. ITU-R 656
format removes the need for these pins by embedding the
sync pulses within the data packet.

To support this feature, enable necessary register bits
when this feature is enabled via device tree.

Signed-off-by: Ken Sloat <ksloat@aampglobal.com>
---
 drivers/media/platform/atmel/atmel-isc-regs.h | 2 ++
 drivers/media/platform/atmel/atmel-isc.c      | 7 ++++++-
 2 files changed, 8 insertions(+), 1 deletion(-)
Eugen Hristev - Jan. 7, 2019, 11:10 a.m.
On 28.12.2018 18:59, Ken Sloat wrote:
> From: Ken Sloat <ksloat@aampglobal.com>

> 

> The ISC driver currently supports ITU-R 601 encoding which

> utilizes the external hysync and vsync signals. ITU-R 656

> format removes the need for these pins by embedding the

> sync pulses within the data packet.

> 

> To support this feature, enable necessary register bits

> when this feature is enabled via device tree.

> 

> Signed-off-by: Ken Sloat <ksloat@aampglobal.com>

Acked-by: Eugen Hristev <eugen.hristev@microchip.com>


Also for my reference, which board and which sensor did you test this with ?

Thanks

> ---

>   drivers/media/platform/atmel/atmel-isc-regs.h | 2 ++

>   drivers/media/platform/atmel/atmel-isc.c      | 7 ++++++-

>   2 files changed, 8 insertions(+), 1 deletion(-)

>
Ken Sloat - Jan. 14, 2019, 8:27 p.m.
> From: Eugen.Hristev@microchip.com <Eugen.Hristev@microchip.com>

> Sent: Monday, January 7, 2019 6:10 AM

> To: Ken Sloat <KSloat@aampglobal.com>

> Cc: mchehab@kernel.org; Nicolas.Ferre@microchip.com;

> alexandre.belloni@bootlin.com; Ludovic.Desroches@microchip.com; linux-

> media@vger.kernel.org

> Subject: Re: [PATCH v1 1/2] media: atmel-isc: Add support for BT656 with CRC

> decoding

> 

> 

> 

> On 28.12.2018 18:59, Ken Sloat wrote:

> > From: Ken Sloat <ksloat@aampglobal.com>

> >

> > The ISC driver currently supports ITU-R 601 encoding which utilizes

> > the external hysync and vsync signals. ITU-R 656 format removes the

> > need for these pins by embedding the sync pulses within the data

> > packet.

> >

> > To support this feature, enable necessary register bits when this

> > feature is enabled via device tree.

> >

> > Signed-off-by: Ken Sloat <ksloat@aampglobal.com>

> Acked-by: Eugen Hristev <eugen.hristev@microchip.com>

> 

> Also for my reference, which board and which sensor did you test this with ?

> 

> Thanks

> 

> > ---

> >   drivers/media/platform/atmel/atmel-isc-regs.h | 2 ++

> >   drivers/media/platform/atmel/atmel-isc.c      | 7 ++++++-

> >   2 files changed, 8 insertions(+), 1 deletion(-)

> >


Hi Eugen,

Sorry for my delayed reply. I tested this with a tw9990 sensor connected to a custom board based on the SAMA5D27-SOM1-EK1 board.

Thanks,
Ken

Patch

diff --git a/drivers/media/platform/atmel/atmel-isc-regs.h b/drivers/media/platform/atmel/atmel-isc-regs.h
index 2aadc19235ea..8b6f4db15bdc 100644
--- a/drivers/media/platform/atmel/atmel-isc-regs.h
+++ b/drivers/media/platform/atmel/atmel-isc-regs.h
@@ -24,6 +24,8 @@ 
 #define ISC_PFE_CFG0_HPOL_LOW   BIT(0)
 #define ISC_PFE_CFG0_VPOL_LOW   BIT(1)
 #define ISC_PFE_CFG0_PPOL_LOW   BIT(2)
+#define ISC_PFE_CFG0_CCIR656    BIT(9)
+#define ISC_PFE_CFG0_CCIR_CRC   BIT(10)
 
 #define ISC_PFE_CFG0_MODE_PROGRESSIVE   (0x0 << 4)
 #define ISC_PFE_CFG0_MODE_MASK          GENMASK(6, 4)
diff --git a/drivers/media/platform/atmel/atmel-isc.c b/drivers/media/platform/atmel/atmel-isc.c
index 50178968b8a6..9a399aa7ca92 100644
--- a/drivers/media/platform/atmel/atmel-isc.c
+++ b/drivers/media/platform/atmel/atmel-isc.c
@@ -1095,7 +1095,8 @@  static int isc_configure(struct isc_device *isc)
 	pfe_cfg0  |= subdev->pfe_cfg0 | ISC_PFE_CFG0_MODE_PROGRESSIVE;
 	mask = ISC_PFE_CFG0_BPS_MASK | ISC_PFE_CFG0_HPOL_LOW |
 	       ISC_PFE_CFG0_VPOL_LOW | ISC_PFE_CFG0_PPOL_LOW |
-	       ISC_PFE_CFG0_MODE_MASK;
+	       ISC_PFE_CFG0_MODE_MASK | ISC_PFE_CFG0_CCIR_CRC |
+		   ISC_PFE_CFG0_CCIR656;
 
 	regmap_update_bits(regmap, ISC_PFE_CFG0, mask, pfe_cfg0);
 
@@ -2084,6 +2085,10 @@  static int isc_parse_dt(struct device *dev, struct isc_device *isc)
 		if (flags & V4L2_MBUS_PCLK_SAMPLE_FALLING)
 			subdev_entity->pfe_cfg0 |= ISC_PFE_CFG0_PPOL_LOW;
 
+		if (v4l2_epn.bus_type == V4L2_MBUS_BT656)
+			subdev_entity->pfe_cfg0 |= ISC_PFE_CFG0_CCIR_CRC |
+					ISC_PFE_CFG0_CCIR656;
+
 		subdev_entity->asd->match_type = V4L2_ASYNC_MATCH_FWNODE;
 		subdev_entity->asd->match.fwnode =
 			of_fwnode_handle(rem);

Privacy Policy