]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: codecs: wcd939x: Use simple defines for chipid register value
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Mon, 16 Jun 2025 11:54:10 +0000 (13:54 +0200)
committerMark Brown <broonie@kernel.org>
Sun, 22 Jun 2025 23:26:40 +0000 (00:26 +0100)
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>
sound/soc/codecs/wcd939x.c

index 45645abe3085662f7c4c6d76a590b98ad71fc56f..7ec751a6cd2610dd3c4eb2bb6556e8700b62427c 100644 (file)
@@ -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,
@@ -85,11 +88,6 @@ enum {
 /* Z value compared in milliOhm */
 #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,
@@ -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) {