Skip to content

Commit 91dc486

Browse files
davidlin923bardliao
authored andcommitted
ASoC: Intel: ti-common: support tas2563 amplifier
Implement tas2563 support code in this common module so it could be shared between multiple SOF machine drivers. Signed-off-by: David Lin <david.lin@intel.com>
1 parent 485e39e commit 91dc486

File tree

6 files changed

+113
-0
lines changed

6 files changed

+113
-0
lines changed

include/sound/soc-acpi-intel-ssp-common.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737
#define RT5682_ACPI_HID "10EC5682"
3838
#define RT5682S_ACPI_HID "RTL5682"
3939

40+
/* Texas Instruments */
41+
#define TAS2563_ACPI_HID "TXNW2563"
42+
4043
enum snd_soc_acpi_intel_codec {
4144
CODEC_NONE,
4245

@@ -63,6 +66,7 @@ enum snd_soc_acpi_intel_codec {
6366
CODEC_RT1015P,
6467
CODEC_RT1019P,
6568
CODEC_RT1308,
69+
CODEC_TAS2563,
6670
};
6771

6872
enum snd_soc_acpi_intel_codec

sound/soc/intel/boards/Kconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ config SND_SOC_INTEL_SOF_CIRRUS_COMMON
4141
config SND_SOC_INTEL_SOF_NUVOTON_COMMON
4242
tristate
4343

44+
config SND_SOC_INTEL_SOF_TI_COMMON
45+
tristate
46+
4447
config SND_SOC_INTEL_SOF_BOARD_HELPERS
4548
select SND_SOC_ACPI_INTEL_MATCH
4649
tristate

sound/soc/intel/boards/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,8 @@ obj-$(CONFIG_SND_SOC_INTEL_SOF_CIRRUS_COMMON) += snd-soc-intel-sof-cirrus-common
6969
snd-soc-intel-sof-nuvoton-common-y += sof_nuvoton_common.o
7070
obj-$(CONFIG_SND_SOC_INTEL_SOF_NUVOTON_COMMON) += snd-soc-intel-sof-nuvoton-common.o
7171

72+
snd-soc-intel-sof-ti-common-y += sof_ti_common.o
73+
obj-$(CONFIG_SND_SOC_INTEL_SOF_TI_COMMON) += snd-soc-intel-sof-ti-common.o
74+
7275
snd-soc-intel-sof-board-helpers-y += sof_board_helpers.o
7376
obj-$(CONFIG_SND_SOC_INTEL_SOF_BOARD_HELPERS) += snd-soc-intel-sof-board-helpers.o
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
// SPDX-License-Identifier: GPL-2.0-only
2+
//
3+
// Copyright(c) 2025 Intel Corporation
4+
#include <linux/module.h>
5+
#include <linux/string.h>
6+
#include <sound/pcm.h>
7+
#include <sound/pcm_params.h>
8+
#include <sound/soc.h>
9+
#include <sound/soc-acpi.h>
10+
#include <sound/soc-dai.h>
11+
#include <sound/soc-dapm.h>
12+
#include <sound/sof.h>
13+
#include <uapi/sound/asound.h>
14+
#include "../common/soc-intel-quirks.h"
15+
#include "sof_ti_common.h"
16+
17+
/*
18+
* Texas Instruments TAS2563 just mount one device to manage multiple devices,
19+
* so the kcontrols, widgets and routes just keep one item, respectively.
20+
*/
21+
static const struct snd_kcontrol_new tas2563_spk_kcontrols[] = {
22+
SOC_DAPM_PIN_SWITCH("Spk"),
23+
};
24+
25+
static const struct snd_soc_dapm_widget tas2563_spk_dapm_widgets[] = {
26+
SND_SOC_DAPM_SPK("Spk", NULL),
27+
};
28+
29+
static const struct snd_soc_dapm_route tas2563_spk_dapm_routes[] = {
30+
{ "Spk", NULL, "OUT" },
31+
};
32+
33+
static struct snd_soc_dai_link_component tas2563_dai_link_components[] = {
34+
{
35+
.name = TAS2563_DEV0_NAME,
36+
.dai_name = TAS2563_CODEC_DAI,
37+
},
38+
};
39+
40+
static int tas2563_init(struct snd_soc_pcm_runtime *rtd)
41+
{
42+
struct snd_soc_card *card = rtd->card;
43+
int ret;
44+
45+
ret = snd_soc_dapm_new_controls(&card->dapm, tas2563_spk_dapm_widgets,
46+
ARRAY_SIZE(tas2563_spk_dapm_widgets));
47+
if (ret) {
48+
dev_err(rtd->dev, "unable to add dapm widgets, ret %d\n", ret);
49+
return ret;
50+
}
51+
52+
ret = snd_soc_add_card_controls(card, tas2563_spk_kcontrols,
53+
ARRAY_SIZE(tas2563_spk_kcontrols));
54+
if (ret) {
55+
dev_err(rtd->dev, "unable to add controls, ret %d\n", ret);
56+
return ret;
57+
}
58+
59+
ret = snd_soc_dapm_add_routes(&card->dapm, tas2563_spk_dapm_routes,
60+
ARRAY_SIZE(tas2563_spk_dapm_routes));
61+
if (ret)
62+
dev_err(rtd->dev, "unable to add dapm routes, ret %d\n", ret);
63+
64+
return ret;
65+
}
66+
67+
void sof_tas2563_dai_link(struct snd_soc_dai_link *link)
68+
{
69+
link->codecs = tas2563_dai_link_components;
70+
link->num_codecs = ARRAY_SIZE(tas2563_dai_link_components);
71+
link->init = tas2563_init;
72+
}
73+
EXPORT_SYMBOL_NS(sof_tas2563_dai_link, "SND_SOC_INTEL_SOF_TI_COMMON");
74+
75+
MODULE_DESCRIPTION("ASoC Intel SOF Texas Instruments helpers");
76+
MODULE_LICENSE("GPL");
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/* SPDX-License-Identifier: GPL-2.0-only */
2+
/*
3+
* Copyright(c) 2025 Intel Corporation.
4+
*/
5+
6+
/*
7+
* This file defines data structures used in Machine Driver for Intel
8+
* platforms with Texas Instruments Codecs.
9+
*/
10+
#ifndef __SOF_TI_COMMON_H
11+
#define __SOF_TI_COMMON_H
12+
13+
#include <sound/soc.h>
14+
#include <sound/soc-acpi-intel-ssp-common.h>
15+
16+
/*
17+
* Texas Instruments TAS2563
18+
*/
19+
#define TAS2563_CODEC_DAI "tasdev_codec"
20+
#define TAS2563_DEV0_NAME "i2c-" TAS2563_ACPI_HID ":00"
21+
22+
void sof_tas2563_dai_link(struct snd_soc_dai_link *link);
23+
24+
#endif /* __SOF_TI_COMMON_H */

sound/soc/intel/common/soc-acpi-intel-ssp-common.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ static const struct codec_map amps[] = {
6565
CODEC_MAP_ENTRY("RT1019P", "rt1019", RT1019P_ACPI_HID, CODEC_RT1019P),
6666
CODEC_MAP_ENTRY("RT1308", "rt1308", RT1308_ACPI_HID, CODEC_RT1308),
6767

68+
/* Texas Instruments */
69+
CODEC_MAP_ENTRY("TAS2563", "tas2563", TAS2563_ACPI_HID, CODEC_TAS2563),
70+
6871
/*
6972
* Monolithic components
7073
*

0 commit comments

Comments
 (0)