Subject: [PATCH 1/6] ASoC: amd: Renaming snd-soc-card structure and fields.

As in future our machine driver supports multiple codecs
So changing naming convention of snd_soc_card struct and its fields.

Signed-off-by: Ravulapati Vishnu vardhan rao <[email protected]>
---
sound/soc/amd/acp3x-rt5682-max9836.c | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/sound/soc/amd/acp3x-rt5682-max9836.c b/sound/soc/amd/acp3x-rt5682-max9836.c
index 6009e444b858..8b5af064864f 100644
--- a/sound/soc/amd/acp3x-rt5682-max9836.c
+++ b/sound/soc/amd/acp3x-rt5682-max9836.c
@@ -290,7 +290,7 @@ static const struct snd_kcontrol_new acp3x_dmic_mux_control =
SOC_DAPM_ENUM_EXT("DMIC Select Mux", acp3x_dmic_enum,
dmic_get, dmic_set);

-static const struct snd_soc_dapm_widget acp3x_widgets[] = {
+static const struct snd_soc_dapm_widget acp3x_5682_widgets[] = {
SND_SOC_DAPM_HP("Headphone Jack", NULL),
SND_SOC_DAPM_SPK("Spk", NULL),
SND_SOC_DAPM_MIC("Headset Mic", NULL),
@@ -298,7 +298,7 @@ static const struct snd_soc_dapm_widget acp3x_widgets[] = {
&acp3x_dmic_mux_control),
};

-static const struct snd_soc_dapm_route acp3x_audio_route[] = {
+static const struct snd_soc_dapm_route acp3x_5682_audio_route[] = {
{"Headphone Jack", NULL, "HPOL"},
{"Headphone Jack", NULL, "HPOR"},
{"IN1P", NULL, "Headset Mic"},
@@ -307,23 +307,23 @@ static const struct snd_soc_dapm_route acp3x_audio_route[] = {
{"Dmic Mux", "Rear Mic", "DMIC"},
};

-static const struct snd_kcontrol_new acp3x_mc_controls[] = {
+static const struct snd_kcontrol_new acp3x_5682_mc_controls[] = {
SOC_DAPM_PIN_SWITCH("Headphone Jack"),
SOC_DAPM_PIN_SWITCH("Spk"),
SOC_DAPM_PIN_SWITCH("Headset Mic"),
};

-static struct snd_soc_card acp3x_card = {
+static struct snd_soc_card acp3x_5682 = {
.name = "acp3xalc5682m98357",
.owner = THIS_MODULE,
.dai_link = acp3x_dai_5682_98357,
.num_links = ARRAY_SIZE(acp3x_dai_5682_98357),
- .dapm_widgets = acp3x_widgets,
- .num_dapm_widgets = ARRAY_SIZE(acp3x_widgets),
- .dapm_routes = acp3x_audio_route,
- .num_dapm_routes = ARRAY_SIZE(acp3x_audio_route),
- .controls = acp3x_mc_controls,
- .num_controls = ARRAY_SIZE(acp3x_mc_controls),
+ .dapm_widgets = acp3x_5682_widgets,
+ .num_dapm_widgets = ARRAY_SIZE(acp3x_5682_widgets),
+ .dapm_routes = acp3x_5682_audio_route,
+ .num_dapm_routes = ARRAY_SIZE(acp3x_5682_audio_route),
+ .controls = acp3x_5682_mc_controls,
+ .num_controls = ARRAY_SIZE(acp3x_5682_mc_controls),
};

static int acp3x_probe(struct platform_device *pdev)
@@ -336,8 +336,8 @@ static int acp3x_probe(struct platform_device *pdev)
if (!machine)
return -ENOMEM;

- card = &acp3x_card;
- acp3x_card.dev = &pdev->dev;
+ card = &acp3x_5682;
+ acp3x_5682.dev = &pdev->dev;
platform_set_drvdata(pdev, card);
snd_soc_card_set_drvdata(card, machine);

@@ -348,11 +348,11 @@ static int acp3x_probe(struct platform_device *pdev)
return PTR_ERR(dmic_sel);
}

- ret = devm_snd_soc_register_card(&pdev->dev, &acp3x_card);
+ ret = devm_snd_soc_register_card(&pdev->dev, &acp3x_5682);
if (ret) {
dev_err(&pdev->dev,
"devm_snd_soc_register_card(%s) failed: %d\n",
- acp3x_card.name, ret);
+ acp3x_5682.name, ret);
return ret;
}
return 0;
--
2.17.1


Subject: [PATCH 2/6] ASoC: amd: Passing card structure based on codec

Passing specific snd_soc_card structure depending on the ACPI ID.
In future we can add other IDs in the ACPI table and pass the structure.

Signed-off-by: Ravulapati Vishnu vardhan rao <[email protected]>
---
sound/soc/amd/acp3x-rt5682-max9836.c | 24 +++++++++++++++++++-----
1 file changed, 19 insertions(+), 5 deletions(-)

diff --git a/sound/soc/amd/acp3x-rt5682-max9836.c b/sound/soc/amd/acp3x-rt5682-max9836.c
index 8b5af064864f..1e446e4bab25 100644
--- a/sound/soc/amd/acp3x-rt5682-max9836.c
+++ b/sound/soc/amd/acp3x-rt5682-max9836.c
@@ -326,18 +326,32 @@ static struct snd_soc_card acp3x_5682 = {
.num_controls = ARRAY_SIZE(acp3x_5682_mc_controls),
};

+void *soc_is_rltk_max(struct device *dev)
+{
+ const struct acpi_device_id *match;
+
+ match = acpi_match_device(dev->driver->acpi_match_table, dev);
+ if (!match)
+ return NULL;
+ return (void *)match->driver_data;
+}
+
static int acp3x_probe(struct platform_device *pdev)
{
int ret;
struct snd_soc_card *card;
struct acp3x_platform_info *machine;
+ struct device *dev = &pdev->dev;
+
+ card = (struct snd_soc_card *)soc_is_rltk_max(dev);
+ if (!card)
+ return -ENODEV;

machine = devm_kzalloc(&pdev->dev, sizeof(*machine), GFP_KERNEL);
if (!machine)
return -ENOMEM;

- card = &acp3x_5682;
- acp3x_5682.dev = &pdev->dev;
+ card->dev = &pdev->dev;
platform_set_drvdata(pdev, card);
snd_soc_card_set_drvdata(card, machine);

@@ -348,18 +362,18 @@ static int acp3x_probe(struct platform_device *pdev)
return PTR_ERR(dmic_sel);
}

- ret = devm_snd_soc_register_card(&pdev->dev, &acp3x_5682);
+ ret = devm_snd_soc_register_card(&pdev->dev, card);
if (ret) {
dev_err(&pdev->dev,
"devm_snd_soc_register_card(%s) failed: %d\n",
- acp3x_5682.name, ret);
+ card->name, ret);
return ret;
}
return 0;
}

static const struct acpi_device_id acp3x_audio_acpi_match[] = {
- { "AMDI5682", 0 },
+ { "AMDI5682", (unsigned long)&acp3x_5682},
{},
};
MODULE_DEVICE_TABLE(acpi, acp3x_audio_acpi_match);
--
2.17.1

Subject: [PATCH 3/6] ASoC: amd: SND_SOC_RT5682_I2C does not build rt5682

changing SND_SOC_RT5682_I2C to SND_SOC_RT5682 because,
This flag which was previously set as SND_SOC_RT5682
used to build rt5682 codec driver but by changing into
SND_SOC_RT5682_I2C is preventing to build rt5682 codec
driver and machine driver fails to probe.So Reverting the changes.

Signed-off-by: Ravulapati Vishnu vardhan rao <[email protected]>
---
sound/soc/amd/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/amd/Kconfig b/sound/soc/amd/Kconfig
index e37cf72f2bab..77ffdb41bee5 100644
--- a/sound/soc/amd/Kconfig
+++ b/sound/soc/amd/Kconfig
@@ -29,7 +29,7 @@ config SND_SOC_AMD_ACP3x

config SND_SOC_AMD_RV_RT5682_MACH
tristate "AMD RV support for RT5682"
- select SND_SOC_RT5682_I2C
+ select SND_SOC_RT5682
select SND_SOC_MAX98357A
select SND_SOC_CROS_EC_CODEC
select I2C_CROS_EC_TUNNEL
--
2.17.1

Subject: [PATCH 4/6] ASoC: amd: Adding support for ALC1015 codec in machine driver

Adding support for ALC1015 RTK codec in machine driver.
Passing specific card structure based on its ACPI ID.

Signed-off-by: Ravulapati Vishnu vardhan rao <[email protected]>
---
sound/soc/amd/Kconfig | 1 +
sound/soc/amd/acp3x-rt5682-max9836.c | 63 ++++++++++++++++++++++++++--
2 files changed, 60 insertions(+), 4 deletions(-)

diff --git a/sound/soc/amd/Kconfig b/sound/soc/amd/Kconfig
index 77ffdb41bee5..3e19995a74bc 100644
--- a/sound/soc/amd/Kconfig
+++ b/sound/soc/amd/Kconfig
@@ -30,6 +30,7 @@ config SND_SOC_AMD_ACP3x
config SND_SOC_AMD_RV_RT5682_MACH
tristate "AMD RV support for RT5682"
select SND_SOC_RT5682
+ select SND_SOC_RT1015
select SND_SOC_MAX98357A
select SND_SOC_CROS_EC_CODEC
select I2C_CROS_EC_TUNNEL
diff --git a/sound/soc/amd/acp3x-rt5682-max9836.c b/sound/soc/amd/acp3x-rt5682-max9836.c
index 1e446e4bab25..ac96ef70aafa 100644
--- a/sound/soc/amd/acp3x-rt5682-max9836.c
+++ b/sound/soc/amd/acp3x-rt5682-max9836.c
@@ -21,6 +21,7 @@

#include "raven/acp3x.h"
#include "../codecs/rt5682.h"
+#include "../codecs/rt1015.h"

#define PCO_PLAT_CLK 48000000
#define RT5682_PLL_FREQ (48000 * 512)
@@ -246,7 +247,18 @@ SND_SOC_DAILINK_DEF(cros_ec,
SND_SOC_DAILINK_DEF(platform,
DAILINK_COMP_ARRAY(COMP_PLATFORM("acp3x_rv_i2s_dma.0")));

-static struct snd_soc_dai_link acp3x_dai_5682_98357[] = {
+static struct snd_soc_codec_conf rt1015_conf[] = {
+ {
+ .dlc = COMP_CODEC_CONF("i2c-10EC1015:00"),
+ .name_prefix = "Left",
+ },
+ {
+ .dlc = COMP_CODEC_CONF("i2c-10EC1015:01"),
+ .name_prefix = "Right",
+ },
+};
+
+static struct snd_soc_dai_link acp3x_dai[] = {
{
.name = "acp3x-5682-play",
.stream_name = "Playback",
@@ -316,8 +328,8 @@ static const struct snd_kcontrol_new acp3x_5682_mc_controls[] = {
static struct snd_soc_card acp3x_5682 = {
.name = "acp3xalc5682m98357",
.owner = THIS_MODULE,
- .dai_link = acp3x_dai_5682_98357,
- .num_links = ARRAY_SIZE(acp3x_dai_5682_98357),
+ .dai_link = acp3x_dai,
+ .num_links = ARRAY_SIZE(acp3x_dai),
.dapm_widgets = acp3x_5682_widgets,
.num_dapm_widgets = ARRAY_SIZE(acp3x_5682_widgets),
.dapm_routes = acp3x_5682_audio_route,
@@ -326,6 +338,47 @@ static struct snd_soc_card acp3x_5682 = {
.num_controls = ARRAY_SIZE(acp3x_5682_mc_controls),
};

+static const struct snd_soc_dapm_widget acp3x_1015_widgets[] = {
+ SND_SOC_DAPM_HP("Headphone Jack", NULL),
+ SND_SOC_DAPM_MIC("Headset Mic", NULL),
+ SND_SOC_DAPM_MUX("Dmic Mux", SND_SOC_NOPM, 0, 0,
+ &acp3x_dmic_mux_control),
+ SND_SOC_DAPM_SPK("Left Spk", NULL),
+ SND_SOC_DAPM_SPK("Right Spk", NULL),
+};
+
+static const struct snd_soc_dapm_route acp3x_1015_route[] = {
+ {"Headphone Jack", NULL, "HPOL"},
+ {"Headphone Jack", NULL, "HPOR"},
+ {"IN1P", NULL, "Headset Mic"},
+ {"Dmic Mux", "Front Mic", "DMIC"},
+ {"Dmic Mux", "Rear Mic", "DMIC"},
+ {"Left Spk", NULL, "Left SPO"},
+ {"Right Spk", NULL, "Right SPO"},
+};
+
+static const struct snd_kcontrol_new acp3x_mc_1015_controls[] = {
+ SOC_DAPM_PIN_SWITCH("Headphone Jack"),
+ SOC_DAPM_PIN_SWITCH("Headset Mic"),
+ SOC_DAPM_PIN_SWITCH("Left Spk"),
+ SOC_DAPM_PIN_SWITCH("Right Spk"),
+};
+
+static struct snd_soc_card acp3x_1015 = {
+ .name = "acp3xalc56821015",
+ .owner = THIS_MODULE,
+ .dai_link = acp3x_dai,
+ .num_links = ARRAY_SIZE(acp3x_dai),
+ .dapm_widgets = acp3x_1015_widgets,
+ .num_dapm_widgets = ARRAY_SIZE(acp3x_1015_widgets),
+ .dapm_routes = acp3x_1015_route,
+ .num_dapm_routes = ARRAY_SIZE(acp3x_1015_route),
+ .codec_conf = rt1015_conf,
+ .num_configs = ARRAY_SIZE(rt1015_conf),
+ .controls = acp3x_mc_1015_controls,
+ .num_controls = ARRAY_SIZE(acp3x_mc_1015_controls),
+};
+
void *soc_is_rltk_max(struct device *dev)
{
const struct acpi_device_id *match;
@@ -374,6 +427,7 @@ static int acp3x_probe(struct platform_device *pdev)

static const struct acpi_device_id acp3x_audio_acpi_match[] = {
{ "AMDI5682", (unsigned long)&acp3x_5682},
+ { "AMDI1015", (unsigned long)&acp3x_1015},
{},
};
MODULE_DEVICE_TABLE(acpi, acp3x_audio_acpi_match);
@@ -390,5 +444,6 @@ static struct platform_driver acp3x_audio = {
module_platform_driver(acp3x_audio);

MODULE_AUTHOR("[email protected]");
-MODULE_DESCRIPTION("ALC5682 & MAX98357 audio support");
+MODULE_AUTHOR("[email protected]");
+MODULE_DESCRIPTION("ALC5682 ALC1015 & MAX98357 audio support");
MODULE_LICENSE("GPL v2");
--
2.17.1

Subject: [PATCH 5/6] ASoC: amd: Adding DAI LINK for rt1015 codec

DAI link support for RTK 1015 and providing the codec details
depending on the snd_soc_card selected by ACPI ID.

Signed-off-by: Ravulapati Vishnu vardhan rao <[email protected]>
---
sound/soc/amd/acp3x-rt5682-max9836.c | 35 ++++++++++++++++++++++++----
1 file changed, 30 insertions(+), 5 deletions(-)

diff --git a/sound/soc/amd/acp3x-rt5682-max9836.c b/sound/soc/amd/acp3x-rt5682-max9836.c
index ac96ef70aafa..607205cb3a98 100644
--- a/sound/soc/amd/acp3x-rt5682-max9836.c
+++ b/sound/soc/amd/acp3x-rt5682-max9836.c
@@ -32,6 +32,12 @@ static struct clk *rt5682_dai_wclk;
static struct clk *rt5682_dai_bclk;
static struct gpio_desc *dmic_sel;

+enum {
+ RT5682 = 0,
+ MAX,
+ EC,
+};
+
static int acp3x_5682_init(struct snd_soc_pcm_runtime *rtd)
{
int ret;
@@ -241,6 +247,9 @@ SND_SOC_DAILINK_DEF(rt5682,
DAILINK_COMP_ARRAY(COMP_CODEC("i2c-10EC5682:00", "rt5682-aif1")));
SND_SOC_DAILINK_DEF(max,
DAILINK_COMP_ARRAY(COMP_CODEC("MX98357A:00", "HiFi")));
+SND_SOC_DAILINK_DEF(rt1015,
+ DAILINK_COMP_ARRAY(COMP_CODEC("i2c-10EC1015:00", "rt1015-aif"),
+ COMP_CODEC("i2c-10EC1015:01", "rt1015-aif")));
SND_SOC_DAILINK_DEF(cros_ec,
DAILINK_COMP_ARRAY(COMP_CODEC("GOOG0013:00", "EC Codec I2S RX")));

@@ -259,7 +268,7 @@ static struct snd_soc_codec_conf rt1015_conf[] = {
};

static struct snd_soc_dai_link acp3x_dai[] = {
- {
+ [RT5682] = {
.name = "acp3x-5682-play",
.stream_name = "Playback",
.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
@@ -270,16 +279,19 @@ static struct snd_soc_dai_link acp3x_dai[] = {
.ops = &acp3x_5682_ops,
SND_SOC_DAILINK_REG(acp3x_i2s, rt5682, platform),
},
- {
+ [MAX] = {
.name = "acp3x-max98357-play",
.stream_name = "HiFi Playback",
.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
- | SND_SOC_DAIFMT_CBM_CFM,
+ | SND_SOC_DAIFMT_CBS_CFS,
.dpcm_playback = 1,
.ops = &acp3x_max_play_ops,
- SND_SOC_DAILINK_REG(acp3x_bt, max, platform),
+ .cpus = acp3x_bt,
+ .num_cpus = ARRAY_SIZE(acp3x_bt),
+ .platforms = platform,
+ .num_platforms = ARRAY_SIZE(platform),
},
- {
+ [EC] = {
.name = "acp3x-ec-dmic0-capture",
.stream_name = "Capture DMIC0",
.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
@@ -389,6 +401,18 @@ void *soc_is_rltk_max(struct device *dev)
return (void *)match->driver_data;
}

+static void card_spk_dai_link_present(struct snd_soc_dai_link *links,
+ const char *card_name)
+{
+ if (!strcmp(card_name, "acp3xalc56821015")) {
+ links[1].codecs = rt1015;
+ links[1].num_codecs = ARRAY_SIZE(rt1015);
+ } else {
+ links[1].codecs = max;
+ links[1].num_codecs = ARRAY_SIZE(max);
+ }
+}
+
static int acp3x_probe(struct platform_device *pdev)
{
int ret;
@@ -404,6 +428,7 @@ static int acp3x_probe(struct platform_device *pdev)
if (!machine)
return -ENOMEM;

+ card_spk_dai_link_present(card->dai_link, card->name);
card->dev = &pdev->dev;
platform_set_drvdata(pdev, card);
snd_soc_card_set_drvdata(card, machine);
--
2.17.1

Subject: [PATCH 6/6] ASoC: amd: Added hw_params support for ALC1015

Adding rt1015 hw_params which set Bit-clock ratio PLL and appropriate
sys clk specific with RTK1015.

Signed-off-by: Ravulapati Vishnu vardhan rao <[email protected]>
---
sound/soc/amd/acp3x-rt5682-max9836.c | 39 ++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)

diff --git a/sound/soc/amd/acp3x-rt5682-max9836.c b/sound/soc/amd/acp3x-rt5682-max9836.c
index 607205cb3a98..bf635ae928ae 100644
--- a/sound/soc/amd/acp3x-rt5682-max9836.c
+++ b/sound/soc/amd/acp3x-rt5682-max9836.c
@@ -126,6 +126,44 @@ static int rt5682_clk_enable(struct snd_pcm_substream *substream)
return ret;
}

+static int acp3x_1015_hw_params(struct snd_pcm_substream *substream,
+ struct snd_pcm_hw_params *params)
+{
+ struct snd_soc_pcm_runtime *rtd = substream->private_data;
+ struct snd_soc_dai *codec_dai;
+ int srate, i, ret;
+
+ ret = 0;
+ srate = params_rate(params);
+
+ for (i = 0; i < rtd->num_codecs; i++) {
+ if (strcmp(rtd->codec_dais[i]->name, "rt1015-aif"))
+ continue;
+ codec_dai = rtd->codec_dais[i];
+
+ ret = snd_soc_dai_set_bclk_ratio(codec_dai, 64);
+ if (ret < 0) {
+ dev_err(codec_dai->dev,
+ "codec_dai bclk ratio not set\n");
+ return ret;
+ }
+ ret = snd_soc_dai_set_pll(codec_dai, 0, RT1015_PLL_S_BCLK,
+ 64 * srate, 256 * srate);
+ if (ret < 0) {
+ dev_err(codec_dai->dev, "codec_dai PLL not set\n");
+ return ret;
+ }
+ ret = snd_soc_dai_set_sysclk(codec_dai, RT1015_SCLK_S_PLL,
+ 256 * srate, SND_SOC_CLOCK_IN);
+ if (ret < 0) {
+ dev_err(codec_dai->dev,
+ "codec_dai sys clock not set\n");
+ return ret;
+ }
+ }
+ return ret;
+}
+
static void rt5682_clk_disable(void)
{
clk_disable_unprepare(rt5682_dai_wclk);
@@ -231,6 +269,7 @@ static const struct snd_soc_ops acp3x_5682_ops = {
static const struct snd_soc_ops acp3x_max_play_ops = {
.startup = acp3x_max_startup,
.shutdown = rt5682_shutdown,
+ .hw_params = acp3x_1015_hw_params,
};

static const struct snd_soc_ops acp3x_ec_cap0_ops = {
--
2.17.1

2020-07-27 15:34:18

by Pierre-Louis Bossart

[permalink] [raw]
Subject: Re: [PATCH 3/6] ASoC: amd: SND_SOC_RT5682_I2C does not build rt5682



On 7/27/20 9:58 AM, Ravulapati Vishnu vardhan rao wrote:
> changing SND_SOC_RT5682_I2C to SND_SOC_RT5682 because,
> This flag which was previously set as SND_SOC_RT5682
> used to build rt5682 codec driver but by changing into
> SND_SOC_RT5682_I2C is preventing to build rt5682 codec
> driver and machine driver fails to probe.So Reverting the changes.

The split between I2C and SoundWire means you have to choose the I2C or
SDW mode. Selecting the common part looks very strange.

see Intel machine drviers:

Kconfig: select SND_SOC_RT5682_I2C
Kconfig: select SND_SOC_RT5682_I2C
Kconfig: select SND_SOC_RT5682_I2C
Kconfig: select SND_SOC_RT5682_SDW

>
> Signed-off-by: Ravulapati Vishnu vardhan rao <[email protected]>
> ---
> sound/soc/amd/Kconfig | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sound/soc/amd/Kconfig b/sound/soc/amd/Kconfig
> index e37cf72f2bab..77ffdb41bee5 100644
> --- a/sound/soc/amd/Kconfig
> +++ b/sound/soc/amd/Kconfig
> @@ -29,7 +29,7 @@ config SND_SOC_AMD_ACP3x
>
> config SND_SOC_AMD_RV_RT5682_MACH
> tristate "AMD RV support for RT5682"
> - select SND_SOC_RT5682_I2C
> + select SND_SOC_RT5682
> select SND_SOC_MAX98357A
> select SND_SOC_CROS_EC_CODEC
> select I2C_CROS_EC_TUNNEL
>

2020-07-27 18:50:02

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 3/6] ASoC: amd: SND_SOC_RT5682_I2C does not build rt5682

On Mon, Jul 27, 2020 at 10:31:24AM -0500, Pierre-Louis Bossart wrote:
> On 7/27/20 9:58 AM, Ravulapati Vishnu vardhan rao wrote:

> > changing SND_SOC_RT5682_I2C to SND_SOC_RT5682 because,
> > This flag which was previously set as SND_SOC_RT5682
> > used to build rt5682 codec driver but by changing into
> > SND_SOC_RT5682_I2C is preventing to build rt5682 codec
> > driver and machine driver fails to probe.So Reverting the changes.

> The split between I2C and SoundWire means you have to choose the I2C or SDW
> mode. Selecting the common part looks very strange.

Right, and I can't understand the commit message at all. What's the
actual issue here and how could this fix it - in what situation wouldn't
you need one of the bus modules?


Attachments:
(No filename) (759.00 B)
signature.asc (499.00 B)
Download all attachments
Subject: RE: [PATCH 3/6] ASoC: amd: SND_SOC_RT5682_I2C does not build rt5682

[AMD Official Use Only - Internal Distribution Only]

So Actually for rt5682 codec Now in 5.8 there are three flags :
SND_SOC_RT5682
SND_SOC_RT5682_I2C
SND_SOC_RT5682_SDW

But till 5.7.8 we have
SND_SOC_RT5682
SND_SOC_RT5682_SDW

So in our design we were using SND_SOC_RT5682 which build snd_soc_rt5682.ko
Creates the respective codec_dais as defined in that .ko

If we use SND_SOC_RT5682_I2C we get snd_soc_rt5682_I2c.ko , it is not creating the expected codec_dai links.

As there are three flags defined in codecs, I expect that previous one which we were using(SND_SOC_RT5682) is not a wrong flag and I expect to use
SND_SOC_RT5682 as it is still available.

Thanks,
Vishnu


-----Original Message-----
From: Mark Brown <[email protected]>
Sent: Monday, July 27, 2020 9:40 PM
To: Pierre-Louis Bossart <[email protected]>
Cc: RAVULAPATI, VISHNU VARDHAN RAO <[email protected]>; moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM... <[email protected]>; Arnd Bergmann <[email protected]>; open list <[email protected]>; YueHaibing <[email protected]>; Takashi Iwai <[email protected]>; Enric Balletbo i Serra <[email protected]>; Liam Girdwood <[email protected]>; Mukunda, Vijendar <[email protected]>; Deucher, Alexander <[email protected]>; Agrawal, Akshu <[email protected]>
Subject: Re: [PATCH 3/6] ASoC: amd: SND_SOC_RT5682_I2C does not build rt5682

On Mon, Jul 27, 2020 at 10:31:24AM -0500, Pierre-Louis Bossart wrote:
> On 7/27/20 9:58 AM, Ravulapati Vishnu vardhan rao wrote:

> > changing SND_SOC_RT5682_I2C to SND_SOC_RT5682 because, This flag
> > which was previously set as SND_SOC_RT5682 used to build rt5682
> > codec driver but by changing into SND_SOC_RT5682_I2C is preventing
> > to build rt5682 codec driver and machine driver fails to probe.So
> > Reverting the changes.

> The split between I2C and SoundWire means you have to choose the I2C
> or SDW mode. Selecting the common part looks very strange.

Right, and I can't understand the commit message at all. What's the actual issue here and how could this fix it - in what situation wouldn't you need one of the bus modules?

2020-07-28 12:15:37

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 3/6] ASoC: amd: SND_SOC_RT5682_I2C does not build rt5682

On Tue, Jul 28, 2020 at 06:59:50AM +0000, RAVULAPATI, VISHNU VARDHAN RAO wrote:

> So Actually for rt5682 codec Now in 5.8 there are three flags :
> SND_SOC_RT5682
> SND_SOC_RT5682_I2C
> SND_SOC_RT5682_SDW

> But till 5.7.8 we have
> SND_SOC_RT5682
> SND_SOC_RT5682_SDW

> So in our design we were using SND_SOC_RT5682 which build snd_soc_rt5682.ko
> Creates the respective codec_dais as defined in that .ko

> If we use SND_SOC_RT5682_I2C we get snd_soc_rt5682_I2c.ko , it is not creating the expected codec_dai links.

Could you be more specific about the way in which "it is not creating
the expected codec_dai links" please? What are you expecting to happen
and what happens instead? Do you see any error messages for example?

> As there are three flags defined in codecs, I expect that previous one which we were using(SND_SOC_RT5682) is not a wrong flag and I expect to use
> SND_SOC_RT5682 as it is still available.

Given that the core module does not register with any bus it is
difficult to see how that could possibly work - the core module doesn't
contain a driver at all. Have you tested this change?


Attachments:
(No filename) (1.12 kB)
signature.asc (499.00 B)
Download all attachments

2020-07-28 12:23:36

by Pierre-Louis Bossart

[permalink] [raw]
Subject: Re: [PATCH 3/6] ASoC: amd: SND_SOC_RT5682_I2C does not build rt5682



On 7/28/20 7:07 AM, Mark Brown wrote:
> On Tue, Jul 28, 2020 at 06:59:50AM +0000, RAVULAPATI, VISHNU VARDHAN RAO wrote:
>
>> So Actually for rt5682 codec Now in 5.8 there are three flags :
>> SND_SOC_RT5682
>> SND_SOC_RT5682_I2C
>> SND_SOC_RT5682_SDW
>
>> But till 5.7.8 we have
>> SND_SOC_RT5682
>> SND_SOC_RT5682_SDW
>
>> So in our design we were using SND_SOC_RT5682 which build snd_soc_rt5682.ko
>> Creates the respective codec_dais as defined in that .ko
>
>> If we use SND_SOC_RT5682_I2C we get snd_soc_rt5682_I2c.ko , it is not creating the expected codec_dai links.
>
> Could you be more specific about the way in which "it is not creating
> the expected codec_dai links" please? What are you expecting to happen
> and what happens instead? Do you see any error messages for example?
>
>> As there are three flags defined in codecs, I expect that previous one which we were using(SND_SOC_RT5682) is not a wrong flag and I expect to use
>> SND_SOC_RT5682 as it is still available.
>
> Given that the core module does not register with any bus it is
> difficult to see how that could possibly work - the core module doesn't
> contain a driver at all. Have you tested this change?

I share Mark's point. Have you tested this change on top of Mark's tree,
or only on top of the stable kernel?

Subject: RE: [PATCH 3/6] ASoC: amd: SND_SOC_RT5682_I2C does not build rt5682

[AMD Official Use Only - Internal Distribution Only]

-----Original Message-----
From: Pierre-Louis Bossart <[email protected]>
Sent: Tuesday, July 28, 2020 5:48 PM
To: Mark Brown <[email protected]>; RAVULAPATI, VISHNU VARDHAN RAO <[email protected]>
Cc: moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM... <[email protected]>; Arnd Bergmann <[email protected]>; Liam Girdwood <[email protected]>; open list <[email protected]>; YueHaibing <[email protected]>; Takashi Iwai <[email protected]>; Deucher, Alexander <[email protected]>; Mukunda, Vijendar <[email protected]>; Enric Balletbo i Serra <[email protected]>; Agrawal, Akshu <[email protected]>
Subject: Re: [PATCH 3/6] ASoC: amd: SND_SOC_RT5682_I2C does not build rt5682



On 7/28/20 7:07 AM, Mark Brown wrote:
> On Tue, Jul 28, 2020 at 06:59:50AM +0000, RAVULAPATI, VISHNU VARDHAN RAO wrote:
>
>> So Actually for rt5682 codec Now in 5.8 there are three flags :
>> SND_SOC_RT5682
>> SND_SOC_RT5682_I2C
>> SND_SOC_RT5682_SDW
>
>> But till 5.7.8 we have
>> SND_SOC_RT5682
>> SND_SOC_RT5682_SDW
>
>> So in our design we were using SND_SOC_RT5682 which build
>> snd_soc_rt5682.ko Creates the respective codec_dais as defined in
>> that .ko
>
>> If we use SND_SOC_RT5682_I2C we get snd_soc_rt5682_I2c.ko , it is not creating the expected codec_dai links.
>
> Could you be more specific about the way in which "it is not creating
> the expected codec_dai links" please? What are you expecting to
> happen and what happens instead? Do you see any error messages for example?
>
>> As there are three flags defined in codecs, I expect that previous
>> one which we were using(SND_SOC_RT5682) is not a wrong flag and I
>> expect to use
>> SND_SOC_RT5682 as it is still available.
>
> Given that the core module does not register with any bus it is
> difficult to see how that could possibly work - the core module
> doesn't contain a driver at all. Have you tested this change?

I share Mark's point. Have you tested this change on top of Mark's tree, or only on top of the stable kernel?
Ok. I will drop that patch and send the other series.

Thanks,

2020-07-28 15:37:42

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 3/6] ASoC: amd: SND_SOC_RT5682_I2C does not build rt5682

On Tue, Jul 28, 2020 at 03:24:42PM +0000, RAVULAPATI, VISHNU VARDHAN RAO wrote:
> [AMD Official Use Only - Internal Distribution Only]
>
> -----Original Message-----
> From: Pierre-Louis Bossart <[email protected]>
> Sent: Tuesday, July 28, 2020 5:48 PM

I'm not seeing any new text in here?

> To: Mark Brown <[email protected]>; RAVULAPATI, VISHNU VARDHAN RAO <[email protected]>
> Cc: moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM... <[email protected]>; Arnd Bergmann <[email protected]>; Liam Girdwood <[email protected]>; open list <[email protected]>; YueHaibing <[email protected]>; Takashi Iwai <[email protected]>; Deucher, Alexander <[email protected]>; Mukunda, Vijendar <[email protected]>; Enric Balletbo i Serra <[email protected]>; Agrawal, Akshu <[email protected]>
> Subject: Re: [PATCH 3/6] ASoC: amd: SND_SOC_RT5682_I2C does not build rt5682
>
>
>
> On 7/28/20 7:07 AM, Mark Brown wrote:
> > On Tue, Jul 28, 2020 at 06:59:50AM +0000, RAVULAPATI, VISHNU VARDHAN RAO wrote:
> >
> >> So Actually for rt5682 codec Now in 5.8 there are three flags :
> >> SND_SOC_RT5682
> >> SND_SOC_RT5682_I2C
> >> SND_SOC_RT5682_SDW
> >
> >> But till 5.7.8 we have
> >> SND_SOC_RT5682
> >> SND_SOC_RT5682_SDW
> >
> >> So in our design we were using SND_SOC_RT5682 which build
> >> snd_soc_rt5682.ko Creates the respective codec_dais as defined in
> >> that .ko
> >
> >> If we use SND_SOC_RT5682_I2C we get snd_soc_rt5682_I2c.ko , it is not creating the expected codec_dai links.
> >
> > Could you be more specific about the way in which "it is not creating
> > the expected codec_dai links" please? What are you expecting to
> > happen and what happens instead? Do you see any error messages for example?
> >
> >> As there are three flags defined in codecs, I expect that previous
> >> one which we were using(SND_SOC_RT5682) is not a wrong flag and I
> >> expect to use
> >> SND_SOC_RT5682 as it is still available.
> >
> > Given that the core module does not register with any bus it is
> > difficult to see how that could possibly work - the core module
> > doesn't contain a driver at all. Have you tested this change?
>
> I share Mark's point. Have you tested this change on top of Mark's tree, or only on top of the stable kernel?
> Ok. I will drop that patch and send the other series.
>
> Thanks,
>


Attachments:
(No filename) (2.42 kB)
signature.asc (499.00 B)
Download all attachments
Subject: RE: [PATCH 3/6] ASoC: amd: SND_SOC_RT5682_I2C does not build rt5682

I will drop this patch series and will send new series.

Thanks,

-----Original Message-----
From: Mark Brown <[email protected]>
Sent: Tuesday, July 28, 2020 9:06 PM
To: RAVULAPATI, VISHNU VARDHAN RAO <[email protected]>
Cc: Pierre-Louis Bossart <[email protected]>; moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM... <[email protected]>; Arnd Bergmann <[email protected]>; Liam Girdwood <[email protected]>; open list <[email protected]>; YueHaibing <[email protected]>; Takashi Iwai <[email protected]>; Deucher, Alexander <[email protected]>; Mukunda, Vijendar <[email protected]>; Enric Balletbo i Serra <[email protected]>; Agrawal, Akshu <[email protected]>
Subject: Re: [PATCH 3/6] ASoC: amd: SND_SOC_RT5682_I2C does not build rt5682

On Tue, Jul 28, 2020 at 03:24:42PM +0000, RAVULAPATI, VISHNU VARDHAN RAO wrote:
> [AMD Official Use Only - Internal Distribution Only]
>
> -----Original Message-----
> From: Pierre-Louis Bossart <[email protected]>
> Sent: Tuesday, July 28, 2020 5:48 PM

I'm not seeing any new text in here?

> To: Mark Brown <[email protected]>; RAVULAPATI, VISHNU VARDHAN RAO
> <[email protected]>
> Cc: moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM...
> <[email protected]>; Arnd Bergmann <[email protected]>; Liam
> Girdwood <[email protected]>; open list
> <[email protected]>; YueHaibing <[email protected]>;
> Takashi Iwai <[email protected]>; Deucher, Alexander
> <[email protected]>; Mukunda, Vijendar
> <[email protected]>; Enric Balletbo i Serra
> <[email protected]>; Agrawal, Akshu <[email protected]>
> Subject: Re: [PATCH 3/6] ASoC: amd: SND_SOC_RT5682_I2C does not build
> rt5682
>
>
>
> On 7/28/20 7:07 AM, Mark Brown wrote:
> > On Tue, Jul 28, 2020 at 06:59:50AM +0000, RAVULAPATI, VISHNU VARDHAN RAO wrote:
> >
> >> So Actually for rt5682 codec Now in 5.8 there are three flags :
> >> SND_SOC_RT5682
> >> SND_SOC_RT5682_I2C
> >> SND_SOC_RT5682_SDW
> >
> >> But till 5.7.8 we have
> >> SND_SOC_RT5682
> >> SND_SOC_RT5682_SDW
> >
> >> So in our design we were using SND_SOC_RT5682 which build
> >> snd_soc_rt5682.ko Creates the respective codec_dais as defined in
> >> that .ko
> >
> >> If we use SND_SOC_RT5682_I2C we get snd_soc_rt5682_I2c.ko , it is not creating the expected codec_dai links.
> >
> > Could you be more specific about the way in which "it is not
> > creating the expected codec_dai links" please? What are you
> > expecting to happen and what happens instead? Do you see any error messages for example?
> >
> >> As there are three flags defined in codecs, I expect that previous
> >> one which we were using(SND_SOC_RT5682) is not a wrong flag and I
> >> expect to use
> >> SND_SOC_RT5682 as it is still available.
> >
> > Given that the core module does not register with any bus it is
> > difficult to see how that could possibly work - the core module
> > doesn't contain a driver at all. Have you tested this change?
>
> I share Mark's point. Have you tested this change on top of Mark's tree, or only on top of the stable kernel?
> Ok. I will drop that patch and send the other series.
>
> Thanks,
>