ASoC: Intel: cleanups
Subsystems (3)
cover ASoC: Intel: cleanups
This patchset contain 4 different cleanups:
a) change of pdata definition to avoid using SST-specific structures and allow for machine driver reuse w/ SOF. No new features, just different data structures.
b) removal of remaining GFP_ATOMIC usages
c) Cleanup of machine driver tables for APL (missing SOF information and quirk for APL RVP/LeafHill CRB boards). These boards are used outside of Intel so it's worth sharing the fixes for the general public.
d) typo
Bard liao (1):
ASoC: Intel: common: add SOF information for APL RVP
Pierre-Louis Bossart (6):
ASoC: acpi: define common interface for machine driver configuration
ASoC: Intel: use standard interface for Hdaudio machine driver
ASoC: Intel: use standard interface for Atom machine drivers
ASoC: Intel: boards: fix Skylake typo
ASoC: Intel: remove GFP_ATOMIC, use GFP_KERNEL
ASoC: Intel: common: add quirk for APL RVP boards
include/sound/soc-acpi.h | 14 +++++++ sound/soc/intel/atom/sst/sst_acpi.c | 4 ++ sound/soc/intel/atom/sst/sst_pvt.c | 4 +- sound/soc/intel/boards/bytcr_rt5640.c | 6 +-- sound/soc/intel/boards/bytcr_rt5651.c | 6 +-- sound/soc/intel/boards/cht_bsw_rt5645.c | 6 +-- sound/soc/intel/boards/cht_bsw_rt5672.c | 2 +- sound/soc/intel/boards/glk_rt5682_max98357a.c | 2 +- sound/soc/intel/boards/kbl_da7219_max98927.c | 8 ++-- sound/soc/intel/boards/kbl_rt5663_max98927.c | 4 +- sound/soc/intel/boards/skl_hda_dsp_generic.c | 22 +++++------ .../soc/intel/boards/skl_nau88l25_max98357a.c | 4 +- sound/soc/intel/boards/skl_nau88l25_ssm4567.c | 4 +- .../intel/common/soc-acpi-intel-bxt-match.c | 38 +++++++++++++++++++ sound/soc/intel/skylake/skl.c | 10 ++--- 15 files changed, 87 insertions(+), 47 deletions(-)
Signature · 1 line
2.17.1
PATCH 1/7 ASoC: acpi: define common interface for machine driver configuration
The machine drivers may need information provided by the platform driver. Currently the information is passed using pdata specific to each plaform driver. This prevents other drivers, such as SOF, from reusing machine drivers directly.
Add a new structure which contains the required fields.
This proposal requires a bit more work on the platform side but this generic interface helps reuse code directly.
--- include/sound/soc-acpi.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
include/sound/soc-acpi.h +14 -0
@@ -37,6 +37,19 @@ snd_soc_acpi_find_package_from_hid(const u8 hid[ACPI_ID_LEN],struct snd_soc_acpi_mach *snd_soc_acpi_find_machine (struct snd_soc_acpi_mach *machines); +/** +* snd_soc_acpi_mach_params: interface for machine driver configuration +* +* @acpi_ipc_irq_index: used for BYT-CR detection +* @platform: string used for HDaudio codec support +* @codec_mask: used for HDAudio support +*/ +struct snd_soc_acpi_mach_params { +u32 acpi_ipc_irq_index; +const char *platform; +u32 codec_mask; +}; +/** * snd_soc_acpi_mach: ACPI-based machine descriptor. Most of the fields are * related to the hardware, except for the firmware and topology file names.
@@ -68,6 +81,7 @@ struct snd_soc_acpi_mach {struct snd_soc_acpi_mach * (*machine_quirk)(void *arg);const void *quirk_data;void *pdata; +struct snd_soc_acpi_mach_params mach_params;const char *sof_fw_filename;const char *sof_tplg_filename;const char *asoc_plat_name;
Signature · 1 line
2.17.1
PATCH 2/7 ASoC: Intel: use standard interface for Hdaudio machine driver
In reply to Pierre-Louis BossartDon't rely on internal Skylake-specific data structures, use generic interface to let other drivers use the same machine driver as is, e.g. SOF to support HDaudio codecs and HDMI outputs.
Tested on LeafHill CRB board, no regression seen with this change.
--- sound/soc/intel/boards/skl_hda_dsp_generic.c | 20 ++++++++++---------- sound/soc/intel/skylake/skl.c | 10 +++------- 2 files changed, 13 insertions(+), 17 deletions(-)
sound/soc/intel/boards/skl_hda_dsp_generic.c +10 -10
@@ -12,8 +12,8 @@#include <sound/pcm.h> #include <sound/pcm_params.h> #include <sound/soc.h> +#include <sound/soc-acpi.h> #include "../../codecs/hdac_hdmi.h" -#include "../skylake/skl.h" #include "skl_hda_dsp_common.h" static const struct snd_soc_dapm_widget skl_hda_widgets[] = {
@@ -101,17 +101,17 @@ static struct snd_soc_card hda_soc_card = {#define IDISP_ROUTE_COUNT (IDISP_DAI_COUNT * 2)#define IDISP_CODEC_MASK 0x4 -static int skl_hda_fill_card_info (struct skl_machine_pdata *pdata) +static int skl_hda_fill_card_info (struct snd_soc_acpi_mach_params *mach_params) {struct snd_soc_card *card = &hda_soc_card;struct snd_soc_dai_link *dai_link;u32 codec_count, codec_mask;int i, num_links, num_route; - codec_mask = pdata->codec_mask; + codec_mask = mach_params->codec_mask; codec_count =hweight_long (codec_mask); -if (codec_count ==1 && pdata->codec_mask &IDISP_CODEC_MASK ) { +if (codec_count ==1 && codec_mask &IDISP_CODEC_MASK ) { num_links =IDISP_DAI_COUNT ; num_route =IDISP_ROUTE_COUNT ; }else if (codec_count ==2 && codec_mask &IDISP_CODEC_MASK ) {
@@ -127,14 +127,14 @@ static int skl_hda_fill_card_info(struct skl_machine_pdata *pdata) card->num_dapm_routes = num_route;for_each_card_prelinks (card, i, dai_link) - dai_link->platform_name = pdata->platform; + dai_link->platform_name = mach_params->platform;return 0 ; }static int skl_hda_audio_probe (struct platform_device *pdev) { -struct skl_machine_pdata *pdata; +struct snd_soc_acpi_mach *mach;struct skl_hda_private *ctx;int ret;
@@ -146,11 +146,11 @@ static int skl_hda_audio_probe(struct platform_device *pdev)INIT_LIST_HEAD (&ctx->hdmi_pcm_list); - pdata =dev_get_drvdata (&pdev->dev); -if (!pdata) + mach =dev_get_drvdata (&pdev->dev); +if (!mach)return -EINVAL ; - ret =skl_hda_fill_card_info (pdata); + ret =skl_hda_fill_card_info (&mach->mach_params);if (ret <0 ) {dev_err (&pdev->dev,"Unsupported HDAudio/iDisp configuration found\n" );return ret;
@@ -158,7 +158,7 @@ static int skl_hda_audio_probe(struct platform_device *pdev) ctx->pcm_count = hda_soc_card.num_links; ctx->dai_index =1 ;/* hdmi codec dai name starts from index 1 */ - ctx->platform_name = pdata->platform; + ctx->platform_name = mach->mach_params.platform; hda_soc_card.dev = &pdev->dev;snd_soc_card_set_drvdata (&hda_soc_card, ctx);
sound/soc/intel/skylake/skl.c +3 -7
@@ -525,7 +525,6 @@ static int skl_machine_device_register(struct skl *skl) {struct snd_soc_acpi_mach *mach = skl->mach;struct hdac_bus *bus =skl_to_bus (skl); -struct skl_machine_pdata *pdata;struct platform_device *pdev;int ret;
@@ -542,12 +541,9 @@ static int skl_machine_device_register(struct skl *skl)return -EIO ; } -if (mach->pdata) { - pdata = (struct skl_machine_pdata *)mach->pdata; - pdata->platform =dev_name (bus->dev); - pdata->codec_mask = bus->codec_mask; -dev_set_drvdata (&pdev->dev, mach->pdata); - } + mach->mach_params.platform =dev_name (bus->dev); + mach->mach_params.codec_mask = bus->codec_mask; +dev_set_drvdata (&pdev->dev, mach); skl->i2s_dev = pdev;
Signature · 1 line
2.17.1
PATCH 3/7 ASoC: Intel: use standard interface for Atom machine drivers
In reply to Pierre-Louis BossartDon't rely on internal Atom/SST-specific data structures, use generic interface to let other drivers use the same machine drivers as is, e.g. SOF to support BYT-CR devices
--- sound/soc/intel/atom/sst/sst_acpi.c | 4 ++++ sound/soc/intel/boards/bytcr_rt5640.c | 6 +----- sound/soc/intel/boards/bytcr_rt5651.c | 6 +----- sound/soc/intel/boards/cht_bsw_rt5645.c | 6 +----- 4 files changed, 7 insertions(+), 15 deletions(-)
sound/soc/intel/atom/sst/sst_acpi.c +4 -0
@@ -341,6 +341,10 @@ static int sst_acpi_probe(struct platform_device *pdev) byt_rvp_platform_data.res_info = &bytcr_res_info; } +/* update machine parameters */ + mach->mach_params.acpi_ipc_irq_index = + pdata->res_info->acpi_ipc_irq_index; + plat_dev =platform_device_register_data (dev, pdata->platform,-1 ,NULL ,0 );if (IS_ERR (plat_dev)) {
sound/soc/intel/boards/bytcr_rt5640.c +1 -5
@@ -29,7 +29,6 @@#include <linux/input.h> #include <linux/slab.h> #include <asm/cpu_device_id.h> -#include <asm/platform_sst_audio.h> #include <sound/pcm.h> #include <sound/pcm_params.h> #include <sound/soc.h>
@@ -1152,10 +1151,7 @@ static int snd_byt_rt5640_mc_probe(struct platform_device *pdev)* (will be overridden if DMI quirk is detected) */ if (is_valleyview ()) { -struct sst_platform_info *p_info = mach->pdata; -const struct sst_res_info *res_info = p_info->res_info; - -if (res_info->acpi_ipc_irq_index ==0 ) +if (mach->mach_params.acpi_ipc_irq_index ==0 ) is_bytcr = true; }
sound/soc/intel/boards/bytcr_rt5651.c +1 -5
@@ -32,7 +32,6 @@#include <linux/slab.h> #include <asm/cpu_device_id.h> #include <asm/intel-family.h> -#include <asm/platform_sst_audio.h> #include <sound/pcm.h> #include <sound/pcm_params.h> #include <sound/soc.h>
@@ -920,10 +919,7 @@ static int snd_byt_rt5651_mc_probe(struct platform_device *pdev)* (will be overridden if DMI quirk is detected) */ if (x86_match_cpu (baytrail_cpu_ids)) { -struct sst_platform_info *p_info = mach->pdata; -const struct sst_res_info *res_info = p_info->res_info; - -if (res_info->acpi_ipc_irq_index ==0 ) +if (mach->mach_params.acpi_ipc_irq_index ==0 ) is_bytcr = true; }
sound/soc/intel/boards/cht_bsw_rt5645.c +1 -5
@@ -27,7 +27,6 @@#include <linux/dmi.h> #include <linux/slab.h> #include <asm/cpu_device_id.h> -#include <asm/platform_sst_audio.h> #include <sound/pcm.h> #include <sound/pcm_params.h> #include <sound/soc.h>
@@ -585,10 +584,7 @@ static int snd_cht_mc_probe(struct platform_device *pdev)* (will be overridden if DMI quirk is detected) */ if (is_valleyview ()) { -struct sst_platform_info *p_info = mach->pdata; -const struct sst_res_info *res_info = p_info->res_info; - -if (res_info->acpi_ipc_irq_index ==0 ) +if (mach->mach_params.acpi_ipc_irq_index ==0 ) is_bytcr = true; }
Signature · 1 line
2.17.1
PATCH 4/7 ASoC: Intel: boards: fix Skylake typo
In reply to Pierre-Louis Bossarts/skylaye/skylake
--- sound/soc/intel/boards/kbl_da7219_max98927.c | 6 +++--- sound/soc/intel/boards/kbl_rt5663_max98927.c | 4 ++-- sound/soc/intel/boards/skl_nau88l25_max98357a.c | 4 ++-- sound/soc/intel/boards/skl_nau88l25_ssm4567.c | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-)
sound/soc/intel/boards/kbl_da7219_max98927.c +3 -3
@@ -441,7 +441,7 @@ static int kabylake_refcap_startup(struct snd_pcm_substream *substream) } -static struct snd_soc_ops skylaye_refcap_ops = { +static struct snd_soc_ops skylake_refcap_ops = { .startup = kabylake_refcap_startup, };
@@ -525,7 +525,7 @@ static struct snd_soc_dai_link kabylake_dais[] = { .dpcm_capture = 1, .nonatomic = 1, .dynamic = 1, - .ops = &skylaye_refcap_ops, + .ops = &skylake_refcap_ops, }, [KBL_DPCM_AUDIO_DMIC_CP] = { .name = "Kbl Audio DMIC cap",
@@ -736,7 +736,7 @@ static struct snd_soc_dai_link kabylake_max98927_dais[] = { .dpcm_capture = 1, .nonatomic = 1, .dynamic = 1, - .ops = &skylaye_refcap_ops, + .ops = &skylake_refcap_ops, }, [KBL_DPCM_AUDIO_DMIC_CP] = { .name = "Kbl Audio DMIC cap",
sound/soc/intel/boards/kbl_rt5663_max98927.c +2 -2
@@ -586,7 +586,7 @@ static int kabylake_refcap_startup(struct snd_pcm_substream *substream) &constraints_16000); } -static struct snd_soc_ops skylaye_refcap_ops = { +static struct snd_soc_ops skylake_refcap_ops = { .startup = kabylake_refcap_startup, };
@@ -655,7 +655,7 @@ static struct snd_soc_dai_link kabylake_dais[] = { .dpcm_capture = 1, .nonatomic = 1, .dynamic = 1, - .ops = &skylaye_refcap_ops, + .ops = &skylake_refcap_ops, }, [KBL_DPCM_AUDIO_DMIC_CP] = { .name = "Kbl Audio DMIC cap",
sound/soc/intel/boards/skl_nau88l25_max98357a.c +2 -2
@@ -400,7 +400,7 @@ static int skylake_refcap_startup(struct snd_pcm_substream *substream) &constraints_16000); } -static const struct snd_soc_ops skylaye_refcap_ops = { +static const struct snd_soc_ops skylake_refcap_ops = { .startup = skylake_refcap_startup, };
@@ -447,7 +447,7 @@ static struct snd_soc_dai_link skylake_dais[] = { .dpcm_capture = 1, .nonatomic = 1, .dynamic = 1, - .ops = &skylaye_refcap_ops, + .ops = &skylake_refcap_ops, }, [SKL_DPCM_AUDIO_DMIC_CP] = { .name = "Skl Audio DMIC cap",
sound/soc/intel/boards/skl_nau88l25_ssm4567.c +2 -2
@@ -449,7 +449,7 @@ static int skylake_refcap_startup(struct snd_pcm_substream *substream) &constraints_16000); } -static const struct snd_soc_ops skylaye_refcap_ops = { +static const struct snd_soc_ops skylake_refcap_ops = { .startup = skylake_refcap_startup, };
@@ -496,7 +496,7 @@ static struct snd_soc_dai_link skylake_dais[] = { .dpcm_capture = 1, .nonatomic = 1, .dynamic = 1, - .ops = &skylaye_refcap_ops, + .ops = &skylake_refcap_ops, }, [SKL_DPCM_AUDIO_DMIC_CP] = { .name = "Skl Audio DMIC cap",
Signature · 1 line
2.17.1
PATCH 5/7 ASoC: Intel: remove GFP_ATOMIC, use GFP_KERNEL
In reply to Pierre-Louis BossartGFP_ATOMIC is not required on any Intel drivers, use GFP_KERNEL instead. A first cleanup was merged in April but missed a number occurrences and new ones were added by copy/paste inertia.
While we are at it, make checkpatch happy with a sizeof(*msg)
--- sound/soc/intel/atom/sst/sst_pvt.c | 4 ++-- sound/soc/intel/boards/cht_bsw_rt5672.c | 2 +- sound/soc/intel/boards/glk_rt5682_max98357a.c | 2 +- sound/soc/intel/boards/kbl_da7219_max98927.c | 2 +- sound/soc/intel/boards/skl_hda_dsp_generic.c | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-)
sound/soc/intel/atom/sst/sst_pvt.c +2 -2
@@ -166,11 +166,11 @@ int sst_create_ipc_msg(struct ipc_post **arg, bool large) {struct ipc_post *msg; - msg =kzalloc (sizeof (struct ipc_post ),GFP_ATOMIC ); + msg =kzalloc (sizeof (*msg),GFP_KERNEL );if (!msg)return -ENOMEM ;if (large) { - msg->mailbox_data =kzalloc (SST_MAILBOX_SIZE ,GFP_ATOMIC ); + msg->mailbox_data =kzalloc (SST_MAILBOX_SIZE ,GFP_KERNEL );if (!msg->mailbox_data) {kfree (msg);return -ENOMEM ;
sound/soc/intel/boards/cht_bsw_rt5672.c +1 -1
@@ -403,7 +403,7 @@ static int snd_cht_mc_probe(struct platform_device *pdev)const char *i2c_name;int i; - drv =devm_kzalloc (&pdev->dev,sizeof (*drv),GFP_ATOMIC ); + drv =devm_kzalloc (&pdev->dev,sizeof (*drv),GFP_KERNEL );if (!drv)return -ENOMEM ;
sound/soc/intel/boards/glk_rt5682_max98357a.c +1 -1
@@ -603,7 +603,7 @@ static int geminilake_audio_probe(struct platform_device *pdev) {struct glk_card_private *ctx; - ctx =devm_kzalloc (&pdev->dev,sizeof (*ctx),GFP_ATOMIC ); + ctx =devm_kzalloc (&pdev->dev,sizeof (*ctx),GFP_KERNEL );if (!ctx)return -ENOMEM ;
sound/soc/intel/boards/kbl_da7219_max98927.c +1 -1
@@ -935,7 +935,7 @@ static int kabylake_audio_probe(struct platform_device *pdev) {struct kbl_codec_private *ctx; - ctx =devm_kzalloc (&pdev->dev,sizeof (*ctx),GFP_ATOMIC ); + ctx =devm_kzalloc (&pdev->dev,sizeof (*ctx),GFP_KERNEL );if (!ctx)return -ENOMEM ;
sound/soc/intel/boards/skl_hda_dsp_generic.c +1 -1
@@ -140,7 +140,7 @@ static int skl_hda_audio_probe(struct platform_device *pdev)dev_dbg (&pdev->dev,"%s: entry\n" , __func__); - ctx =devm_kzalloc (&pdev->dev,sizeof (*ctx),GFP_ATOMIC ); + ctx =devm_kzalloc (&pdev->dev,sizeof (*ctx),GFP_KERNEL );if (!ctx)return -ENOMEM ;
Signature · 1 line
2.17.1
PATCH 6/7 ASoC: Intel: common: add SOF information for APL RVP
In reply to Pierre-Louis BossartFrom: Bard liao <[email protected]>
Add firmware/topology information for APL RVP
--- sound/soc/intel/common/soc-acpi-intel-bxt-match.c | 3 +++ 1 file changed, 3 insertions(+)
sound/soc/intel/common/soc-acpi-intel-bxt-match.c +3 -0
@@ -19,6 +19,9 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_bxt_machines[] = { .id = "INT343A", .drv_name = "bxt_alc298s_i2s", .fw_filename = "intel/dsp_fw_bxtn.bin", + .sof_fw_filename = "intel/sof-apl.ri", + .sof_tplg_filename = "intel/sof-apl-rt298.tplg", + .asoc_plat_name = "0000:00:0e.0", }, { .id = "DLGS7219",
Signature · 1 line
2.17.1
PATCH 7/7 ASoC: Intel: common: add quirk for APL RVP boards
In reply to Pierre-Louis BossartFor some reason the RVP/LeafHill SSDT exposes an INT34C3 ID which is used on other boards to point to the TDF8532 amplifier. Yay BIOS.
Add a DMI-quirk to ignore this ID and check for other valid machine driver descriptors.
--- .../intel/common/soc-acpi-intel-bxt-match.c | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+)
sound/soc/intel/common/soc-acpi-intel-bxt-match.c +35 -0
@@ -6,9 +6,43 @@* */ +#include <linux/dmi.h> #include <sound/soc-acpi.h> #include <sound/soc-acpi-intel-match.h> +static unsigned long apl_machine_id; + +#define APL_RVP 1 + +static int apl_rvp_quirk_cb (const struct dmi_system_id *id) +{ + apl_machine_id =APL_RVP ; +return 1 ; +} + +static const struct dmi_system_id apl_table[] = { + { + .callback = apl_rvp_quirk_cb, + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Intel Corp." ), +DMI_MATCH (DMI_BOARD_NAME ,"Apollolake RVP1A" ), + }, + }, + {}, +}; + +static struct snd_soc_acpi_mach *apl_quirk (void *arg) +{ +struct snd_soc_acpi_mach *mach = arg; + +dmi_check_system (apl_table); + +if (apl_machine_id ==APL_RVP ) +return NULL ; +else +return mach; +} +static struct snd_soc_acpi_codecs bxt_codecs = { .num_codecs =1 , .codecs = {"MX98357A" }
@@ -50,6 +84,7 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_bxt_machines[] = { { .id = "INT34C3", .drv_name = "bxt_tdf8532", + .machine_quirk = apl_quirk, .sof_fw_filename = "intel/sof-apl.ri", .sof_tplg_filename = "intel/sof-apl-tdf8532.tplg", .asoc_plat_name = "0000:00:0e.0",
Signature · 1 line
2.17.1
Re: [PATCH 7/7] ASoC: Intel: common: add quirk for APL RVP boards
Quoted 61 lines · Pierre-Louis Bossart
For some reason the RVP/LeafHill SSDT exposes an INT34C3 ID which is used on other boards to point to the TDF8532 amplifier. Yay BIOS.
Add a DMI-quirk to ignore this ID and check for other valid machine driver descriptors.
Signed-off-by Pierre-Louis Bossart <[email protected]>--- .../intel/common/soc-acpi-intel-bxt-match.c | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+)sound/soc/intel/common/soc-acpi-intel-bxt-match.c +34
-0@@ -6,9 +6,43 @@* */ +#include <linux/dmi.h> #include <sound/soc-acpi.h> #include <sound/soc-acpi-intel-match.h> +static unsigned long apl_machine_id; + +#define APL_RVP 1 + +static int apl_rvp_quirk_cb (const struct dmi_system_id *id) +{ + apl_machine_id =APL_RVP ; +return 1 ; +} + +static const struct dmi_system_id apl_table[] = { + { + .callback = apl_rvp_quirk_cb, + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Intel Corp." ), +DMI_MATCH (DMI_BOARD_NAME ,"Apollolake RVP1A" ), + }, + }, + {}, +}; + +static struct snd_soc_acpi_mach *apl_quirk (void *arg) +{ +struct snd_soc_acpi_mach *mach = arg; + +dmi_check_system (apl_table); + +if (apl_machine_id ==APL_RVP ) +return NULL ; +else +return mach; +} +static struct snd_soc_acpi_codecs bxt_codecs = { .num_codecs =1 , .codecs = {"MX98357A" }
sound/soc/intel/common/soc-acpi-intel-bxt-match.c struct snd_soc_acpi_mach snd_soc_acpi_intel_bxt_machines[] = { · line 90
Quoted 7 lines
sound/soc/intel/common/soc-acpi-intel-bxt-match.c +1
-0@@ -50,6 +84,7 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_bxt_machines[] = { { .id = "INT34C3", .drv_name = "bxt_tdf8532", + .machine_quirk = apl_quirk, .sof_fw_filename = "intel/sof-apl.ri", .sof_tplg_filename = "intel/sof-apl-tdf8532.tplg", .asoc_plat_name = "0000:00:0e.0",
I believe this can work, but when I went through snd_soc_acpi_find_machine(), I find a possible bug there, it won't continue matching search when the machine_quirk() return NULL.
Let me send a fix for that.
Thanks,
~Keyon
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Re: [PATCH 7/7] ASoC: Intel: common: add quirk for APL RVP boards
In reply to Pierre-Louis BossartQuoted 16 lines · Pierre-Louis Bossart
For some reason the RVP/LeafHill SSDT exposes an INT34C3 ID which is used on other boards to point to the TDF8532 amplifier. Yay BIOS.
Add a DMI-quirk to ignore this ID and check for other valid machine driver descriptors.
sound/soc/intel/common/soc-acpi-intel-bxt-match.c +10
-0+static unsigned long apl_machine_id; + +#define APL_RVP 1 + +static int apl_rvp_quirk_cb (const struct dmi_system_id *id) +{ + apl_machine_id =APL_RVP ; +return 1 ; +} +
sound/soc/intel/common/soc-acpi-intel-bxt-match.c line 31
Quoted 10 lines
sound/soc/intel/common/soc-acpi-intel-bxt-match.c +9
-0+static const struct dmi_system_id apl_table[] = { + { + .callback = apl_rvp_quirk_cb, + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Intel Corp." ), +DMI_MATCH (DMI_BOARD_NAME ,"Apollolake RVP1A" ), + }, + }, + {},
Terminator entry doesn't need a comma. It would prevent from (unlikely) mistakes when extending the list.
sound/soc/intel/common/soc-acpi-intel-bxt-match.c line 38
Quoted 8 lines
sound/soc/intel/common/soc-acpi-intel-bxt-match.c +7
-0+}; + +static struct snd_soc_acpi_mach *apl_quirk (void *arg) +{ +struct snd_soc_acpi_mach *mach = arg; + +dmi_check_system (apl_table);
Can't we just use driver_data of the table above and get rid of at least global variable?
Quoted 6 lines
sound/soc/intel/common/soc-acpi-intel-bxt-match.c +6
-0+ +if (apl_machine_id ==APL_RVP ) +return NULL ; +else +return mach; +}
Signature · 2 lines
With Best Regards, Andy Shevchenko
Re: [PATCH 7/7] ASoC: Intel: common: add quirk for APL RVP boards
Quoted 19 lines · Andy Shevchenko
Quoted 18 lines · Pierre-Louis Bossart
For some reason the RVP/LeafHill SSDT exposes an INT34C3 ID which is used on other boards to point to the TDF8532 amplifier. Yay BIOS.
Add a DMI-quirk to ignore this ID and check for other valid machine driver descriptors.
sound/soc/intel/common/soc-acpi-intel-bxt-match.c +13
-0+static unsigned long apl_machine_id; + +#define APL_RVP 1 + +static int apl_rvp_quirk_cb (const struct dmi_system_id *id) +{ + apl_machine_id =APL_RVP ; +return 1 ; +} + +static const struct dmi_system_id apl_table[] = { + { + .callback = apl_rvp_quirk_cb,
Quoted 8 lines
sound/soc/intel/common/soc-acpi-intel-bxt-match.c line 31
Quoted 6 lines
sound/soc/intel/common/soc-acpi-intel-bxt-match.c +6
-0+ .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Intel Corp." ), + DMI_MATCH(DMI_BOARD_NAME, "Apollolake RVP1A"), + }, + }, + {},Terminator entry doesn't need a comma. It would prevent from (unlikely) mistakes when extending the list.
Indeed. I don't know how many tables use this though... will update.
Quoted 9 lines
sound/soc/intel/common/soc-acpi-intel-bxt-match.c line 38
Quoted 8 lines
sound/soc/intel/common/soc-acpi-intel-bxt-match.c +7
-0+}; + +static struct snd_soc_acpi_mach *apl_quirk (void *arg) +{ +struct snd_soc_acpi_mach *mach = arg; + +dmi_check_system (apl_table);Can't we just use
driver_dataof the table above and get rid of at least global variable?
Yes. The code is pretty much copy-pasted from other BYT quirks but can be written in a better way
Will send a v2 later today, thanks Andy for the suggestion.
Quoted 7 lines
Quoted 7 lines
sound/soc/intel/common/soc-acpi-intel-bxt-match.c +6
-0+ +if (apl_machine_id ==APL_RVP ) +return NULL ; +else +return mach; +}
Quoted 11 lines · Pierre-Louis Bossart
This patchset contain 4 different cleanups:
a) change of pdata definition to avoid using SST-specific structures and allow for machine driver reuse w/ SOF. No new features, just different data structures.
b) removal of remainingGFP_ATOMICusages
c) Cleanup of machine driver tables for APL (missing SOF information and quirk for APL RVP/LeafHill CRB boards). These boards are used outside of Intel so it's worth sharing the fixes for the general public.
d) typo
Looks like a nice clean up!
P.S. Nevertheless, please consider comments to the quirk adding patch
Quoted 31 lines
Bard liao (1):
ASoC: Intel: common: add SOF information for APL RVPPierre-Louis Bossart (6):
ASoC: acpi: define common interface for machine driver configuration
ASoC: Intel: use standard interface for Hdaudio machine driver
ASoC: Intel: use standard interface for Atom machine drivers
ASoC: Intel: boards: fix Skylake typo
ASoC: Intel: removeGFP_ATOMIC, useGFP_KERNEL
ASoC: Intel: common: add quirk for APL RVP boardsinclude/sound/soc-acpi.h | 14 +++++++ sound/soc/intel/atom/sst/sst_acpi.c | 4 ++ sound/soc/intel/atom/sst/sst_pvt.c | 4 +- sound/soc/intel/boards/bytcr_rt5640.c | 6 +-- sound/soc/intel/boards/bytcr_rt5651.c | 6 +-- sound/soc/intel/boards/cht_bsw_rt5645.c | 6 +-- sound/soc/intel/boards/cht_bsw_rt5672.c | 2 +- sound/soc/intel/boards/glk_rt5682_max98357a.c | 2 +- sound/soc/intel/boards/kbl_da7219_max98927.c | 8 ++-- sound/soc/intel/boards/kbl_rt5663_max98927.c | 4 +- sound/soc/intel/boards/skl_hda_dsp_generic.c | 22 +++++------ .../soc/intel/boards/skl_nau88l25_max98357a.c | 4 +- sound/soc/intel/boards/skl_nau88l25_ssm4567.c | 4 +- .../intel/common/soc-acpi-intel-bxt-match.c | 38 +++++++++++++++++++ sound/soc/intel/skylake/skl.c | 10 ++--- 15 files changed, 87 insertions(+), 47 deletions(-)Signature · 1 line
2.17.1
Signature · 2 lines
With Best Regards, Andy Shevchenko