ASoC: amd: acp: Enable i2s tdm support for skyrim platforms
Enable i2s tdm support for skyrim platform using dmi quirks. Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com> Link: https://lore.kernel.org/r/20230109132104.1259479-6-venkataprasad.potturu@amd.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
200553008e
commit
d386a10c9c
@ -16,6 +16,7 @@
|
||||
#include <sound/pcm_params.h>
|
||||
#include <sound/soc-acpi.h>
|
||||
#include <sound/soc-dapm.h>
|
||||
#include <linux/dmi.h>
|
||||
#include <linux/module.h>
|
||||
|
||||
#include "acp-mach.h"
|
||||
@ -95,6 +96,8 @@ static int acp_asoc_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct snd_soc_card *card = NULL;
|
||||
struct device *dev = &pdev->dev;
|
||||
const struct dmi_system_id *dmi_id;
|
||||
struct acp_card_drvdata *acp_card_drvdata;
|
||||
int ret;
|
||||
|
||||
if (!pdev->id_entry)
|
||||
@ -113,6 +116,11 @@ static int acp_asoc_probe(struct platform_device *pdev)
|
||||
card->num_controls = ARRAY_SIZE(acp_controls);
|
||||
card->drvdata = (struct acp_card_drvdata *)pdev->id_entry->driver_data;
|
||||
|
||||
acp_card_drvdata = card->drvdata;
|
||||
dmi_id = dmi_first_match(acp_quirk_table);
|
||||
if (dmi_id && dmi_id->driver_data)
|
||||
acp_card_drvdata->tdm_mode = dmi_id->driver_data;
|
||||
|
||||
acp_legacy_dai_links_create(card);
|
||||
|
||||
ret = devm_snd_soc_register_card(&pdev->dev, card);
|
||||
|
@ -32,6 +32,20 @@
|
||||
#define DUAL_CHANNEL 2
|
||||
#define FOUR_CHANNEL 4
|
||||
|
||||
#define TDM_MODE_ENABLE 1
|
||||
|
||||
const struct dmi_system_id acp_quirk_table[] = {
|
||||
{
|
||||
/* Google skyrim proto-0 */
|
||||
.matches = {
|
||||
DMI_EXACT_MATCH(DMI_PRODUCT_FAMILY, "Google_Skyrim"),
|
||||
},
|
||||
.driver_data = (void *)TDM_MODE_ENABLE,
|
||||
},
|
||||
{}
|
||||
};
|
||||
EXPORT_SYMBOL_GPL(acp_quirk_table);
|
||||
|
||||
static struct snd_soc_jack pco_jack;
|
||||
|
||||
static const unsigned int channels[] = {
|
||||
|
@ -65,5 +65,6 @@ struct acp_card_drvdata {
|
||||
|
||||
int acp_sofdsp_dai_links_create(struct snd_soc_card *card);
|
||||
int acp_legacy_dai_links_create(struct snd_soc_card *card);
|
||||
extern const struct dmi_system_id acp_quirk_table[];
|
||||
|
||||
#endif
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include <sound/pcm_params.h>
|
||||
#include <sound/soc-acpi.h>
|
||||
#include <sound/soc-dapm.h>
|
||||
#include <linux/dmi.h>
|
||||
#include <linux/module.h>
|
||||
|
||||
#include "acp-mach.h"
|
||||
@ -102,6 +103,8 @@ static int acp_sof_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct snd_soc_card *card = NULL;
|
||||
struct device *dev = &pdev->dev;
|
||||
const struct dmi_system_id *dmi_id;
|
||||
struct acp_card_drvdata *acp_card_drvdata;
|
||||
int ret;
|
||||
|
||||
if (!pdev->id_entry)
|
||||
@ -120,6 +123,11 @@ static int acp_sof_probe(struct platform_device *pdev)
|
||||
card->num_controls = ARRAY_SIZE(acp_controls);
|
||||
card->drvdata = (struct acp_card_drvdata *)pdev->id_entry->driver_data;
|
||||
|
||||
acp_card_drvdata = card->drvdata;
|
||||
dmi_id = dmi_first_match(acp_quirk_table);
|
||||
if (dmi_id && dmi_id->driver_data)
|
||||
acp_card_drvdata->tdm_mode = dmi_id->driver_data;
|
||||
|
||||
acp_sofdsp_dai_links_create(card);
|
||||
|
||||
ret = devm_snd_soc_register_card(&pdev->dev, card);
|
||||
|
Loading…
Reference in New Issue
Block a user