@@ -987,6 +987,24 @@ static struct capabilities atc_capabilities(struct ct_atc *atc)
987987 return hw -> capabilities (hw );
988988}
989989
990+ static void atc_dedicated_rca_select (struct ct_atc * atc )
991+ {
992+ struct dao * dao ;
993+ struct ct_mixer * mixer = atc -> mixer ;
994+ struct rsc * rscs [2 ] = {NULL };
995+
996+ dao = container_of (atc -> daios [atc -> rca_state ? RCA : LINEO1 ],
997+ struct dao , daio );
998+ dao -> ops -> clear_left_input (dao );
999+ dao -> ops -> clear_right_input (dao );
1000+
1001+ mixer -> get_output_ports (mixer , MIX_WAVE_FRONT , & rscs [0 ], & rscs [1 ]);
1002+ dao = container_of (atc -> daios [atc -> rca_state ? LINEO1 : RCA ],
1003+ struct dao , daio );
1004+ dao -> ops -> set_left_input (dao , rscs [0 ]);
1005+ dao -> ops -> set_right_input (dao , rscs [1 ]);
1006+ }
1007+
9901008static int atc_output_switch_get (struct ct_atc * atc )
9911009{
9921010 struct hw * hw = atc -> hw ;
@@ -1088,6 +1106,11 @@ static int atc_mic_unmute(struct ct_atc *atc, unsigned char state)
10881106 return atc_daio_unmute (atc , state , MIC );
10891107}
10901108
1109+ static int atc_rca_unmute (struct ct_atc * atc , unsigned char state )
1110+ {
1111+ return atc_daio_unmute (atc , state , RCA );
1112+ }
1113+
10911114static int atc_spdif_out_unmute (struct ct_atc * atc , unsigned char state )
10921115{
10931116 return atc_daio_unmute (atc , state , SPDIFOO );
@@ -1303,6 +1326,7 @@ static int atc_identify_card(struct ct_atc *atc, unsigned int ssid)
13031326 dev_info (atc -> card -> dev , "chip %s model %s (%04x:%04x) is found\n" ,
13041327 atc -> chip_name , atc -> model_name ,
13051328 vendor_id , device_id );
1329+ atc -> rca_state = 0 ;
13061330 return 0 ;
13071331}
13081332
@@ -1400,11 +1424,11 @@ static int atc_get_resources(struct ct_atc *atc)
14001424 daio_mgr = (struct daio_mgr * )atc -> rsc_mgrs [DAIO ];
14011425 da_desc .msr = atc -> msr ;
14021426 for (i = 0 ; i < NUM_DAIOTYP ; i ++ ) {
1403- if ((i == MIC ) && !cap .dedicated_mic )
1427+ if ((( i == MIC ) && !cap .dedicated_mic ) || (( i == RCA ) && ! cap . dedicated_rca ) )
14041428 continue ;
14051429 da_desc .type = (atc -> model != CTSB073X ) ? i :
14061430 ((i == SPDIFIO ) ? SPDIFI1 : i );
1407- da_desc .output = i < LINEIM ;
1431+ da_desc .output = ( i < LINEIM ) || ( i == RCA ) ;
14081432 err = daio_mgr -> get_daio (daio_mgr , & da_desc ,
14091433 (struct daio * * )& atc -> daios [i ]);
14101434 if (err ) {
@@ -1511,6 +1535,9 @@ static void atc_connect_resources(struct ct_atc *atc)
15111535 dao -> ops -> set_right_input (dao , rscs [1 ]);
15121536 }
15131537
1538+ if (cap .dedicated_rca )
1539+ atc_dedicated_rca_select (atc );
1540+
15141541 dai = container_of (atc -> daios [LINEIM ], struct dai , daio );
15151542 atc_connect_dai (atc -> rsc_mgrs [SRC ], dai ,
15161543 (struct src * * )& atc -> srcs [2 ],
@@ -1643,12 +1670,14 @@ static const struct ct_atc atc_preset = {
16431670 .line_rear_unmute = atc_line_rear_unmute ,
16441671 .line_in_unmute = atc_line_in_unmute ,
16451672 .mic_unmute = atc_mic_unmute ,
1673+ .rca_unmute = atc_rca_unmute ,
16461674 .spdif_out_unmute = atc_spdif_out_unmute ,
16471675 .spdif_in_unmute = atc_spdif_in_unmute ,
16481676 .spdif_out_get_status = atc_spdif_out_get_status ,
16491677 .spdif_out_set_status = atc_spdif_out_set_status ,
16501678 .spdif_out_passthru = atc_spdif_out_passthru ,
16511679 .capabilities = atc_capabilities ,
1680+ .dedicated_rca_select = atc_dedicated_rca_select ,
16521681 .output_switch_get = atc_output_switch_get ,
16531682 .output_switch_put = atc_output_switch_put ,
16541683 .mic_source_switch_get = atc_mic_source_switch_get ,
0 commit comments