From 0c86a96a5d552d5f7ddd9004b4639821ab2c3083 Mon Sep 17 00:00:00 2001 From: Vladimir Barinov Date: Tue, 18 Dec 2018 14:34:58 +0300 Subject: [PATCH 206/211] rcar-vin: add ISP source enable This adds possbility to use ISP as a source for VIN8-VIN15 on V3H Signed-off-by: Vladimir Barinov --- drivers/media/platform/soc_camera/rcar_vin.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/media/platform/soc_camera/rcar_vin.c b/drivers/media/platform/soc_camera/rcar_vin.c index 6ba94c3..bcc1cfd 100644 --- a/drivers/media/platform/soc_camera/rcar_vin.c +++ b/drivers/media/platform/soc_camera/rcar_vin.c @@ -102,6 +102,7 @@ /* Register bit fields for R-Car VIN */ /* Video n Main Control Register bits */ +#define VNMC_ISPE (1 << 30) #define VNMC_DPINE (1 << 27) #define VNMC_SCLE (1 << 26) #define VNMC_FOC (1 << 21) @@ -188,6 +189,7 @@ #define RCAR_VIN_BT601 (1 << 2) #define RCAR_VIN_BT656 (1 << 3) #define RCAR_VIN_CSI2 (1 << 4) +#define RCAR_VIN_ISP (1 << 5) static int lut_reverse; module_param(lut_reverse, int, 0644); @@ -1238,6 +1240,9 @@ static int rcar_vin_setup(struct rcar_vin_priv *priv) vnmc |= VNMC_SCLE; } + if (priv->pdata_flags & RCAR_VIN_ISP) + vnmc |= VNMC_ISPE; + /* progressive or interlaced mode */ interrupts = progressive ? VNIE_FIE : VNIE_EFE; @@ -2042,6 +2047,9 @@ static int rcar_vin_set_bus_param(struct soc_camera_device *icd) vnmc |= VNMC_DPINE; } + if (priv->pdata_flags & RCAR_VIN_ISP) + vnmc |= VNMC_ISPE; + if (priv->chip == RCAR_H3 || priv->chip == RCAR_M3 || priv->chip == RCAR_M3N || priv->chip == RCAR_V3M || priv->chip == RCAR_V3H) @@ -3124,6 +3132,9 @@ static int rcar_vin_probe(struct platform_device *pdev) of_node_put(np); + if (of_property_read_bool(np, "isp,enable")) + pdata_flags = RCAR_VIN_ISP; + dev_dbg(&pdev->dev, "pdata_flags = %08x\n", pdata_flags); mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); -- 2.7.4