Skip to content

Commit 170fb3b

Browse files
committed
Revert "ASoC: sdw_utils: cs_amp: Assign non-overlapping TDM masks for each codec on a bus"
This reverts commit 74d4c78. Will use the upstream commit after merge. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
1 parent 0c8300c commit 170fb3b

3 files changed

Lines changed: 0 additions & 49 deletions

File tree

include/sound/soc_sdw_utils.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,6 @@ int asoc_sdw_cs_amp_init(struct snd_soc_card *card,
224224
struct snd_soc_dai_link *dai_links,
225225
struct asoc_sdw_codec_info *info,
226226
bool playback);
227-
int asoc_sdw_cs_spk_feedback_rtd_init(struct snd_soc_pcm_runtime *rtd,
228-
struct snd_soc_dai *dai);
229227

230228
/* MAXIM codec support */
231229
int asoc_sdw_maxim_init(struct snd_soc_card *card,

sound/soc/sdw_utils/soc_sdw_cs_amp.c

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include <sound/soc_sdw_utils.h>
1616

1717
#define CODEC_NAME_SIZE 8
18-
#define CS_AMP_CHANNELS_PER_AMP 4
1918

2019
int asoc_sdw_cs_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai)
2120
{
@@ -49,51 +48,6 @@ int asoc_sdw_cs_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai
4948
}
5049
EXPORT_SYMBOL_NS(asoc_sdw_cs_spk_rtd_init, SND_SOC_SDW_UTILS);
5150

52-
int asoc_sdw_cs_spk_feedback_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai)
53-
{
54-
const struct snd_soc_dai_link *dai_link = rtd->dai_link;
55-
const struct snd_soc_dai_link_ch_map *ch_map;
56-
const struct snd_soc_dai_link_component *codec_dlc;
57-
struct snd_soc_dai *codec_dai;
58-
u8 ch_slot[8] = {};
59-
unsigned int amps_per_bus, ch_per_amp, mask;
60-
int i, ret;
61-
62-
WARN_ON(dai_link->num_cpus > ARRAY_SIZE(ch_slot));
63-
64-
/*
65-
* CS35L56 has 4 TX channels. When the capture is aggregated the
66-
* same bus slots will be allocated to all the amps on a bus. Only
67-
* one amp on that bus can be transmitting in each slot so divide
68-
* the available 4 slots between all the amps on a bus.
69-
*/
70-
amps_per_bus = dai_link->num_codecs / dai_link->num_cpus;
71-
if ((amps_per_bus == 0) || (amps_per_bus > CS_AMP_CHANNELS_PER_AMP)) {
72-
dev_err(rtd->card->dev, "Illegal num_codecs:%u / num_cpus:%u\n",
73-
dai_link->num_codecs, dai_link->num_cpus);
74-
return -EINVAL;
75-
}
76-
77-
ch_per_amp = CS_AMP_CHANNELS_PER_AMP / amps_per_bus;
78-
79-
for_each_rtd_ch_maps(rtd, i, ch_map) {
80-
codec_dlc = snd_soc_link_to_codec(rtd->dai_link, i);
81-
codec_dai = snd_soc_find_dai(codec_dlc);
82-
mask = GENMASK(ch_per_amp - 1, 0) << ch_slot[ch_map->cpu];
83-
84-
ret = snd_soc_dai_set_tdm_slot(codec_dai, 0, mask, 4, 32);
85-
if (ret < 0) {
86-
dev_err(rtd->card->dev, "Failed to set TDM slot:%d\n", ret);
87-
return ret;
88-
}
89-
90-
ch_slot[ch_map->cpu] += ch_per_amp;
91-
}
92-
93-
return 0;
94-
}
95-
EXPORT_SYMBOL_NS(asoc_sdw_cs_spk_feedback_rtd_init, SND_SOC_SDW_UTILS);
96-
9751
int asoc_sdw_cs_amp_init(struct snd_soc_card *card,
9852
struct snd_soc_dai_link *dai_links,
9953
struct asoc_sdw_codec_info *info,

sound/soc/sdw_utils/soc_sdw_utils.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,6 @@ struct asoc_sdw_codec_info codec_info_list[] = {
504504
.dai_name = "cs35l56-sdw1c",
505505
.dai_type = SOC_SDW_DAI_TYPE_AMP,
506506
.dailink = {SOC_SDW_UNUSED_DAI_ID, SOC_SDW_AMP_IN_DAI_ID},
507-
.rtd_init = asoc_sdw_cs_spk_feedback_rtd_init,
508507
},
509508
},
510509
.dai_num = 2,

0 commit comments

Comments
 (0)