Commit 408a454e authored by Vijendar Mukunda's avatar Vijendar Mukunda Committed by Mark Brown

ASoC: intel: rename soundwire common header macros

Rename sof quirk macros, dai type and dai link macros with "SOC_SDW" tag.

Link: https://github.com/thesofproject/linux/pull/5068Signed-off-by: default avatarVijendar Mukunda <Vijendar.Mukunda@amd.com>
Reviewed-by: default avatarBard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://patch.msgid.link/20240801091446.10457-3-Vijendar.Mukunda@amd.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 6588fcc8
......@@ -98,7 +98,7 @@ static const struct snd_soc_dai_link bridge_dai_template = {
int bridge_cs35l56_count_sidecar(struct snd_soc_card *card,
int *num_dais, int *num_devs)
{
if (sof_sdw_quirk & SOF_SIDECAR_AMPS) {
if (sof_sdw_quirk & SOC_SDW_SIDECAR_AMPS) {
(*num_dais)++;
(*num_devs) += ARRAY_SIZE(bridge_cs35l56_name_prefixes);
}
......@@ -110,7 +110,7 @@ int bridge_cs35l56_add_sidecar(struct snd_soc_card *card,
struct snd_soc_dai_link **dai_links,
struct snd_soc_codec_conf **codec_conf)
{
if (sof_sdw_quirk & SOF_SIDECAR_AMPS) {
if (sof_sdw_quirk & SOC_SDW_SIDECAR_AMPS) {
**dai_links = bridge_dai_template;
for (int i = 0; i < ARRAY_SIZE(bridge_cs35l56_name_prefixes); i++) {
......@@ -130,7 +130,7 @@ int bridge_cs35l56_spk_init(struct snd_soc_card *card,
struct asoc_sdw_codec_info *info,
bool playback)
{
if (sof_sdw_quirk & SOF_SIDECAR_AMPS)
if (sof_sdw_quirk & SOC_SDW_SIDECAR_AMPS)
info->amp_num += ARRAY_SIZE(bridge_cs35l56_name_prefixes);
return 0;
......
This diff is collapsed.
......@@ -14,16 +14,16 @@
#include <sound/soc.h>
#include "sof_hdmi_common.h"
#define MAX_NO_PROPS 2
#define SOC_SDW_MAX_NO_PROPS 2
#define MAX_HDMI_NUM 4
#define SDW_UNUSED_DAI_ID -1
#define SDW_JACK_OUT_DAI_ID 0
#define SDW_JACK_IN_DAI_ID 1
#define SDW_AMP_OUT_DAI_ID 2
#define SDW_AMP_IN_DAI_ID 3
#define SDW_DMIC_DAI_ID 4
#define SDW_MAX_CPU_DAIS 16
#define SDW_INTEL_BIDIR_PDI_BASE 2
#define SOC_SDW_UNUSED_DAI_ID -1
#define SOC_SDW_JACK_OUT_DAI_ID 0
#define SOC_SDW_JACK_IN_DAI_ID 1
#define SOC_SDW_AMP_OUT_DAI_ID 2
#define SOC_SDW_AMP_IN_DAI_ID 3
#define SOC_SDW_DMIC_DAI_ID 4
#define SOC_SDW_MAX_CPU_DAIS 16
#define SOC_SDW_INTEL_BIDIR_PDI_BASE 2
#define SDW_MAX_LINKS 4
......@@ -44,27 +44,27 @@ enum {
SOF_I2S_SSP5 = BIT(5),
};
#define SOF_JACK_JDSRC(quirk) ((quirk) & GENMASK(3, 0))
#define SOC_SDW_JACK_JDSRC(quirk) ((quirk) & GENMASK(3, 0))
/* Deprecated and no longer supported by the code */
#define SOF_SDW_FOUR_SPK BIT(4)
#define SOC_SDW_FOUR_SPK BIT(4)
#define SOF_SDW_TGL_HDMI BIT(5)
#define SOF_SDW_PCH_DMIC BIT(6)
#define SOC_SDW_PCH_DMIC BIT(6)
#define SOF_SSP_PORT(x) (((x) & GENMASK(5, 0)) << 7)
#define SOF_SSP_GET_PORT(quirk) (((quirk) >> 7) & GENMASK(5, 0))
/* Deprecated and no longer supported by the code */
#define SOF_SDW_NO_AGGREGATION BIT(14)
#define SOC_SDW_NO_AGGREGATION BIT(14)
/* If a CODEC has an optional speaker output, this quirk will enable it */
#define SOF_CODEC_SPKR BIT(15)
#define SOC_SDW_CODEC_SPKR BIT(15)
/*
* If the CODEC has additional devices attached directly to it.
*
* For the cs42l43:
* - 0 - No speaker output
* - SOF_CODEC_SPKR - CODEC internal speaker
* - SOF_SIDECAR_AMPS - 2x Sidecar amplifiers + CODEC internal speaker
* - SOF_CODEC_SPKR | SOF_SIDECAR_AMPS - Not currently supported
* - SOC_SDW_CODEC_SPKR - CODEC internal speaker
* - SOC_SDW_SIDECAR_AMPS - 2x Sidecar amplifiers + CODEC internal speaker
* - SOC_SDW_CODEC_SPKR | SOC_SDW_SIDECAR_AMPS - Not currently supported
*/
#define SOF_SIDECAR_AMPS BIT(16)
#define SOC_SDW_SIDECAR_AMPS BIT(16)
/* BT audio offload: reserve 3 bits for future */
#define SOF_BT_OFFLOAD_SSP_SHIFT 15
......@@ -73,11 +73,11 @@ enum {
(((quirk) << SOF_BT_OFFLOAD_SSP_SHIFT) & SOF_BT_OFFLOAD_SSP_MASK)
#define SOF_SSP_BT_OFFLOAD_PRESENT BIT(18)
#define SOF_SDW_DAI_TYPE_JACK 0
#define SOF_SDW_DAI_TYPE_AMP 1
#define SOF_SDW_DAI_TYPE_MIC 2
#define SOC_SDW_DAI_TYPE_JACK 0
#define SOC_SDW_DAI_TYPE_AMP 1
#define SOC_SDW_DAI_TYPE_MIC 2
#define SOF_SDW_MAX_DAI_NUM 8
#define SOC_SDW_MAX_DAI_NUM 8
struct asoc_sdw_codec_info;
......@@ -108,7 +108,7 @@ struct asoc_sdw_codec_info {
const u8 acpi_id[ACPI_ID_LEN];
const bool ignore_pch_dmic;
const struct snd_soc_ops *ops;
struct asoc_sdw_dai_info dais[SOF_SDW_MAX_DAI_NUM];
struct asoc_sdw_dai_info dais[SOC_SDW_MAX_DAI_NUM];
const int dai_num;
int (*codec_card_late_probe)(struct snd_soc_card *card);
......
......@@ -104,7 +104,7 @@ int cs42l43_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *da
struct snd_soc_card *card = rtd->card;
int ret;
if (!(sof_sdw_quirk & SOF_SIDECAR_AMPS)) {
if (!(sof_sdw_quirk & SOC_SDW_SIDECAR_AMPS)) {
/* Will be set by the bridge code in this case */
card->components = devm_kasprintf(card->dev, GFP_KERNEL,
"%s spk:cs42l43-spk",
......
......@@ -23,13 +23,13 @@
*/
static int rt711_add_codec_device_props(struct device *sdw_dev)
{
struct property_entry props[MAX_NO_PROPS] = {};
struct property_entry props[SOC_SDW_MAX_NO_PROPS] = {};
struct fwnode_handle *fwnode;
int ret;
if (!SOF_JACK_JDSRC(sof_sdw_quirk))
if (!SOC_SDW_JACK_JDSRC(sof_sdw_quirk))
return 0;
props[0] = PROPERTY_ENTRY_U32("realtek,jd-src", SOF_JACK_JDSRC(sof_sdw_quirk));
props[0] = PROPERTY_ENTRY_U32("realtek,jd-src", SOC_SDW_JACK_JDSRC(sof_sdw_quirk));
fwnode = fwnode_create_software_node(props, NULL);
if (IS_ERR(fwnode))
......
......@@ -23,14 +23,14 @@
*/
static int rt_sdca_jack_add_codec_device_props(struct device *sdw_dev)
{
struct property_entry props[MAX_NO_PROPS] = {};
struct property_entry props[SOC_SDW_MAX_NO_PROPS] = {};
struct fwnode_handle *fwnode;
int ret;
if (!SOF_JACK_JDSRC(sof_sdw_quirk))
if (!SOC_SDW_JACK_JDSRC(sof_sdw_quirk))
return 0;
props[0] = PROPERTY_ENTRY_U32("realtek,jd-src", SOF_JACK_JDSRC(sof_sdw_quirk));
props[0] = PROPERTY_ENTRY_U32("realtek,jd-src", SOC_SDW_JACK_JDSRC(sof_sdw_quirk));
fwnode = fwnode_create_software_node(props, NULL);
if (IS_ERR(fwnode))
......@@ -168,7 +168,7 @@ int sof_sdw_rt_sdca_jack_exit(struct snd_soc_card *card, struct snd_soc_dai_link
if (!ctx->headset_codec_dev)
return 0;
if (!SOF_JACK_JDSRC(sof_sdw_quirk))
if (!SOC_SDW_JACK_JDSRC(sof_sdw_quirk))
return 0;
device_remove_software_node(ctx->headset_codec_dev);
......
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