Commit d4c750f2 authored by Ajit Kumar Pandey's avatar Ajit Kumar Pandey Committed by Mark Brown

ASoC: amd: acp: Add generic machine driver support for ACP cards

We have machines with different audio endpoints configurations
across various distributions. We need to support multiple sound
cards for different combinations of I2S instance and codecs hw.
Now we also need to support SOF-DSP endpoints based sound cards.
All such card combinations slightly differs in terms of machine
ops callback. This patch adds ACP generic machine driver module
that exposes method to create ACP cards dai links and define new
ops for audio endpoints configurations. Initially we have added
dailink support for RT5682 and RT1019 codec connection with ACP
I2S_SP instance. We will add newer codecs in this module to use
this for all AMD's ACP block sound cards supports in future.
Signed-off-by: default avatarAjit Kumar Pandey <AjitKumar.Pandey@amd.com>
Link: https://lore.kernel.org/r/20211019070938.5076-5-AjitKumar.Pandey@amd.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent e646b51f
......@@ -25,3 +25,13 @@ config SND_AMD_ASOC_RENOIR
depends on X86 && PCI
help
This option enables Renoir I2S support on AMD platform.
config SND_SOC_AMD_MACH_COMMON
tristate
select CLK_FIXED_FCH
select SND_SOC_RT5682_I2C
select SND_SOC_DMIC
select SND_SOC_RT1019
depends on X86 && PCI && I2C
help
This option enables common Machine driver module for ACP.
......@@ -11,7 +11,12 @@ snd-acp-i2s-objs := acp-i2s.o
#platform specific driver
snd-acp-renoir-objs := acp-renoir.o
#machine specific driver
snd-acp-mach-objs := acp-mach-common.o
obj-$(CONFIG_SND_SOC_AMD_ACP_PCM) += snd-acp-pcm.o
obj-$(CONFIG_SND_SOC_AMD_ACP_I2S) += snd-acp-i2s.o
obj-$(CONFIG_SND_AMD_ASOC_RENOIR) += snd-acp-renoir.o
obj-$(CONFIG_SND_SOC_AMD_MACH_COMMON) += snd-acp-mach.o
This diff is collapsed.
/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */
/*
* This file is provided under a dual BSD/GPLv2 license. When using or
* redistributing this file, you may do so under either license.
*
* Copyright(c) 2021 Advanced Micro Devices, Inc. All rights reserved.
*
* Author: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
*/
#ifndef __ACP_MACH_H
#define __ACP_MACH_H
#include <sound/core.h>
#include <sound/jack.h>
#include <sound/pcm_params.h>
#include <sound/soc-dapm.h>
#include <linux/input.h>
#include <linux/module.h>
#include <sound/soc.h>
enum be_id {
HEADSET_BE_ID = 0,
AMP_BE_ID,
DMIC_BE_ID,
};
enum cpu_endpoints {
NONE = 0,
I2S_SP,
I2S_BT,
DMIC,
};
enum codec_endpoints {
DUMMY = 0,
RT5682,
RT1019,
};
struct acp_card_drvdata {
unsigned int hs_cpu_id;
unsigned int amp_cpu_id;
unsigned int dmic_cpu_id;
unsigned int hs_codec_id;
unsigned int amp_codec_id;
unsigned int dmic_codec_id;
unsigned int dai_fmt;
struct clk *wclk;
struct clk *bclk;
};
int acp_sofdsp_dai_links_create(struct snd_soc_card *card);
int acp_legacy_dai_links_create(struct snd_soc_card *card);
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment