atv_demod: fix commit "c12f8957d441e99d3c037dfe1f36029f55421fe3". [1/1]
authornengwen.chen <nengwen.chen@amlogic.com>
Wed, 12 Jun 2019 09:22:30 +0000 (17:22 +0800)
committernengwen.chen <nengwen.chen@amlogic.com>
Wed, 12 Jun 2019 09:26:54 +0000 (17:26 +0800)
PD#TV-6044, PD#TV-6047

Problem:
1.fix commit "c12f8957d441e99d3c037dfe1f36029f55421fe3".

Solution:
1.fix commit "c12f8957d441e99d3c037dfe1f36029f55421fe3".

Verify:
Verified by x301

Change-Id: I8e8632e608b8e0ddd8757409af6c5509bafd801d
Signed-off-by: nengwen.chen <nengwen.chen@amlogic.com>
drivers/amlogic/atv_demod/atvauddemod_func.c
drivers/amlogic/atv_demod/atvauddemod_func.h

index 38fb8b7..a2654bb 100644 (file)
@@ -1667,22 +1667,16 @@ void set_outputmode_status_init(void)
 
 void set_output_left_right_exchange(unsigned int ch)
 {
-#if 0 /* use audio module interface */
-       unsigned int read = 0;
-
-       atvaudio_ctrl_read(&read);
-
-       if (is_meson_tl1_cpu() || is_meson_tm2_cpu()) { /* bit[19] */
-               if ((read & (1 << 19)) != ((ch & 0x01) << 19))
-                       atvaudio_ctrl_write((read & ~(1 << 19)) |
-                                       ((ch & 0x01) << 19));
-       } else { /* bit[2] */
-               if ((read & (1 << 2)) != ((ch & 0x01) << 2))
-                       atvaudio_ctrl_write((read & ~(1 << 2)) |
-                                       ((ch & 0x01) << 2));
-       }
+#ifdef CONFIG_AMLOGIC_SND_SOC_AUGE
+       if (ch)
+               fratv_LR_swap(true);
+       else
+               fratv_LR_swap(false);
 #else
-
+       if (ch)
+               atv_LR_swap(true);
+       else
+               atv_LR_swap(false);
 #endif
 }
 
@@ -1692,26 +1686,15 @@ void set_output_left_right_exchange(unsigned int ch)
  */
 void audio_source_select(int source)
 {
-#if 0 /* use audio module interface */
-       unsigned int reg = 0;
-
-       atvaudio_ctrl_read(&reg);
-
-       if (source) {
-               if (is_meson_tl1_cpu() || is_meson_tm2_cpu())
-                       atvaudio_ctrl_write(reg | 0x100000);/* bit20 */
-               else
-                       atvaudio_ctrl_write(reg | 0x3);/* bit[1-0] */
-       } else {
-               if (is_meson_tl1_cpu() || is_meson_tm2_cpu())
-                       atvaudio_ctrl_write(reg & (~0x100000));/* bit20 */
-               else
-                       atvaudio_ctrl_write(reg & (~0x3));/* bit[1-0] */
-       }
+#ifdef CONFIG_AMLOGIC_SND_SOC_AUGE
+       if (source)
+               fratv_src_select(true);
+       else
+               fratv_src_select(false);
 #else
        if (source)
-               fratv_src_select(1);
+               atv_LR_swap(true);
        else
-               fratv_src_select(0);
+               atv_LR_swap(false);
 #endif
 }
index 3e60518..e5f304a 100644 (file)
@@ -23,7 +23,7 @@
 #ifdef CONFIG_AMLOGIC_SND_SOC_AUGE
 #include "sound/soc/amlogic/auge/audio_utils.h"
 #else
-#include "sound/soc/amlogic/meson/audio_utils.h"
+#include "sound/soc/amlogic/meson/audio_hw.h"
 #endif
 
 extern unsigned int signal_audmode;