From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
To: Trevor Wu <trevor.wu@mediatek.com>,
broonie@kernel.org, tiwai@suse.com, robh+dt@kernel.org,
matthias.bgg@gmail.com
Cc: alsa-devel@alsa-project.org, linux-mediatek@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
aaronyu@google.com, yc.hung@mediatek.com
Subject: Re: [PATCH 4/5] ASoC: mediatek: mt8195: add machine driver with mt6359, max98390 and rt5682
Date: Mon, 14 Mar 2022 10:00:58 +0100 [thread overview]
Message-ID: <db4d4b19-0c44-0bad-3544-01237bbb6c07@collabora.com> (raw)
In-Reply-To: <5fafa7d8a23fbdce82272529d817816f42c4ac37.camel@mediatek.com>
Il 12/03/22 17:18, Trevor Wu ha scritto:
> On Thu, 2022-03-10 at 16:21 +0100, AngeloGioacchino Del Regno wrote:
>> Il 08/03/22 08:24, Trevor Wu ha scritto:
>>> This patch adds support for mt8195 board with mt6359, max98390 and
>>> rt5682.
>>>
>>> Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
>>
>> Hello Trevor,
>> thanks for the patch! However, there's something to improve...
>>
>>> ---
>>> sound/soc/mediatek/Kconfig | 16 +
>>> sound/soc/mediatek/mt8195/Makefile | 5 +
>>> .../mt8195/mt8195-mt6359-max98390-rt5682.c | 1058
>>> +++++++++++++++++
>>> 3 files changed, 1079 insertions(+)
>>> create mode 100644 sound/soc/mediatek/mt8195/mt8195-mt6359-
>>> max98390-rt5682.c
>>>
>>>
>
> [...]
>>> +
>>> +static const struct snd_soc_dapm_widget
>>> + mt8195_mt6359_max98390_rt5682_widgets[] = {
>>> + SND_SOC_DAPM_SPK("Left Speaker", NULL),
>>> + SND_SOC_DAPM_SPK("Right Speaker", NULL),
>>> + SND_SOC_DAPM_HP("Headphone Jack", NULL),
>>
>> We can at least partially reuse existing UCM2 configuration if you
>> slightly change the names for these controls.
>>
>
> I don't know what the UCM2 configuration means.
> Could you give me more information?
>
UCM == Use Case Manager;
In short, it's userspace (alsa-lib) configuration for sound cards, allowing
to configure the various mixers for various usecases (speaker/headphone/HDMI
playback, headset/internal microphone, etc).
Check this GitHub repository for more information:
https://github.com/alsa-project/alsa-ucm-conf/tree/master/ucm2
>
>> Specifically, MAX98090 (yes I know it's a different codec) has names
>> "Speaker Left", "Speaker Right" instead, we will be able to at least
>> partially reuse these (or get uniform naming, which is still good).
>> As for the "Headphone Jack", it's simply "Headphone".
>>
>> Please note that the actual control names in userspace will be,
>> exactly,
>>
>> "Speaker Left Switch", "Speaker Right Switch",
>> "Headphone Left Switch", "Headphone Right Switch"...
>>
>> ....where "Switch" gets automatically appended because of the control
>> type.
>>
>>> + SND_SOC_DAPM_MIC("Headset Mic", NULL),
>>
>> This "Headset Mic" name is fine.
>>
>>> + SND_SOC_DAPM_MIXER(SOF_DMA_DL2, SND_SOC_NOPM, 0, 0, NULL, 0),
>>> + SND_SOC_DAPM_MIXER(SOF_DMA_DL3, SND_SOC_NOPM, 0, 0, NULL, 0),
>>> + SND_SOC_DAPM_MIXER(SOF_DMA_UL4, SND_SOC_NOPM, 0, 0, NULL, 0),
>>> + SND_SOC_DAPM_MIXER(SOF_DMA_UL5, SND_SOC_NOPM, 0, 0, NULL, 0),
>>> +};
>>> +
> [...]
>>> +
>>> +static struct snd_soc_dai_link
>>> mt8195_mt6359_max98390_rt5682_dai_links[] = {
>>
>>
>> ... again, different name, same contents ...
>>
>>
>> And I won't go on repeating the same thing over and over again.
>> I think that the best idea here is to either create a mt8195-mt6359-
>> rt5682-common.c
>> file, or to rename the others to something else and get them all in
>> the same file.
>>
>>
>> Regards,
>> Angelo
>
> Hi Angelo,
>
> Thanks for your review.
> Please forgive me for deleting some comments above.
> I totally agree that most code can be reused.
> I will try revising and merging all mt8195 machine drivers in a file.
No worries. Looking forward to see the next version.
Thank you!
Regards,
Angelo
>
> Thanks,
> Trevor
>
next prev parent reply other threads:[~2022-03-14 9:01 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-08 7:24 [PATCH 0/5] ASoC: mediatek: Add support for MT8195 sound card with " Trevor Wu
2022-03-08 7:24 ` [PATCH 1/5] ASoC: mediatek: mt8195: add reset controller Trevor Wu
2022-03-10 15:25 ` AngeloGioacchino Del Regno
2022-03-08 7:24 ` [PATCH 2/5] dt-bindings: mediatek: mt8195: add reset property Trevor Wu
2022-03-10 22:12 ` Rob Herring
2022-03-12 13:31 ` Trevor Wu
2022-03-08 7:24 ` [PATCH 3/5] ASoC: mediatek: mt8195: common code for mt8195 machine driver Trevor Wu
2022-03-08 7:24 ` [PATCH 4/5] ASoC: mediatek: mt8195: add machine driver with mt6359, max98390 and rt5682 Trevor Wu
2022-03-10 15:21 ` AngeloGioacchino Del Regno
2022-03-12 16:18 ` Trevor Wu
2022-03-14 9:00 ` AngeloGioacchino Del Regno [this message]
2022-03-08 7:24 ` [PATCH 5/5] dt-bindings: mediatek: mt8195: add mt8195-mt6359-max98390-rt5682 document Trevor Wu
2022-03-10 22:18 ` Rob Herring
2022-03-12 14:20 ` Trevor Wu
2022-03-14 15:28 ` Rob Herring
2022-03-11 20:22 ` (subset) [PATCH 0/5] ASoC: mediatek: Add support for MT8195 sound card with max98390 and rt5682 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=db4d4b19-0c44-0bad-3544-01237bbb6c07@collabora.com \
--to=angelogioacchino.delregno@collabora.com \
--cc=aaronyu@google.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=robh+dt@kernel.org \
--cc=tiwai@suse.com \
--cc=trevor.wu@mediatek.com \
--cc=yc.hung@mediatek.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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®