From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Mark Brown <broonie@kernel.org>, Jack Yu <jack.yu@realtek.com>
Cc: "lgirdwood@gmail.com" <lgirdwood@gmail.com>,
"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
"lars@metafoo.de" <lars@metafoo.de>,
"Flove(HsinFu)" <flove@realtek.com>,
"Oder Chiou" <oder_chiou@realtek.com>,
"Shuming [范書銘]" <shumingf@realtek.com>,
"Derek [方德義]" <derek.fang@realtek.com>,
"Bard Liao" <yung-chuan.liao@linux.intel.com>,
"Charles Keepax" <ckeepax@opensource.cirrus.com>
Subject: Re: [PATCH v2] ASoC: rt721-sdca: Add RT721 SDCA driver
Date: Tue, 24 Sep 2024 17:26:38 +0200 [thread overview]
Message-ID: <12d2ef42-694e-47fc-af85-ab2b27dd8afa@linux.intel.com> (raw)
In-Reply-To: <ZvKsYUXJ42UZ_bhm@finisterre.sirena.org.uk>
>>> That tells us it has 3 functions (jack, mic, amp), so what's different to RT722?
>>> could we have a single driver for both parts? A lot of this driver seems
>>> copy-pasted-renamed.
>
>> RT721 has 3 functions just like RT722, but it's still a different codec and from internal discussion,
>> we think it's better to separate the driver for future code management.
>
> As I mentioned with the events it's possible there's some room for
> factoring out some of the code for the common bits that are shared
> between multiple devices. Look at how Cirrus' Arizona drivers for
> example, each chip has specific support in a separate driver but there's
> a lot of shared code.
>
>>>> + /* Set RC calibration */
>>>> + rt721_sdca_index_write(rt721, RT721_RC_CALIB_CTRL,
>>>> + RT721_RC_CALIB_CTRL0, 0x0b00);
>>>> + rt721_sdca_index_write(rt721, RT721_RC_CALIB_CTRL,
>>>> + RT721_RC_CALIB_CTRL0, 0x0b40);
>>>> + /* Fine tune PDE2A latency */
>>>> + regmap_write(rt721->regmap, 0x2f5c, 0x25); }
>
>>> Humm, isn't all this supposed to be handled with blind writes? It seems odd to
>>> hard-code all this, no?
>
>> It seems there is no api or function to support blind write from ACPI from latest upstream code,
>> and we think it's easier for us to manage the different function's blind write.
The problem is that those blind writes are supposed to be sku-specific,
so it's not great to encode a behavior in a generic codec driver.
It's my understanding that the Windows driver will rely on blind writes,
it'd seem natural to use the same initialization parameters, no?
> It's always possible for you to add shared code for things like parsing
> ACPI tables (any references to the spec for blind writes here?).
Yes, the code is already available in a prototype, see the initial code
here:
https://github.com/thesofproject/linux/pull/5010/commits/3e4ff84242dbb7774bbed785371d27c3afc10a96
The goal was to add a sound/soc/sdca library to parse ACPI function
information, extract initialization tables, deal with interrupts, create
controls, etc.
That said, it's probably best if Bard and/or Charles take over since I
won't be able to work on this short-term.
One of the big opens is how we deal with regmap. In theory each SDCA
function is independent from others, but in practice they all share a
common control channel and interrupt mechanism.
I initially thought we could have one regmap for each function, but
Charles had a different idea that we should handle regmap at the device
level. Both options have merits and issues, we didn't really reach a
conclusion on this.
One of the other opens is also related to regmap, we now have two types
of regmap for SoundWire (sdw- and sdw-mbq), but there are parts of ASoC
where components are assumed to have a single regmap.
next prev parent reply other threads:[~2024-09-24 15:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-24 9:03 [PATCH v2] ASoC: rt721-sdca: Add RT721 SDCA driver Jack Yu
2024-09-24 9:36 ` Pierre-Louis Bossart
2024-09-24 11:54 ` Jack Yu
2024-09-24 12:11 ` Mark Brown
2024-09-24 15:26 ` Pierre-Louis Bossart [this message]
2024-09-25 4:03 ` Jack Yu
2024-09-25 4:07 ` Jack Yu
2024-09-24 14:03 ` Liao, Bard
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=12d2ef42-694e-47fc-af85-ab2b27dd8afa@linux.intel.com \
--to=pierre-louis.bossart@linux.intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=ckeepax@opensource.cirrus.com \
--cc=derek.fang@realtek.com \
--cc=flove@realtek.com \
--cc=jack.yu@realtek.com \
--cc=lars@metafoo.de \
--cc=lgirdwood@gmail.com \
--cc=oder_chiou@realtek.com \
--cc=shumingf@realtek.com \
--cc=yung-chuan.liao@linux.intel.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.