@@ -752,6 +752,8 @@ static void es8326_jack_detect_handler(struct work_struct *work)
752
752
es8326 -> hp = 0 ;
753
753
}
754
754
regmap_update_bits (es8326 -> regmap , ES8326_HPDET_TYPE , 0x03 , 0x01 );
755
+ regmap_write (es8326 -> regmap , ES8326_SYS_BIAS , 0x0a );
756
+ regmap_update_bits (es8326 -> regmap , ES8326_HP_DRIVER_REF , 0x0f , 0x03 );
755
757
/*
756
758
* Inverted HPJACK_POL bit to trigger one IRQ to double check HP Removal event
757
759
*/
@@ -777,6 +779,8 @@ static void es8326_jack_detect_handler(struct work_struct *work)
777
779
regmap_update_bits (es8326 -> regmap , ES8326_HPDET_TYPE , 0x03 , 0x01 );
778
780
usleep_range (50000 , 70000 );
779
781
regmap_update_bits (es8326 -> regmap , ES8326_HPDET_TYPE , 0x03 , 0x00 );
782
+ regmap_write (es8326 -> regmap , ES8326_SYS_BIAS , 0x1f );
783
+ regmap_update_bits (es8326 -> regmap , ES8326_HP_DRIVER_REF , 0x0f , 0x08 );
780
784
queue_delayed_work (system_wq , & es8326 -> jack_detect_work ,
781
785
msecs_to_jiffies (400 ));
782
786
es8326 -> hp = 1 ;
@@ -846,14 +850,14 @@ static int es8326_calibrate(struct snd_soc_component *component)
846
850
if ((es8326 -> version == ES8326_VERSION_B ) && (es8326 -> calibrated == false)) {
847
851
dev_dbg (component -> dev , "ES8326_VERSION_B, calibrating\n" );
848
852
regmap_write (es8326 -> regmap , ES8326_CLK_INV , 0xc0 );
849
- regmap_write (es8326 -> regmap , ES8326_CLK_DIV1 , 0x01 );
853
+ regmap_write (es8326 -> regmap , ES8326_CLK_DIV1 , 0x03 );
850
854
regmap_write (es8326 -> regmap , ES8326_CLK_DLL , 0x30 );
851
855
regmap_write (es8326 -> regmap , ES8326_CLK_MUX , 0xed );
852
856
regmap_write (es8326 -> regmap , ES8326_CLK_DAC_SEL , 0x08 );
853
857
regmap_write (es8326 -> regmap , ES8326_CLK_TRI , 0xc1 );
854
858
regmap_write (es8326 -> regmap , ES8326_DAC_MUTE , 0x03 );
855
859
regmap_write (es8326 -> regmap , ES8326_ANA_VSEL , 0x7f );
856
- regmap_write (es8326 -> regmap , ES8326_VMIDLOW , 0x03 );
860
+ regmap_write (es8326 -> regmap , ES8326_VMIDLOW , 0x23 );
857
861
regmap_write (es8326 -> regmap , ES8326_DAC2HPMIX , 0x88 );
858
862
usleep_range (15000 , 20000 );
859
863
regmap_write (es8326 -> regmap , ES8326_HP_OFFSET_CAL , 0x8c );
@@ -894,28 +898,29 @@ static int es8326_resume(struct snd_soc_component *component)
894
898
/* reset internal clock state */
895
899
regmap_write (es8326 -> regmap , ES8326_RESET , 0x1f );
896
900
regmap_write (es8326 -> regmap , ES8326_VMIDSEL , 0x0E );
901
+ regmap_write (es8326 -> regmap , ES8326_ANA_LP , 0xf0 );
897
902
usleep_range (10000 , 15000 );
898
903
regmap_write (es8326 -> regmap , ES8326_HPJACK_TIMER , 0xe9 );
899
- regmap_write (es8326 -> regmap , ES8326_ANA_MICBIAS , 0x4b );
904
+ regmap_write (es8326 -> regmap , ES8326_ANA_MICBIAS , 0xcb );
900
905
/* set headphone default type and detect pin */
901
906
regmap_write (es8326 -> regmap , ES8326_HPDET_TYPE , 0x83 );
902
907
regmap_write (es8326 -> regmap , ES8326_CLK_RESAMPLE , 0x05 );
903
- regmap_write (es8326 -> regmap , ES8326_HP_MISC , 0x30 );
904
908
905
909
/* set internal oscillator as clock source of headpone cp */
906
910
regmap_write (es8326 -> regmap , ES8326_CLK_DIV_CPC , 0x89 );
907
911
regmap_write (es8326 -> regmap , ES8326_CLK_CTL , ES8326_CLK_ON );
908
912
/* clock manager reset release */
909
913
regmap_write (es8326 -> regmap , ES8326_RESET , 0x17 );
910
914
/* set headphone detection as half scan mode */
911
- regmap_write (es8326 -> regmap , ES8326_HP_MISC , 0x30 );
915
+ regmap_write (es8326 -> regmap , ES8326_HP_MISC , 0x3d );
912
916
regmap_write (es8326 -> regmap , ES8326_PULLUP_CTL , 0x00 );
913
917
914
918
/* enable headphone driver */
919
+ regmap_write (es8326 -> regmap , ES8326_HP_VOL , 0xc4 );
915
920
regmap_write (es8326 -> regmap , ES8326_HP_DRIVER , 0xa7 );
916
921
usleep_range (2000 , 5000 );
917
- regmap_write (es8326 -> regmap , ES8326_HP_DRIVER_REF , 0xa3 );
918
- regmap_write (es8326 -> regmap , ES8326_HP_DRIVER_REF , 0xb3 );
922
+ regmap_write (es8326 -> regmap , ES8326_HP_DRIVER_REF , 0x23 );
923
+ regmap_write (es8326 -> regmap , ES8326_HP_DRIVER_REF , 0x33 );
919
924
regmap_write (es8326 -> regmap , ES8326_HP_DRIVER , 0xa1 );
920
925
921
926
regmap_write (es8326 -> regmap , ES8326_CLK_INV , 0x00 );
@@ -946,7 +951,7 @@ static int es8326_resume(struct snd_soc_component *component)
946
951
(ES8326_IO_DMIC_CLK << ES8326_SDINOUT1_SHIFT ));
947
952
regmap_write (es8326 -> regmap , ES8326_SDINOUT23_IO , ES8326_IO_INPUT );
948
953
949
- regmap_write (es8326 -> regmap , ES8326_ANA_PDN , 0x3b );
954
+ regmap_write (es8326 -> regmap , ES8326_ANA_PDN , 0x00 );
950
955
regmap_write (es8326 -> regmap , ES8326_RESET , ES8326_CSM_ON );
951
956
regmap_update_bits (es8326 -> regmap , ES8326_PGAGAIN , ES8326_MIC_SEL_MASK ,
952
957
ES8326_MIC1_SEL );
0 commit comments