Skip to content

Commit

Permalink
add: tree's use-avs-driver.patch
Browse files Browse the repository at this point in the history
  • Loading branch information
june-fish committed Apr 27, 2024
1 parent 3271649 commit 6386377
Showing 1 changed file with 94 additions and 0 deletions.
94 changes: 94 additions & 0 deletions chromebook/use-avs-driver.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
diff --git a/sound/hda/intel-dsp-config.c b/sound/hda/intel-dsp-config.c
index 6a384b922e4f..515361a74087 100644
--- a/sound/hda/intel-dsp-config.c
+++ b/sound/hda/intel-dsp-config.c
@@ -16,10 +16,11 @@
static int dsp_driver;

module_param(dsp_driver, int, 0444);
-MODULE_PARM_DESC(dsp_driver, "Force the DSP driver for Intel DSP (0=auto, 1=legacy, 2=SST, 3=SOF)");
+MODULE_PARM_DESC(dsp_driver, "Force the DSP driver for Intel DSP (0=auto, 1=legacy, 2=SST, 3=SOF, 4=AVS)");

#define FLAG_SST BIT(0)
#define FLAG_SOF BIT(1)
+#define FLAG_AVS BIT(2)
#define FLAG_SST_ONLY_IF_DMIC BIT(15)
#define FLAG_SOF_ONLY_IF_DMIC BIT(16)
#define FLAG_SOF_ONLY_IF_SOUNDWIRE BIT(17)
@@ -56,7 +57,7 @@ static const struct config_entry config_table[] = {
/*
* Apollolake (Broxton-P)
* the legacy HDAudio driver is used except on Up Squared (SOF) and
- * Chromebooks (SST), as well as devices based on the ES8336 codec
+ * Chromebooks (AVS), as well as devices based on the ES8336 codec
*/
#if IS_ENABLED(CONFIG_SND_SOC_SOF_APOLLOLAKE)
{
@@ -79,9 +80,9 @@ static const struct config_entry config_table[] = {
.codec_hid = &essx_83x6,
},
#endif
-#if IS_ENABLED(CONFIG_SND_SOC_INTEL_APL)
+#if IS_ENABLED(CONFIG_SND_SOC_INTEL_AVS)
{
- .flags = FLAG_SST,
+ .flags = FLAG_AVS,
.device = PCI_DEVICE_ID_INTEL_HDA_APL,
.dmi_table = (const struct dmi_system_id []) {
{
@@ -96,13 +97,13 @@ static const struct config_entry config_table[] = {
#endif
/*
* Skylake and Kabylake use legacy HDAudio driver except for Google
- * Chromebooks (SST)
+ * Chromebooks (AVS)
*/

/* Sunrise Point-LP */
-#if IS_ENABLED(CONFIG_SND_SOC_INTEL_SKL)
+#if IS_ENABLED(CONFIG_SND_SOC_INTEL_AVS)
{
- .flags = FLAG_SST,
+ .flags = FLAG_AVS,
.device = PCI_DEVICE_ID_INTEL_HDA_SKL_LP,
.dmi_table = (const struct dmi_system_id []) {
{
@@ -114,15 +115,17 @@ static const struct config_entry config_table[] = {
{}
}
},
+#endif
+#if IS_ENABLED(CONFIG_SND_SOC_INTEL_SKL)
{
.flags = FLAG_SST | FLAG_SST_ONLY_IF_DMIC,
.device = PCI_DEVICE_ID_INTEL_HDA_SKL_LP,
},
#endif
/* Kabylake-LP */
-#if IS_ENABLED(CONFIG_SND_SOC_INTEL_KBL)
+#if IS_ENABLED(CONFIG_SND_SOC_INTEL_AVS)
{
- .flags = FLAG_SST,
+ .flags = FLAG_AVS,
.device = PCI_DEVICE_ID_INTEL_HDA_KBL_LP,
.dmi_table = (const struct dmi_system_id []) {
{
@@ -134,6 +137,8 @@ static const struct config_entry config_table[] = {
{}
}
},
+#endif
+#if IS_ENABLED(CONFIG_SND_SOC_INTEL_KBL)
{
.flags = FLAG_SST | FLAG_SST_ONLY_IF_DMIC,
.device = PCI_DEVICE_ID_INTEL_HDA_KBL_LP,
@@ -677,6 +682,9 @@ int snd_intel_dsp_driver_probe(struct pci_dev *pci)
}
}

+ if (cfg->flags & FLAG_AVS)
+ return SND_INTEL_DSP_DRIVER_AVS;
+
return SND_INTEL_DSP_DRIVER_LEGACY;
}
EXPORT_SYMBOL_GPL(snd_intel_dsp_driver_probe);

0 comments on commit 6386377

Please sign in to comment.