Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: codecs: ES8326: Modify the configuration of and micbias

Because we designed a new version of ES8326, the configuration of
micbias needed to be modified.We tested the new driver,
on both the new version and the old one. It works well.

Signed-off-by: Zhang Yi <zhangyi@everest-semi.com>
Link: https://patch.msgid.link/20241028060529.3359-1-zhangyi@everest-semi.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Zhang Yi and committed by
Mark Brown
bc48c555 dea15b2a

+16 -4
+16 -4
sound/soc/codecs/es8326.c
··· 614 614 } else { 615 615 regmap_update_bits(es8326->regmap, ES8326_ADC_MUTE, 616 616 0x0F, 0x0F); 617 + if (es8326->version > ES8326_VERSION_B) { 618 + regmap_update_bits(es8326->regmap, ES8326_VMIDSEL, 0x40, 0x40); 619 + regmap_update_bits(es8326->regmap, ES8326_ANA_MICBIAS, 0x70, 0x00); 620 + } 617 621 } 618 622 } else { 619 623 if (!es8326->calibrated) { ··· 644 640 ES8326_MUTE_MASK, ~(ES8326_MUTE)); 645 641 } else { 646 642 msleep(300); 643 + if (es8326->version > ES8326_VERSION_B) { 644 + regmap_update_bits(es8326->regmap, ES8326_ANA_MICBIAS, 0x70, 0x50); 645 + regmap_update_bits(es8326->regmap, ES8326_VMIDSEL, 0x40, 0x00); 646 + } 647 647 regmap_update_bits(es8326->regmap, ES8326_ADC_MUTE, 648 648 0x0F, 0x00); 649 649 } ··· 829 821 iface = snd_soc_component_read(comp, ES8326_HPDET_STA); 830 822 dev_dbg(comp->dev, "gpio flag %#04x", iface); 831 823 832 - if ((es8326->jack_remove_retry == 1) && (es8326->version != ES8326_VERSION_B)) { 824 + if ((es8326->jack_remove_retry == 1) && (es8326->version < ES8326_VERSION_B)) { 833 825 if (iface & ES8326_HPINSERT_FLAG) 834 826 es8326->jack_remove_retry = 2; 835 827 else ··· 867 859 /* 868 860 * Inverted HPJACK_POL bit to trigger one IRQ to double check HP Removal event 869 861 */ 870 - if ((es8326->jack_remove_retry == 0) && (es8326->version != ES8326_VERSION_B)) { 862 + if ((es8326->jack_remove_retry == 0) && (es8326->version < ES8326_VERSION_B)) { 871 863 es8326->jack_remove_retry = 1; 872 864 dev_dbg(comp->dev, "remove event check, invert HPJACK_POL, cnt = %d\n", 873 865 es8326->jack_remove_retry); ··· 962 954 regmap_read(es8326->regmap, ES8326_CHIP_VERSION, &reg); 963 955 es8326->version = reg; 964 956 965 - if ((es8326->version == ES8326_VERSION_B) && (es8326->calibrated == false)) { 957 + if ((es8326->version >= ES8326_VERSION_B) && (es8326->calibrated == false)) { 966 958 dev_dbg(component->dev, "ES8326_VERSION_B, calibrating\n"); 967 959 regmap_write(es8326->regmap, ES8326_CLK_INV, 0xc0); 968 960 regmap_write(es8326->regmap, ES8326_CLK_DIV1, 0x03); ··· 1055 1047 regmap_write(es8326->regmap, ES8326_DAC_VPPSCALE, 0x15); 1056 1048 1057 1049 regmap_write(es8326->regmap, ES8326_HPDET_TYPE, 0x80 | 1058 - ((es8326->version == ES8326_VERSION_B) ? 1050 + ((es8326->version >= ES8326_VERSION_B) ? 1059 1051 (ES8326_HP_DET_SRC_PIN9 | es8326->jack_pol) : 1060 1052 (ES8326_HP_DET_SRC_PIN9 | es8326->jack_pol | 0x04))); 1061 1053 usleep_range(5000, 10000); ··· 1081 1073 regmap_write(es8326->regmap, ES8326_ADC1_SRC, 0x44); 1082 1074 regmap_write(es8326->regmap, ES8326_ADC2_SRC, 0x66); 1083 1075 es8326_disable_micbias(es8326->component); 1076 + if (es8326->version > ES8326_VERSION_B) { 1077 + regmap_update_bits(es8326->regmap, ES8326_ANA_MICBIAS, 0x73, 0x03); 1078 + regmap_update_bits(es8326->regmap, ES8326_VMIDSEL, 0x40, 0x40); 1079 + } 1084 1080 1085 1081 msleep(200); 1086 1082 regmap_write(es8326->regmap, ES8326_INT_SOURCE, ES8326_INT_SRC_PIN9);