Avoid mode and use directions logic instead, introducing modem support
authorPaul Kocialkowski <contact@paulk.fr>
Sat, 27 Oct 2012 14:58:10 +0000 (16:58 +0200)
committerPaul Kocialkowski <contact@paulk.fr>
Sat, 27 Oct 2012 14:58:10 +0000 (16:58 +0200)
GalaxyS2: Added modem routes, using directions, corrected init path info

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
device/galaxys2.c
include/yamaha-mc1n2-audio.h
yamaha-mc1n2-audio.c

index ba48251..8a26453 100644 (file)
@@ -42,14 +42,14 @@ struct yamaha_mc1n2_audio_params_init galaxys2_params_init = {
                .asHpOut[0].abSrcOnOff[0] = MCDRV_SRC0_MIC3_OFF | MCDRV_SRC0_MIC2_OFF | MCDRV_SRC0_MIC1_OFF,
                .asHpOut[0].abSrcOnOff[1] = MCDRV_SRC1_LINE1_M_OFF | MCDRV_SRC1_LINE1_R_OFF | MCDRV_SRC1_LINE1_L_OFF,
                .asHpOut[0].abSrcOnOff[2] = MCDRV_SRC2_LINE2_M_OFF | MCDRV_SRC2_LINE2_R_OFF | MCDRV_SRC2_LINE2_L_OFF,
-               .asHpOut[0].abSrcOnOff[3] = MCDRV_SRC3_DIR2_DIRECT_OFF | MCDRV_SRC3_DIR2_OFF | MCDRV_SRC3_DIR1_OFF,
+               .asHpOut[0].abSrcOnOff[3] = MCDRV_SRC3_DIR2_DIRECT_OFF | MCDRV_SRC3_DIR2_OFF | MCDRV_SRC3_DIR1_OFF | MCDRV_SRC3_DIR0_OFF,
                .asHpOut[0].abSrcOnOff[4] = MCDRV_SRC4_ADC1_OFF | MCDRV_SRC4_ADC0_OFF | MCDRV_SRC4_PDM_OFF | MCDRV_SRC4_DTMF_OFF,
                .asHpOut[0].abSrcOnOff[5] = MCDRV_SRC5_DAC_M_OFF | MCDRV_SRC5_DAC_R_OFF | MCDRV_SRC5_DAC_L_OFF,
                .asHpOut[0].abSrcOnOff[6] = MCDRV_SRC6_CDSP_DIRECT_OFF | MCDRV_SRC6_CDSP_OFF | MCDRV_SRC6_AE_OFF | MCDRV_SRC6_MIX_OFF,
                .asHpOut[1].abSrcOnOff[0] = MCDRV_SRC0_MIC3_OFF | MCDRV_SRC0_MIC2_OFF | MCDRV_SRC0_MIC1_OFF,
                .asHpOut[1].abSrcOnOff[1] = MCDRV_SRC1_LINE1_M_OFF | MCDRV_SRC1_LINE1_R_OFF | MCDRV_SRC1_LINE1_L_OFF,
                .asHpOut[1].abSrcOnOff[2] = MCDRV_SRC2_LINE2_M_OFF | MCDRV_SRC2_LINE2_R_OFF | MCDRV_SRC2_LINE2_L_OFF,
-               .asHpOut[1].abSrcOnOff[3] = MCDRV_SRC3_DIR2_DIRECT_OFF | MCDRV_SRC3_DIR2_OFF | MCDRV_SRC3_DIR1_OFF,
+               .asHpOut[1].abSrcOnOff[3] = MCDRV_SRC3_DIR2_DIRECT_OFF | MCDRV_SRC3_DIR2_OFF | MCDRV_SRC3_DIR1_OFF | MCDRV_SRC3_DIR0_OFF,
                .asHpOut[1].abSrcOnOff[4] = MCDRV_SRC4_ADC1_OFF | MCDRV_SRC4_ADC0_OFF | MCDRV_SRC4_PDM_OFF | MCDRV_SRC4_DTMF_OFF,
                .asHpOut[1].abSrcOnOff[5] = MCDRV_SRC5_DAC_M_OFF | MCDRV_SRC5_DAC_R_OFF | MCDRV_SRC5_DAC_L_OFF,
                .asHpOut[1].abSrcOnOff[6] = MCDRV_SRC6_CDSP_DIRECT_OFF | MCDRV_SRC6_CDSP_OFF | MCDRV_SRC6_AE_OFF | MCDRV_SRC6_MIX_OFF,
@@ -57,14 +57,14 @@ struct yamaha_mc1n2_audio_params_init galaxys2_params_init = {
                .asSpOut[0].abSrcOnOff[0] = MCDRV_SRC0_MIC3_OFF | MCDRV_SRC0_MIC2_OFF | MCDRV_SRC0_MIC1_OFF,
                .asSpOut[0].abSrcOnOff[1] = MCDRV_SRC1_LINE1_M_OFF | MCDRV_SRC1_LINE1_R_OFF | MCDRV_SRC1_LINE1_L_OFF,
                .asSpOut[0].abSrcOnOff[2] = MCDRV_SRC2_LINE2_M_OFF | MCDRV_SRC2_LINE2_R_OFF | MCDRV_SRC2_LINE2_L_OFF,
-               .asSpOut[0].abSrcOnOff[3] = MCDRV_SRC3_DIR2_DIRECT_OFF | MCDRV_SRC3_DIR2_OFF | MCDRV_SRC3_DIR1_OFF,
+               .asSpOut[0].abSrcOnOff[3] = MCDRV_SRC3_DIR2_DIRECT_OFF | MCDRV_SRC3_DIR2_OFF | MCDRV_SRC3_DIR1_OFF | MCDRV_SRC3_DIR0_OFF,
                .asSpOut[0].abSrcOnOff[4] = MCDRV_SRC4_ADC1_OFF | MCDRV_SRC4_ADC0_OFF | MCDRV_SRC4_PDM_OFF | MCDRV_SRC4_DTMF_OFF,
                .asSpOut[0].abSrcOnOff[5] = MCDRV_SRC5_DAC_M_OFF | MCDRV_SRC5_DAC_R_OFF | MCDRV_SRC5_DAC_L_OFF,
                .asSpOut[0].abSrcOnOff[6] = MCDRV_SRC6_CDSP_DIRECT_OFF | MCDRV_SRC6_CDSP_OFF | MCDRV_SRC6_AE_OFF | MCDRV_SRC6_MIX_OFF,
                .asSpOut[1].abSrcOnOff[0] = MCDRV_SRC0_MIC3_OFF | MCDRV_SRC0_MIC2_OFF | MCDRV_SRC0_MIC1_OFF,
                .asSpOut[1].abSrcOnOff[1] = MCDRV_SRC1_LINE1_M_OFF | MCDRV_SRC1_LINE1_R_OFF | MCDRV_SRC1_LINE1_L_OFF,
                .asSpOut[1].abSrcOnOff[2] = MCDRV_SRC2_LINE2_M_OFF | MCDRV_SRC2_LINE2_R_OFF | MCDRV_SRC2_LINE2_L_OFF,
-               .asSpOut[1].abSrcOnOff[3] = MCDRV_SRC3_DIR2_DIRECT_OFF | MCDRV_SRC3_DIR2_OFF | MCDRV_SRC3_DIR1_OFF,
+               .asSpOut[1].abSrcOnOff[3] = MCDRV_SRC3_DIR2_DIRECT_OFF | MCDRV_SRC3_DIR2_OFF | MCDRV_SRC3_DIR1_OFF | MCDRV_SRC3_DIR0_OFF,
                .asSpOut[1].abSrcOnOff[4] = MCDRV_SRC4_ADC1_OFF | MCDRV_SRC4_ADC0_OFF | MCDRV_SRC4_PDM_OFF | MCDRV_SRC4_DTMF_OFF,
                .asSpOut[1].abSrcOnOff[5] = MCDRV_SRC5_DAC_M_OFF | MCDRV_SRC5_DAC_R_OFF | MCDRV_SRC5_DAC_L_OFF,
                .asSpOut[1].abSrcOnOff[6] = MCDRV_SRC6_CDSP_DIRECT_OFF | MCDRV_SRC6_CDSP_OFF | MCDRV_SRC6_AE_OFF | MCDRV_SRC6_MIX_OFF,
@@ -72,7 +72,7 @@ struct yamaha_mc1n2_audio_params_init galaxys2_params_init = {
                .asRcOut[0].abSrcOnOff[0] = MCDRV_SRC0_MIC3_OFF | MCDRV_SRC0_MIC2_OFF | MCDRV_SRC0_MIC1_OFF,
                .asRcOut[0].abSrcOnOff[1] = MCDRV_SRC1_LINE1_M_OFF | MCDRV_SRC1_LINE1_R_OFF | MCDRV_SRC1_LINE1_L_OFF,
                .asRcOut[0].abSrcOnOff[2] = MCDRV_SRC2_LINE2_M_OFF | MCDRV_SRC2_LINE2_R_OFF | MCDRV_SRC2_LINE2_L_OFF,
-               .asRcOut[0].abSrcOnOff[3] = MCDRV_SRC3_DIR2_DIRECT_OFF | MCDRV_SRC3_DIR2_OFF | MCDRV_SRC3_DIR1_OFF,
+               .asRcOut[0].abSrcOnOff[3] = MCDRV_SRC3_DIR2_DIRECT_OFF | MCDRV_SRC3_DIR2_OFF | MCDRV_SRC3_DIR1_OFF | MCDRV_SRC3_DIR0_OFF,
                .asRcOut[0].abSrcOnOff[4] = MCDRV_SRC4_ADC1_OFF | MCDRV_SRC4_ADC0_OFF | MCDRV_SRC4_PDM_OFF | MCDRV_SRC4_DTMF_OFF,
                .asRcOut[0].abSrcOnOff[5] = MCDRV_SRC5_DAC_M_OFF | MCDRV_SRC5_DAC_R_OFF | MCDRV_SRC5_DAC_L_OFF,
                .asRcOut[0].abSrcOnOff[6] = MCDRV_SRC6_CDSP_DIRECT_OFF | MCDRV_SRC6_CDSP_OFF | MCDRV_SRC6_AE_OFF | MCDRV_SRC6_MIX_OFF,
@@ -80,14 +80,14 @@ struct yamaha_mc1n2_audio_params_init galaxys2_params_init = {
                .asLout1[0].abSrcOnOff[0] = MCDRV_SRC0_MIC3_OFF | MCDRV_SRC0_MIC2_OFF | MCDRV_SRC0_MIC1_OFF,
                .asLout1[0].abSrcOnOff[1] = MCDRV_SRC1_LINE1_M_OFF | MCDRV_SRC1_LINE1_R_OFF | MCDRV_SRC1_LINE1_L_OFF,
                .asLout1[0].abSrcOnOff[2] = MCDRV_SRC2_LINE2_M_OFF | MCDRV_SRC2_LINE2_R_OFF | MCDRV_SRC2_LINE2_L_OFF,
-               .asLout1[0].abSrcOnOff[3] = MCDRV_SRC3_DIR2_DIRECT_OFF | MCDRV_SRC3_DIR2_OFF | MCDRV_SRC3_DIR1_OFF,
+               .asLout1[0].abSrcOnOff[3] = MCDRV_SRC3_DIR2_DIRECT_OFF | MCDRV_SRC3_DIR2_OFF | MCDRV_SRC3_DIR1_OFF | MCDRV_SRC3_DIR0_OFF,
                .asLout1[0].abSrcOnOff[4] = MCDRV_SRC4_ADC1_OFF | MCDRV_SRC4_ADC0_OFF | MCDRV_SRC4_PDM_OFF | MCDRV_SRC4_DTMF_OFF,
                .asLout1[0].abSrcOnOff[5] = MCDRV_SRC5_DAC_M_OFF | MCDRV_SRC5_DAC_R_OFF | MCDRV_SRC5_DAC_L_OFF,
                .asLout1[0].abSrcOnOff[6] = MCDRV_SRC6_CDSP_DIRECT_OFF | MCDRV_SRC6_CDSP_OFF | MCDRV_SRC6_AE_OFF | MCDRV_SRC6_MIX_OFF,
                .asLout1[1].abSrcOnOff[0] = MCDRV_SRC0_MIC3_OFF | MCDRV_SRC0_MIC2_OFF | MCDRV_SRC0_MIC1_OFF,
                .asLout1[1].abSrcOnOff[1] = MCDRV_SRC1_LINE1_M_OFF | MCDRV_SRC1_LINE1_R_OFF | MCDRV_SRC1_LINE1_L_OFF,
                .asLout1[1].abSrcOnOff[2] = MCDRV_SRC2_LINE2_M_OFF | MCDRV_SRC2_LINE2_R_OFF | MCDRV_SRC2_LINE2_L_OFF,
-               .asLout1[1].abSrcOnOff[3] = MCDRV_SRC3_DIR2_DIRECT_OFF | MCDRV_SRC3_DIR2_OFF | MCDRV_SRC3_DIR1_OFF,
+               .asLout1[1].abSrcOnOff[3] = MCDRV_SRC3_DIR2_DIRECT_OFF | MCDRV_SRC3_DIR2_OFF | MCDRV_SRC3_DIR1_OFF | MCDRV_SRC3_DIR0_OFF,
                .asLout1[1].abSrcOnOff[4] = MCDRV_SRC4_ADC1_OFF | MCDRV_SRC4_ADC0_OFF | MCDRV_SRC4_PDM_OFF | MCDRV_SRC4_DTMF_OFF,
                .asLout1[1].abSrcOnOff[5] = MCDRV_SRC5_DAC_M_OFF | MCDRV_SRC5_DAC_R_OFF | MCDRV_SRC5_DAC_L_OFF,
                .asLout1[1].abSrcOnOff[6] = MCDRV_SRC6_CDSP_DIRECT_OFF | MCDRV_SRC6_CDSP_OFF | MCDRV_SRC6_AE_OFF | MCDRV_SRC6_MIX_OFF,
@@ -95,14 +95,14 @@ struct yamaha_mc1n2_audio_params_init galaxys2_params_init = {
                .asLout2[0].abSrcOnOff[0] = MCDRV_SRC0_MIC3_OFF | MCDRV_SRC0_MIC2_OFF | MCDRV_SRC0_MIC1_OFF,
                .asLout2[0].abSrcOnOff[1] = MCDRV_SRC1_LINE1_M_OFF | MCDRV_SRC1_LINE1_R_OFF | MCDRV_SRC1_LINE1_L_OFF,
                .asLout2[0].abSrcOnOff[2] = MCDRV_SRC2_LINE2_M_OFF | MCDRV_SRC2_LINE2_R_OFF | MCDRV_SRC2_LINE2_L_OFF,
-               .asLout2[0].abSrcOnOff[3] = MCDRV_SRC3_DIR2_DIRECT_OFF | MCDRV_SRC3_DIR2_OFF | MCDRV_SRC3_DIR1_OFF,
+               .asLout2[0].abSrcOnOff[3] = MCDRV_SRC3_DIR2_DIRECT_OFF | MCDRV_SRC3_DIR2_OFF | MCDRV_SRC3_DIR1_OFF | MCDRV_SRC3_DIR0_OFF,
                .asLout2[0].abSrcOnOff[4] = MCDRV_SRC4_ADC1_OFF | MCDRV_SRC4_ADC0_OFF | MCDRV_SRC4_PDM_OFF | MCDRV_SRC4_DTMF_OFF,
                .asLout2[0].abSrcOnOff[5] = MCDRV_SRC5_DAC_M_OFF | MCDRV_SRC5_DAC_R_OFF | MCDRV_SRC5_DAC_L_OFF,
                .asLout2[0].abSrcOnOff[6] = MCDRV_SRC6_CDSP_DIRECT_OFF | MCDRV_SRC6_CDSP_OFF | MCDRV_SRC6_AE_OFF | MCDRV_SRC6_MIX_OFF,
                .asLout2[1].abSrcOnOff[0] = MCDRV_SRC0_MIC3_OFF | MCDRV_SRC0_MIC2_OFF | MCDRV_SRC0_MIC1_OFF,
                .asLout2[1].abSrcOnOff[1] = MCDRV_SRC1_LINE1_M_OFF | MCDRV_SRC1_LINE1_R_OFF | MCDRV_SRC1_LINE1_L_OFF,
                .asLout2[1].abSrcOnOff[2] = MCDRV_SRC2_LINE2_M_OFF | MCDRV_SRC2_LINE2_R_OFF | MCDRV_SRC2_LINE2_L_OFF,
-               .asLout2[1].abSrcOnOff[3] = MCDRV_SRC3_DIR2_DIRECT_OFF | MCDRV_SRC3_DIR2_OFF | MCDRV_SRC3_DIR1_OFF,
+               .asLout2[1].abSrcOnOff[3] = MCDRV_SRC3_DIR2_DIRECT_OFF | MCDRV_SRC3_DIR2_OFF | MCDRV_SRC3_DIR1_OFF | MCDRV_SRC3_DIR0_OFF,
                .asLout2[1].abSrcOnOff[4] = MCDRV_SRC4_ADC1_OFF | MCDRV_SRC4_ADC0_OFF | MCDRV_SRC4_PDM_OFF | MCDRV_SRC4_DTMF_OFF,
                .asLout2[1].abSrcOnOff[5] = MCDRV_SRC5_DAC_M_OFF | MCDRV_SRC5_DAC_R_OFF | MCDRV_SRC5_DAC_L_OFF,
                .asLout2[1].abSrcOnOff[6] = MCDRV_SRC6_CDSP_DIRECT_OFF | MCDRV_SRC6_CDSP_OFF | MCDRV_SRC6_AE_OFF | MCDRV_SRC6_MIX_OFF,
@@ -120,7 +120,7 @@ struct yamaha_mc1n2_audio_params_init galaxys2_params_init = {
                .asDit1[0].abSrcOnOff[0] = MCDRV_SRC0_MIC3_OFF | MCDRV_SRC0_MIC2_OFF | MCDRV_SRC0_MIC1_OFF,
                .asDit1[0].abSrcOnOff[1] = MCDRV_SRC1_LINE1_M_OFF | MCDRV_SRC1_LINE1_R_OFF | MCDRV_SRC1_LINE1_L_OFF,
                .asDit1[0].abSrcOnOff[2] = MCDRV_SRC2_LINE2_M_OFF | MCDRV_SRC2_LINE2_R_OFF | MCDRV_SRC2_LINE2_L_OFF,
-               .asDit1[0].abSrcOnOff[3] = MCDRV_SRC3_DIR2_DIRECT_OFF | MCDRV_SRC3_DIR2_OFF | MCDRV_SRC3_DIR1_OFF,
+               .asDit1[0].abSrcOnOff[3] = MCDRV_SRC3_DIR2_DIRECT_OFF | MCDRV_SRC3_DIR2_OFF | MCDRV_SRC3_DIR1_OFF | MCDRV_SRC3_DIR0_OFF,
                .asDit1[0].abSrcOnOff[4] = MCDRV_SRC4_ADC1_OFF | MCDRV_SRC4_ADC0_OFF | MCDRV_SRC4_PDM_OFF | MCDRV_SRC4_DTMF_OFF,
                .asDit1[0].abSrcOnOff[5] = MCDRV_SRC5_DAC_M_OFF | MCDRV_SRC5_DAC_R_OFF | MCDRV_SRC5_DAC_L_OFF,
                .asDit1[0].abSrcOnOff[6] = MCDRV_SRC6_CDSP_DIRECT_OFF | MCDRV_SRC6_CDSP_OFF | MCDRV_SRC6_AE_OFF | MCDRV_SRC6_MIX_OFF,
@@ -128,7 +128,7 @@ struct yamaha_mc1n2_audio_params_init galaxys2_params_init = {
                .asDit2[0].abSrcOnOff[0] = MCDRV_SRC0_MIC3_OFF | MCDRV_SRC0_MIC2_OFF | MCDRV_SRC0_MIC1_OFF,
                .asDit2[0].abSrcOnOff[1] = MCDRV_SRC1_LINE1_M_OFF | MCDRV_SRC1_LINE1_R_OFF | MCDRV_SRC1_LINE1_L_OFF,
                .asDit2[0].abSrcOnOff[2] = MCDRV_SRC2_LINE2_M_OFF | MCDRV_SRC2_LINE2_R_OFF | MCDRV_SRC2_LINE2_L_OFF,
-               .asDit2[0].abSrcOnOff[3] = MCDRV_SRC3_DIR2_DIRECT_OFF | MCDRV_SRC3_DIR2_OFF | MCDRV_SRC3_DIR1_OFF,
+               .asDit2[0].abSrcOnOff[3] = MCDRV_SRC3_DIR2_DIRECT_OFF | MCDRV_SRC3_DIR2_OFF | MCDRV_SRC3_DIR1_OFF | MCDRV_SRC3_DIR0_OFF,
                .asDit2[0].abSrcOnOff[4] = MCDRV_SRC4_ADC1_OFF | MCDRV_SRC4_ADC0_OFF | MCDRV_SRC4_PDM_OFF | MCDRV_SRC4_DTMF_OFF,
                .asDit2[0].abSrcOnOff[5] = MCDRV_SRC5_DAC_M_OFF | MCDRV_SRC5_DAC_R_OFF | MCDRV_SRC5_DAC_L_OFF,
                .asDit2[0].abSrcOnOff[6] = MCDRV_SRC6_CDSP_DIRECT_OFF | MCDRV_SRC6_CDSP_OFF | MCDRV_SRC6_AE_OFF | MCDRV_SRC6_MIX_OFF,
@@ -136,14 +136,14 @@ struct yamaha_mc1n2_audio_params_init galaxys2_params_init = {
                .asDac[0].abSrcOnOff[0] = MCDRV_SRC0_MIC3_OFF | MCDRV_SRC0_MIC2_OFF | MCDRV_SRC0_MIC1_OFF,
                .asDac[0].abSrcOnOff[1] = MCDRV_SRC1_LINE1_M_OFF | MCDRV_SRC1_LINE1_R_OFF | MCDRV_SRC1_LINE1_L_OFF,
                .asDac[0].abSrcOnOff[2] = MCDRV_SRC2_LINE2_M_OFF | MCDRV_SRC2_LINE2_R_OFF | MCDRV_SRC2_LINE2_L_OFF,
-               .asDac[0].abSrcOnOff[3] = MCDRV_SRC3_DIR2_DIRECT_OFF | MCDRV_SRC3_DIR2_OFF | MCDRV_SRC3_DIR1_OFF,
+               .asDac[0].abSrcOnOff[3] = MCDRV_SRC3_DIR2_DIRECT_OFF | MCDRV_SRC3_DIR2_OFF | MCDRV_SRC3_DIR1_OFF | MCDRV_SRC3_DIR0_OFF,
                .asDac[0].abSrcOnOff[4] = MCDRV_SRC4_ADC1_OFF | MCDRV_SRC4_ADC0_OFF | MCDRV_SRC4_PDM_OFF | MCDRV_SRC4_DTMF_OFF,
                .asDac[0].abSrcOnOff[5] = MCDRV_SRC5_DAC_M_OFF | MCDRV_SRC5_DAC_R_OFF | MCDRV_SRC5_DAC_L_OFF,
                .asDac[0].abSrcOnOff[6] = MCDRV_SRC6_CDSP_DIRECT_OFF | MCDRV_SRC6_CDSP_OFF | MCDRV_SRC6_AE_OFF | MCDRV_SRC6_MIX_OFF,
                .asDac[1].abSrcOnOff[0] = MCDRV_SRC0_MIC3_OFF | MCDRV_SRC0_MIC2_OFF | MCDRV_SRC0_MIC1_OFF,
                .asDac[1].abSrcOnOff[1] = MCDRV_SRC1_LINE1_M_OFF | MCDRV_SRC1_LINE1_R_OFF | MCDRV_SRC1_LINE1_L_OFF,
                .asDac[1].abSrcOnOff[2] = MCDRV_SRC2_LINE2_M_OFF | MCDRV_SRC2_LINE2_R_OFF | MCDRV_SRC2_LINE2_L_OFF,
-               .asDac[1].abSrcOnOff[3] = MCDRV_SRC3_DIR2_DIRECT_OFF | MCDRV_SRC3_DIR2_OFF | MCDRV_SRC3_DIR1_OFF,
+               .asDac[1].abSrcOnOff[3] = MCDRV_SRC3_DIR2_DIRECT_OFF | MCDRV_SRC3_DIR2_OFF | MCDRV_SRC3_DIR1_OFF | MCDRV_SRC3_DIR0_OFF,
                .asDac[1].abSrcOnOff[4] = MCDRV_SRC4_ADC1_OFF | MCDRV_SRC4_ADC0_OFF | MCDRV_SRC4_PDM_OFF | MCDRV_SRC4_DTMF_OFF,
                .asDac[1].abSrcOnOff[5] = MCDRV_SRC5_DAC_M_OFF | MCDRV_SRC5_DAC_R_OFF | MCDRV_SRC5_DAC_L_OFF,
                .asDac[1].abSrcOnOff[6] = MCDRV_SRC6_CDSP_DIRECT_OFF | MCDRV_SRC6_CDSP_OFF | MCDRV_SRC6_AE_OFF | MCDRV_SRC6_MIX_OFF,
@@ -151,7 +151,7 @@ struct yamaha_mc1n2_audio_params_init galaxys2_params_init = {
                .asAe[0].abSrcOnOff[0] = MCDRV_SRC0_MIC3_OFF | MCDRV_SRC0_MIC2_OFF | MCDRV_SRC0_MIC1_OFF,
                .asAe[0].abSrcOnOff[1] = MCDRV_SRC1_LINE1_M_OFF | MCDRV_SRC1_LINE1_R_OFF | MCDRV_SRC1_LINE1_L_OFF,
                .asAe[0].abSrcOnOff[2] = MCDRV_SRC2_LINE2_M_OFF | MCDRV_SRC2_LINE2_R_OFF | MCDRV_SRC2_LINE2_L_OFF,
-               .asAe[0].abSrcOnOff[3] = MCDRV_SRC3_DIR2_DIRECT_OFF | MCDRV_SRC3_DIR2_OFF | MCDRV_SRC3_DIR1_OFF,
+               .asAe[0].abSrcOnOff[3] = MCDRV_SRC3_DIR2_DIRECT_OFF | MCDRV_SRC3_DIR2_OFF | MCDRV_SRC3_DIR1_OFF | MCDRV_SRC3_DIR0_OFF,
                .asAe[0].abSrcOnOff[4] = MCDRV_SRC4_ADC1_OFF | MCDRV_SRC4_ADC0_OFF | MCDRV_SRC4_PDM_OFF | MCDRV_SRC4_DTMF_OFF,
                .asAe[0].abSrcOnOff[5] = MCDRV_SRC5_DAC_M_OFF | MCDRV_SRC5_DAC_R_OFF | MCDRV_SRC5_DAC_L_OFF,
                .asAe[0].abSrcOnOff[6] = MCDRV_SRC6_CDSP_DIRECT_OFF | MCDRV_SRC6_CDSP_OFF | MCDRV_SRC6_AE_OFF | MCDRV_SRC6_MIX_OFF,
@@ -176,14 +176,14 @@ struct yamaha_mc1n2_audio_params_init galaxys2_params_init = {
                .asAdc0[0].abSrcOnOff[0] = MCDRV_SRC0_MIC3_OFF | MCDRV_SRC0_MIC2_OFF | MCDRV_SRC0_MIC1_OFF,
                .asAdc0[0].abSrcOnOff[1] = MCDRV_SRC1_LINE1_M_OFF | MCDRV_SRC1_LINE1_R_OFF | MCDRV_SRC1_LINE1_L_OFF,
                .asAdc0[0].abSrcOnOff[2] = MCDRV_SRC2_LINE2_M_OFF | MCDRV_SRC2_LINE2_R_OFF | MCDRV_SRC2_LINE2_L_OFF,
-               .asAdc0[0].abSrcOnOff[3] = MCDRV_SRC3_DIR2_DIRECT_OFF | MCDRV_SRC3_DIR2_OFF | MCDRV_SRC3_DIR1_OFF,
+               .asAdc0[0].abSrcOnOff[3] = MCDRV_SRC3_DIR2_DIRECT_OFF | MCDRV_SRC3_DIR2_OFF | MCDRV_SRC3_DIR1_OFF | MCDRV_SRC3_DIR0_OFF,
                .asAdc0[0].abSrcOnOff[4] = MCDRV_SRC4_ADC1_OFF | MCDRV_SRC4_ADC0_OFF | MCDRV_SRC4_PDM_OFF | MCDRV_SRC4_DTMF_OFF,
                .asAdc0[0].abSrcOnOff[5] = MCDRV_SRC5_DAC_M_OFF | MCDRV_SRC5_DAC_R_OFF | MCDRV_SRC5_DAC_L_OFF,
                .asAdc0[0].abSrcOnOff[6] = MCDRV_SRC6_CDSP_DIRECT_OFF | MCDRV_SRC6_CDSP_OFF | MCDRV_SRC6_AE_OFF | MCDRV_SRC6_MIX_OFF,
                .asAdc0[1].abSrcOnOff[0] = MCDRV_SRC0_MIC3_OFF | MCDRV_SRC0_MIC2_OFF | MCDRV_SRC0_MIC1_OFF,
                .asAdc0[1].abSrcOnOff[1] = MCDRV_SRC1_LINE1_M_OFF | MCDRV_SRC1_LINE1_R_OFF | MCDRV_SRC1_LINE1_L_OFF,
                .asAdc0[1].abSrcOnOff[2] = MCDRV_SRC2_LINE2_M_OFF | MCDRV_SRC2_LINE2_R_OFF | MCDRV_SRC2_LINE2_L_OFF,
-               .asAdc0[1].abSrcOnOff[3] = MCDRV_SRC3_DIR2_DIRECT_OFF | MCDRV_SRC3_DIR2_OFF | MCDRV_SRC3_DIR1_OFF,
+               .asAdc0[1].abSrcOnOff[3] = MCDRV_SRC3_DIR2_DIRECT_OFF | MCDRV_SRC3_DIR2_OFF | MCDRV_SRC3_DIR1_OFF | MCDRV_SRC3_DIR0_OFF,
                .asAdc0[1].abSrcOnOff[4] = MCDRV_SRC4_ADC1_OFF | MCDRV_SRC4_ADC0_OFF | MCDRV_SRC4_PDM_OFF | MCDRV_SRC4_DTMF_OFF,
                .asAdc0[1].abSrcOnOff[5] = MCDRV_SRC5_DAC_M_OFF | MCDRV_SRC5_DAC_R_OFF | MCDRV_SRC5_DAC_L_OFF,
                .asAdc0[1].abSrcOnOff[6] = MCDRV_SRC6_CDSP_DIRECT_OFF | MCDRV_SRC6_CDSP_OFF | MCDRV_SRC6_AE_OFF | MCDRV_SRC6_MIX_OFF,
@@ -199,7 +199,7 @@ struct yamaha_mc1n2_audio_params_init galaxys2_params_init = {
                .asMix[0].abSrcOnOff[0] = MCDRV_SRC0_MIC3_OFF | MCDRV_SRC0_MIC2_OFF | MCDRV_SRC0_MIC1_OFF,
                .asMix[0].abSrcOnOff[1] = MCDRV_SRC1_LINE1_M_OFF | MCDRV_SRC1_LINE1_R_OFF | MCDRV_SRC1_LINE1_L_OFF,
                .asMix[0].abSrcOnOff[2] = MCDRV_SRC2_LINE2_M_OFF | MCDRV_SRC2_LINE2_R_OFF | MCDRV_SRC2_LINE2_L_OFF,
-               .asMix[0].abSrcOnOff[3] = MCDRV_SRC3_DIR2_DIRECT_OFF | MCDRV_SRC3_DIR2_OFF | MCDRV_SRC3_DIR1_OFF,
+               .asMix[0].abSrcOnOff[3] = MCDRV_SRC3_DIR2_DIRECT_OFF | MCDRV_SRC3_DIR2_OFF | MCDRV_SRC3_DIR1_OFF | MCDRV_SRC3_DIR0_OFF,
                .asMix[0].abSrcOnOff[4] = MCDRV_SRC4_ADC1_OFF | MCDRV_SRC4_ADC0_OFF | MCDRV_SRC4_PDM_OFF | MCDRV_SRC4_DTMF_OFF,
                .asMix[0].abSrcOnOff[5] = MCDRV_SRC5_DAC_M_OFF | MCDRV_SRC5_DAC_R_OFF | MCDRV_SRC5_DAC_L_OFF,
                .asMix[0].abSrcOnOff[6] = MCDRV_SRC6_CDSP_DIRECT_OFF | MCDRV_SRC6_CDSP_OFF | MCDRV_SRC6_AE_OFF | MCDRV_SRC6_MIX_OFF,
@@ -207,7 +207,7 @@ struct yamaha_mc1n2_audio_params_init galaxys2_params_init = {
                .asBias[0].abSrcOnOff[0] = MCDRV_SRC0_MIC3_OFF | MCDRV_SRC0_MIC2_OFF | MCDRV_SRC0_MIC1_OFF,
                .asBias[0].abSrcOnOff[1] = MCDRV_SRC1_LINE1_M_OFF | MCDRV_SRC1_LINE1_R_OFF | MCDRV_SRC1_LINE1_L_OFF,
                .asBias[0].abSrcOnOff[2] = MCDRV_SRC2_LINE2_M_OFF | MCDRV_SRC2_LINE2_R_OFF | MCDRV_SRC2_LINE2_L_OFF,
-               .asBias[0].abSrcOnOff[3] = MCDRV_SRC3_DIR2_DIRECT_OFF | MCDRV_SRC3_DIR2_OFF | MCDRV_SRC3_DIR1_OFF,
+               .asBias[0].abSrcOnOff[3] = MCDRV_SRC3_DIR2_DIRECT_OFF | MCDRV_SRC3_DIR2_OFF | MCDRV_SRC3_DIR1_OFF | MCDRV_SRC3_DIR0_OFF,
                .asBias[0].abSrcOnOff[4] = MCDRV_SRC4_ADC1_OFF | MCDRV_SRC4_ADC0_OFF | MCDRV_SRC4_PDM_OFF | MCDRV_SRC4_DTMF_OFF,
                .asBias[0].abSrcOnOff[5] = MCDRV_SRC5_DAC_M_OFF | MCDRV_SRC5_DAC_R_OFF | MCDRV_SRC5_DAC_L_OFF,
                .asBias[0].abSrcOnOff[6] = MCDRV_SRC6_CDSP_DIRECT_OFF | MCDRV_SRC6_CDSP_OFF | MCDRV_SRC6_AE_OFF | MCDRV_SRC6_MIX_OFF,
@@ -274,8 +274,57 @@ struct yamaha_mc1n2_audio_params_init galaxys2_params_init = {
 
 struct yamaha_mc1n2_audio_params_route galaxys2_params_routes[] = {
        {
+               .device = AUDIO_DEVICE_OUT_EARPIECE,
+               .direction = YAMAHA_MC1N2_AUDIO_DIRECTION_OUTPUT,
+
+               .ae_info = {
+                       .bOnOff = 0,
+                       .abBex = { 0 },
+                       .abWide = { 0 },
+                       .abDrc = { 0 },
+                       .abEq5 = { 0 },
+                       .abEq3 = { 0 },
+               },
+
+               .path_info.asHpOut[0].abSrcOnOff = { 0 },
+               .path_info.asHpOut[1].abSrcOnOff = { 0 },
+               .path_info.asSpOut[0].abSrcOnOff = { 0 },
+               .path_info.asSpOut[1].abSrcOnOff = { 0 },
+               .path_info.asRcOut[0].abSrcOnOff = { 0 },
+               .path_info.asLout1[0].abSrcOnOff = { 0 },
+               .path_info.asLout1[1].abSrcOnOff = { 0 },
+               .path_info.asLout2[0].abSrcOnOff = { 0 },
+               .path_info.asLout2[1].abSrcOnOff = { 0 },
+               .path_info.asPeak[0].abSrcOnOff = { 0 },
+               .path_info.asDit0[0].abSrcOnOff = { 0 },
+               .path_info.asDit1[0].abSrcOnOff = { 0 },
+               .path_info.asDit2[0].abSrcOnOff = { 0 },
+               .path_info.asDac[0].abSrcOnOff = { 0 },
+               .path_info.asDac[1].abSrcOnOff = { 0 },
+               .path_info.asAe[0].abSrcOnOff = { 0 },
+               .path_info.asCdsp[0].abSrcOnOff = { 0 },
+               .path_info.asCdsp[1].abSrcOnOff = { 0 },
+               .path_info.asCdsp[2].abSrcOnOff = { 0 },
+               .path_info.asCdsp[3].abSrcOnOff = { 0 },
+               .path_info.asAdc0[0].abSrcOnOff = { 0 },
+               .path_info.asAdc0[1].abSrcOnOff = { 0 },
+               .path_info.asAdc1[0].abSrcOnOff = { 0 },
+               .path_info.asMix[0].abSrcOnOff = { 0 },
+               .path_info.asBias[0].abSrcOnOff = { 0 },
+
+               .path_info.asRcOut[0].abSrcOnOff[5] = MCDRV_SRC5_DAC_R_ON | MCDRV_SRC5_DAC_L_ON,
+               .path_info.asDac[0].abSrcOnOff[6] = MCDRV_SRC6_MIX_ON,
+               .path_info.asMix[0].abSrcOnOff[3] = MCDRV_SRC3_DIR0_ON,
+
+               .dac_info = {
+                       .bMasterSwap = 0,
+                       .bVoiceSwap = 0,
+                       .bDcCut = 0,
+               },
+       },
+       {
                .device = AUDIO_DEVICE_OUT_SPEAKER,
-               .mode = AUDIO_MODE_NORMAL,
+               .direction = YAMAHA_MC1N2_AUDIO_DIRECTION_OUTPUT,
 
                .ae_info = {
                        .bOnOff = 0,
@@ -324,7 +373,7 @@ struct yamaha_mc1n2_audio_params_route galaxys2_params_routes[] = {
        },
        {
                .device = AUDIO_DEVICE_OUT_WIRED_HEADPHONE,
-               .mode = AUDIO_MODE_NORMAL,
+               .direction = YAMAHA_MC1N2_AUDIO_DIRECTION_OUTPUT,
 
                .ae_info = {
                        .bOnOff = 0x00,
@@ -374,7 +423,7 @@ struct yamaha_mc1n2_audio_params_route galaxys2_params_routes[] = {
        },
        {
                .device = AUDIO_DEVICE_OUT_WIRED_HEADSET,
-               .mode = AUDIO_MODE_NORMAL,
+               .direction = YAMAHA_MC1N2_AUDIO_DIRECTION_OUTPUT,
 
                .ae_info = {
                        .bOnOff = 0x00,
@@ -424,7 +473,7 @@ struct yamaha_mc1n2_audio_params_route galaxys2_params_routes[] = {
        },
        {
                .device = AUDIO_DEVICE_IN_BUILTIN_MIC,
-               .mode = AUDIO_MODE_NORMAL,
+               .direction = YAMAHA_MC1N2_AUDIO_DIRECTION_INPUT,
 
                .ae_info = {
                        .bOnOff = 0x00,
@@ -479,7 +528,7 @@ struct yamaha_mc1n2_audio_params_route galaxys2_params_routes[] = {
        },
        {
                .device = AUDIO_DEVICE_IN_WIRED_HEADSET,
-               .mode = AUDIO_MODE_NORMAL,
+               .direction = YAMAHA_MC1N2_AUDIO_DIRECTION_INPUT,
 
                .ae_info = {
                        .bOnOff = 0x00,
@@ -532,6 +581,217 @@ struct yamaha_mc1n2_audio_params_route galaxys2_params_routes[] = {
                        .bDcCut = 0,
                },
        },
+       {
+               .device = AUDIO_DEVICE_OUT_EARPIECE,
+               .direction = YAMAHA_MC1N2_AUDIO_DIRECTION_MODEM,
+
+               .ae_info = {
+                       .bOnOff = 0,
+                       .abBex = { 0 },
+                       .abWide = { 0 },
+                       .abDrc = { 0 },
+                       .abEq5 = { 0 },
+                       .abEq3 = { 0 },
+               },
+
+               .path_info.asHpOut[0].abSrcOnOff = { 0 },
+               .path_info.asHpOut[1].abSrcOnOff = { 0 },
+               .path_info.asSpOut[0].abSrcOnOff = { 0 },
+               .path_info.asSpOut[1].abSrcOnOff = { 0 },
+               .path_info.asRcOut[0].abSrcOnOff = { 0 },
+               .path_info.asLout1[0].abSrcOnOff = { 0 },
+               .path_info.asLout1[1].abSrcOnOff = { 0 },
+               .path_info.asLout2[0].abSrcOnOff = { 0 },
+               .path_info.asLout2[1].abSrcOnOff = { 0 },
+               .path_info.asPeak[0].abSrcOnOff = { 0 },
+               .path_info.asDit0[0].abSrcOnOff = { 0 },
+               .path_info.asDit1[0].abSrcOnOff = { 0 },
+               .path_info.asDit2[0].abSrcOnOff = { 0 },
+               .path_info.asDac[0].abSrcOnOff = { 0 },
+               .path_info.asDac[1].abSrcOnOff = { 0 },
+               .path_info.asAe[0].abSrcOnOff = { 0 },
+               .path_info.asCdsp[0].abSrcOnOff = { 0 },
+               .path_info.asCdsp[1].abSrcOnOff = { 0 },
+               .path_info.asCdsp[2].abSrcOnOff = { 0 },
+               .path_info.asCdsp[3].abSrcOnOff = { 0 },
+               .path_info.asAdc0[0].abSrcOnOff = { 0 },
+               .path_info.asAdc0[1].abSrcOnOff = { 0 },
+               .path_info.asAdc1[0].abSrcOnOff = { 0 },
+               .path_info.asMix[0].abSrcOnOff = { 0 },
+               .path_info.asBias[0].abSrcOnOff = { 0 },
+
+               .path_info.asRcOut[0].abSrcOnOff[5] = MCDRV_SRC5_DAC_R_ON | MCDRV_SRC5_DAC_L_ON,
+               .path_info.asDit1[0].abSrcOnOff[4] = MCDRV_SRC4_ADC0_ON,
+               .path_info.asDac[0].abSrcOnOff[6] = MCDRV_SRC6_MIX_ON,
+               .path_info.asAdc0[0].abSrcOnOff[0] = MCDRV_SRC0_MIC1_ON,
+               .path_info.asAdc0[1].abSrcOnOff[0] = MCDRV_SRC0_MIC1_ON,
+               .path_info.asMix[0].abSrcOnOff[3] = MCDRV_SRC3_DIR1_ON,
+
+               .dac_info = {
+                       .bMasterSwap = 0,
+                       .bVoiceSwap = 0,
+                       .bDcCut = 0,
+               },
+       },
+       {
+               .device = AUDIO_DEVICE_OUT_WIRED_HEADPHONE,
+               .direction = YAMAHA_MC1N2_AUDIO_DIRECTION_MODEM,
+
+               .ae_info = {
+                       .bOnOff = 0x00,
+                       .abBex = { 0x00 },
+                       .abWide = { 0x00 },
+                       .abDrc = { 0x00 },
+                       .abEq5 = { 0x00 },
+                       .abEq3 = { 0x00 },
+               },
+
+               .path_info.asHpOut[0].abSrcOnOff = { 0 },
+               .path_info.asHpOut[1].abSrcOnOff = { 0 },
+               .path_info.asSpOut[0].abSrcOnOff = { 0 },
+               .path_info.asSpOut[1].abSrcOnOff = { 0 },
+               .path_info.asRcOut[0].abSrcOnOff = { 0 },
+               .path_info.asLout1[0].abSrcOnOff = { 0 },
+               .path_info.asLout1[1].abSrcOnOff = { 0 },
+               .path_info.asLout2[0].abSrcOnOff = { 0 },
+               .path_info.asLout2[1].abSrcOnOff = { 0 },
+               .path_info.asPeak[0].abSrcOnOff = { 0 },
+               .path_info.asDit0[0].abSrcOnOff = { 0 },
+               .path_info.asDit1[0].abSrcOnOff = { 0 },
+               .path_info.asDit2[0].abSrcOnOff = { 0 },
+               .path_info.asDac[0].abSrcOnOff = { 0 },
+               .path_info.asDac[1].abSrcOnOff = { 0 },
+               .path_info.asAe[0].abSrcOnOff = { 0 },
+               .path_info.asCdsp[0].abSrcOnOff = { 0 },
+               .path_info.asCdsp[1].abSrcOnOff = { 0 },
+               .path_info.asCdsp[2].abSrcOnOff = { 0 },
+               .path_info.asCdsp[3].abSrcOnOff = { 0 },
+               .path_info.asAdc0[0].abSrcOnOff = { 0 },
+               .path_info.asAdc0[1].abSrcOnOff = { 0 },
+               .path_info.asAdc1[0].abSrcOnOff = { 0 },
+               .path_info.asMix[0].abSrcOnOff = { 0 },
+               .path_info.asBias[0].abSrcOnOff = { 0 },
+
+               .path_info.asHpOut[0].abSrcOnOff[5] = MCDRV_SRC5_DAC_L_ON,
+               .path_info.asHpOut[1].abSrcOnOff[5] = MCDRV_SRC5_DAC_R_ON,
+               .path_info.asDit1[0].abSrcOnOff[4] = MCDRV_SRC4_ADC0_ON,
+               .path_info.asDac[0].abSrcOnOff[6] = MCDRV_SRC6_MIX_ON,
+               .path_info.asAdc0[0].abSrcOnOff[0] = MCDRV_SRC0_MIC1_ON,
+               .path_info.asAdc0[1].abSrcOnOff[0] = MCDRV_SRC0_MIC1_ON,
+               .path_info.asMix[0].abSrcOnOff[3] = MCDRV_SRC3_DIR1_ON,
+
+               .dac_info = {
+                       .bMasterSwap = 0,
+                       .bVoiceSwap = 0,
+                       .bDcCut = 0,
+               },
+       },
+       {
+               .device = AUDIO_DEVICE_OUT_WIRED_HEADSET,
+               .direction = YAMAHA_MC1N2_AUDIO_DIRECTION_MODEM,
+
+               .ae_info = {
+                       .bOnOff = 0x00,
+                       .abBex = { 0x00 },
+                       .abWide = { 0x00 },
+                       .abDrc = { 0x00 },
+                       .abEq5 = { 0x00 },
+                       .abEq3 = { 0x00 },
+               },
+
+               .path_info.asHpOut[0].abSrcOnOff = { 0 },
+               .path_info.asHpOut[1].abSrcOnOff = { 0 },
+               .path_info.asSpOut[0].abSrcOnOff = { 0 },
+               .path_info.asSpOut[1].abSrcOnOff = { 0 },
+               .path_info.asRcOut[0].abSrcOnOff = { 0 },
+               .path_info.asLout1[0].abSrcOnOff = { 0 },
+               .path_info.asLout1[1].abSrcOnOff = { 0 },
+               .path_info.asLout2[0].abSrcOnOff = { 0 },
+               .path_info.asLout2[1].abSrcOnOff = { 0 },
+               .path_info.asPeak[0].abSrcOnOff = { 0 },
+               .path_info.asDit0[0].abSrcOnOff = { 0 },
+               .path_info.asDit1[0].abSrcOnOff = { 0 },
+               .path_info.asDit2[0].abSrcOnOff = { 0 },
+               .path_info.asDac[0].abSrcOnOff = { 0 },
+               .path_info.asDac[1].abSrcOnOff = { 0 },
+               .path_info.asAe[0].abSrcOnOff = { 0 },
+               .path_info.asCdsp[0].abSrcOnOff = { 0 },
+               .path_info.asCdsp[1].abSrcOnOff = { 0 },
+               .path_info.asCdsp[2].abSrcOnOff = { 0 },
+               .path_info.asCdsp[3].abSrcOnOff = { 0 },
+               .path_info.asAdc0[0].abSrcOnOff = { 0 },
+               .path_info.asAdc0[1].abSrcOnOff = { 0 },
+               .path_info.asAdc1[0].abSrcOnOff = { 0 },
+               .path_info.asMix[0].abSrcOnOff = { 0 },
+               .path_info.asBias[0].abSrcOnOff = { 0 },
+
+               .path_info.asHpOut[0].abSrcOnOff[5] = MCDRV_SRC5_DAC_L_ON,
+               .path_info.asHpOut[1].abSrcOnOff[5] = MCDRV_SRC5_DAC_R_ON,
+               .path_info.asDit1[0].abSrcOnOff[4] = MCDRV_SRC4_ADC0_ON,
+               .path_info.asDac[0].abSrcOnOff[6] = MCDRV_SRC6_MIX_ON,
+               .path_info.asAdc0[0].abSrcOnOff[0] = MCDRV_SRC0_MIC2_ON,
+               .path_info.asAdc0[1].abSrcOnOff[0] = MCDRV_SRC0_MIC2_ON,
+               .path_info.asMix[0].abSrcOnOff[3] = MCDRV_SRC3_DIR1_ON,
+
+               .dac_info = {
+                       .bMasterSwap = 0,
+                       .bVoiceSwap = 0,
+                       .bDcCut = 0,
+               },
+       },
+       {
+               .device = AUDIO_DEVICE_OUT_SPEAKER,
+               .direction = YAMAHA_MC1N2_AUDIO_DIRECTION_MODEM,
+
+               .ae_info = {
+                       .bOnOff = 0x00,
+                       .abBex = { 0x00 },
+                       .abWide = { 0x00 },
+                       .abDrc = { 0x00 },
+                       .abEq5 = { 0x00 },
+                       .abEq3 = { 0x00 },
+               },
+
+               .path_info.asHpOut[0].abSrcOnOff = { 0 },
+               .path_info.asHpOut[1].abSrcOnOff = { 0 },
+               .path_info.asSpOut[0].abSrcOnOff = { 0 },
+               .path_info.asSpOut[1].abSrcOnOff = { 0 },
+               .path_info.asRcOut[0].abSrcOnOff = { 0 },
+               .path_info.asLout1[0].abSrcOnOff = { 0 },
+               .path_info.asLout1[1].abSrcOnOff = { 0 },
+               .path_info.asLout2[0].abSrcOnOff = { 0 },
+               .path_info.asLout2[1].abSrcOnOff = { 0 },
+               .path_info.asPeak[0].abSrcOnOff = { 0 },
+               .path_info.asDit0[0].abSrcOnOff = { 0 },
+               .path_info.asDit1[0].abSrcOnOff = { 0 },
+               .path_info.asDit2[0].abSrcOnOff = { 0 },
+               .path_info.asDac[0].abSrcOnOff = { 0 },
+               .path_info.asDac[1].abSrcOnOff = { 0 },
+               .path_info.asAe[0].abSrcOnOff = { 0 },
+               .path_info.asCdsp[0].abSrcOnOff = { 0 },
+               .path_info.asCdsp[1].abSrcOnOff = { 0 },
+               .path_info.asCdsp[2].abSrcOnOff = { 0 },
+               .path_info.asCdsp[3].abSrcOnOff = { 0 },
+               .path_info.asAdc0[0].abSrcOnOff = { 0 },
+               .path_info.asAdc0[1].abSrcOnOff = { 0 },
+               .path_info.asAdc1[0].abSrcOnOff = { 0 },
+               .path_info.asMix[0].abSrcOnOff = { 0 },
+               .path_info.asBias[0].abSrcOnOff = { 0 },
+
+               .path_info.asSpOut[0].abSrcOnOff[5] = MCDRV_SRC5_DAC_M_ON,
+               .path_info.asDac[0].abSrcOnOff[6] = MCDRV_SRC6_MIX_ON,
+               .path_info.asDit1[0].abSrcOnOff[4] = MCDRV_SRC4_ADC0_ON,
+               .path_info.asDac[0].abSrcOnOff[6] = MCDRV_SRC6_MIX_ON,
+               .path_info.asAdc0[0].abSrcOnOff[0] = MCDRV_SRC0_MIC3_ON,
+               .path_info.asAdc0[1].abSrcOnOff[0] = MCDRV_SRC0_MIC3_ON,
+               .path_info.asMix[0].abSrcOnOff[3] = MCDRV_SRC3_DIR1_ON,
+
+               .dac_info = {
+                       .bMasterSwap = 0,
+                       .bVoiceSwap = 0,
+                       .bDcCut = 0,
+               },
+       },
 };
 
 struct yamaha_mc1n2_audio_device_ops galaxys2_ops = {
index 067c76b..aeb6752 100644 (file)
 
 #include "mc1n2.h"
 
+enum yamaha_mc1n2_audio_direction {
+       YAMAHA_MC1N2_AUDIO_DIRECTION_OUTPUT,
+       YAMAHA_MC1N2_AUDIO_DIRECTION_INPUT,
+       YAMAHA_MC1N2_AUDIO_DIRECTION_MODEM,
+       YAMAHA_MC1N2_AUDIO_DIRECTION_MAX
+};
+
 struct yamaha_mc1n2_audio_params_init {
        MCDRV_AE_INFO ae_info;
        MCDRV_PATH_INFO path_info;
@@ -35,7 +42,7 @@ struct yamaha_mc1n2_audio_params_init {
 
 struct yamaha_mc1n2_audio_params_route {
        audio_devices_t device;
-       audio_mode_t mode;
+       enum yamaha_mc1n2_audio_direction direction;
 
        MCDRV_AE_INFO ae_info;
        MCDRV_PATH_INFO path_info;
@@ -59,10 +66,10 @@ struct yamaha_mc1n2_audio_pdata {
 
        audio_devices_t output_device;
        audio_devices_t input_device;
-       audio_mode_t mode;
 
        int output_state;
        int input_state;
+       int modem_state;
 };
 
 /*
@@ -89,10 +96,12 @@ int yamaha_mc1n2_audio_output_start(struct yamaha_mc1n2_audio_pdata *pdata);
 int yamaha_mc1n2_audio_output_stop(struct yamaha_mc1n2_audio_pdata *pdata);
 int yamaha_mc1n2_audio_input_start(struct yamaha_mc1n2_audio_pdata *pdata);
 int yamaha_mc1n2_audio_input_stop(struct yamaha_mc1n2_audio_pdata *pdata);
+int yamaha_mc1n2_audio_modem_start(struct yamaha_mc1n2_audio_pdata *pdata);
+int yamaha_mc1n2_audio_modem_stop(struct yamaha_mc1n2_audio_pdata *pdata);
 
 // Values configuration
 int yamaha_mc1n2_audio_set_route(struct yamaha_mc1n2_audio_pdata *pdata,
-       audio_devices_t device, audio_mode_t mode);
+       audio_devices_t device);
 char *yamaha_mc1n2_audio_get_hw_node(struct yamaha_mc1n2_audio_pdata *pdata);
 
 // Init/Deinit
index f0761e5..c3a80ca 100644 (file)
@@ -169,7 +169,7 @@ int yamaha_mc1n2_audio_init(struct yamaha_mc1n2_audio_pdata *pdata)
 
 struct yamaha_mc1n2_audio_params_route *
        yamaha_mc1n2_audio_params_route_find(struct yamaha_mc1n2_audio_pdata *pdata,
-       audio_devices_t device, audio_mode_t mode)
+       audio_devices_t device, enum yamaha_mc1n2_audio_direction direction)
 {
        struct yamaha_mc1n2_audio_params_route *params = NULL;
        int params_count = 0;
@@ -184,7 +184,7 @@ struct yamaha_mc1n2_audio_params_route *
                return NULL;
 
        for(i=0 ; i < params_count ; i++) {
-               if(params[i].device == device && params[i].mode == mode)
+               if(params[i].device == device && params[i].direction == direction)
                        return &params[i];
        }
 
@@ -334,6 +334,8 @@ int yamaha_mc1n2_audio_route_start(struct yamaha_mc1n2_audio_pdata *pdata)
 
        int rc;
 
+       LOGD("%s()", __func__);
+
        if(pdata == NULL || pdata->ops == NULL)
                return -1;
 
@@ -349,7 +351,7 @@ int yamaha_mc1n2_audio_route_start(struct yamaha_mc1n2_audio_pdata *pdata)
 output_merge:
        if(pdata->output_state) {
                params_route = yamaha_mc1n2_audio_params_route_find(pdata,
-                       pdata->output_device, pdata->mode);
+                       pdata->output_device, YAMAHA_MC1N2_AUDIO_DIRECTION_OUTPUT);
                if(params_route == NULL)
                        goto input_merge;
 
@@ -361,7 +363,19 @@ output_merge:
 input_merge:
        if(pdata->input_state) {
                params_route = yamaha_mc1n2_audio_params_route_find(pdata,
-                       pdata->input_device, pdata->mode);
+                       pdata->input_device, YAMAHA_MC1N2_AUDIO_DIRECTION_INPUT);
+               if(params_route == NULL)
+                       goto modem_merge;
+
+               memcpy(&params_dst, params_route, sizeof(params_dst));
+               yamaha_mc1n2_audio_params_route_merge(&params_src, &params_dst);
+               memcpy(&params_src, &params_dst, sizeof(params_src));
+       }
+
+modem_merge:
+       if(pdata->modem_state) {
+               params_route = yamaha_mc1n2_audio_params_route_find(pdata,
+                       pdata->output_device, YAMAHA_MC1N2_AUDIO_DIRECTION_MODEM);
                if(params_route == NULL)
                        goto route_start;
 
@@ -401,6 +415,8 @@ int yamaha_mc1n2_audio_output_start(struct yamaha_mc1n2_audio_pdata *pdata)
 {
        int rc;
 
+       LOGD("%s()", __func__);
+
        if(pdata == NULL || pdata->ops == NULL)
                return -1;
 
@@ -425,6 +441,8 @@ int yamaha_mc1n2_audio_output_stop(struct yamaha_mc1n2_audio_pdata *pdata)
 {
        int rc;
 
+       LOGD("%s()", __func__);
+
        if(pdata == NULL || pdata->ops == NULL)
                return -1;
 
@@ -449,6 +467,8 @@ int yamaha_mc1n2_audio_input_start(struct yamaha_mc1n2_audio_pdata *pdata)
 {
        int rc;
 
+       LOGD("%s()", __func__);
+
        if(pdata == NULL || pdata->ops == NULL)
                return -1;
 
@@ -473,6 +493,8 @@ int yamaha_mc1n2_audio_input_stop(struct yamaha_mc1n2_audio_pdata *pdata)
 {
        int rc;
 
+       LOGD("%s()", __func__);
+
        if(pdata == NULL || pdata->ops == NULL)
                return -1;
 
@@ -493,15 +515,69 @@ int yamaha_mc1n2_audio_input_stop(struct yamaha_mc1n2_audio_pdata *pdata)
        return 0;
 }
 
+int yamaha_mc1n2_audio_modem_start(struct yamaha_mc1n2_audio_pdata *pdata)
+{
+       int rc;
+
+       LOGD("%s()", __func__);
+
+       if(pdata == NULL || pdata->ops == NULL)
+               return -1;
+
+       pdata->modem_state = 1;
+
+       rc = yamaha_mc1n2_audio_route_start(pdata);
+       if(rc < 0) {
+               LOGE("Route start failed, aborting!");
+               return -1;
+       }
+
+       rc = yamaha_mc1n2_audio_ioctl_notify(pdata, MCDRV_NOTIFY_CALL_START);
+       if(rc < 0) {
+               LOGE("NOTIFY_CALL_START IOCTL failed, aborting!");
+               return -1;
+       }
+
+       return 0;
+}
+
+int yamaha_mc1n2_audio_modem_stop(struct yamaha_mc1n2_audio_pdata *pdata)
+{
+       int rc;
+
+       LOGD("%s()", __func__);
+
+       if(pdata == NULL || pdata->ops == NULL)
+               return -1;
+
+       pdata->modem_state = 0;
+
+       rc = yamaha_mc1n2_audio_route_start(pdata);
+       if(rc < 0) {
+               LOGE("Route start failed, aborting!");
+               return -1;
+       }
+
+       rc = yamaha_mc1n2_audio_ioctl_notify(pdata, MCDRV_NOTIFY_CALL_STOP);
+       if(rc < 0) {
+               LOGE("NOTIFY_CALL_START IOCTL failed, aborting!");
+               return -1;
+       }
+
+       return 0;
+}
+
 /*
  * Values configuration
  */
 
 int yamaha_mc1n2_audio_set_route(struct yamaha_mc1n2_audio_pdata *pdata,
-       audio_devices_t device, audio_mode_t mode)
+       audio_devices_t device)
 {
        int changed = 0;
 
+       LOGD("%s(%x)", __func__, device);
+
        if(pdata == NULL)
                return -1;
 
@@ -513,12 +589,7 @@ int yamaha_mc1n2_audio_set_route(struct yamaha_mc1n2_audio_pdata *pdata,
                changed = 1;
        }
 
-       if(pdata->mode != mode) {
-               pdata->mode = mode;
-               changed = 1;
-       }
-
-       if(changed && (pdata->output_state || pdata->input_state))
+       if(changed && (pdata->output_state || pdata->input_state || pdata->modem_state))
                return yamaha_mc1n2_audio_route_start(pdata);
 
        return 0;
@@ -566,6 +637,8 @@ int yamaha_mc1n2_audio_start(struct yamaha_mc1n2_audio_pdata **pdata_p,
        struct yamaha_mc1n2_audio_pdata *pdata = NULL;
        int rc;
 
+       LOGD("%s(%s)", __func__, device_name);
+
        if(pdata_p == NULL || device_name == NULL)
                return -1;
 
@@ -585,5 +658,7 @@ int yamaha_mc1n2_audio_stop(struct yamaha_mc1n2_audio_pdata *pdata)
        if(pdata == NULL)
                return -1;
 
+       LOGD("%s()", __func__);
+
        return 0;
 }