Skip to content

ASoC: SOF: Intel: add codec_mask module parameter - #1551

Merged
plbossart merged 1 commit into
thesofproject:topic/sof-devfrom
kv2019i:topic/hda-force-codec-mask
Nov 26, 2019
Merged

plbossart merged 1 commit into
thesofproject:topic/sof-devfrom
kv2019i:topic/hda-force-codec-mask

Conversation

@kv2019i

@kv2019i kv2019i commented Nov 26, 2019

Copy link
Copy Markdown
Collaborator

Add a module parameter 'codec_mask' to filter out unwanted
HDA codecs from driver probe. E.g. on most systems,
codec_mask=4 will limit to HDMI audio and exclude any
external HDA codecs.

Similar to 'probe_mask' module parameter of snd-hda-intel.

Signed-off-by: Kai Vehmanen kai.vehmanen@linux.intel.com

Add a module parameter 'codec_mask' to filter out unwanted
HDA codecs from driver probe. E.g. on most systems,
codec_mask=4 will limit to HDMI audio and exclude any
external HDA codecs.

Similar to 'probe_mask' module parameter of snd-hda-intel.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>

@plbossart plbossart left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
wondering if we can extend this so that with Kconfig selections you can remove iDISP or regular HDaudio directly.

@kv2019i

kv2019i commented Nov 26, 2019

Copy link
Copy Markdown
Collaborator Author

@plbossart wrote:

wondering if we can extend this so that with Kconfig selections you can remove iDISP or regular
HDaudio directly.

I thought about that, but the addresses can (at least in theory) vary from system to another, so hardcoding them to kconfig does not seem good. And passing raw mask values via kconfig seems like a very low-level developer option -- we could still add it though, but will need to hide it in the developer options menu at least.

Another limitation we currently have is that if I block the HDMI codec (e.g. set codec_mask=1), our SOF probe will now fail as the generic machine driver code only understands the special case where num_codecs==1 and that one codecs is HDMI. Can be of course fixed, but is a limitation to be aware of at least.

But switching between HDMI-only and all-HDA is pretty convenient now. Just edit modprobe rules, reload driver and you are done. No kernel recompile or reboot needed. I'm using following now:

#options snd_sof_intel_hda_common codec_mask=0x4

If I uncomment this, one gets a HDMI-only config. Commented out, you get the full HDA setup again. This is pretty nice.

@plbossart
plbossart merged commit 0bdbe73 into thesofproject:topic/sof-dev Nov 26, 2019
@wenqingfu wenqingfu mentioned this pull request Nov 27, 2019
7 of 15 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants