ASoC: SOF: Intel: Initialize hdaudio bus properly
authorTakashi Iwai <tiwai@suse.de>
Wed, 7 Aug 2019 18:50:50 +0000 (20:50 +0200)
committerTakashi Iwai <tiwai@suse.de>
Thu, 8 Aug 2019 14:38:12 +0000 (16:38 +0200)
commitd4ff1b3917a529bdc75592af6b1504ad6c4029f7
treeac68a812ac46218fe20c90cb0a16edfacd65c06e
parent19abfefd4c7604993d1c31e098a3f48bdafe334d
ASoC: SOF: Intel: Initialize hdaudio bus properly

The SOF HD-audio bus has its house-made initialization code.  It's
supposedly for making the code independent from HD-audio bus drivers.
However, this is error-prone, and above all, the SOF driver has
already dependency on HD-audio bus driver when CONFIG_SND_SOF_HDA is
set.  That is, if this Kconfig is set, there is no reason to avoid the
call to the proper bus init function.

Also, the ext_ops that is set at bus initialization can be better
handled inside sof_hda_bus_init().  We don't need to refer this
outside the bus initialization.

So this patch addresses these issues:
- sof_hda_bus_init() calls nothing but snd_hdac_ext_bus_init()
  when CONFIG_SND_SOF_HDA is set.  Otherwise some fields are
  initialized locally like before for avoiding the dependency.
- ext_ops is referred inside sof_hda_bus_init().  The ext_ops argument
  of snd_hda_bus_init() is dropped.

Acked-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/soc/sof/intel/hda-bus.c
sound/soc/sof/intel/hda.c
sound/soc/sof/intel/hda.h