All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: "Amadeusz Sławiński" <amadeuszx.slawinski@linux.intel.com>,
	"Alicja Michalska" <ahplka19@gmail.com>,
	alsa-devel@alsa-project.org, broonie@kernel.org
Cc: cezary.rojewski@intel.com, upstream@semihalf.com,
	rad@semihalf.com, tiwai@suse.com, hdegoede@redhat.com,
	cujomalainey@chromium.org, lma@semihalf.com
Subject: Re: [PATCH] ASoC: Intel: avs: Add support for RT5663 codec
Date: Thu, 22 Dec 2022 09:59:24 -0600	[thread overview]
Message-ID: <4a627876-fd7c-25a3-bbae-cbb4539f18bb@linux.intel.com> (raw)
In-Reply-To: <f3b81814-96ce-f54e-5df9-6a70e4c29b19@linux.intel.com>



On 12/22/22 03:41, Amadeusz Sławiński wrote:
> On 12/21/2022 9:36 PM, Pierre-Louis Bossart wrote:
>>
>>> +static int avs_create_dai_link(struct device *dev, const char
>>> *platform_name, int ssp_port,
>>> +                   struct snd_soc_dai_link **dai_link)
>>> +{
>>> +    struct snd_soc_dai_link_component *platform;
>>> +    struct snd_soc_dai_link *dl;
>>> +
>>> +    dl = devm_kzalloc(dev, sizeof(*dl), GFP_KERNEL);
>>> +    platform = devm_kzalloc(dev, sizeof(*platform), GFP_KERNEL);
>>> +    if (!dl || !platform)
>>> +        return -ENOMEM;
>>> +
>>> +    platform->name = platform_name;
>>> +
>>> +    dl->name = devm_kasprintf(dev, GFP_KERNEL, "SSP%d-Codec",
>>> ssp_port);
>>> +    dl->cpus = devm_kzalloc(dev, sizeof(*dl->cpus), GFP_KERNEL);
>>> +    dl->codecs = devm_kzalloc(dev, sizeof(*dl->codecs), GFP_KERNEL);
>>> +    if (!dl->name || !dl->cpus || !dl->codecs)
>>> +        return -ENOMEM;
>>> +
>>> +    dl->cpus->dai_name = devm_kasprintf(dev, GFP_KERNEL, "SSP%d
>>> Pin", ssp_port);
>>> +    dl->codecs->name = devm_kasprintf(dev, GFP_KERNEL,
>>> "i2c-10EC5663:00");
>>> +    dl->codecs->dai_name = RT5663_DAI_NAME;
>>> +    if (!dl->cpus->dai_name || !dl->codecs->name ||
>>> !dl->codecs->dai_name)
>>> +        return -ENOMEM;
>>> +
>>> +    dl->num_cpus = 1;
>>> +    dl->num_codecs = 1;
>>> +    dl->platforms = platform;
>>> +    dl->num_platforms = 1;
>>> +    dl->id = 0;
>>> +    dl->dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
>>> SND_SOC_DAIFMT_CBS_CFS;
>>
>> can I ask why it's necessary to hard-code the format, shouldn't this be
>> specified in the topology?
>>
>> It's a generic question for AVS machine drivers, the same code is found
>> in other cases.
>>
> 
> It describes back-end and topology describes FEs and FE and BE DSP
> configuration, machine boards describe BE configuration. Not to say that
> I didn't wonder if we can perhaps simplify things some more  and move BE
> declaration to topology and perhaps even implement generic i2s board. It
> is something to revisit.

My point is that the topology already provides the information for the
DSP configuration and this is used for the codec configuration, but
that's two pieces of information that need to match, and two things to
change if for some reason you want to use different options.

  reply	other threads:[~2022-12-22 17:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-21 20:13 [PATCH] ASoC: Intel: avs: Add support for RT5663 codec Alicja Michalska
2022-12-21 20:36 ` Pierre-Louis Bossart
2022-12-22  9:41   ` Amadeusz Sławiński
2022-12-22 15:59     ` Pierre-Louis Bossart [this message]
2022-12-22  9:35 ` Amadeusz Sławiński

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=4a627876-fd7c-25a3-bbae-cbb4539f18bb@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=ahplka19@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=amadeuszx.slawinski@linux.intel.com \
    --cc=broonie@kernel.org \
    --cc=cezary.rojewski@intel.com \
    --cc=cujomalainey@chromium.org \
    --cc=hdegoede@redhat.com \
    --cc=lma@semihalf.com \
    --cc=rad@semihalf.com \
    --cc=tiwai@suse.com \
    --cc=upstream@semihalf.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 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.