From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> To: Mark Brown <broonie@kernel.org> Cc: alsa-devel@alsa-project.org, lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/4] ASoC: codecs: wsa883x: add control, dapm widgets and map Date: Wed, 29 Jun 2022 12:00:23 +0100 [thread overview] Message-ID: <2fdd0847-5102-ea9f-cfbb-f3dd378d3a8a@linaro.org> (raw) In-Reply-To: <YrwwPbm0sL1RGwjO@sirena.org.uk> Thanks Mark, On 29/06/2022 11:58, Mark Brown wrote: > On Wed, Jun 29, 2022 at 10:06:43AM +0100, Srinivas Kandagatla wrote: > >> +static int wsa_dev_mode_put(struct snd_kcontrol *kcontrol, >> + struct snd_ctl_elem_value *ucontrol) >> +{ >> + struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); >> + struct wsa883x_priv *wsa883x = snd_soc_component_get_drvdata(component); >> + >> + if (wsa883x->dev_mode == ucontrol->value.enumerated.item[0]) >> + return 0; >> + >> + wsa883x->dev_mode = ucontrol->value.enumerated.item[0]; >> + >> + return 0; >> +} > > This isn't returning 1 when the value changes so will miss generating > events, please test the driver with mixer-test. Yes my bad.. > >> + switch (event) { >> + case SND_SOC_DAPM_POST_PMU: >> + if (wsa883x->dev_mode == RECEIVER) { >> + snd_soc_component_write_field(component, WSA883X_CDC_PATH_MODE, >> + WSA883X_RXD_MODE_MASK, >> + WSA883X_RXD_MODE_HIFI); >> + snd_soc_component_write_field(component, WSA883X_SPKR_PWM_CLK_CTL, >> + WSA883X_SPKR_PWM_FREQ_SEL_MASK, >> + WSA883X_SPKR_PWM_FREQ_F600KHZ); >> + snd_soc_component_write_field(component, WSA883X_DRE_CTL_0, >> + WSA883X_DRE_PROG_DELAY_MASK, 0x0); >> + } else if (wsa883x->dev_mode == SPEAKER) { > > This looks like it'd be better written as a switch statement. Sounds good, > >> +static const struct snd_kcontrol_new wsa883x_snd_controls[] = { >> + SOC_SINGLE_RANGE_TLV("PA Gain", WSA883X_DRE_CTL_1, 1, >> + 0x0, 0x1f, 1, pa_gain), > > Volume controls should end in Volume, mixer-test should also have caught > this. Okay, will fix all these in next spin.
WARNING: multiple messages have this Message-ID (diff)
From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> To: Mark Brown <broonie@kernel.org> Cc: linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, tiwai@suse.com, lgirdwood@gmail.com Subject: Re: [PATCH 3/4] ASoC: codecs: wsa883x: add control, dapm widgets and map Date: Wed, 29 Jun 2022 12:00:23 +0100 [thread overview] Message-ID: <2fdd0847-5102-ea9f-cfbb-f3dd378d3a8a@linaro.org> (raw) In-Reply-To: <YrwwPbm0sL1RGwjO@sirena.org.uk> Thanks Mark, On 29/06/2022 11:58, Mark Brown wrote: > On Wed, Jun 29, 2022 at 10:06:43AM +0100, Srinivas Kandagatla wrote: > >> +static int wsa_dev_mode_put(struct snd_kcontrol *kcontrol, >> + struct snd_ctl_elem_value *ucontrol) >> +{ >> + struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol); >> + struct wsa883x_priv *wsa883x = snd_soc_component_get_drvdata(component); >> + >> + if (wsa883x->dev_mode == ucontrol->value.enumerated.item[0]) >> + return 0; >> + >> + wsa883x->dev_mode = ucontrol->value.enumerated.item[0]; >> + >> + return 0; >> +} > > This isn't returning 1 when the value changes so will miss generating > events, please test the driver with mixer-test. Yes my bad.. > >> + switch (event) { >> + case SND_SOC_DAPM_POST_PMU: >> + if (wsa883x->dev_mode == RECEIVER) { >> + snd_soc_component_write_field(component, WSA883X_CDC_PATH_MODE, >> + WSA883X_RXD_MODE_MASK, >> + WSA883X_RXD_MODE_HIFI); >> + snd_soc_component_write_field(component, WSA883X_SPKR_PWM_CLK_CTL, >> + WSA883X_SPKR_PWM_FREQ_SEL_MASK, >> + WSA883X_SPKR_PWM_FREQ_F600KHZ); >> + snd_soc_component_write_field(component, WSA883X_DRE_CTL_0, >> + WSA883X_DRE_PROG_DELAY_MASK, 0x0); >> + } else if (wsa883x->dev_mode == SPEAKER) { > > This looks like it'd be better written as a switch statement. Sounds good, > >> +static const struct snd_kcontrol_new wsa883x_snd_controls[] = { >> + SOC_SINGLE_RANGE_TLV("PA Gain", WSA883X_DRE_CTL_1, 1, >> + 0x0, 0x1f, 1, pa_gain), > > Volume controls should end in Volume, mixer-test should also have caught > this. Okay, will fix all these in next spin.
next prev parent reply other threads:[~2022-06-29 11:00 UTC|newest] Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-06-29 9:06 [PATCH 0/4] ASoC: codecs: add WSA883x support Srinivas Kandagatla 2022-06-29 9:06 ` Srinivas Kandagatla 2022-06-29 9:06 ` [PATCH 1/4] ASoC: dt-bindings: Add WSA883x bindings Srinivas Kandagatla 2022-06-29 9:06 ` Srinivas Kandagatla 2022-06-29 9:06 ` [PATCH 2/4] ASoC: codecs: add wsa883x amplifier support Srinivas Kandagatla 2022-06-29 9:06 ` Srinivas Kandagatla 2022-06-29 15:03 ` Pierre-Louis Bossart 2022-06-29 15:03 ` Pierre-Louis Bossart 2022-06-29 16:09 ` Srinivas Kandagatla 2022-06-29 16:09 ` Srinivas Kandagatla 2022-06-29 16:42 ` Pierre-Louis Bossart 2022-06-29 16:42 ` Pierre-Louis Bossart 2022-06-29 9:06 ` [PATCH 3/4] ASoC: codecs: wsa883x: add control, dapm widgets and map Srinivas Kandagatla 2022-06-29 9:06 ` Srinivas Kandagatla 2022-06-29 10:58 ` Mark Brown 2022-06-29 10:58 ` Mark Brown 2022-06-29 11:00 ` Srinivas Kandagatla [this message] 2022-06-29 11:00 ` Srinivas Kandagatla 2022-06-29 9:06 ` [PATCH 4/4] MAINTAINERS: add ASoC Qualcomm codecs Srinivas Kandagatla 2022-06-29 9:06 ` Srinivas Kandagatla 2022-06-29 14:44 ` (subset) [PATCH 0/4] ASoC: codecs: add WSA883x support Mark Brown 2022-06-29 14:44 ` Mark Brown
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=2fdd0847-5102-ea9f-cfbb-f3dd378d3a8a@linaro.org \ --to=srinivas.kandagatla@linaro.org \ --cc=alsa-devel@alsa-project.org \ --cc=broonie@kernel.org \ --cc=lgirdwood@gmail.com \ --cc=linux-kernel@vger.kernel.org \ --cc=perex@perex.cz \ --cc=tiwai@suse.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.