From: kovalev@altlinux.org To: devel-kernel@lists.altlinux.org Subject: [d-kernel] [PATCH 4/9] ASoC: codecs: ES8326: Change Hp_detect register names Date: Fri, 8 Dec 2023 20:09:34 +0300 Message-ID: <20231208170938.175868-5-kovalev@altlinux.org> (raw) In-Reply-To: <20231208170938.175868-1-kovalev@altlinux.org> From: Zhu Ning <zhuning0077@gmail.com> Commit 4ddad00c609bdcd6635537d3acb9bd57a5fc79e6 upstream. The old register naming method is confusing. The reg 0x57 decides the default headset hardware connection type, and the reg 0xfb is the headset detection status register, which changes during headset insertion. Change the name to ES8326_HPDET_TYPE and ES8326_HPDET_STA. Signed-off-by: Zhu Ning <zhuning0077@gmail.com> Link: https://lore.kernel.org/r/20230717033223.42506-1-zhuning0077@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Vasiliy Kovalev <kovalev@altlinux.org> --- sound/soc/codecs/es8326.c | 10 +++++----- sound/soc/codecs/es8326.h | 12 ++++++++---- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/sound/soc/codecs/es8326.c b/sound/soc/codecs/es8326.c index 4399ba36aee25d..e953c0157ba03f 100644 --- a/sound/soc/codecs/es8326.c +++ b/sound/soc/codecs/es8326.c @@ -159,7 +159,7 @@ static const struct snd_soc_dapm_route es8326_dapm_routes[] = { }; static const struct regmap_range es8326_volatile_ranges[] = { - regmap_reg_range(ES8326_HP_DETECT, ES8326_HP_DETECT), + regmap_reg_range(ES8326_HPDET_STA, ES8326_HPDET_STA), }; static const struct regmap_access_table es8326_volatile_table = { @@ -519,7 +519,7 @@ static void es8326_jack_button_handler(struct work_struct *work) return; mutex_lock(&es8326->lock); - iface = snd_soc_component_read(comp, ES8326_HP_DETECT); + iface = snd_soc_component_read(comp, ES8326_HPDET_STA); switch (iface) { case 0x93: /* pause button detected */ @@ -578,7 +578,7 @@ static void es8326_jack_detect_handler(struct work_struct *work) unsigned int iface; mutex_lock(&es8326->lock); - iface = snd_soc_component_read(comp, ES8326_HP_DETECT); + iface = snd_soc_component_read(comp, ES8326_HPDET_STA); dev_dbg(comp->dev, "gpio flag %#04x", iface); if ((iface & ES8326_HPINSERT_FLAG) == 0) { /* Jack unplugged or spurious IRQ */ @@ -651,7 +651,7 @@ static int es8326_resume(struct snd_soc_component *component) regmap_write(es8326->regmap, ES8326_ADC1_SRC, es8326->mic1_src); regmap_write(es8326->regmap, ES8326_ADC2_SRC, es8326->mic2_src); regmap_write(es8326->regmap, ES8326_HPJACK_TIMER, 0x88); - regmap_write(es8326->regmap, ES8326_HP_DET, + regmap_write(es8326->regmap, ES8326_HPDET_TYPE, ES8326_HP_DET_SRC_PIN9 | es8326->jack_pol); regmap_write(es8326->regmap, ES8326_INT_SOURCE, es8326->interrupt_src); regmap_write(es8326->regmap, ES8326_INTOUT_IO, es8326->interrupt_clk); @@ -743,7 +743,7 @@ static void es8326_enable_jack_detect(struct snd_soc_component *component, mutex_lock(&es8326->lock); if (es8326->jd_inverted) - snd_soc_component_update_bits(component, ES8326_HP_DET, + snd_soc_component_update_bits(component, ES8326_HPDET_TYPE, ES8326_HP_DET_JACK_POL, ~es8326->jack_pol); es8326->jack = jack; diff --git a/sound/soc/codecs/es8326.h b/sound/soc/codecs/es8326.h index 65ed4d1dc7da09..cd04d11a88d96a 100644 --- a/sound/soc/codecs/es8326.h +++ b/sound/soc/codecs/es8326.h @@ -73,15 +73,19 @@ #define ES8326_DRC_RECOVERY 0x53 #define ES8326_DRC_WINSIZE 0x54 #define ES8326_HPJACK_TIMER 0x56 -#define ES8326_HP_DET 0x57 +#define ES8326_HPDET_TYPE 0x57 #define ES8326_INT_SOURCE 0x58 #define ES8326_INTOUT_IO 0x59 #define ES8326_SDINOUT1_IO 0x5A #define ES8326_SDINOUT23_IO 0x5B #define ES8326_JACK_PULSE 0x5C +#define ES8326_HP_MISC 0xF7 +#define ES8326_CTIA_OMTP_STA 0xF8 #define ES8326_PULLUP_CTL 0xF9 -#define ES8326_HP_DETECT 0xFB +#define ES8326_CSM_I2C_STA 0xFA +#define ES8326_HPDET_STA 0xFB +#define ES8326_CSM_MUTE_STA 0xFC #define ES8326_CHIP_ID1 0xFD #define ES8326_CHIP_ID2 0xFE #define ES8326_CHIP_VERSION 0xFF @@ -146,7 +150,7 @@ #define ES8326_ADC3_SHIFT 0 #define ES8326_ADC4_SHIFT 3 -/* ES8326_HP_DET */ +/* ES8326_HPDET_TYPE */ #define ES8326_HP_DET_SRC_PIN27 (1 << 5) #define ES8326_HP_DET_SRC_PIN9 (1 << 4) #define ES8326_HP_DET_JACK_POL (1 << 3) @@ -174,7 +178,7 @@ #define ES8326_SDINOUT2_SHIFT 4 #define ES8326_SDINOUT3_SHIFT 0 -/* ES8326_HP_DETECT */ +/* ES8326_HPDET_STA */ #define ES8326_HPINSERT_FLAG (1 << 1) #define ES8326_HPBUTTON_FLAG (1 << 0) -- 2.33.8
next prev parent reply other threads:[~2023-12-08 17:09 UTC|newest] Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-12-08 17:09 [d-kernel] [PATCH 0/9] ASoC: codecs: es8326: fix support kovalev 2023-12-08 17:09 ` [d-kernel] [PATCH 1/9] Revert "ASoC: Intel: sof_es8336: add ES8326 component support" kovalev 2023-12-08 17:09 ` [d-kernel] [PATCH 2/9] ASoC: codecs: es8326: Convert to i2c's .probe_new() kovalev 2023-12-08 17:09 ` [d-kernel] [PATCH 3/9] ASoC: codecs: ES8326: Add es8326_mute function kovalev 2023-12-08 17:09 ` kovalev [this message] 2023-12-08 17:09 ` [d-kernel] [PATCH 5/9] ASoC: codecs: ES8326: Change Volatile Reg function kovalev 2023-12-08 17:09 ` [d-kernel] [PATCH 6/9] ASoC: codecs: ES8326: Fix power-up sequence kovalev 2023-12-08 17:09 ` [d-kernel] [PATCH 7/9] ASOC: codecs: ES8326: Add calibration support for version_b kovalev 2023-12-08 17:09 ` [d-kernel] [PATCH 8/9] ASoC: codecs: ES8326: Update jact detection function kovalev
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20231208170938.175868-5-kovalev@altlinux.org \ --to=kovalev@altlinux.org \ --cc=devel-kernel@lists.altlinux.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
ALT Linux kernel packages development This inbox may be cloned and mirrored by anyone: git clone --mirror http://lore.altlinux.org/devel-kernel/0 devel-kernel/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 devel-kernel devel-kernel/ http://lore.altlinux.org/devel-kernel \ devel-kernel@altlinux.org devel-kernel@altlinux.ru devel-kernel@altlinux.com public-inbox-index devel-kernel Example config snippet for mirrors. Newsgroup available over NNTP: nntp://lore.altlinux.org/org.altlinux.lists.devel-kernel AGPL code for this site: git clone https://public-inbox.org/public-inbox.git