aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/intel/boards/sof_sdw.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/intel/boards/sof_sdw.c')
-rw-r--r--sound/soc/intel/boards/sof_sdw.c64
1 files changed, 45 insertions, 19 deletions
diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c
index 4e4284729773..300391fbc2fc 100644
--- a/sound/soc/intel/boards/sof_sdw.c
+++ b/sound/soc/intel/boards/sof_sdw.c
@@ -570,16 +570,14 @@ int sdw_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params)
{
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
+ struct snd_soc_dai_link_ch_map *ch_maps;
int ch = params_channels(params);
- struct snd_soc_dai *codec_dai;
- struct snd_soc_dai *cpu_dai;
unsigned int ch_mask;
int num_codecs;
int step;
int i;
- int j;
- if (!rtd->dai_link->codec_ch_maps)
+ if (!rtd->dai_link->ch_maps)
return 0;
/* Identical data will be sent to all codecs in playback */
@@ -605,13 +603,9 @@ int sdw_hw_params(struct snd_pcm_substream *substream,
* link has more than one codec DAIs. Set codec channel mask and
* ASoC will set the corresponding channel numbers for each cpu dai.
*/
- for_each_rtd_cpu_dais(rtd, i, cpu_dai) {
- for_each_rtd_codec_dais(rtd, j, codec_dai) {
- if (rtd->dai_link->codec_ch_maps[j].connected_cpu_id != i)
- continue;
- rtd->dai_link->codec_ch_maps[j].ch_mask = ch_mask << (j * step);
- }
- }
+ for_each_link_ch_maps(rtd->dai_link, i, ch_maps)
+ ch_maps->ch_mask = ch_mask << (i * step);
+
return 0;
}
@@ -861,6 +855,36 @@ static struct sof_sdw_codec_info codec_info_list[] = {
.dai_num = 1,
},
{
+ .part_id = 0x722,
+ .version_id = 3,
+ .dais = {
+ {
+ .direction = {true, true},
+ .dai_name = "rt722-sdca-aif1",
+ .dai_type = SOF_SDW_DAI_TYPE_JACK,
+ .dailink = {SDW_JACK_OUT_DAI_ID, SDW_JACK_IN_DAI_ID},
+ .init = sof_sdw_rt_sdca_jack_init,
+ .exit = sof_sdw_rt_sdca_jack_exit,
+ },
+ {
+ .direction = {true, false},
+ .dai_name = "rt722-sdca-aif2",
+ .dai_type = SOF_SDW_DAI_TYPE_AMP,
+ /* No feedback capability is provided by rt722-sdca codec driver*/
+ .dailink = {SDW_AMP_OUT_DAI_ID, SDW_UNUSED_DAI_ID},
+ .init = sof_sdw_rt722_spk_init,
+ },
+ {
+ .direction = {false, true},
+ .dai_name = "rt722-sdca-aif3",
+ .dai_type = SOF_SDW_DAI_TYPE_MIC,
+ .dailink = {SDW_UNUSED_DAI_ID, SDW_DMIC_DAI_ID},
+ .init = sof_sdw_rt722_sdca_dmic_init,
+ },
+ },
+ .dai_num = 3,
+ },
+ {
.part_id = 0x8373,
.dais = {
{
@@ -1232,11 +1256,11 @@ static int fill_sdw_codec_dlc(struct device *dev,
else if (is_unique_device(adr_link, sdw_version, mfg_id, part_id,
class_id, adr_index))
codec->name = devm_kasprintf(dev, GFP_KERNEL,
- "sdw:%01x:%04x:%04x:%02x", link_id,
+ "sdw:0:%01x:%04x:%04x:%02x", link_id,
mfg_id, part_id, class_id);
else
codec->name = devm_kasprintf(dev, GFP_KERNEL,
- "sdw:%01x:%04x:%04x:%02x:%01x", link_id,
+ "sdw:0:%01x:%04x:%04x:%02x:%01x", link_id,
mfg_id, part_id, class_id, unique_id);
if (!codec->name)
@@ -1350,15 +1374,17 @@ static int get_slave_info(const struct snd_soc_acpi_link_adr *adr_link,
return 0;
}
-static void set_dailink_map(struct snd_soc_dai_link_codec_ch_map *sdw_codec_ch_maps,
+static void set_dailink_map(struct snd_soc_dai_link_ch_map *sdw_codec_ch_maps,
int codec_num, int cpu_num)
{
int step;
int i;
step = codec_num / cpu_num;
- for (i = 0; i < codec_num; i++)
- sdw_codec_ch_maps[i].connected_cpu_id = i / step;
+ for (i = 0; i < codec_num; i++) {
+ sdw_codec_ch_maps[i].cpu = i / step;
+ sdw_codec_ch_maps[i].codec = i;
+ }
}
static const char * const type_strings[] = {"SimpleJack", "SmartAmp", "SmartMic"};
@@ -1453,7 +1479,7 @@ static int create_sdw_dailink(struct snd_soc_card *card, int *link_index,
*ignore_pch_dmic = true;
for_each_pcm_streams(stream) {
- struct snd_soc_dai_link_codec_ch_map *sdw_codec_ch_maps;
+ struct snd_soc_dai_link_ch_map *sdw_codec_ch_maps;
char *name, *cpu_name;
int playback, capture;
static const char * const sdw_stream_name[] = {
@@ -1530,7 +1556,7 @@ static int create_sdw_dailink(struct snd_soc_card *card, int *link_index,
dai_links[*link_index].nonatomic = true;
set_dailink_map(sdw_codec_ch_maps, codec_num, cpu_dai_num);
- dai_links[*link_index].codec_ch_maps = sdw_codec_ch_maps;
+ dai_links[*link_index].ch_maps = sdw_codec_ch_maps;
ret = set_codec_init_func(card, adr_link, dai_links + (*link_index)++,
playback, group_id, adr_index, dai_index);
if (ret < 0) {
@@ -1947,7 +1973,7 @@ static int mc_probe(struct platform_device *pdev)
/* Register the card */
ret = devm_snd_soc_register_card(card->dev, card);
if (ret) {
- dev_err(card->dev, "snd_soc_register_card failed %d\n", ret);
+ dev_err_probe(card->dev, ret, "snd_soc_register_card failed %d\n", ret);
mc_dailink_exit_loop(card);
return ret;
}