ASoC: wm_adsp: Move DSP Rate controls into the codec
The rate controls are codec-specific, it's not possible to generically say what the range or the meaning of each control is (or even if they exist at all) - that depends on the particular codec. This is currently being handled for Arizona codecs by putting an Arizona-specific table of controls inside the wm_adsp driver. This creates a dependency between wm_adsp and arizona.c, and is an awkward solution if the ADSP is used in another family of codecs Fix this by moving the Arizona-specific rate controls into the Arizona codec drivers. Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:

committed by
Mark Brown

parent
89a6192049
commit
336d0442b9
@@ -2286,6 +2286,33 @@ int arizona_set_output_mode(struct snd_soc_codec *codec, int output, bool diff)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(arizona_set_output_mode);
|
||||
|
||||
static const struct soc_enum arizona_adsp2_rate_enum[] = {
|
||||
SOC_VALUE_ENUM_SINGLE(ARIZONA_DSP1_CONTROL_1,
|
||||
ARIZONA_DSP1_RATE_SHIFT, 0xf,
|
||||
ARIZONA_RATE_ENUM_SIZE,
|
||||
arizona_rate_text, arizona_rate_val),
|
||||
SOC_VALUE_ENUM_SINGLE(ARIZONA_DSP2_CONTROL_1,
|
||||
ARIZONA_DSP1_RATE_SHIFT, 0xf,
|
||||
ARIZONA_RATE_ENUM_SIZE,
|
||||
arizona_rate_text, arizona_rate_val),
|
||||
SOC_VALUE_ENUM_SINGLE(ARIZONA_DSP3_CONTROL_1,
|
||||
ARIZONA_DSP1_RATE_SHIFT, 0xf,
|
||||
ARIZONA_RATE_ENUM_SIZE,
|
||||
arizona_rate_text, arizona_rate_val),
|
||||
SOC_VALUE_ENUM_SINGLE(ARIZONA_DSP4_CONTROL_1,
|
||||
ARIZONA_DSP1_RATE_SHIFT, 0xf,
|
||||
ARIZONA_RATE_ENUM_SIZE,
|
||||
arizona_rate_text, arizona_rate_val),
|
||||
};
|
||||
|
||||
const struct snd_kcontrol_new arizona_adsp2_rate_controls[] = {
|
||||
SOC_ENUM("DSP1 Rate", arizona_adsp2_rate_enum[0]),
|
||||
SOC_ENUM("DSP2 Rate", arizona_adsp2_rate_enum[1]),
|
||||
SOC_ENUM("DSP3 Rate", arizona_adsp2_rate_enum[2]),
|
||||
SOC_ENUM("DSP4 Rate", arizona_adsp2_rate_enum[3]),
|
||||
};
|
||||
EXPORT_SYMBOL_GPL(arizona_adsp2_rate_controls);
|
||||
|
||||
MODULE_DESCRIPTION("ASoC Wolfson Arizona class device support");
|
||||
MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
Reference in New Issue
Block a user