void Sound_Speaker_Turnon(int channel) { PRINTK("Sound_Speaker_Turnon channel = %d\n",channel); if(gsk_on) return; #if defined(TINNO_ANDROID_S9081) if( isHeadsetPlug() == true ) { const mm_segment_t oldfs = get_fs(); set_fs( KERNEL_DS); struct file *fp = filp_open( SR_FILE, O_RDONLY, 0 ); if( IS_ERR( fp )) { headset_switch_off(); } else { if(( fp->f_op ) && ( fp->f_op->read )) { char c = '0'; const ssize_t size = fp->f_op->read( fp, &c, 1, &fp->f_pos ); if( size == 1 ) { if( c == '1' ) headset_switch_on(); else headset_switch_off(); } } filp_close( fp, NULL ); } set_fs( oldfs ); } #endif #if defined(ENABLE_2_IN_1_SPK) #if defined(AMP_CLASS_D) hwSPKClassDInit(); hwSPKClassDVolumeControl(SPK_AMP_GAIN,SPK_AMP_GAIN);//4:15dB, 6:21dB #endif #endif hw2in1SpeakerSetting(0,0);//0=>spk mode; 1=>receiver mode #if defined(AMP_CLASS_AB) hwSPKClassABTurnOn(SPK_L_ENABLE,SPK_R_ENABLE); #elif defined(AMP_CLASS_D) hwSPKClassDTurnOn(SPK_L_ENABLE,SPK_R_ENABLE); #endif msleep(SPK_WARM_UP_TIME); gsk_on = true; }
bool Speaker_Init(void) { PRINTK("+Speaker_Init Success"); #if defined(AMP_CLASS_AB) hwSPKClassABInit(); hwSPKClassABVolumeControl(SPK_AMP_GAIN,SPK_AMP_GAIN);//4:15dB, 6:21dB #elif defined(AMP_CLASS_D) hwSPKClassDInit(); hwSPKClassDVolumeControl(SPK_AMP_GAIN,SPK_AMP_GAIN);//4:15dB, 6:21dB #endif hwSPKClassABVoiceBypassAnalogGain(RCV_AMP_GAIN); PRINTK("-Speaker_Init Success"); return true; }
void Sound_Speaker_Turnon(int channel) { PRINTK("Sound_Speaker_Turnon channel = %d\n",channel); if(gsk_on) return; #if defined(ENABLE_2_IN_1_SPK) #if defined(AMP_CLASS_D) hwSPKClassDInit(); hwSPKClassDVolumeControl(SPK_AMP_GAIN,SPK_AMP_GAIN);//4:15dB, 6:21dB #endif #endif hw2in1SpeakerSetting(0,0);//0=>spk mode; 1=>receiver mode #if defined(AMP_CLASS_AB) hwSPKClassABTurnOn(SPK_L_ENABLE,SPK_R_ENABLE); #elif defined(AMP_CLASS_D) hwSPKClassDTurnOn(SPK_L_ENABLE,SPK_R_ENABLE); #endif msleep(SPK_WARM_UP_TIME); gsk_on = true; }