On 2022-07-20 3:13 PM, Takashi Iwai wrote:
On Wed, 20 Jul 2022 15:06:20 +0200,
Cezary Rojewski wrote:
Refactor snd_hdac_ext_bus_device_init() so that it makes use of
snd_hda_codec_device_init() to create and initialize new codec device.
Causes the latter to become the sole codec device constructor.
Users of the refactored function are updated accordingly and now also
take responsibility for assigning driver's private data as that task is
no longer performed by hdac_hda_dev_probe().
Hrm, this doesn't look really right. It means you'll introduce a hard
dependency chain in a reverse order: snd-hda-ext-core ->
snd-hda-codec.
Originally, the ext bus code was written completely independent from
the legacy HD-audio implementations, and hdac-hda driver was a kind of
wrapper / bridge for the legacy codec over the ext bus. If we want
change this rule and make the legacy HD-audio codec always tied with
the ext bus, a likely better way would be to call
snd_hda_codec_device_init() in the caller's side (e.g. skl or sof),
then pass the newly created codec object to
snd_hdac_ext_bus_device_init() for further initialization.
Agree. That or drop the snd_hdac_ext_bus_device_init() entirely. Will
send an update soon.
In regard to the other subject, my plan:
- separate code used by both ALSA/ASoC into sound/hda (this includes
many hda_codec functions)
- combine hda_bus and hdac_bus
- combine hda_codec and hdac_device
- drop HDA_DEV_ASOC
- drop hdac_hda/hdac_hdmi (once skylake-driver is gone; sof will be
updated accordingly)
<story does not end here>
Regards,
Czarek