Lines Matching +full:static +full:- +full:enable
1 // SPDX-License-Identifier: GPL-2.0-only
3 * ak4535.c -- AK4535 ALSA Soc Audio driver
37 static const struct reg_default ak4535_reg_defaults[] = {
55 static bool ak4535_volatile(struct device *dev, unsigned int reg) in ak4535_volatile()
65 static const char *ak4535_mono_gain[] = {"+6dB", "-17dB"};
66 static const char *ak4535_mono_out[] = {"(L + R)/2", "Hi-Z"};
67 static const char *ak4535_hp_out[] = {"Stereo", "Mono"};
68 static const char *ak4535_deemp[] = {"44.1kHz", "Off", "48kHz", "32kHz"};
69 static const char *ak4535_mic_select[] = {"Internal", "External"};
71 static const struct soc_enum ak4535_enum[] = {
79 static const struct snd_kcontrol_new ak4535_snd_controls[] = {
102 static const struct snd_kcontrol_new ak4535_mono1_mixer_controls[] = {
108 static const struct snd_kcontrol_new ak4535_stereo_mixer_controls[] = {
115 static const struct snd_kcontrol_new ak4535_input_mixer_controls[] = {
121 static const struct snd_kcontrol_new ak4535_input_mux_control =
125 static const struct snd_kcontrol_new ak4535_hpl_control =
129 static const struct snd_kcontrol_new ak4535_hpr_control =
133 static const struct snd_kcontrol_new ak4535_mono2_control =
137 static const struct snd_kcontrol_new ak4535_line_control =
141 static const struct snd_soc_dapm_widget ak4535_dapm_widgets[] = {
154 SND_SOC_DAPM_SWITCH("Mono 2 Enable", SND_SOC_NOPM, 0, 0,
157 SND_SOC_DAPM_PGA("Speaker Enable", AK4535_MODE2, 0, 0, NULL, 0),
158 SND_SOC_DAPM_SWITCH("Line Out Enable", SND_SOC_NOPM, 0, 0,
160 SND_SOC_DAPM_SWITCH("Left HP Enable", SND_SOC_NOPM, 0, 0,
162 SND_SOC_DAPM_SWITCH("Right HP Enable", SND_SOC_NOPM, 0, 0,
191 static const struct snd_soc_dapm_route ak4535_audio_map[] = {
210 {"LOUT", NULL, "Line Out Enable"},
211 {"ROUT", NULL, "Line Out Enable"},
212 {"Line Out Enable", "Switch", "Line Out"},
220 {"HPL", NULL, "Left HP Enable"},
221 {"Left HP Enable", "Switch", "HP L Amp"},
225 {"HPR", NULL, "Right HP Enable"},
226 {"Right HP Enable", "Switch", "HP R Amp"},
230 {"SPP", NULL, "Speaker Enable"},
231 {"SPN", NULL, "Speaker Enable"},
232 {"Speaker Enable", "Switch", "Spk Amp"},
236 {"MOUT2", NULL, "Mono 2 Enable"},
237 {"Mono 2 Enable", "Switch", "Stereo Mixer"},
248 static int ak4535_set_dai_sysclk(struct snd_soc_dai *codec_dai, in ak4535_set_dai_sysclk()
251 struct snd_soc_component *component = codec_dai->component; in ak4535_set_dai_sysclk()
254 ak4535->sysclk = freq; in ak4535_set_dai_sysclk()
258 static int ak4535_hw_params(struct snd_pcm_substream *substream, in ak4535_hw_params()
262 struct snd_soc_component *component = dai->component; in ak4535_hw_params()
268 fs = ak4535->sysclk / rate; in ak4535_hw_params()
287 static int ak4535_set_dai_fmt(struct snd_soc_dai *codec_dai, in ak4535_set_dai_fmt()
290 struct snd_soc_component *component = codec_dai->component; in ak4535_set_dai_fmt()
302 return -EINVAL; in ak4535_set_dai_fmt()
312 static int ak4535_mute(struct snd_soc_dai *dai, int mute, int direction) in ak4535_mute()
314 struct snd_soc_component *component = dai->component; in ak4535_mute()
324 static int ak4535_set_bias_level(struct snd_soc_component *component, in ak4535_set_bias_level()
349 static const struct snd_soc_dai_ops ak4535_dai_ops = {
357 static struct snd_soc_dai_driver ak4535_dai = {
358 .name = "ak4535-hifi",
374 static int ak4535_resume(struct snd_soc_component *component) in ak4535_resume()
380 static const struct regmap_config ak4535_regmap = {
392 static const struct snd_soc_component_driver soc_component_dev_ak4535 = {
408 static int ak4535_i2c_probe(struct i2c_client *i2c, in ak4535_i2c_probe()
414 ak4535 = devm_kzalloc(&i2c->dev, sizeof(struct ak4535_priv), in ak4535_i2c_probe()
417 return -ENOMEM; in ak4535_i2c_probe()
419 ak4535->regmap = devm_regmap_init_i2c(i2c, &ak4535_regmap); in ak4535_i2c_probe()
420 if (IS_ERR(ak4535->regmap)) { in ak4535_i2c_probe()
421 ret = PTR_ERR(ak4535->regmap); in ak4535_i2c_probe()
422 dev_err(&i2c->dev, "Failed to init regmap: %d\n", ret); in ak4535_i2c_probe()
428 ret = devm_snd_soc_register_component(&i2c->dev, in ak4535_i2c_probe()
434 static const struct i2c_device_id ak4535_i2c_id[] = {
440 static struct i2c_driver ak4535_i2c_driver = {