video/rockchip: rga2: force rga version if hardware not support
[firefly-linux-kernel-4.4.55.git] / drivers / video / rockchip / rga2 / rga2_drv.c
index 936411d895cda3f874e71dc814b114a5f5459c1f..850d20f33f348b8208387f9b479cea4e5e175e2a 100644 (file)
@@ -178,6 +178,11 @@ static inline int rga2_init_version(void)
        major_version = (reg_version & RGA2_MAJOR_VERSION_MASK) >> 24;
        minor_version = (reg_version & RGA2_MINOR_VERSION_MASK) >> 20;
 
+       /*
+        * some old rga ip has no rga version register, so force set to 2.00
+        */
+       if (!major_version && !minor_version)
+               major_version = 2;
        sprintf(rga->version, "%d.%02d", major_version, minor_version);
 
        return 0;