Skip to content

Commit 5c10da4

Browse files
gongjun-songbroonie
authored andcommitted
ASoC: Intel: sof_sdw: use common helpers for all Realtek amps
sof_sdw_rt1308.c/sof_sdw_rt1316.c/sof_sdw_rt1318.c handle amp in basically the same way, optimized and merged into one file. Reviewed-by: Ranjani Sridharan <[email protected]> Reviewed-by: Bard Liao <[email protected]> Signed-off-by: Gongjun Song <[email protected]> Signed-off-by: Pierre-Louis Bossart <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent c0660fc commit 5c10da4

File tree

6 files changed

+120
-411
lines changed

6 files changed

+120
-411
lines changed

sound/soc/intel/boards/Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ snd-soc-sof_da7219_max98373-objs := sof_da7219_max98373.o
3737
snd-soc-ehl-rt5660-objs := ehl_rt5660.o
3838
snd-soc-sof-ssp-amp-objs := sof_ssp_amp.o
3939
snd-soc-sof-sdw-objs += sof_sdw.o \
40-
sof_sdw_max98373.o sof_sdw_rt1308.o \
41-
sof_sdw_rt1316.o sof_sdw_rt1318.o \
40+
sof_sdw_max98373.o sof_sdw_rt_amp.o \
4241
sof_sdw_rt5682.o sof_sdw_rt700.o \
4342
sof_sdw_rt711.o sof_sdw_rt711_sdca.o \
4443
sof_sdw_rt715.o sof_sdw_rt715_sdca.o \

sound/soc/intel/boards/sof_sdw.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -550,23 +550,23 @@ static struct sof_sdw_codec_info codec_info_list[] = {
550550
.direction = {true, false},
551551
.dai_name = "rt1308-aif",
552552
.ops = &sof_sdw_rt1308_i2s_ops,
553-
.init = sof_sdw_rt1308_init,
554-
.exit = sof_sdw_rt1308_exit,
553+
.init = sof_sdw_rt_amp_init,
554+
.exit = sof_sdw_rt_amp_exit,
555555
.codec_type = SOF_SDW_CODEC_TYPE_AMP,
556556
},
557557
{
558558
.part_id = 0x1316,
559559
.direction = {true, true},
560560
.dai_name = "rt1316-aif",
561-
.init = sof_sdw_rt1316_init,
562-
.exit = sof_sdw_rt1316_exit,
561+
.init = sof_sdw_rt_amp_init,
562+
.exit = sof_sdw_rt_amp_exit,
563563
.codec_type = SOF_SDW_CODEC_TYPE_AMP,
564564
},
565565
{
566566
.part_id = 0x1318,
567567
.direction = {true, true},
568568
.dai_name = "rt1318-aif",
569-
.init = sof_sdw_rt1318_init,
569+
.init = sof_sdw_rt_amp_init,
570570
.codec_type = SOF_SDW_CODEC_TYPE_AMP,
571571
},
572572
{

sound/soc/intel/boards/sof_sdw_common.h

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -125,30 +125,18 @@ int sof_sdw_rt700_init(struct snd_soc_card *card,
125125
struct sof_sdw_codec_info *info,
126126
bool playback);
127127

128-
/* RT1308 support */
128+
/* RT1308 I2S support */
129129
extern struct snd_soc_ops sof_sdw_rt1308_i2s_ops;
130130

131-
int sof_sdw_rt1308_init(struct snd_soc_card *card,
131+
/* generic amp support */
132+
int sof_sdw_rt_amp_init(struct snd_soc_card *card,
132133
const struct snd_soc_acpi_link_adr *link,
133134
struct snd_soc_dai_link *dai_links,
134135
struct sof_sdw_codec_info *info,
135136
bool playback);
136-
int sof_sdw_rt1308_exit(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link);
137+
int sof_sdw_rt_amp_exit(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link);
137138

138139
/* RT1316 support */
139-
int sof_sdw_rt1316_init(struct snd_soc_card *card,
140-
const struct snd_soc_acpi_link_adr *link,
141-
struct snd_soc_dai_link *dai_links,
142-
struct sof_sdw_codec_info *info,
143-
bool playback);
144-
int sof_sdw_rt1316_exit(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link);
145-
146-
/* RT1318 support */
147-
int sof_sdw_rt1318_init(struct snd_soc_card *card,
148-
const struct snd_soc_acpi_link_adr *link,
149-
struct snd_soc_dai_link *dai_links,
150-
struct sof_sdw_codec_info *info,
151-
bool playback);
152140

153141
/* RT715 support */
154142
int sof_sdw_rt715_init(struct snd_soc_card *card,

sound/soc/intel/boards/sof_sdw_rt1316.c

Lines changed: 0 additions & 239 deletions
This file was deleted.

0 commit comments

Comments
 (0)