Beispiel #1
0
static int aml_audio_set_i2s_mute(struct snd_kcontrol *kcontrol,
    struct snd_ctl_elem_value *ucontrol)
{
    aml_audio_i2s_mute_flag = ucontrol->value.integer.value[0];
    printk(KERN_INFO "aml_audio_i2s_mute_flag: flag=%d\n",aml_audio_i2s_mute_flag);
    if(aml_audio_i2s_mute_flag){
        aml_audio_i2s_mute();
    }else{
        aml_audio_i2s_unmute();
    }
    return 0;
}
Beispiel #2
0
static int audio_control(unsigned int audio_mode)
{
	struct aml_av_det *amlav_det = Myamlav_det;
	switch(audio_mode)
	{
		case I2S_AUDIO_OUTPUT:
			audio_mode_s = 0;
			gpio_direction_output(amlav_det->pdata[0].audio_sel_pin,1);
			printk(KERN_INFO"audio_sel_pin set I2S_AUDIO_OUTPUT!\n");
			break;
		case COAXIAL_OUTPUT:
			audio_mode_s = 1;
			gpio_direction_output(amlav_det->pdata[0].audio_sel_pin,0);
			printk(KERN_INFO"audio_sel_pin set COAXIAL_OUTPUT!\n");
			break;
		case AV_AUDIO_MUTE:
			audio_mode_s = 2;
			aml_audio_i2s_mute();
			aml_pin_mux_switch(amlav_det->pdev,1);
			printk(KERN_INFO"AV_AUDIO_MUTE!,LR_CLK pinmux clear\n");
			break;
		case AV_AUDIO_UNMUTE:
			audio_mode_s = 3;
			aml_audio_i2s_unmute();
			aml_pin_mux_switch(amlav_det->pdev,0);
			printk(KERN_INFO"AV_AUDIO_UNMUTE!,LR_CLK pinmux set\n");
			break;
		case HDMI_AUDIO_MUTE:
			audio_mode_s = 4;
			hdmitx_audio_mute_op(0);
			printk(KERN_INFO"HDMI_AUDIO_MUTE!\n");
			break;
		case HDMI_AUDIO_UNMUTE:
			audio_mode_s = 5;
			hdmitx_audio_mute_op(1);
			printk(KERN_INFO"HDMI_AUDIO_UNMUTE!\n");
			break;
		default:
			break;
	}
	return 0;
}