Bindings and values for input, removed comment
authorPaul Kocialkowski <contact@paulk.fr>
Sat, 20 Oct 2012 17:07:52 +0000 (19:07 +0200)
committerPaul Kocialkowski <contact@paulk.fr>
Sat, 20 Oct 2012 17:07:52 +0000 (19:07 +0200)
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
device/galaxys2.c
include/yamaha-mc1n2-audio.h
yamaha-mc1n2-audio.c

index 81cedff..f659522 100644 (file)
@@ -422,6 +422,61 @@ struct yamaha_mc1n2_audio_params_route galaxys2_params_routes[] = {
                        .bDcCut = 0,
                },
        },
+       {
+               .device = AUDIO_DEVICE_IN_BUILTIN_MIC,
+               .mode = AUDIO_MODE_NORMAL,
+
+               .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.asDit0[0].abSrcOnOff[0] = MCDRV_SRC0_MIC3_OFF | MCDRV_SRC0_MIC2_OFF | MCDRV_SRC0_MIC1_OFF,
+               .path_info.asDit0[0].abSrcOnOff[1] = MCDRV_SRC1_LINE1_M_OFF | MCDRV_SRC1_LINE1_R_OFF | MCDRV_SRC1_LINE1_L_OFF,
+               .path_info.asDit0[0].abSrcOnOff[2] = MCDRV_SRC2_LINE2_M_OFF | MCDRV_SRC2_LINE2_R_OFF | MCDRV_SRC2_LINE2_L_OFF,
+               .path_info.asDit0[0].abSrcOnOff[3] = MCDRV_SRC3_DIR2_DIRECT_OFF | MCDRV_SRC3_DIR2_OFF | MCDRV_SRC3_DIR1_OFF | MCDRV_SRC3_DIR0_OFF,
+               .path_info.asDit0[0].abSrcOnOff[4] = MCDRV_SRC4_ADC1_OFF | MCDRV_SRC4_ADC0_ON | MCDRV_SRC4_PDM_OFF | MCDRV_SRC4_DTMF_OFF,
+               .path_info.asDit0[0].abSrcOnOff[5] = MCDRV_SRC5_DAC_M_OFF | MCDRV_SRC5_DAC_R_OFF | MCDRV_SRC5_DAC_L_OFF,
+               .path_info.asDit0[0].abSrcOnOff[6] = MCDRV_SRC6_CDSP_DIRECT_OFF | MCDRV_SRC6_CDSP_OFF | MCDRV_SRC6_AE_OFF | MCDRV_SRC6_MIX_OFF,
+               .path_info.asAdc0[0].abSrcOnOff[0] = MCDRV_SRC0_MIC1_ON,
+               .path_info.asAdc0[1].abSrcOnOff[0] = MCDRV_SRC0_MIC1_ON,
+
+               .dac_info = {
+                       .bMasterSwap = 0,
+                       .bVoiceSwap = 0,
+                       .bDcCut = 0,
+               },
+       },
 };
 
 struct yamaha_mc1n2_audio_device_ops galaxys2_ops = {
index b94143b..067c76b 100644 (file)
 
 #include "mc1n2.h"
 
-/*
-params_route = ptr
-params_init = ptr
-
-
-
-params_route[] = {
-       .device = ,
-       .ae_info = {
-       },
-       .path_info = {
-       },
-       .dac_info = {
-       },
-};
-
-=> take from params_init and see next
-*/
-
 struct yamaha_mc1n2_audio_params_init {
        MCDRV_AE_INFO ae_info;
        MCDRV_PATH_INFO path_info;
@@ -106,7 +87,8 @@ int yamaha_mc1n2_audio_ioctl_notify(struct yamaha_mc1n2_audio_pdata *pdata,
 int yamaha_mc1n2_audio_init(struct yamaha_mc1n2_audio_pdata *pdata);
 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);
 
 // Values configuration
 int yamaha_mc1n2_audio_set_route(struct yamaha_mc1n2_audio_pdata *pdata,
index a482c45..f0761e5 100644 (file)
@@ -445,6 +445,54 @@ int yamaha_mc1n2_audio_output_stop(struct yamaha_mc1n2_audio_pdata *pdata)
        return 0;
 }
 
+int yamaha_mc1n2_audio_input_start(struct yamaha_mc1n2_audio_pdata *pdata)
+{
+       int rc;
+
+       if(pdata == NULL || pdata->ops == NULL)
+               return -1;
+
+       pdata->input_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_VOICE_REC_START);
+       if(rc < 0) {
+               LOGE("NOTIFY_VOICE_REC_START IOCTL failed, aborting!");
+               return -1;
+       }
+
+       return 0;
+}
+
+int yamaha_mc1n2_audio_input_stop(struct yamaha_mc1n2_audio_pdata *pdata)
+{
+       int rc;
+
+       if(pdata == NULL || pdata->ops == NULL)
+               return -1;
+
+       pdata->input_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_VOICE_REC_STOP);
+       if(rc < 0) {
+               LOGE("NOTIFY_VOICE_REC_START IOCTL failed, aborting!");
+               return -1;
+       }
+
+       return 0;
+}
+
 /*
  * Values configuration
  */