6 Sep
2019
6 Sep
'19
5:33 p.m.
Hey,
On Fri, 6 Sep 2019, Pierre-Louis Bossart wrote:
- if (!strncmp(card->name, "sof-skl_hda_card", 16)) {
for_each_card_components(card, component) {
modname = module_name(component->dev->driver->owner);
if (!strncmp(component->name, "ehdaudio0D2", 11) &&
!strncmp(modname, "snd_hda_codec_hdmi", 18))
use_common_codec = 1;
}
- }
yuk. I am not a big fan of this...
It seems that we could pass information from the SOF side to the machine driver using the mach_params argument. we already pass the codec_mask and other fields, it wouldn't be too hard to reclaim a field or extend the structure to pass the information.
it is ugly, no question about it. :) My reasoning for this was to contain the ugliness within the machine drivers (especially these that are used with both SOF and SST). New machine drivers with no legacy to maintain could just skip it.
If the general concept of compiling both codec drivers in, and selecting at runtime, is acceptable, I'll check how this would look via mach_params.
Br, Kai