Repository navigation
Fix/legacy sst coexistence #480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
2bf7e58
ff215d0
5510151
50a6888
a74e976
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -172,6 +172,9 @@ module_param_array(beep_mode, bool, NULL, 0444); | |
| MODULE_PARM_DESC(beep_mode, "Select HDA Beep registration mode " | ||
| "(0=off, 1=on) (default=1)."); | ||
| #endif | ||
| static int skl_pci_binding; | ||
| module_param_named(pci_binding, skl_pci_binding, int, 0444); | ||
| MODULE_PARM_DESC(pci_binding, "PCI binding (0=auto, 1=only legacy, 2=only asoc"); | ||
|
|
||
| #ifdef CONFIG_PM | ||
| static int param_set_xint(const char *val, const struct kernel_param *kp); | ||
|
|
@@ -357,6 +360,7 @@ enum { | |
| AZX_DCAPS_NO_64BIT |\ | ||
| AZX_DCAPS_4K_BDLE_BOUNDARY | AZX_DCAPS_SNOOP_OFF) | ||
|
|
||
| #define AZX_DCAPS_INTEL_DSP_DETECTION(conf) (IS_ENABLED(CONFIG_SND_HDA_INTEL_DSP_DETECTION_##conf) ? AZX_DCAPS_INTEL_SHARED : 0) | ||
| /* | ||
| * vga_switcheroo support | ||
| */ | ||
|
|
@@ -2130,6 +2134,28 @@ static int azx_probe(struct pci_dev *pci, | |
| bool schedule_probe; | ||
| int err; | ||
|
|
||
| /* check if this driver can be used on SKL+ Intel platforms */ | ||
| if (pci_id->driver_data & AZX_DCAPS_INTEL_SHARED) { | ||
| switch (skl_pci_binding) { | ||
| case SND_SKL_PCI_BIND_AUTO: | ||
| if (pci->class != 0x040300) { | ||
| dev_info(&pci->dev, "The DSP is enabled on this platform, aborting probe\n"); | ||
| return -ENODEV; | ||
| } | ||
| dev_info(&pci->dev, "No DSP detected, continuing HDaudio legacy probe\n"); | ||
| break; | ||
| case SND_SKL_PCI_BIND_LEGACY: | ||
| dev_info(&pci->dev, "Module parameter forced binding with HDaudio legacy, bypassed detection logic\n"); | ||
| break; | ||
| case SND_SKL_PCI_BIND_ASOC: | ||
| dev_info(&pci->dev, "Module parameter forced binding with SKL+ ASoC driver, aborting probe\n"); | ||
| return -ENODEV; | ||
| default: | ||
| dev_err(&pci->dev, "invalid value for skl_pci_binding module parameter, ignored\n"); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't ignoring an invalid value be equivalent to automatic detection, to also fall back to the pre-patch behaviour? Similar for the ASoC code below.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't get your point. In both cases an invalid module parameter is ignored and the previous behavior is used. |
||
| break; | ||
| } | ||
| } | ||
|
|
||
| if (dev >= SNDRV_CARDS) | ||
| return -ENODEV; | ||
| if (!enable[dev]) { | ||
|
|
@@ -2430,34 +2456,48 @@ static const struct pci_device_id azx_ids[] = { | |
| .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE }, | ||
| /* Sunrise Point-LP */ | ||
| { PCI_DEVICE(0x8086, 0x9d70), | ||
| .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE }, | ||
| .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE | | ||
| AZX_DCAPS_INTEL_DSP_DETECTION(SKL) | ||
| }, | ||
| /* Kabylake */ | ||
| { PCI_DEVICE(0x8086, 0xa171), | ||
| .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE }, | ||
| /* Kabylake-LP */ | ||
| { PCI_DEVICE(0x8086, 0x9d71), | ||
| .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE }, | ||
| .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE | | ||
| AZX_DCAPS_INTEL_DSP_DETECTION(KBL) | ||
| }, | ||
| /* Kabylake-H */ | ||
| { PCI_DEVICE(0x8086, 0xa2f0), | ||
| .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE }, | ||
| /* Coffelake */ | ||
| { PCI_DEVICE(0x8086, 0xa348), | ||
| .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE}, | ||
| .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE | | ||
| AZX_DCAPS_INTEL_DSP_DETECTION(CFL) | ||
| }, | ||
| /* Cannonlake */ | ||
| { PCI_DEVICE(0x8086, 0x9dc8), | ||
| .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE}, | ||
| .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE | | ||
| AZX_DCAPS_INTEL_DSP_DETECTION(CNL) | ||
| }, | ||
| /* Icelake */ | ||
| { PCI_DEVICE(0x8086, 0x34c8), | ||
| .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE}, | ||
| .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE | | ||
| AZX_DCAPS_INTEL_DSP_DETECTION(ICL) | ||
| }, | ||
| /* Broxton-P(Apollolake) */ | ||
| { PCI_DEVICE(0x8086, 0x5a98), | ||
| .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_BROXTON }, | ||
| .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_BROXTON | | ||
| AZX_DCAPS_INTEL_DSP_DETECTION(APL) | ||
| }, | ||
| /* Broxton-T */ | ||
| { PCI_DEVICE(0x8086, 0x1a98), | ||
| .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_BROXTON }, | ||
| /* Gemini-Lake */ | ||
| { PCI_DEVICE(0x8086, 0x3198), | ||
| .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_BROXTON }, | ||
| .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_BROXTON | | ||
| AZX_DCAPS_INTEL_DSP_DETECTION(GLK) | ||
| }, | ||
| /* Haswell */ | ||
| { PCI_DEVICE(0x8086, 0x0a0c), | ||
| .driver_data = AZX_DRIVER_HDMI | AZX_DCAPS_INTEL_HASWELL }, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wouldn't it be better to hide these Kconfig entries by removing their help entries, if they are anyway not for humans to toggle?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are different opinions on this. I used comments in the past but was asked to add a help message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also don't like the fact that commit messages are out of scope in github. Thanks for the typo report.