* [PATCH v2] ASoC: wm8741: Add digital mute callback
@ 2017-10-30 8:28 Sergej Sawazki
2017-10-30 15:41 ` Charles Keepax
0 siblings, 1 reply; 4+ messages in thread
From: Sergej Sawazki @ 2017-10-30 8:28 UTC (permalink / raw)
To: broonie, lgirdwood, ckeepax; +Cc: ce3a, patches, alsa-devel, Sergej Sawazki
Signed-off-by: Sergej Sawazki <sergej@taudac.com>
---
Changes in v2:
* Refactored debug message.
sound/soc/codecs/wm8741.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/sound/soc/codecs/wm8741.c b/sound/soc/codecs/wm8741.c
index b8c1940..5571882 100644
--- a/sound/soc/codecs/wm8741.c
+++ b/sound/soc/codecs/wm8741.c
@@ -351,6 +351,17 @@ static int wm8741_set_dai_fmt(struct snd_soc_dai *codec_dai,
return 0;
}
+int wm8741_mute(struct snd_soc_dai *codec_dai, int mute)
+{
+ struct snd_soc_codec *codec = codec_dai->codec;
+
+ dev_dbg(codec->dev, "wm8741_mute: mute = %d\n", mute);
+
+ snd_soc_update_bits(codec, WM8741_VOLUME_CONTROL,
+ WM8741_SOFT_MASK, !!mute << WM8741_SOFT_SHIFT);
+ return 0;
+}
+
#define WM8741_RATES (SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \
SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | \
SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_176400 | \
@@ -364,6 +375,7 @@ static const struct snd_soc_dai_ops wm8741_dai_ops = {
.hw_params = wm8741_hw_params,
.set_sysclk = wm8741_set_dai_sysclk,
.set_fmt = wm8741_set_dai_fmt,
+ .digital_mute = wm8741_mute,
};
static struct snd_soc_dai_driver wm8741_dai = {
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] ASoC: wm8741: Add digital mute callback
2017-10-30 8:28 [PATCH v2] ASoC: wm8741: Add digital mute callback Sergej Sawazki
@ 2017-10-30 15:41 ` Charles Keepax
2017-10-30 16:13 ` Mark Brown
2017-10-31 9:36 ` Sergej Sawazki
0 siblings, 2 replies; 4+ messages in thread
From: Charles Keepax @ 2017-10-30 15:41 UTC (permalink / raw)
To: Sergej Sawazki; +Cc: alsa-devel, patches, lgirdwood, broonie, ce3a, ckeepax
On Mon, Oct 30, 2017 at 09:28:16AM +0100, Sergej Sawazki wrote:
> Signed-off-by: Sergej Sawazki <sergej@taudac.com>
> ---
> Changes in v2:
> * Refactored debug message.
>
> sound/soc/codecs/wm8741.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/sound/soc/codecs/wm8741.c b/sound/soc/codecs/wm8741.c
> index b8c1940..5571882 100644
> --- a/sound/soc/codecs/wm8741.c
> +++ b/sound/soc/codecs/wm8741.c
> @@ -351,6 +351,17 @@ static int wm8741_set_dai_fmt(struct snd_soc_dai *codec_dai,
> return 0;
> }
>
> +int wm8741_mute(struct snd_soc_dai *codec_dai, int mute)
> +{
> + struct snd_soc_codec *codec = codec_dai->codec;
> +
> + dev_dbg(codec->dev, "wm8741_mute: mute = %d\n", mute);
It is still not really normal style to include the function name
in the debug messages. How about just "digital mute = %d\n" or
something like that?
Thanks,
Charles
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] ASoC: wm8741: Add digital mute callback
2017-10-30 15:41 ` Charles Keepax
@ 2017-10-30 16:13 ` Mark Brown
2017-10-31 9:36 ` Sergej Sawazki
1 sibling, 0 replies; 4+ messages in thread
From: Mark Brown @ 2017-10-30 16:13 UTC (permalink / raw)
To: Charles Keepax
Cc: alsa-devel, patches, lgirdwood, ce3a, ckeepax, Sergej Sawazki
[-- Attachment #1.1: Type: text/plain, Size: 438 bytes --]
On Mon, Oct 30, 2017 at 03:41:35PM +0000, Charles Keepax wrote:
> On Mon, Oct 30, 2017 at 09:28:16AM +0100, Sergej Sawazki wrote:
> > + dev_dbg(codec->dev, "wm8741_mute: mute = %d\n", mute);
> It is still not really normal style to include the function name
> in the debug messages. How about just "digital mute = %d\n" or
> something like that?
Or just don't log anything and rely on framework level diagnostics if
they're needed.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] ASoC: wm8741: Add digital mute callback
2017-10-30 15:41 ` Charles Keepax
2017-10-30 16:13 ` Mark Brown
@ 2017-10-31 9:36 ` Sergej Sawazki
1 sibling, 0 replies; 4+ messages in thread
From: Sergej Sawazki @ 2017-10-31 9:36 UTC (permalink / raw)
To: Charles Keepax, broonie; +Cc: ce3a, patches, ckeepax, lgirdwood, alsa-devel
Am 30.10.2017 um 16:41 schrieb Charles Keepax:
> On Mon, Oct 30, 2017 at 09:28:16AM +0100, Sergej Sawazki wrote:
>> Signed-off-by: Sergej Sawazki <sergej@taudac.com>
>> ---
>> Changes in v2:
>> * Refactored debug message.
>>
>> sound/soc/codecs/wm8741.c | 12 ++++++++++++
>> 1 file changed, 12 insertions(+)
>>
>> diff --git a/sound/soc/codecs/wm8741.c b/sound/soc/codecs/wm8741.c
>> index b8c1940..5571882 100644
>> --- a/sound/soc/codecs/wm8741.c
>> +++ b/sound/soc/codecs/wm8741.c
>> @@ -351,6 +351,17 @@ static int wm8741_set_dai_fmt(struct snd_soc_dai *codec_dai,
>> return 0;
>> }
>>
>> +int wm8741_mute(struct snd_soc_dai *codec_dai, int mute)
>> +{
>> + struct snd_soc_codec *codec = codec_dai->codec;
>> +
>> + dev_dbg(codec->dev, "wm8741_mute: mute = %d\n", mute);
>
> It is still not really normal style to include the function name
> in the debug messages. How about just "digital mute = %d\n" or
> something like that?
>
Maybe not really normal, but CONSISTENT. That's the style used
throughout the entire file. And it makes the log look consistent.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-10-31 9:36 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-30 8:28 [PATCH v2] ASoC: wm8741: Add digital mute callback Sergej Sawazki
2017-10-30 15:41 ` Charles Keepax
2017-10-30 16:13 ` Mark Brown
2017-10-31 9:36 ` Sergej Sawazki
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.