  static DECLARE_BITMAP(device_map, MAP_MAX_NUM);
  static DEFINE_MUTEX(list_lock);
  
-@@ -2947,7 +3004,10 @@ static int rcar_vin_probe(struct platform_device *pdev)
+@@ -2947,7 +3027,10 @@ static int rcar_vin_probe(struct platform_device *pdev)
  	const char *str;
  	unsigned int i;
  	struct device_node *epn = NULL, *ren = NULL;

-		rcar_csi2_hwdeinit(priv);
-		pm_runtime_put_sync(&priv->pdev->dev);
+		if (atomic_dec_return(&priv->use_count) == 0) {
+			rcar_csi2_hwdeinit(priv);
+			pm_runtime_put_sync(&priv->pdev->dev);
+		}
 	}
 
 	return ret;
@@ -519,18 +489,19 @@ static int rcar_csi2_parse_dt(struct device_node *np,
 		return -EINVAL;
 
 	v4l2_of_parse_endpoint(endpoint, &bus_cfg);

 
 	return 0;
diff --git a/drivers/media/platform/soc_camera/rcar_vin.c b/drivers/media/platform/soc_camera/rcar_vin.c
index 0c0027e..7b7e4ba 100644
--- a/drivers/media/platform/soc_camera/rcar_vin.c
+++ b/drivers/media/platform/soc_camera/rcar_vin.c
@@ -106,6 +106,7 @@
 #define VNMC_INF_YUV8_BT601	(1 << 16)
 #define VNMC_INF_YUV10_BT656	(2 << 16)
 #define VNMC_INF_YUV10_BT601	(3 << 16)
+#define VNMC_INF_RAW8		(4 << 16)
 #define VNMC_INF_YUV16		(5 << 16)
 #define VNMC_INF_RGB888		(6 << 16)
 #define VNMC_INF_MASK		(7 << 16)
@@ -364,6 +365,7 @@ enum csi2_fmt {
 	RCAR_CSI_FMT_NONE = -1,
 	RCAR_CSI_RGB888,
 	RCAR_CSI_YCBCR422,
+	RCAR_CSI_RAW8,
 };
 
 struct vin_coeff {
@@ -730,10 +732,13 @@ struct rcar_vin_priv {
 	enum csi2_fmt			csi_fmt;
 	enum virtual_ch			vc;
 	bool				csi_sync;
