diff options
| author | Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> | 2025-06-16 13:54:10 +0200 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2025-06-23 00:26:40 +0100 |
| commit | 5d3ccd356e2ce510bdbd4b0c389f2fe3deb41a45 (patch) | |
| tree | 784ad148f9fabcd5de48d31527c66fe4332d8b32 | |
| parent | 100877df34b00257c9ed6d279b06b3ed1da5e2c1 (diff) | |
ASoC: codecs: wcd939x: Use simple defines for chipid register value
The value used to identify chip variant is not an enumeration, but raw
value used to compare registers with. The 'enum' is not used in the
code at all, so simplify and make it a raw hex value define, so
intention will be explicit.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20250616-asoc-wcd93xx-enum-v1-3-a20a1b538509@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
| -rw-r--r-- | sound/soc/codecs/wcd939x.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/sound/soc/codecs/wcd939x.c b/sound/soc/codecs/wcd939x.c index 45645abe3085..7ec751a6cd26 100644 --- a/sound/soc/codecs/wcd939x.c +++ b/sound/soc/codecs/wcd939x.c @@ -36,6 +36,9 @@ #define TX_ADC_MAX (4) #define WCD_MBHC_HS_V_MAX 1600 +#define CHIPID_WCD9390 0x0 +#define CHIPID_WCD9395 0x5 + enum { WCD939X_VERSION_1_0 = 0, WCD939X_VERSION_1_1, @@ -86,11 +89,6 @@ enum { #define WCD939X_ANA_MBHC_ZDET_CONST (1018 * 1024) enum { - WCD9390 = 0, - WCD9395 = 5, -}; - -enum { /* INTR_CTRL_INT_MASK_0 */ WCD939X_IRQ_MBHC_BUTTON_PRESS_DET = 0, WCD939X_IRQ_MBHC_BUTTON_RELEASE_DET, @@ -1483,7 +1481,7 @@ static int wcd939x_rx_hph_mode_put(struct snd_kcontrol *kcontrol, if (mode_val == wcd939x->hph_mode) return 0; - if (wcd939x->variant == WCD9390) { + if (wcd939x->variant == CHIPID_WCD9390) { switch (mode_val) { case CLS_H_NORMAL: case CLS_H_LP: @@ -3065,7 +3063,7 @@ static int wcd939x_soc_codec_probe(struct snd_soc_component *component) disable_irq_nosync(wcd939x->ear_pdm_wd_int); switch (wcd939x->variant) { - case WCD9390: + case CHIPID_WCD9390: ret = snd_soc_add_component_controls(component, wcd9390_snd_controls, ARRAY_SIZE(wcd9390_snd_controls)); if (ret < 0) { @@ -3075,7 +3073,7 @@ static int wcd939x_soc_codec_probe(struct snd_soc_component *component) goto err_free_ear_pdm_wd_int; } break; - case WCD9395: + case CHIPID_WCD9395: ret = snd_soc_add_component_controls(component, wcd9395_snd_controls, ARRAY_SIZE(wcd9395_snd_controls)); if (ret < 0) { |
