media: mfc: add ifdef for smc call interface
authorJeonghee Kim <jhhhh.kim@samsung.com>
Fri, 26 Jan 2018 05:23:19 +0000 (14:23 +0900)
committerSunyoung Kang <sy0816.kang@samsung.com>
Tue, 29 May 2018 06:59:18 +0000 (15:59 +0900)
Change-Id: I005938342a29fc9f16a801ea590fafd31b7d073f
Signed-off-by: Jeonghee Kim <jhhhh.kim@samsung.com>
drivers/media/platform/exynos/mfc/s5p_mfc_pm.c

index 2937f678c91d5a1fa3081dee7d89d1446c50cdd0..59a81b12f96a8f1bf60ac2e5618e9dfebdd35c0e 100644 (file)
@@ -40,7 +40,6 @@ int s5p_mfc_pm_clock_on(struct s5p_mfc_dev *dev)
 {
        int ret = 0;
        int state;
-       unsigned long flags;
 
        dev->pm.clock_on_steps = 1;
        state = atomic_read(&dev->clk_ref);
@@ -57,7 +56,10 @@ int s5p_mfc_pm_clock_on(struct s5p_mfc_dev *dev)
                s5p_mfc_set_risc_base_addr(dev, dev->pm.base_type);
 
        dev->pm.clock_on_steps |= 0x1 << 2;
+#ifdef CONFIG_EXYNOS_CONTENT_PATH_PROTECTION
        if (dev->curr_ctx_is_drm) {
+               unsigned long flags;
+
                spin_lock_irqsave(&dev->pm.clklock, flags);
                mfc_debug(3, "Begin: enable protection\n");
                ret = exynos_smc(SMC_PROTECTION_SET, 0,
@@ -72,7 +74,7 @@ int s5p_mfc_pm_clock_on(struct s5p_mfc_dev *dev)
                mfc_debug(3, "End: enable protection\n");
                spin_unlock_irqrestore(&dev->pm.clklock, flags);
        }
-
+#endif
        dev->pm.clock_on_steps |= 0x1 << 4;
        atomic_inc_return(&dev->clk_ref);
 
@@ -99,8 +101,6 @@ int s5p_mfc_pm_clock_on_with_base(struct s5p_mfc_dev *dev,
 void s5p_mfc_pm_clock_off(struct s5p_mfc_dev *dev)
 {
        int state;
-       unsigned long flags;
-       int ret = 0;
 
        dev->pm.clock_off_steps = 1;
        atomic_dec_return(&dev->clk_ref);
@@ -113,7 +113,11 @@ void s5p_mfc_pm_clock_off(struct s5p_mfc_dev *dev)
                atomic_set(&dev->clk_ref, 0);
                dev->pm.clock_off_steps |= 0x1 << 2;
        } else {
+#ifdef CONFIG_EXYNOS_CONTENT_PATH_PROTECTION
                if (dev->curr_ctx_is_drm) {
+                       unsigned long flags;
+                       int ret = 0;
+
                        mfc_debug(3, "Begin: disable protection\n");
                        spin_lock_irqsave(&dev->pm.clklock, flags);
                        dev->pm.clock_off_steps |= 0x1 << 3;
@@ -129,6 +133,7 @@ void s5p_mfc_pm_clock_off(struct s5p_mfc_dev *dev)
                        dev->pm.clock_off_steps |= 0x1 << 4;
                        spin_unlock_irqrestore(&dev->pm.clklock, flags);
                }
+#endif
                dev->pm.clock_off_steps |= 0x1 << 5;
                clk_disable(dev->pm.clock);
        }