@@ -412,9 +412,9 @@ static const struct _coeff_div coeff_div_v3[] = {
412
412
{125 , 48000 , 6000000 , 0x04 , 0x04 , 0x1F , 0x2D , 0x8A , 0x0A , 0x27 , 0x27 },
413
413
414
414
{128 , 8000 , 1024000 , 0x60 , 0x00 , 0x05 , 0x75 , 0x8A , 0x1B , 0x1F , 0x7F },
415
- {128 , 16000 , 2048000 , 0x20 , 0x00 , 0x31 , 0x35 , 0x8A , 0x1B , 0x1F , 0x3F },
416
- {128 , 44100 , 5644800 , 0xE0 , 0x00 , 0x01 , 0x2D , 0xCA , 0x0A , 0x1F , 0x1F },
417
- {128 , 48000 , 6144000 , 0xE0 , 0x00 , 0x01 , 0x2D , 0xCA , 0x0A , 0x1F , 0x1F },
415
+ {128 , 16000 , 2048000 , 0x20 , 0x00 , 0x31 , 0x35 , 0x08 , 0x19 , 0x1F , 0x3F },
416
+ {128 , 44100 , 5644800 , 0xE0 , 0x00 , 0x01 , 0x2D , 0x48 , 0x08 , 0x1F , 0x1F },
417
+ {128 , 48000 , 6144000 , 0xE0 , 0x00 , 0x01 , 0x2D , 0x48 , 0x08 , 0x1F , 0x1F },
418
418
{144 , 8000 , 1152000 , 0x20 , 0x00 , 0x03 , 0x35 , 0x8A , 0x1B , 0x23 , 0x47 },
419
419
{144 , 16000 , 2304000 , 0x20 , 0x00 , 0x11 , 0x35 , 0x8A , 0x1B , 0x23 , 0x47 },
420
420
{192 , 8000 , 1536000 , 0x60 , 0x02 , 0x0D , 0x75 , 0x8A , 0x1B , 0x1F , 0x7F },
@@ -423,10 +423,10 @@ static const struct _coeff_div coeff_div_v3[] = {
423
423
424
424
{200 , 48000 , 9600000 , 0x04 , 0x04 , 0x0F , 0x2D , 0xCA , 0x0A , 0x1F , 0x1F },
425
425
{250 , 48000 , 12000000 , 0x04 , 0x04 , 0x0F , 0x2D , 0xCA , 0x0A , 0x27 , 0x27 },
426
- {256 , 8000 , 2048000 , 0x60 , 0x00 , 0x31 , 0x35 , 0x8A , 0x1B , 0x1F , 0x7F },
427
- {256 , 16000 , 4096000 , 0x20 , 0x00 , 0x01 , 0x35 , 0x8A , 0x1B , 0x1F , 0x3F },
428
- {256 , 44100 , 11289600 , 0xE0 , 0x00 , 0x30 , 0x2D , 0xCA , 0x0A , 0x1F , 0x1F },
429
- {256 , 48000 , 12288000 , 0xE0 , 0x00 , 0x30 , 0x2D , 0xCA , 0x0A , 0x1F , 0x1F },
426
+ {256 , 8000 , 2048000 , 0x60 , 0x00 , 0x31 , 0x35 , 0x08 , 0x19 , 0x1F , 0x7F },
427
+ {256 , 16000 , 4096000 , 0x20 , 0x00 , 0x01 , 0x35 , 0x08 , 0x19 , 0x1F , 0x3F },
428
+ {256 , 44100 , 11289600 , 0xE0 , 0x01 , 0x01 , 0x2D , 0x48 , 0x08 , 0x1F , 0x1F },
429
+ {256 , 48000 , 12288000 , 0xE0 , 0x01 , 0x01 , 0x2D , 0x48 , 0x08 , 0x1F , 0x1F },
430
430
{288 , 8000 , 2304000 , 0x20 , 0x00 , 0x01 , 0x35 , 0x8A , 0x1B , 0x23 , 0x47 },
431
431
{384 , 8000 , 3072000 , 0x60 , 0x02 , 0x05 , 0x75 , 0x8A , 0x1B , 0x1F , 0x7F },
432
432
{384 , 16000 , 6144000 , 0x20 , 0x02 , 0x03 , 0x35 , 0x8A , 0x1B , 0x1F , 0x3F },
@@ -435,10 +435,10 @@ static const struct _coeff_div coeff_div_v3[] = {
435
435
436
436
{400 , 48000 , 19200000 , 0xE4 , 0x04 , 0x35 , 0x6d , 0xCA , 0x0A , 0x1F , 0x1F },
437
437
{500 , 48000 , 24000000 , 0xF8 , 0x04 , 0x3F , 0x6D , 0xCA , 0x0A , 0x1F , 0x1F },
438
- {512 , 8000 , 4096000 , 0x60 , 0x00 , 0x01 , 0x35 , 0x8A , 0x1B , 0x1F , 0x7F },
439
- {512 , 16000 , 8192000 , 0x20 , 0x00 , 0x30 , 0x35 , 0x8A , 0x1B , 0x1F , 0x3F },
440
- {512 , 44100 , 22579200 , 0xE0 , 0x00 , 0x00 , 0x2D , 0xCA , 0x0A , 0x1F , 0x1F },
441
- {512 , 48000 , 24576000 , 0xE0 , 0x00 , 0x00 , 0x2D , 0xCA , 0x0A , 0x1F , 0x1F },
438
+ {512 , 8000 , 4096000 , 0x60 , 0x00 , 0x01 , 0x08 , 0x19 , 0x1B , 0x1F , 0x7F },
439
+ {512 , 16000 , 8192000 , 0x20 , 0x00 , 0x30 , 0x35 , 0x08 , 0x19 , 0x1F , 0x3F },
440
+ {512 , 44100 , 22579200 , 0xE0 , 0x00 , 0x00 , 0x2D , 0x48 , 0x08 , 0x1F , 0x1F },
441
+ {512 , 48000 , 24576000 , 0xE0 , 0x00 , 0x00 , 0x2D , 0x48 , 0x08 , 0x1F , 0x1F },
442
442
{768 , 8000 , 6144000 , 0x60 , 0x02 , 0x11 , 0x35 , 0x8A , 0x1B , 0x1F , 0x7F },
443
443
{768 , 16000 , 12288000 , 0x20 , 0x02 , 0x01 , 0x35 , 0x8A , 0x1B , 0x1F , 0x3F },
444
444
{768 , 32000 , 24576000 , 0xE0 , 0x02 , 0x30 , 0x2D , 0xCA , 0x0A , 0x1F , 0x1F },
@@ -835,14 +835,14 @@ static void es8326_jack_detect_handler(struct work_struct *work)
835
835
dev_dbg (comp -> dev , "Report hp remove event\n" );
836
836
snd_soc_jack_report (es8326 -> jack , 0 , SND_JACK_HEADSET );
837
837
/* mute adc when mic path switch */
838
- regmap_write (es8326 -> regmap , ES8326_ADC_SCALE , 0x33 );
839
838
regmap_write (es8326 -> regmap , ES8326_ADC1_SRC , 0x44 );
840
839
regmap_write (es8326 -> regmap , ES8326_ADC2_SRC , 0x66 );
841
840
es8326 -> hp = 0 ;
842
841
}
843
842
regmap_update_bits (es8326 -> regmap , ES8326_HPDET_TYPE , 0x03 , 0x01 );
844
843
regmap_write (es8326 -> regmap , ES8326_SYS_BIAS , 0x0a );
845
844
regmap_update_bits (es8326 -> regmap , ES8326_HP_DRIVER_REF , 0x0f , 0x03 );
845
+ regmap_write (es8326 -> regmap , ES8326_INT_SOURCE , ES8326_INT_SRC_PIN9 );
846
846
/*
847
847
* Inverted HPJACK_POL bit to trigger one IRQ to double check HP Removal event
848
848
*/
@@ -865,6 +865,8 @@ static void es8326_jack_detect_handler(struct work_struct *work)
865
865
* set auto-check mode, then restart jack_detect_work after 400ms.
866
866
* Don't report jack status.
867
867
*/
868
+ regmap_write (es8326 -> regmap , ES8326_INT_SOURCE ,
869
+ (ES8326_INT_SRC_PIN9 | ES8326_INT_SRC_BUTTON ));
868
870
regmap_update_bits (es8326 -> regmap , ES8326_HPDET_TYPE , 0x03 , 0x01 );
869
871
es8326_enable_micbias (es8326 -> component );
870
872
usleep_range (50000 , 70000 );
@@ -891,7 +893,6 @@ static void es8326_jack_detect_handler(struct work_struct *work)
891
893
snd_soc_jack_report (es8326 -> jack ,
892
894
SND_JACK_HEADSET , SND_JACK_HEADSET );
893
895
894
- regmap_write (es8326 -> regmap , ES8326_ADC_SCALE , 0x33 );
895
896
regmap_update_bits (es8326 -> regmap , ES8326_PGA_PDN ,
896
897
0x08 , 0x08 );
897
898
regmap_update_bits (es8326 -> regmap , ES8326_PGAGAIN ,
@@ -987,7 +988,7 @@ static int es8326_resume(struct snd_soc_component *component)
987
988
regmap_write (es8326 -> regmap , ES8326_VMIDSEL , 0x0E );
988
989
regmap_write (es8326 -> regmap , ES8326_ANA_LP , 0xf0 );
989
990
usleep_range (10000 , 15000 );
990
- regmap_write (es8326 -> regmap , ES8326_HPJACK_TIMER , 0xe9 );
991
+ regmap_write (es8326 -> regmap , ES8326_HPJACK_TIMER , 0xd9 );
991
992
regmap_write (es8326 -> regmap , ES8326_ANA_MICBIAS , 0xcb );
992
993
/* set headphone default type and detect pin */
993
994
regmap_write (es8326 -> regmap , ES8326_HPDET_TYPE , 0x83 );
@@ -1038,8 +1039,7 @@ static int es8326_resume(struct snd_soc_component *component)
1038
1039
es8326_enable_micbias (es8326 -> component );
1039
1040
usleep_range (50000 , 70000 );
1040
1041
regmap_update_bits (es8326 -> regmap , ES8326_HPDET_TYPE , 0x03 , 0x00 );
1041
- regmap_write (es8326 -> regmap , ES8326_INT_SOURCE ,
1042
- (ES8326_INT_SRC_PIN9 | ES8326_INT_SRC_BUTTON ));
1042
+ regmap_write (es8326 -> regmap , ES8326_INT_SOURCE , ES8326_INT_SRC_PIN9 );
1043
1043
regmap_write (es8326 -> regmap , ES8326_INTOUT_IO ,
1044
1044
es8326 -> interrupt_clk );
1045
1045
regmap_write (es8326 -> regmap , ES8326_SDINOUT1_IO ,
@@ -1060,6 +1060,8 @@ static int es8326_resume(struct snd_soc_component *component)
1060
1060
es8326 -> hp = 0 ;
1061
1061
es8326 -> hpl_vol = 0x03 ;
1062
1062
es8326 -> hpr_vol = 0x03 ;
1063
+
1064
+ es8326_irq (es8326 -> irq , es8326 );
1063
1065
return 0 ;
1064
1066
}
1065
1067
@@ -1070,6 +1072,9 @@ static int es8326_suspend(struct snd_soc_component *component)
1070
1072
cancel_delayed_work_sync (& es8326 -> jack_detect_work );
1071
1073
es8326_disable_micbias (component );
1072
1074
es8326 -> calibrated = false;
1075
+ regmap_write (es8326 -> regmap , ES8326_CLK_MUX , 0x2d );
1076
+ regmap_write (es8326 -> regmap , ES8326_DAC2HPMIX , 0x00 );
1077
+ regmap_write (es8326 -> regmap , ES8326_ANA_PDN , 0x3b );
1073
1078
regmap_write (es8326 -> regmap , ES8326_CLK_CTL , ES8326_CLK_OFF );
1074
1079
regcache_cache_only (es8326 -> regmap , true);
1075
1080
regcache_mark_dirty (es8326 -> regmap );
0 commit comments