Unverified Commit 100877df authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Mark Brown
Browse files

ASoC: codecs: wcd938x: 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: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20250616-asoc-wcd93xx-enum-v1-2-a20a1b538509@linaro.org


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 2f6ff1e6
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -25,6 +25,9 @@
#include "wcd-mbhc-v2.h"
#include "wcd938x.h"

#define CHIPID_WCD9380			0x0
#define CHIPID_WCD9385			0x5

#define WCD938X_MAX_MICBIAS		(4)
#define WCD938X_MBHC_MAX_BUTTONS	(8)
#define TX_ADC_MAX			(4)
@@ -72,11 +75,6 @@
	SOC_SINGLE_EXT_TLV(xname, reg, shift, max, invert, snd_soc_get_volsw, \
			   wcd938x_ear_pa_put_gain, tlv_array)

enum {
	WCD9380 = 0,
	WCD9385 = 5,
};

enum {
	/* INTR_CTRL_INT_MASK_0 */
	WCD938X_IRQ_MBHC_BUTTON_PRESS_DET = 0,
@@ -3119,7 +3117,7 @@ static int wcd938x_soc_codec_probe(struct snd_soc_component *component)
	disable_irq_nosync(wcd938x->aux_pdm_wd_int);

	switch (variant) {
	case WCD9380:
	case CHIPID_WCD9380:
		ret = snd_soc_add_component_controls(component, wcd9380_snd_controls,
					ARRAY_SIZE(wcd9380_snd_controls));
		if (ret < 0) {
@@ -3129,7 +3127,7 @@ static int wcd938x_soc_codec_probe(struct snd_soc_component *component)
			goto err_free_aux_pdm_wd_int;
		}
		break;
	case WCD9385:
	case CHIPID_WCD9385:
		ret = snd_soc_add_component_controls(component, wcd9385_snd_controls,
					ARRAY_SIZE(wcd9385_snd_controls));
		if (ret < 0) {