Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6ebbce0a authored by Richard Fitzgerald's avatar Richard Fitzgerald Committed by Mark Brown
Browse files

ASoC: wm8998: Initial WM8998 codec driver

parent 50e6168f
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -171,6 +171,7 @@ config SND_SOC_ALL_CODECS
	select SND_SOC_WM8995 if SND_SOC_I2C_AND_SPI
	select SND_SOC_WM8996 if I2C
	select SND_SOC_WM8997 if MFD_WM8997
	select SND_SOC_WM8998 if MFD_WM8998
	select SND_SOC_WM9081 if I2C
	select SND_SOC_WM9090 if I2C
	select SND_SOC_WM9705 if SND_SOC_AC97_BUS
@@ -195,9 +196,11 @@ config SND_SOC_ARIZONA
	default y if SND_SOC_WM5102=y
	default y if SND_SOC_WM5110=y
	default y if SND_SOC_WM8997=y
	default y if SND_SOC_WM8998=y
	default m if SND_SOC_WM5102=m
	default m if SND_SOC_WM5110=m
	default m if SND_SOC_WM8997=m
	default m if SND_SOC_WM8998=m

config SND_SOC_WM_HUBS
	tristate
@@ -865,6 +868,9 @@ config SND_SOC_WM8996
config SND_SOC_WM8997
	tristate

config SND_SOC_WM8998
	tristate

config SND_SOC_WM9081
	tristate

+2 −0
Original line number Diff line number Diff line
@@ -176,6 +176,7 @@ snd-soc-wm8993-objs := wm8993.o
snd-soc-wm8994-objs := wm8994.o wm8958-dsp2.o
snd-soc-wm8995-objs := wm8995.o
snd-soc-wm8997-objs := wm8997.o
snd-soc-wm8998-objs := wm8998.o
snd-soc-wm9081-objs := wm9081.o
snd-soc-wm9090-objs := wm9090.o
snd-soc-wm9705-objs := wm9705.o
@@ -364,6 +365,7 @@ obj-$(CONFIG_SND_SOC_WM8993) += snd-soc-wm8993.o
obj-$(CONFIG_SND_SOC_WM8994)	+= snd-soc-wm8994.o
obj-$(CONFIG_SND_SOC_WM8995)	+= snd-soc-wm8995.o
obj-$(CONFIG_SND_SOC_WM8997)	+= snd-soc-wm8997.o
obj-$(CONFIG_SND_SOC_WM8998)	+= snd-soc-wm8998.o
obj-$(CONFIG_SND_SOC_WM9081)	+= snd-soc-wm9081.o
obj-$(CONFIG_SND_SOC_WM9090)	+= snd-soc-wm9090.o
obj-$(CONFIG_SND_SOC_WM9705)	+= snd-soc-wm9705.o
+33 −0
Original line number Diff line number Diff line
@@ -316,6 +316,7 @@ const char *arizona_mixer_texts[ARIZONA_NUM_MIXER_INPUTS] = {
	"Tone Generator 2",
	"Haptics",
	"AEC",
	"AEC2",
	"Mic Mute Mixer",
	"Noise Generator",
	"IN1L",
@@ -423,6 +424,7 @@ int arizona_mixer_values[ARIZONA_NUM_MIXER_INPUTS] = {
	0x05,
	0x06,  /* Haptics */
	0x08,  /* AEC */
	0x09,  /* AEC2 */
	0x0c,  /* Noise mixer */
	0x0d,  /* Comfort noise */
	0x10,  /* IN1L */
@@ -527,6 +529,32 @@ EXPORT_SYMBOL_GPL(arizona_mixer_values);
const DECLARE_TLV_DB_SCALE(arizona_mixer_tlv, -3200, 100, 0);
EXPORT_SYMBOL_GPL(arizona_mixer_tlv);

const char * const arizona_sample_rate_text[ARIZONA_SAMPLE_RATE_ENUM_SIZE] = {
	"12kHz", "24kHz", "48kHz", "96kHz", "192kHz",
	"11.025kHz", "22.05kHz", "44.1kHz", "88.2kHz", "176.4kHz",
	"4kHz", "8kHz", "16kHz", "32kHz",
};
EXPORT_SYMBOL_GPL(arizona_sample_rate_text);

const unsigned int arizona_sample_rate_val[ARIZONA_SAMPLE_RATE_ENUM_SIZE] = {
	0x01, 0x02, 0x03, 0x04, 0x05, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,
	0x10, 0x11, 0x12, 0x13,
};
EXPORT_SYMBOL_GPL(arizona_sample_rate_val);

const char *arizona_sample_rate_val_to_name(unsigned int rate_val)
{
	int i;

	for (i = 0; i < ARRAY_SIZE(arizona_sample_rate_val); ++i) {
		if (arizona_sample_rate_val[i] == rate_val)
			return arizona_sample_rate_text[i];
	}

	return "Illegal";
}
EXPORT_SYMBOL_GPL(arizona_sample_rate_val_to_name);

const char *arizona_rate_text[ARIZONA_RATE_ENUM_SIZE] = {
	"SYNCCLK rate", "8kHz", "16kHz", "ASYNCCLK rate",
};
@@ -1884,6 +1912,11 @@ static int arizona_calc_fratio(struct arizona_fll *fll,
		if (fll->arizona->rev < 3 || sync)
			return init_ratio;
		break;
	case WM8998:
	case WM1814:
		if (sync)
			return init_ratio;
		break;
	default:
		return init_ratio;
	}
+6 −1
Original line number Diff line number Diff line
@@ -93,7 +93,7 @@ struct arizona_priv {
	bool dvfs_cached;
};

#define ARIZONA_NUM_MIXER_INPUTS 103
#define ARIZONA_NUM_MIXER_INPUTS 104

extern const unsigned int arizona_mixer_tlv[];
extern const char *arizona_mixer_texts[ARIZONA_NUM_MIXER_INPUTS];
@@ -214,8 +214,12 @@ extern int arizona_mixer_values[ARIZONA_NUM_MIXER_INPUTS];
	 .num_regs = 1 }) }

#define ARIZONA_RATE_ENUM_SIZE 4
#define ARIZONA_SAMPLE_RATE_ENUM_SIZE 14

extern const char *arizona_rate_text[ARIZONA_RATE_ENUM_SIZE];
extern const int arizona_rate_val[ARIZONA_RATE_ENUM_SIZE];
extern const char * const arizona_sample_rate_text[ARIZONA_SAMPLE_RATE_ENUM_SIZE];
extern const unsigned int arizona_sample_rate_val[ARIZONA_SAMPLE_RATE_ENUM_SIZE];

extern const struct soc_enum arizona_isrc_fsl[];
extern const struct soc_enum arizona_isrc_fsh[];
@@ -301,4 +305,5 @@ int arizona_set_output_mode(struct snd_soc_codec *codec, int output,

extern bool arizona_input_analog(struct snd_soc_codec *codec, int shift);

extern const char *arizona_sample_rate_val_to_name(unsigned int rate_val);
#endif
+1430 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading