media_modules: make h264 encoder compatible with older socs [1/1]
authorRico Yang <wei.yang@amlogic.com>
Sun, 2 Aug 2020 17:12:16 +0000 (01:12 +0800)
committergerrit autosubmit <gerrit.autosubmit@scgit.amlogic.com>
Mon, 3 Aug 2020 13:14:47 +0000 (06:14 -0700)
PD#SWPL-25846

Problem:
h264 encoder not working on old socs pre-sc2

Solution:
make h264 encoder compatible with older socs

Verify:
verified on franklin

Change-Id: I1ddbea32748069be06ee344ec1dbf8987a5b350b
Signed-off-by: Rico Yang <wei.yang@amlogic.com>
drivers/frame_sink/encoder/h264/encoder.c

index 66a3f6c8552ae6264e4f0f9c4c32479e84beef9c..9421b9331f794bdab8208e451c023b82f092193f 100644 (file)
@@ -4496,11 +4496,13 @@ static s32 amvenc_avc_probe(struct platform_device *pdev)
 #endif
        }
 
-       if (hcodec_clk_prepare(&pdev->dev, &s_hcodec_clks)) {
-               //err = -ENOENT;
-               enc_pr(LOG_ERROR, "[%s:%d] probe hcodec enc failed\n", __FUNCTION__, __LINE__);
-               //goto ERROR_PROBE_DEVICE;
-               return -EINVAL;
+       if (get_cpu_type() >= MESON_CPU_MAJOR_ID_SC2) {
+               if (hcodec_clk_prepare(&pdev->dev, &s_hcodec_clks)) {
+                       //err = -ENOENT;
+                       enc_pr(LOG_ERROR, "[%s:%d] probe hcodec enc failed\n", __FUNCTION__, __LINE__);
+                       //goto ERROR_PROBE_DEVICE;
+                       return -EINVAL;
+               }
        }
 
        if (get_cpu_type() >= MESON_CPU_MAJOR_ID_SC2) {