[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <D4Q4C17E1A8J.3O1CD1PDP51HH@linaro.org>
Date: Tue, 08 Oct 2024 04:52:50 +0100
From: "Alexey Klimov" <alexey.klimov@...aro.org>
To: "Mohammad Rafi Shaik" <quic_mohs@...cinc.com>, "Liam Girdwood"
<lgirdwood@...il.com>, "Mark Brown" <broonie@...nel.org>, "Jaroslav Kysela"
<perex@...ex.cz>, "Takashi Iwai" <tiwai@...e.com>, "Srinivas Kandagatla"
<srinivas.kandagatla@...aro.org>
Cc: <linux-sound@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<alsa-devel@...a-project.org>, <linux-arm-msm@...r.kernel.org>,
<kernel@...cinc.com>, "Rohit kumar" <quic_rohkumar@...cinc.com>
Subject: Re: [PATCH v1] ASoC: codecs: lpass-macro: Add support for channel
map mixer control
On Mon Sep 30, 2024 at 6:31 AM BST, Mohammad Rafi Shaik wrote:
> From: Rohit kumar <quic_rohkumar@...cinc.com>
>
> Add channel map mixer control for lpass macro codec DAIs.
>
> Signed-off-by: Rohit kumar <quic_rohkumar@...cinc.com>
> Co-developed-by: Mohammad Rafi Shaik <quic_mohs@...cinc.com>
> Signed-off-by: Mohammad Rafi Shaik <quic_mohs@...cinc.com>
> ---
IIUC there was off-the-list discussion about why it is needed.
Could you please elaborate a bit more in the commit message?
> --- a/sound/soc/codecs/lpass-macro-common.c
> +++ b/sound/soc/codecs/lpass-macro-common.c
> @@ -8,12 +8,67 @@
> #include <linux/platform_device.h>
> #include <linux/pm_domain.h>
> #include <linux/pm_runtime.h>
> +#include <sound/control.h>
> +#include <sound/pcm.h>
> +#include <sound/soc.h>
>
> #include "lpass-macro-common.h"
>
> static DEFINE_MUTEX(lpass_codec_mutex);
> static enum lpass_codec_version lpass_codec_version;
>
> +static int lpass_macro_chmap_ctl_get(struct snd_kcontrol *kcontrol,
> + struct snd_ctl_elem_value *ucontrol)
> +{
> + struct snd_pcm_chmap *info = snd_kcontrol_chip(kcontrol);
> + struct snd_soc_dai *dai = info->private_data;
> + u32 *chmap_data = NULL;
You don't really need to set chmap_data to NULL if you're going to overwrite
it with a kzalloc() call a couple of lines below.
> + u32 rx_ch_cnt = 0;
> + u32 tx_ch_cnt = 0;
> + u32 rx_ch, tx_ch;
> +
> + chmap_data = kzalloc(sizeof(u32) * 2, GFP_KERNEL);
> + if (!chmap_data)
> + return -ENOMEM;
> +
[...]
Thanks,
Alexey
Powered by blists - more mailing lists