All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: da7219: read fmw property to get mclk for non-dts systems
@ 2018-04-30  7:01 ` Akshu Agrawal
  0 siblings, 0 replies; 15+ messages in thread
From: Akshu Agrawal @ 2018-04-30  7:01 UTC (permalink / raw)
  Cc: djkurtz, akshu.agrawal, Alexander.Deucher,
	Adam.Thomson.Opensource, Support Opensource, Jaroslav Kysela,
	Takashi Iwai, Liam Girdwood, Mark Brown, moderated list:SOUND,
	open list

Non-dts based systems can use ACPI DSDT to pass on the mclk
to da7219.
This enables da7219 mclk to be linked to system clock.
Enable/Disable of the mclk is already handled in the codec so
platform drivers don't have to explicitly do handling of mclk.

Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
---
 include/sound/da7219.h    | 2 ++
 sound/soc/codecs/da7219.c | 7 ++++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/include/sound/da7219.h b/include/sound/da7219.h
index 1bfcb16..df7ddf4 100644
--- a/include/sound/da7219.h
+++ b/include/sound/da7219.h
@@ -38,6 +38,8 @@ struct da7219_pdata {
 
 	const char *dai_clks_name;
 
+	const char *mclk_name;
+
 	/* Mic */
 	enum da7219_micbias_voltage micbias_lvl;
 	enum da7219_mic_amp_in_sel mic_amp_in_sel;
diff --git a/sound/soc/codecs/da7219.c b/sound/soc/codecs/da7219.c
index 980a6a8..47ffb35 100644
--- a/sound/soc/codecs/da7219.c
+++ b/sound/soc/codecs/da7219.c
@@ -1624,6 +1624,8 @@ static struct da7219_pdata *da7219_fw_to_pdata(struct snd_soc_component *compone
 		dev_warn(dev, "Using default clk name: %s\n",
 			 pdata->dai_clks_name);
 
+	device_property_read_string(dev, "dlg,mclk-name", &pdata->mclk_name);
+
 	if (device_property_read_u32(dev, "dlg,micbias-lvl", &of_val32) >= 0)
 		pdata->micbias_lvl = da7219_fw_micbias_lvl(dev, of_val32);
 	else
@@ -1905,7 +1907,10 @@ static int da7219_probe(struct snd_soc_component *component)
 	da7219_handle_pdata(component);
 
 	/* Check if MCLK provided */
-	da7219->mclk = devm_clk_get(component->dev, "mclk");
+	if (da7219->pdata->mclk_name)
+		da7219->mclk = clk_get(NULL, da7219->pdata->mclk_name);
+	if (!da7219->mclk)
+		da7219->mclk = devm_clk_get(codec->dev, "mclk");
 	if (IS_ERR(da7219->mclk)) {
 		if (PTR_ERR(da7219->mclk) != -ENOENT) {
 			ret = PTR_ERR(da7219->mclk);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH] ASoC: da7219: read fmw property to get mclk for non-dts systems
@ 2018-04-30  7:01 ` Akshu Agrawal
  0 siblings, 0 replies; 15+ messages in thread
From: Akshu Agrawal @ 2018-04-30  7:01 UTC (permalink / raw)
  Cc: moderated list:SOUND, Support Opensource, Liam Girdwood,
	open list, Takashi Iwai, djkurtz, Mark Brown, Alexander.Deucher,
	Adam.Thomson.Opensource, akshu.agrawal

Non-dts based systems can use ACPI DSDT to pass on the mclk
to da7219.
This enables da7219 mclk to be linked to system clock.
Enable/Disable of the mclk is already handled in the codec so
platform drivers don't have to explicitly do handling of mclk.

Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
---
 include/sound/da7219.h    | 2 ++
 sound/soc/codecs/da7219.c | 7 ++++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/include/sound/da7219.h b/include/sound/da7219.h
index 1bfcb16..df7ddf4 100644
--- a/include/sound/da7219.h
+++ b/include/sound/da7219.h
@@ -38,6 +38,8 @@ struct da7219_pdata {
 
 	const char *dai_clks_name;
 
+	const char *mclk_name;
+
 	/* Mic */
 	enum da7219_micbias_voltage micbias_lvl;
 	enum da7219_mic_amp_in_sel mic_amp_in_sel;
diff --git a/sound/soc/codecs/da7219.c b/sound/soc/codecs/da7219.c
index 980a6a8..47ffb35 100644
--- a/sound/soc/codecs/da7219.c
+++ b/sound/soc/codecs/da7219.c
@@ -1624,6 +1624,8 @@ static struct da7219_pdata *da7219_fw_to_pdata(struct snd_soc_component *compone
 		dev_warn(dev, "Using default clk name: %s\n",
 			 pdata->dai_clks_name);
 
+	device_property_read_string(dev, "dlg,mclk-name", &pdata->mclk_name);
+
 	if (device_property_read_u32(dev, "dlg,micbias-lvl", &of_val32) >= 0)
 		pdata->micbias_lvl = da7219_fw_micbias_lvl(dev, of_val32);
 	else
@@ -1905,7 +1907,10 @@ static int da7219_probe(struct snd_soc_component *component)
 	da7219_handle_pdata(component);
 
 	/* Check if MCLK provided */
-	da7219->mclk = devm_clk_get(component->dev, "mclk");
+	if (da7219->pdata->mclk_name)
+		da7219->mclk = clk_get(NULL, da7219->pdata->mclk_name);
+	if (!da7219->mclk)
+		da7219->mclk = devm_clk_get(codec->dev, "mclk");
 	if (IS_ERR(da7219->mclk)) {
 		if (PTR_ERR(da7219->mclk) != -ENOENT) {
 			ret = PTR_ERR(da7219->mclk);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH] ASoC: da7219: read fmw property to get mclk for non-dts systems
  2018-04-30  7:01 ` Akshu Agrawal
@ 2018-04-30  7:01   ` Akshu Agrawal
  -1 siblings, 0 replies; 15+ messages in thread
From: Akshu Agrawal @ 2018-04-30  7:01 UTC (permalink / raw)
  Cc: djkurtz, akshu.agrawal, Alexander.Deucher,
	Adam.Thomson.Opensource, Support Opensource, Jaroslav Kysela,
	Takashi Iwai, Liam Girdwood, Mark Brown, moderated list:SOUND,
	open list

Non-dts based systems can use ACPI DSDT to pass on the mclk
to da7219.
This enables da7219 mclk to be linked to system clock.
Enable/Disable of the mclk is already handled in the codec so
platform drivers don't have to explicitly do handling of mclk.

Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
---
 include/sound/da7219.h    | 2 ++
 sound/soc/codecs/da7219.c | 7 ++++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/include/sound/da7219.h b/include/sound/da7219.h
index 1bfcb16..df7ddf4 100644
--- a/include/sound/da7219.h
+++ b/include/sound/da7219.h
@@ -38,6 +38,8 @@ struct da7219_pdata {
 
 	const char *dai_clks_name;
 
+	const char *mclk_name;
+
 	/* Mic */
 	enum da7219_micbias_voltage micbias_lvl;
 	enum da7219_mic_amp_in_sel mic_amp_in_sel;
diff --git a/sound/soc/codecs/da7219.c b/sound/soc/codecs/da7219.c
index 980a6a8..47ffb35 100644
--- a/sound/soc/codecs/da7219.c
+++ b/sound/soc/codecs/da7219.c
@@ -1624,6 +1624,8 @@ static struct da7219_pdata *da7219_fw_to_pdata(struct snd_soc_component *compone
 		dev_warn(dev, "Using default clk name: %s\n",
 			 pdata->dai_clks_name);
 
+	device_property_read_string(dev, "dlg,mclk-name", &pdata->mclk_name);
+
 	if (device_property_read_u32(dev, "dlg,micbias-lvl", &of_val32) >= 0)
 		pdata->micbias_lvl = da7219_fw_micbias_lvl(dev, of_val32);
 	else
@@ -1905,7 +1907,10 @@ static int da7219_probe(struct snd_soc_component *component)
 	da7219_handle_pdata(component);
 
 	/* Check if MCLK provided */
-	da7219->mclk = devm_clk_get(component->dev, "mclk");
+	if (da7219->pdata->mclk_name)
+		da7219->mclk = clk_get(NULL, da7219->pdata->mclk_name);
+	if (!da7219->mclk)
+		da7219->mclk = devm_clk_get(codec->dev, "mclk");
 	if (IS_ERR(da7219->mclk)) {
 		if (PTR_ERR(da7219->mclk) != -ENOENT) {
 			ret = PTR_ERR(da7219->mclk);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH] ASoC: da7219: read fmw property to get mclk for non-dts systems
@ 2018-04-30  7:01   ` Akshu Agrawal
  0 siblings, 0 replies; 15+ messages in thread
From: Akshu Agrawal @ 2018-04-30  7:01 UTC (permalink / raw)
  Cc: moderated list:SOUND, Support Opensource, Liam Girdwood,
	open list, Takashi Iwai, djkurtz, Mark Brown, Alexander.Deucher,
	Adam.Thomson.Opensource, akshu.agrawal

Non-dts based systems can use ACPI DSDT to pass on the mclk
to da7219.
This enables da7219 mclk to be linked to system clock.
Enable/Disable of the mclk is already handled in the codec so
platform drivers don't have to explicitly do handling of mclk.

Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
---
 include/sound/da7219.h    | 2 ++
 sound/soc/codecs/da7219.c | 7 ++++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/include/sound/da7219.h b/include/sound/da7219.h
index 1bfcb16..df7ddf4 100644
--- a/include/sound/da7219.h
+++ b/include/sound/da7219.h
@@ -38,6 +38,8 @@ struct da7219_pdata {
 
 	const char *dai_clks_name;
 
+	const char *mclk_name;
+
 	/* Mic */
 	enum da7219_micbias_voltage micbias_lvl;
 	enum da7219_mic_amp_in_sel mic_amp_in_sel;
diff --git a/sound/soc/codecs/da7219.c b/sound/soc/codecs/da7219.c
index 980a6a8..47ffb35 100644
--- a/sound/soc/codecs/da7219.c
+++ b/sound/soc/codecs/da7219.c
@@ -1624,6 +1624,8 @@ static struct da7219_pdata *da7219_fw_to_pdata(struct snd_soc_component *compone
 		dev_warn(dev, "Using default clk name: %s\n",
 			 pdata->dai_clks_name);
 
+	device_property_read_string(dev, "dlg,mclk-name", &pdata->mclk_name);
+
 	if (device_property_read_u32(dev, "dlg,micbias-lvl", &of_val32) >= 0)
 		pdata->micbias_lvl = da7219_fw_micbias_lvl(dev, of_val32);
 	else
@@ -1905,7 +1907,10 @@ static int da7219_probe(struct snd_soc_component *component)
 	da7219_handle_pdata(component);
 
 	/* Check if MCLK provided */
-	da7219->mclk = devm_clk_get(component->dev, "mclk");
+	if (da7219->pdata->mclk_name)
+		da7219->mclk = clk_get(NULL, da7219->pdata->mclk_name);
+	if (!da7219->mclk)
+		da7219->mclk = devm_clk_get(codec->dev, "mclk");
 	if (IS_ERR(da7219->mclk)) {
 		if (PTR_ERR(da7219->mclk) != -ENOENT) {
 			ret = PTR_ERR(da7219->mclk);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [alsa-devel] [PATCH] ASoC: da7219: read fmw property to get mclk for non-dts systems
  2018-04-30  7:01   ` Akshu Agrawal
@ 2018-04-30  8:57     ` kbuild test robot
  -1 siblings, 0 replies; 15+ messages in thread
From: kbuild test robot @ 2018-04-30  8:57 UTC (permalink / raw)
  To: Akshu Agrawal
  Cc: kbuild-all, moderated list:SOUND, Support Opensource,
	Liam Girdwood, open list, Takashi Iwai, djkurtz, Mark Brown,
	Alexander.Deucher, Adam.Thomson.Opensource, akshu.agrawal

[-- Attachment #1: Type: text/plain, Size: 5054 bytes --]

Hi Akshu,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on asoc/for-next]
[also build test ERROR on v4.17-rc3 next-20180426]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Akshu-Agrawal/ASoC-da7219-read-fmw-property-to-get-mclk-for-non-dts-systems/20180430-151717
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
config: x86_64-randconfig-s1-04301236 (attached as .config)
compiler: gcc-6 (Debian 6.4.0-9) 6.4.0 20171026
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

   sound/soc//codecs/da7219.c: In function 'da7219_probe':
>> sound/soc//codecs/da7219.c:1913:31: error: 'codec' undeclared (first use in this function)
      da7219->mclk = devm_clk_get(codec->dev, "mclk");
                                  ^~~~~
   sound/soc//codecs/da7219.c:1913:31: note: each undeclared identifier is reported only once for each function it appears in

vim +/codec +1913 sound/soc//codecs/da7219.c

  1867	
  1868	static int da7219_probe(struct snd_soc_component *component)
  1869	{
  1870		struct da7219_priv *da7219 = snd_soc_component_get_drvdata(component);
  1871		unsigned int rev;
  1872		int ret;
  1873	
  1874		mutex_init(&da7219->ctrl_lock);
  1875		mutex_init(&da7219->pll_lock);
  1876	
  1877		/* Regulator configuration */
  1878		ret = da7219_handle_supplies(component);
  1879		if (ret)
  1880			return ret;
  1881	
  1882		ret = regmap_read(da7219->regmap, DA7219_CHIP_REVISION, &rev);
  1883		if (ret) {
  1884			dev_err(component->dev, "Failed to read chip revision: %d\n", ret);
  1885			goto err_disable_reg;
  1886		}
  1887	
  1888		switch (rev & DA7219_CHIP_MINOR_MASK) {
  1889		case 0:
  1890			ret = regmap_register_patch(da7219->regmap, da7219_rev_aa_patch,
  1891						    ARRAY_SIZE(da7219_rev_aa_patch));
  1892			if (ret) {
  1893				dev_err(component->dev, "Failed to register AA patch: %d\n",
  1894					ret);
  1895				goto err_disable_reg;
  1896			}
  1897			break;
  1898		default:
  1899			break;
  1900		}
  1901	
  1902		/* Handle DT/ACPI/Platform data */
  1903		da7219->pdata = dev_get_platdata(component->dev);
  1904		if (!da7219->pdata)
  1905			da7219->pdata = da7219_fw_to_pdata(component);
  1906	
  1907		da7219_handle_pdata(component);
  1908	
  1909		/* Check if MCLK provided */
  1910		if (da7219->pdata->mclk_name)
  1911			da7219->mclk = clk_get(NULL, da7219->pdata->mclk_name);
  1912		if (!da7219->mclk)
> 1913			da7219->mclk = devm_clk_get(codec->dev, "mclk");
  1914		if (IS_ERR(da7219->mclk)) {
  1915			if (PTR_ERR(da7219->mclk) != -ENOENT) {
  1916				ret = PTR_ERR(da7219->mclk);
  1917				goto err_disable_reg;
  1918			} else {
  1919				da7219->mclk = NULL;
  1920			}
  1921		}
  1922	
  1923		/* Default PC counter to free-running */
  1924		snd_soc_component_update_bits(component, DA7219_PC_COUNT, DA7219_PC_FREERUN_MASK,
  1925				    DA7219_PC_FREERUN_MASK);
  1926	
  1927		/* Default gain ramping */
  1928		snd_soc_component_update_bits(component, DA7219_MIXIN_L_CTRL,
  1929				    DA7219_MIXIN_L_AMP_RAMP_EN_MASK,
  1930				    DA7219_MIXIN_L_AMP_RAMP_EN_MASK);
  1931		snd_soc_component_update_bits(component, DA7219_ADC_L_CTRL, DA7219_ADC_L_RAMP_EN_MASK,
  1932				    DA7219_ADC_L_RAMP_EN_MASK);
  1933		snd_soc_component_update_bits(component, DA7219_DAC_L_CTRL, DA7219_DAC_L_RAMP_EN_MASK,
  1934				    DA7219_DAC_L_RAMP_EN_MASK);
  1935		snd_soc_component_update_bits(component, DA7219_DAC_R_CTRL, DA7219_DAC_R_RAMP_EN_MASK,
  1936				    DA7219_DAC_R_RAMP_EN_MASK);
  1937		snd_soc_component_update_bits(component, DA7219_HP_L_CTRL,
  1938				    DA7219_HP_L_AMP_RAMP_EN_MASK,
  1939				    DA7219_HP_L_AMP_RAMP_EN_MASK);
  1940		snd_soc_component_update_bits(component, DA7219_HP_R_CTRL,
  1941				    DA7219_HP_R_AMP_RAMP_EN_MASK,
  1942				    DA7219_HP_R_AMP_RAMP_EN_MASK);
  1943	
  1944		/* Default minimum gain on HP to avoid pops during DAPM sequencing */
  1945		snd_soc_component_update_bits(component, DA7219_HP_L_CTRL,
  1946				    DA7219_HP_L_AMP_MIN_GAIN_EN_MASK,
  1947				    DA7219_HP_L_AMP_MIN_GAIN_EN_MASK);
  1948		snd_soc_component_update_bits(component, DA7219_HP_R_CTRL,
  1949				    DA7219_HP_R_AMP_MIN_GAIN_EN_MASK,
  1950				    DA7219_HP_R_AMP_MIN_GAIN_EN_MASK);
  1951	
  1952		/* Default infinite tone gen, start/stop by Kcontrol */
  1953		snd_soc_component_write(component, DA7219_TONE_GEN_CYCLES, DA7219_BEEP_CYCLES_MASK);
  1954	
  1955		/* Initialise AAD block */
  1956		ret = da7219_aad_init(component);
  1957		if (ret)
  1958			goto err_disable_reg;
  1959	
  1960		return 0;
  1961	
  1962	err_disable_reg:
  1963		regulator_bulk_disable(DA7219_NUM_SUPPLIES, da7219->supplies);
  1964	
  1965		return ret;
  1966	}
  1967	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 31719 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [alsa-devel] [PATCH] ASoC: da7219: read fmw property to get mclk for non-dts systems
@ 2018-04-30  8:57     ` kbuild test robot
  0 siblings, 0 replies; 15+ messages in thread
From: kbuild test robot @ 2018-04-30  8:57 UTC (permalink / raw)
  Cc: kbuild-all, moderated list:SOUND, Support Opensource,
	Liam Girdwood, open list, Takashi Iwai, djkurtz, Mark Brown,
	Alexander.Deucher, Adam.Thomson.Opensource, akshu.agrawal

[-- Attachment #1: Type: text/plain, Size: 5054 bytes --]

Hi Akshu,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on asoc/for-next]
[also build test ERROR on v4.17-rc3 next-20180426]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Akshu-Agrawal/ASoC-da7219-read-fmw-property-to-get-mclk-for-non-dts-systems/20180430-151717
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
config: x86_64-randconfig-s1-04301236 (attached as .config)
compiler: gcc-6 (Debian 6.4.0-9) 6.4.0 20171026
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

   sound/soc//codecs/da7219.c: In function 'da7219_probe':
>> sound/soc//codecs/da7219.c:1913:31: error: 'codec' undeclared (first use in this function)
      da7219->mclk = devm_clk_get(codec->dev, "mclk");
                                  ^~~~~
   sound/soc//codecs/da7219.c:1913:31: note: each undeclared identifier is reported only once for each function it appears in

vim +/codec +1913 sound/soc//codecs/da7219.c

  1867	
  1868	static int da7219_probe(struct snd_soc_component *component)
  1869	{
  1870		struct da7219_priv *da7219 = snd_soc_component_get_drvdata(component);
  1871		unsigned int rev;
  1872		int ret;
  1873	
  1874		mutex_init(&da7219->ctrl_lock);
  1875		mutex_init(&da7219->pll_lock);
  1876	
  1877		/* Regulator configuration */
  1878		ret = da7219_handle_supplies(component);
  1879		if (ret)
  1880			return ret;
  1881	
  1882		ret = regmap_read(da7219->regmap, DA7219_CHIP_REVISION, &rev);
  1883		if (ret) {
  1884			dev_err(component->dev, "Failed to read chip revision: %d\n", ret);
  1885			goto err_disable_reg;
  1886		}
  1887	
  1888		switch (rev & DA7219_CHIP_MINOR_MASK) {
  1889		case 0:
  1890			ret = regmap_register_patch(da7219->regmap, da7219_rev_aa_patch,
  1891						    ARRAY_SIZE(da7219_rev_aa_patch));
  1892			if (ret) {
  1893				dev_err(component->dev, "Failed to register AA patch: %d\n",
  1894					ret);
  1895				goto err_disable_reg;
  1896			}
  1897			break;
  1898		default:
  1899			break;
  1900		}
  1901	
  1902		/* Handle DT/ACPI/Platform data */
  1903		da7219->pdata = dev_get_platdata(component->dev);
  1904		if (!da7219->pdata)
  1905			da7219->pdata = da7219_fw_to_pdata(component);
  1906	
  1907		da7219_handle_pdata(component);
  1908	
  1909		/* Check if MCLK provided */
  1910		if (da7219->pdata->mclk_name)
  1911			da7219->mclk = clk_get(NULL, da7219->pdata->mclk_name);
  1912		if (!da7219->mclk)
> 1913			da7219->mclk = devm_clk_get(codec->dev, "mclk");
  1914		if (IS_ERR(da7219->mclk)) {
  1915			if (PTR_ERR(da7219->mclk) != -ENOENT) {
  1916				ret = PTR_ERR(da7219->mclk);
  1917				goto err_disable_reg;
  1918			} else {
  1919				da7219->mclk = NULL;
  1920			}
  1921		}
  1922	
  1923		/* Default PC counter to free-running */
  1924		snd_soc_component_update_bits(component, DA7219_PC_COUNT, DA7219_PC_FREERUN_MASK,
  1925				    DA7219_PC_FREERUN_MASK);
  1926	
  1927		/* Default gain ramping */
  1928		snd_soc_component_update_bits(component, DA7219_MIXIN_L_CTRL,
  1929				    DA7219_MIXIN_L_AMP_RAMP_EN_MASK,
  1930				    DA7219_MIXIN_L_AMP_RAMP_EN_MASK);
  1931		snd_soc_component_update_bits(component, DA7219_ADC_L_CTRL, DA7219_ADC_L_RAMP_EN_MASK,
  1932				    DA7219_ADC_L_RAMP_EN_MASK);
  1933		snd_soc_component_update_bits(component, DA7219_DAC_L_CTRL, DA7219_DAC_L_RAMP_EN_MASK,
  1934				    DA7219_DAC_L_RAMP_EN_MASK);
  1935		snd_soc_component_update_bits(component, DA7219_DAC_R_CTRL, DA7219_DAC_R_RAMP_EN_MASK,
  1936				    DA7219_DAC_R_RAMP_EN_MASK);
  1937		snd_soc_component_update_bits(component, DA7219_HP_L_CTRL,
  1938				    DA7219_HP_L_AMP_RAMP_EN_MASK,
  1939				    DA7219_HP_L_AMP_RAMP_EN_MASK);
  1940		snd_soc_component_update_bits(component, DA7219_HP_R_CTRL,
  1941				    DA7219_HP_R_AMP_RAMP_EN_MASK,
  1942				    DA7219_HP_R_AMP_RAMP_EN_MASK);
  1943	
  1944		/* Default minimum gain on HP to avoid pops during DAPM sequencing */
  1945		snd_soc_component_update_bits(component, DA7219_HP_L_CTRL,
  1946				    DA7219_HP_L_AMP_MIN_GAIN_EN_MASK,
  1947				    DA7219_HP_L_AMP_MIN_GAIN_EN_MASK);
  1948		snd_soc_component_update_bits(component, DA7219_HP_R_CTRL,
  1949				    DA7219_HP_R_AMP_MIN_GAIN_EN_MASK,
  1950				    DA7219_HP_R_AMP_MIN_GAIN_EN_MASK);
  1951	
  1952		/* Default infinite tone gen, start/stop by Kcontrol */
  1953		snd_soc_component_write(component, DA7219_TONE_GEN_CYCLES, DA7219_BEEP_CYCLES_MASK);
  1954	
  1955		/* Initialise AAD block */
  1956		ret = da7219_aad_init(component);
  1957		if (ret)
  1958			goto err_disable_reg;
  1959	
  1960		return 0;
  1961	
  1962	err_disable_reg:
  1963		regulator_bulk_disable(DA7219_NUM_SUPPLIES, da7219->supplies);
  1964	
  1965		return ret;
  1966	}
  1967	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 31719 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [alsa-devel] [PATCH] ASoC: da7219: read fmw property to get mclk for non-dts systems
  2018-04-30  7:01 ` Akshu Agrawal
@ 2018-04-30  9:28   ` kbuild test robot
  -1 siblings, 0 replies; 15+ messages in thread
From: kbuild test robot @ 2018-04-30  9:28 UTC (permalink / raw)
  To: Akshu Agrawal
  Cc: kbuild-all, moderated list:SOUND, Support Opensource,
	Liam Girdwood, open list, Takashi Iwai, djkurtz, Mark Brown,
	Alexander.Deucher, Adam.Thomson.Opensource, akshu.agrawal

[-- Attachment #1: Type: text/plain, Size: 5091 bytes --]

Hi Akshu,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on asoc/for-next]
[also build test ERROR on v4.17-rc3 next-20180426]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Akshu-Agrawal/ASoC-da7219-read-fmw-property-to-get-mclk-for-non-dts-systems/20180430-150614
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
config: i386-randconfig-x015-201817 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-16) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

   sound/soc/codecs/da7219.c: In function 'da7219_probe':
>> sound/soc/codecs/da7219.c:1913:31: error: 'codec' undeclared (first use in this function); did you mean 'node'?
      da7219->mclk = devm_clk_get(codec->dev, "mclk");
                                  ^~~~~
                                  node
   sound/soc/codecs/da7219.c:1913:31: note: each undeclared identifier is reported only once for each function it appears in

vim +1913 sound/soc/codecs/da7219.c

  1867	
  1868	static int da7219_probe(struct snd_soc_component *component)
  1869	{
  1870		struct da7219_priv *da7219 = snd_soc_component_get_drvdata(component);
  1871		unsigned int rev;
  1872		int ret;
  1873	
  1874		mutex_init(&da7219->ctrl_lock);
  1875		mutex_init(&da7219->pll_lock);
  1876	
  1877		/* Regulator configuration */
  1878		ret = da7219_handle_supplies(component);
  1879		if (ret)
  1880			return ret;
  1881	
  1882		ret = regmap_read(da7219->regmap, DA7219_CHIP_REVISION, &rev);
  1883		if (ret) {
  1884			dev_err(component->dev, "Failed to read chip revision: %d\n", ret);
  1885			goto err_disable_reg;
  1886		}
  1887	
  1888		switch (rev & DA7219_CHIP_MINOR_MASK) {
  1889		case 0:
  1890			ret = regmap_register_patch(da7219->regmap, da7219_rev_aa_patch,
  1891						    ARRAY_SIZE(da7219_rev_aa_patch));
  1892			if (ret) {
  1893				dev_err(component->dev, "Failed to register AA patch: %d\n",
  1894					ret);
  1895				goto err_disable_reg;
  1896			}
  1897			break;
  1898		default:
  1899			break;
  1900		}
  1901	
  1902		/* Handle DT/ACPI/Platform data */
  1903		da7219->pdata = dev_get_platdata(component->dev);
  1904		if (!da7219->pdata)
  1905			da7219->pdata = da7219_fw_to_pdata(component);
  1906	
  1907		da7219_handle_pdata(component);
  1908	
  1909		/* Check if MCLK provided */
  1910		if (da7219->pdata->mclk_name)
  1911			da7219->mclk = clk_get(NULL, da7219->pdata->mclk_name);
  1912		if (!da7219->mclk)
> 1913			da7219->mclk = devm_clk_get(codec->dev, "mclk");
  1914		if (IS_ERR(da7219->mclk)) {
  1915			if (PTR_ERR(da7219->mclk) != -ENOENT) {
  1916				ret = PTR_ERR(da7219->mclk);
  1917				goto err_disable_reg;
  1918			} else {
  1919				da7219->mclk = NULL;
  1920			}
  1921		}
  1922	
  1923		/* Default PC counter to free-running */
  1924		snd_soc_component_update_bits(component, DA7219_PC_COUNT, DA7219_PC_FREERUN_MASK,
  1925				    DA7219_PC_FREERUN_MASK);
  1926	
  1927		/* Default gain ramping */
  1928		snd_soc_component_update_bits(component, DA7219_MIXIN_L_CTRL,
  1929				    DA7219_MIXIN_L_AMP_RAMP_EN_MASK,
  1930				    DA7219_MIXIN_L_AMP_RAMP_EN_MASK);
  1931		snd_soc_component_update_bits(component, DA7219_ADC_L_CTRL, DA7219_ADC_L_RAMP_EN_MASK,
  1932				    DA7219_ADC_L_RAMP_EN_MASK);
  1933		snd_soc_component_update_bits(component, DA7219_DAC_L_CTRL, DA7219_DAC_L_RAMP_EN_MASK,
  1934				    DA7219_DAC_L_RAMP_EN_MASK);
  1935		snd_soc_component_update_bits(component, DA7219_DAC_R_CTRL, DA7219_DAC_R_RAMP_EN_MASK,
  1936				    DA7219_DAC_R_RAMP_EN_MASK);
  1937		snd_soc_component_update_bits(component, DA7219_HP_L_CTRL,
  1938				    DA7219_HP_L_AMP_RAMP_EN_MASK,
  1939				    DA7219_HP_L_AMP_RAMP_EN_MASK);
  1940		snd_soc_component_update_bits(component, DA7219_HP_R_CTRL,
  1941				    DA7219_HP_R_AMP_RAMP_EN_MASK,
  1942				    DA7219_HP_R_AMP_RAMP_EN_MASK);
  1943	
  1944		/* Default minimum gain on HP to avoid pops during DAPM sequencing */
  1945		snd_soc_component_update_bits(component, DA7219_HP_L_CTRL,
  1946				    DA7219_HP_L_AMP_MIN_GAIN_EN_MASK,
  1947				    DA7219_HP_L_AMP_MIN_GAIN_EN_MASK);
  1948		snd_soc_component_update_bits(component, DA7219_HP_R_CTRL,
  1949				    DA7219_HP_R_AMP_MIN_GAIN_EN_MASK,
  1950				    DA7219_HP_R_AMP_MIN_GAIN_EN_MASK);
  1951	
  1952		/* Default infinite tone gen, start/stop by Kcontrol */
  1953		snd_soc_component_write(component, DA7219_TONE_GEN_CYCLES, DA7219_BEEP_CYCLES_MASK);
  1954	
  1955		/* Initialise AAD block */
  1956		ret = da7219_aad_init(component);
  1957		if (ret)
  1958			goto err_disable_reg;
  1959	
  1960		return 0;
  1961	
  1962	err_disable_reg:
  1963		regulator_bulk_disable(DA7219_NUM_SUPPLIES, da7219->supplies);
  1964	
  1965		return ret;
  1966	}
  1967	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 29167 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [alsa-devel] [PATCH] ASoC: da7219: read fmw property to get mclk for non-dts systems
@ 2018-04-30  9:28   ` kbuild test robot
  0 siblings, 0 replies; 15+ messages in thread
From: kbuild test robot @ 2018-04-30  9:28 UTC (permalink / raw)
  Cc: kbuild-all, moderated list:SOUND, Support Opensource,
	Liam Girdwood, open list, Takashi Iwai, djkurtz, Mark Brown,
	Alexander.Deucher, Adam.Thomson.Opensource, akshu.agrawal

[-- Attachment #1: Type: text/plain, Size: 5091 bytes --]

Hi Akshu,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on asoc/for-next]
[also build test ERROR on v4.17-rc3 next-20180426]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Akshu-Agrawal/ASoC-da7219-read-fmw-property-to-get-mclk-for-non-dts-systems/20180430-150614
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
config: i386-randconfig-x015-201817 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-16) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

   sound/soc/codecs/da7219.c: In function 'da7219_probe':
>> sound/soc/codecs/da7219.c:1913:31: error: 'codec' undeclared (first use in this function); did you mean 'node'?
      da7219->mclk = devm_clk_get(codec->dev, "mclk");
                                  ^~~~~
                                  node
   sound/soc/codecs/da7219.c:1913:31: note: each undeclared identifier is reported only once for each function it appears in

vim +1913 sound/soc/codecs/da7219.c

  1867	
  1868	static int da7219_probe(struct snd_soc_component *component)
  1869	{
  1870		struct da7219_priv *da7219 = snd_soc_component_get_drvdata(component);
  1871		unsigned int rev;
  1872		int ret;
  1873	
  1874		mutex_init(&da7219->ctrl_lock);
  1875		mutex_init(&da7219->pll_lock);
  1876	
  1877		/* Regulator configuration */
  1878		ret = da7219_handle_supplies(component);
  1879		if (ret)
  1880			return ret;
  1881	
  1882		ret = regmap_read(da7219->regmap, DA7219_CHIP_REVISION, &rev);
  1883		if (ret) {
  1884			dev_err(component->dev, "Failed to read chip revision: %d\n", ret);
  1885			goto err_disable_reg;
  1886		}
  1887	
  1888		switch (rev & DA7219_CHIP_MINOR_MASK) {
  1889		case 0:
  1890			ret = regmap_register_patch(da7219->regmap, da7219_rev_aa_patch,
  1891						    ARRAY_SIZE(da7219_rev_aa_patch));
  1892			if (ret) {
  1893				dev_err(component->dev, "Failed to register AA patch: %d\n",
  1894					ret);
  1895				goto err_disable_reg;
  1896			}
  1897			break;
  1898		default:
  1899			break;
  1900		}
  1901	
  1902		/* Handle DT/ACPI/Platform data */
  1903		da7219->pdata = dev_get_platdata(component->dev);
  1904		if (!da7219->pdata)
  1905			da7219->pdata = da7219_fw_to_pdata(component);
  1906	
  1907		da7219_handle_pdata(component);
  1908	
  1909		/* Check if MCLK provided */
  1910		if (da7219->pdata->mclk_name)
  1911			da7219->mclk = clk_get(NULL, da7219->pdata->mclk_name);
  1912		if (!da7219->mclk)
> 1913			da7219->mclk = devm_clk_get(codec->dev, "mclk");
  1914		if (IS_ERR(da7219->mclk)) {
  1915			if (PTR_ERR(da7219->mclk) != -ENOENT) {
  1916				ret = PTR_ERR(da7219->mclk);
  1917				goto err_disable_reg;
  1918			} else {
  1919				da7219->mclk = NULL;
  1920			}
  1921		}
  1922	
  1923		/* Default PC counter to free-running */
  1924		snd_soc_component_update_bits(component, DA7219_PC_COUNT, DA7219_PC_FREERUN_MASK,
  1925				    DA7219_PC_FREERUN_MASK);
  1926	
  1927		/* Default gain ramping */
  1928		snd_soc_component_update_bits(component, DA7219_MIXIN_L_CTRL,
  1929				    DA7219_MIXIN_L_AMP_RAMP_EN_MASK,
  1930				    DA7219_MIXIN_L_AMP_RAMP_EN_MASK);
  1931		snd_soc_component_update_bits(component, DA7219_ADC_L_CTRL, DA7219_ADC_L_RAMP_EN_MASK,
  1932				    DA7219_ADC_L_RAMP_EN_MASK);
  1933		snd_soc_component_update_bits(component, DA7219_DAC_L_CTRL, DA7219_DAC_L_RAMP_EN_MASK,
  1934				    DA7219_DAC_L_RAMP_EN_MASK);
  1935		snd_soc_component_update_bits(component, DA7219_DAC_R_CTRL, DA7219_DAC_R_RAMP_EN_MASK,
  1936				    DA7219_DAC_R_RAMP_EN_MASK);
  1937		snd_soc_component_update_bits(component, DA7219_HP_L_CTRL,
  1938				    DA7219_HP_L_AMP_RAMP_EN_MASK,
  1939				    DA7219_HP_L_AMP_RAMP_EN_MASK);
  1940		snd_soc_component_update_bits(component, DA7219_HP_R_CTRL,
  1941				    DA7219_HP_R_AMP_RAMP_EN_MASK,
  1942				    DA7219_HP_R_AMP_RAMP_EN_MASK);
  1943	
  1944		/* Default minimum gain on HP to avoid pops during DAPM sequencing */
  1945		snd_soc_component_update_bits(component, DA7219_HP_L_CTRL,
  1946				    DA7219_HP_L_AMP_MIN_GAIN_EN_MASK,
  1947				    DA7219_HP_L_AMP_MIN_GAIN_EN_MASK);
  1948		snd_soc_component_update_bits(component, DA7219_HP_R_CTRL,
  1949				    DA7219_HP_R_AMP_MIN_GAIN_EN_MASK,
  1950				    DA7219_HP_R_AMP_MIN_GAIN_EN_MASK);
  1951	
  1952		/* Default infinite tone gen, start/stop by Kcontrol */
  1953		snd_soc_component_write(component, DA7219_TONE_GEN_CYCLES, DA7219_BEEP_CYCLES_MASK);
  1954	
  1955		/* Initialise AAD block */
  1956		ret = da7219_aad_init(component);
  1957		if (ret)
  1958			goto err_disable_reg;
  1959	
  1960		return 0;
  1961	
  1962	err_disable_reg:
  1963		regulator_bulk_disable(DA7219_NUM_SUPPLIES, da7219->supplies);
  1964	
  1965		return ret;
  1966	}
  1967	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 29167 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [alsa-devel] [PATCH] ASoC: da7219: read fmw property to get mclk for non-dts systems
  2018-04-30  7:01 ` Akshu Agrawal
@ 2018-04-30  9:31   ` kbuild test robot
  -1 siblings, 0 replies; 15+ messages in thread
From: kbuild test robot @ 2018-04-30  9:31 UTC (permalink / raw)
  To: Akshu Agrawal
  Cc: kbuild-all, moderated list:SOUND, Support Opensource,
	Liam Girdwood, open list, Takashi Iwai, djkurtz, Mark Brown,
	Alexander.Deucher, Adam.Thomson.Opensource, akshu.agrawal

[-- Attachment #1: Type: text/plain, Size: 5230 bytes --]

Hi Akshu,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on asoc/for-next]
[also build test ERROR on v4.17-rc3 next-20180426]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Akshu-Agrawal/ASoC-da7219-read-fmw-property-to-get-mclk-for-non-dts-systems/20180430-150614
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
config: xtensa-allmodconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 7.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=xtensa 

All errors (new ones prefixed by >>):

   sound/soc/codecs/da7219.c: In function 'da7219_probe':
>> sound/soc/codecs/da7219.c:1913:31: error: 'codec' undeclared (first use in this function); did you mean 'cdev'?
      da7219->mclk = devm_clk_get(codec->dev, "mclk");
                                  ^~~~~
                                  cdev
   sound/soc/codecs/da7219.c:1913:31: note: each undeclared identifier is reported only once for each function it appears in

vim +1913 sound/soc/codecs/da7219.c

  1867	
  1868	static int da7219_probe(struct snd_soc_component *component)
  1869	{
  1870		struct da7219_priv *da7219 = snd_soc_component_get_drvdata(component);
  1871		unsigned int rev;
  1872		int ret;
  1873	
  1874		mutex_init(&da7219->ctrl_lock);
  1875		mutex_init(&da7219->pll_lock);
  1876	
  1877		/* Regulator configuration */
  1878		ret = da7219_handle_supplies(component);
  1879		if (ret)
  1880			return ret;
  1881	
  1882		ret = regmap_read(da7219->regmap, DA7219_CHIP_REVISION, &rev);
  1883		if (ret) {
  1884			dev_err(component->dev, "Failed to read chip revision: %d\n", ret);
  1885			goto err_disable_reg;
  1886		}
  1887	
  1888		switch (rev & DA7219_CHIP_MINOR_MASK) {
  1889		case 0:
  1890			ret = regmap_register_patch(da7219->regmap, da7219_rev_aa_patch,
  1891						    ARRAY_SIZE(da7219_rev_aa_patch));
  1892			if (ret) {
  1893				dev_err(component->dev, "Failed to register AA patch: %d\n",
  1894					ret);
  1895				goto err_disable_reg;
  1896			}
  1897			break;
  1898		default:
  1899			break;
  1900		}
  1901	
  1902		/* Handle DT/ACPI/Platform data */
  1903		da7219->pdata = dev_get_platdata(component->dev);
  1904		if (!da7219->pdata)
  1905			da7219->pdata = da7219_fw_to_pdata(component);
  1906	
  1907		da7219_handle_pdata(component);
  1908	
  1909		/* Check if MCLK provided */
  1910		if (da7219->pdata->mclk_name)
  1911			da7219->mclk = clk_get(NULL, da7219->pdata->mclk_name);
  1912		if (!da7219->mclk)
> 1913			da7219->mclk = devm_clk_get(codec->dev, "mclk");
  1914		if (IS_ERR(da7219->mclk)) {
  1915			if (PTR_ERR(da7219->mclk) != -ENOENT) {
  1916				ret = PTR_ERR(da7219->mclk);
  1917				goto err_disable_reg;
  1918			} else {
  1919				da7219->mclk = NULL;
  1920			}
  1921		}
  1922	
  1923		/* Default PC counter to free-running */
  1924		snd_soc_component_update_bits(component, DA7219_PC_COUNT, DA7219_PC_FREERUN_MASK,
  1925				    DA7219_PC_FREERUN_MASK);
  1926	
  1927		/* Default gain ramping */
  1928		snd_soc_component_update_bits(component, DA7219_MIXIN_L_CTRL,
  1929				    DA7219_MIXIN_L_AMP_RAMP_EN_MASK,
  1930				    DA7219_MIXIN_L_AMP_RAMP_EN_MASK);
  1931		snd_soc_component_update_bits(component, DA7219_ADC_L_CTRL, DA7219_ADC_L_RAMP_EN_MASK,
  1932				    DA7219_ADC_L_RAMP_EN_MASK);
  1933		snd_soc_component_update_bits(component, DA7219_DAC_L_CTRL, DA7219_DAC_L_RAMP_EN_MASK,
  1934				    DA7219_DAC_L_RAMP_EN_MASK);
  1935		snd_soc_component_update_bits(component, DA7219_DAC_R_CTRL, DA7219_DAC_R_RAMP_EN_MASK,
  1936				    DA7219_DAC_R_RAMP_EN_MASK);
  1937		snd_soc_component_update_bits(component, DA7219_HP_L_CTRL,
  1938				    DA7219_HP_L_AMP_RAMP_EN_MASK,
  1939				    DA7219_HP_L_AMP_RAMP_EN_MASK);
  1940		snd_soc_component_update_bits(component, DA7219_HP_R_CTRL,
  1941				    DA7219_HP_R_AMP_RAMP_EN_MASK,
  1942				    DA7219_HP_R_AMP_RAMP_EN_MASK);
  1943	
  1944		/* Default minimum gain on HP to avoid pops during DAPM sequencing */
  1945		snd_soc_component_update_bits(component, DA7219_HP_L_CTRL,
  1946				    DA7219_HP_L_AMP_MIN_GAIN_EN_MASK,
  1947				    DA7219_HP_L_AMP_MIN_GAIN_EN_MASK);
  1948		snd_soc_component_update_bits(component, DA7219_HP_R_CTRL,
  1949				    DA7219_HP_R_AMP_MIN_GAIN_EN_MASK,
  1950				    DA7219_HP_R_AMP_MIN_GAIN_EN_MASK);
  1951	
  1952		/* Default infinite tone gen, start/stop by Kcontrol */
  1953		snd_soc_component_write(component, DA7219_TONE_GEN_CYCLES, DA7219_BEEP_CYCLES_MASK);
  1954	
  1955		/* Initialise AAD block */
  1956		ret = da7219_aad_init(component);
  1957		if (ret)
  1958			goto err_disable_reg;
  1959	
  1960		return 0;
  1961	
  1962	err_disable_reg:
  1963		regulator_bulk_disable(DA7219_NUM_SUPPLIES, da7219->supplies);
  1964	
  1965		return ret;
  1966	}
  1967	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 52935 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [alsa-devel] [PATCH] ASoC: da7219: read fmw property to get mclk for non-dts systems
@ 2018-04-30  9:31   ` kbuild test robot
  0 siblings, 0 replies; 15+ messages in thread
From: kbuild test robot @ 2018-04-30  9:31 UTC (permalink / raw)
  Cc: kbuild-all, moderated list:SOUND, Support Opensource,
	Liam Girdwood, open list, Takashi Iwai, djkurtz, Mark Brown,
	Alexander.Deucher, Adam.Thomson.Opensource, akshu.agrawal

[-- Attachment #1: Type: text/plain, Size: 5230 bytes --]

Hi Akshu,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on asoc/for-next]
[also build test ERROR on v4.17-rc3 next-20180426]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Akshu-Agrawal/ASoC-da7219-read-fmw-property-to-get-mclk-for-non-dts-systems/20180430-150614
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
config: xtensa-allmodconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 7.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=xtensa 

All errors (new ones prefixed by >>):

   sound/soc/codecs/da7219.c: In function 'da7219_probe':
>> sound/soc/codecs/da7219.c:1913:31: error: 'codec' undeclared (first use in this function); did you mean 'cdev'?
      da7219->mclk = devm_clk_get(codec->dev, "mclk");
                                  ^~~~~
                                  cdev
   sound/soc/codecs/da7219.c:1913:31: note: each undeclared identifier is reported only once for each function it appears in

vim +1913 sound/soc/codecs/da7219.c

  1867	
  1868	static int da7219_probe(struct snd_soc_component *component)
  1869	{
  1870		struct da7219_priv *da7219 = snd_soc_component_get_drvdata(component);
  1871		unsigned int rev;
  1872		int ret;
  1873	
  1874		mutex_init(&da7219->ctrl_lock);
  1875		mutex_init(&da7219->pll_lock);
  1876	
  1877		/* Regulator configuration */
  1878		ret = da7219_handle_supplies(component);
  1879		if (ret)
  1880			return ret;
  1881	
  1882		ret = regmap_read(da7219->regmap, DA7219_CHIP_REVISION, &rev);
  1883		if (ret) {
  1884			dev_err(component->dev, "Failed to read chip revision: %d\n", ret);
  1885			goto err_disable_reg;
  1886		}
  1887	
  1888		switch (rev & DA7219_CHIP_MINOR_MASK) {
  1889		case 0:
  1890			ret = regmap_register_patch(da7219->regmap, da7219_rev_aa_patch,
  1891						    ARRAY_SIZE(da7219_rev_aa_patch));
  1892			if (ret) {
  1893				dev_err(component->dev, "Failed to register AA patch: %d\n",
  1894					ret);
  1895				goto err_disable_reg;
  1896			}
  1897			break;
  1898		default:
  1899			break;
  1900		}
  1901	
  1902		/* Handle DT/ACPI/Platform data */
  1903		da7219->pdata = dev_get_platdata(component->dev);
  1904		if (!da7219->pdata)
  1905			da7219->pdata = da7219_fw_to_pdata(component);
  1906	
  1907		da7219_handle_pdata(component);
  1908	
  1909		/* Check if MCLK provided */
  1910		if (da7219->pdata->mclk_name)
  1911			da7219->mclk = clk_get(NULL, da7219->pdata->mclk_name);
  1912		if (!da7219->mclk)
> 1913			da7219->mclk = devm_clk_get(codec->dev, "mclk");
  1914		if (IS_ERR(da7219->mclk)) {
  1915			if (PTR_ERR(da7219->mclk) != -ENOENT) {
  1916				ret = PTR_ERR(da7219->mclk);
  1917				goto err_disable_reg;
  1918			} else {
  1919				da7219->mclk = NULL;
  1920			}
  1921		}
  1922	
  1923		/* Default PC counter to free-running */
  1924		snd_soc_component_update_bits(component, DA7219_PC_COUNT, DA7219_PC_FREERUN_MASK,
  1925				    DA7219_PC_FREERUN_MASK);
  1926	
  1927		/* Default gain ramping */
  1928		snd_soc_component_update_bits(component, DA7219_MIXIN_L_CTRL,
  1929				    DA7219_MIXIN_L_AMP_RAMP_EN_MASK,
  1930				    DA7219_MIXIN_L_AMP_RAMP_EN_MASK);
  1931		snd_soc_component_update_bits(component, DA7219_ADC_L_CTRL, DA7219_ADC_L_RAMP_EN_MASK,
  1932				    DA7219_ADC_L_RAMP_EN_MASK);
  1933		snd_soc_component_update_bits(component, DA7219_DAC_L_CTRL, DA7219_DAC_L_RAMP_EN_MASK,
  1934				    DA7219_DAC_L_RAMP_EN_MASK);
  1935		snd_soc_component_update_bits(component, DA7219_DAC_R_CTRL, DA7219_DAC_R_RAMP_EN_MASK,
  1936				    DA7219_DAC_R_RAMP_EN_MASK);
  1937		snd_soc_component_update_bits(component, DA7219_HP_L_CTRL,
  1938				    DA7219_HP_L_AMP_RAMP_EN_MASK,
  1939				    DA7219_HP_L_AMP_RAMP_EN_MASK);
  1940		snd_soc_component_update_bits(component, DA7219_HP_R_CTRL,
  1941				    DA7219_HP_R_AMP_RAMP_EN_MASK,
  1942				    DA7219_HP_R_AMP_RAMP_EN_MASK);
  1943	
  1944		/* Default minimum gain on HP to avoid pops during DAPM sequencing */
  1945		snd_soc_component_update_bits(component, DA7219_HP_L_CTRL,
  1946				    DA7219_HP_L_AMP_MIN_GAIN_EN_MASK,
  1947				    DA7219_HP_L_AMP_MIN_GAIN_EN_MASK);
  1948		snd_soc_component_update_bits(component, DA7219_HP_R_CTRL,
  1949				    DA7219_HP_R_AMP_MIN_GAIN_EN_MASK,
  1950				    DA7219_HP_R_AMP_MIN_GAIN_EN_MASK);
  1951	
  1952		/* Default infinite tone gen, start/stop by Kcontrol */
  1953		snd_soc_component_write(component, DA7219_TONE_GEN_CYCLES, DA7219_BEEP_CYCLES_MASK);
  1954	
  1955		/* Initialise AAD block */
  1956		ret = da7219_aad_init(component);
  1957		if (ret)
  1958			goto err_disable_reg;
  1959	
  1960		return 0;
  1961	
  1962	err_disable_reg:
  1963		regulator_bulk_disable(DA7219_NUM_SUPPLIES, da7219->supplies);
  1964	
  1965		return ret;
  1966	}
  1967	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 52935 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] ASoC: da7219: read fmw property to get mclk for non-dts systems
  2024-03-04 21:50   ` Curtis Malainey
  2024-03-04 22:20     ` Mark Brown
@ 2024-03-05 22:48     ` Curtis Malainey
  1 sibling, 0 replies; 15+ messages in thread
From: Curtis Malainey @ 2024-03-05 22:48 UTC (permalink / raw)
  To: Mark Brown
  Cc: cujomalainey, alsa-devel, Akshu Agrawal, Karthik Ramasubramanian,
	Support Opensource, Jaroslav Kysela, Takashi Iwai, Liam Girdwood

On Mon, Mar 4, 2024 at 1:50 PM Curtis Malainey <cujomalainey@google.com> wrote:
>
> On Mon, Mar 4, 2024 at 1:23 PM Mark Brown <broonie@kernel.org> wrote:
> >
> > On Mon, Mar 04, 2024 at 01:14:43PM -0800, cujomalainey@chromium.org wrote:
> >
>
>
> No problem, I can clean it up, I figured a good starting point would
> be to just revive the original that was sent in 2018
> https://mailman.alsa-project.org/hyperkitty/list/alsa-devel@alsa-project.org/message/26IVUCF7KMKNL7LZWAWWNFF3KB2TURSA/
>
> We have been carrying this in our tree the whole time, just caught it
> and figure I would try and get it up stream again

So after a bunch of debugging on our 5.10 kernel it actually appears
this property is useless and the system is already attaching the mclk
under the clock defined in the property. Maybe someone pushed a
coreboot update to fix this later which rendered this patch useless?

>
> >
> >
> > Having a firmware property for this is obviously broken for DT systems,
> > this should be limited to ACPI systems if it's going to be there at all.
> > It would be nicer if it were implementeded by having some ACPI specific
> > code link whatever the configured clock name is to "mclk" - I don't know
> > if the clock API has an equivalent to regulator_register_supply_alias()
> > but that's the sort of thing I'm thinking of.
>
> I will take a look at this, note that it appears the original author
> is no longer at AMD as the emails are bouncing.

To answer this for the sake of sharing knowledge, there is a clk_add_alias API.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] ASoC: da7219: read fmw property to get mclk for non-dts systems
  2024-03-04 21:50   ` Curtis Malainey
@ 2024-03-04 22:20     ` Mark Brown
  2024-03-05 22:48     ` Curtis Malainey
  1 sibling, 0 replies; 15+ messages in thread
From: Mark Brown @ 2024-03-04 22:20 UTC (permalink / raw)
  To: Curtis Malainey
  Cc: cujomalainey, alsa-devel, Akshu Agrawal, Karthik Ramasubramanian,
	Support Opensource, Jaroslav Kysela, Takashi Iwai, Liam Girdwood

[-- Attachment #1: Type: text/plain, Size: 793 bytes --]

On Mon, Mar 04, 2024 at 01:50:27PM -0800, Curtis Malainey wrote:
> On Mon, Mar 4, 2024 at 1:23 PM Mark Brown <broonie@kernel.org> wrote:

> > I would never have guessed from the changelog that what this change
> > actually does is provide a mechanism for overriding the name we use to
> > request the MCLK.  I had thought this was adding clock handling to a
> > driver that had none.  The changelog should say what the change is
> > doing.

> No problem, I can clean it up, I figured a good starting point would
> be to just revive the original that was sent in 2018
> https://mailman.alsa-project.org/hyperkitty/list/alsa-devel@alsa-project.org/message/26IVUCF7KMKNL7LZWAWWNFF3KB2TURSA/

That seems to have had 0day find build failures immediately so didn't
get looked at :/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] ASoC: da7219: read fmw property to get mclk for non-dts systems
  2024-03-04 21:23 ` Mark Brown
@ 2024-03-04 21:50   ` Curtis Malainey
  2024-03-04 22:20     ` Mark Brown
  2024-03-05 22:48     ` Curtis Malainey
  0 siblings, 2 replies; 15+ messages in thread
From: Curtis Malainey @ 2024-03-04 21:50 UTC (permalink / raw)
  To: Mark Brown
  Cc: cujomalainey, alsa-devel, Akshu Agrawal, Karthik Ramasubramanian,
	Support Opensource, Jaroslav Kysela, Takashi Iwai, Liam Girdwood

On Mon, Mar 4, 2024 at 1:23 PM Mark Brown <broonie@kernel.org> wrote:
>
> On Mon, Mar 04, 2024 at 01:14:43PM -0800, cujomalainey@chromium.org wrote:
>
> > Non-dts based systems can use ACPI DSDT to pass on the mclk
> > to da7219.
> > This enables da7219 mclk to be linked to system clock.
> > Enable/Disable of the mclk is already handled in the codec so
> > platform drivers don't have to explicitly do handling of mclk.
>
> ...
>
> > +     device_property_read_string(dev, "dlg,mclk-name", &pdata->mclk_name);
> > +
>
> ...
>
> > -     da7219->mclk = clk_get(component->dev, "mclk");
> > +     if (da7219->pdata->mclk_name)
> > +             da7219->mclk = clk_get(NULL, da7219->pdata->mclk_name);
> > +     if (!da7219->mclk)
> > +             da7219->mclk = clk_get(component->dev, "mclk");
>
> I would never have guessed from the changelog that what this change
> actually does is provide a mechanism for overriding the name we use to
> request the MCLK.  I had thought this was adding clock handling to a
> driver that had none.  The changelog should say what the change is
> doing.


No problem, I can clean it up, I figured a good starting point would
be to just revive the original that was sent in 2018
https://mailman.alsa-project.org/hyperkitty/list/alsa-devel@alsa-project.org/message/26IVUCF7KMKNL7LZWAWWNFF3KB2TURSA/

We have been carrying this in our tree the whole time, just caught it
and figure I would try and get it up stream again

>
>
> Having a firmware property for this is obviously broken for DT systems,
> this should be limited to ACPI systems if it's going to be there at all.
> It would be nicer if it were implementeded by having some ACPI specific
> code link whatever the configured clock name is to "mclk" - I don't know
> if the clock API has an equivalent to regulator_register_supply_alias()
> but that's the sort of thing I'm thinking of.

I will take a look at this, note that it appears the original author
is no longer at AMD as the emails are bouncing.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH] ASoC: da7219: read fmw property to get mclk for non-dts systems
  2024-03-04 21:14 cujomalainey
@ 2024-03-04 21:23 ` Mark Brown
  2024-03-04 21:50   ` Curtis Malainey
  0 siblings, 1 reply; 15+ messages in thread
From: Mark Brown @ 2024-03-04 21:23 UTC (permalink / raw)
  To: cujomalainey
  Cc: alsa-devel, Akshu Agrawal, Karthik Ramasubramanian,
	Support Opensource, Jaroslav Kysela, Takashi Iwai, Liam Girdwood

[-- Attachment #1: Type: text/plain, Size: 1342 bytes --]

On Mon, Mar 04, 2024 at 01:14:43PM -0800, cujomalainey@chromium.org wrote:

> Non-dts based systems can use ACPI DSDT to pass on the mclk
> to da7219.
> This enables da7219 mclk to be linked to system clock.
> Enable/Disable of the mclk is already handled in the codec so
> platform drivers don't have to explicitly do handling of mclk.

...

> +	device_property_read_string(dev, "dlg,mclk-name", &pdata->mclk_name);
> +

...

> -	da7219->mclk = clk_get(component->dev, "mclk");
> +	if (da7219->pdata->mclk_name)
> +		da7219->mclk = clk_get(NULL, da7219->pdata->mclk_name);
> +	if (!da7219->mclk)
> +		da7219->mclk = clk_get(component->dev, "mclk");

I would never have guessed from the changelog that what this change
actually does is provide a mechanism for overriding the name we use to
request the MCLK.  I had thought this was adding clock handling to a
driver that had none.  The changelog should say what the change is
doing.

Having a firmware property for this is obviously broken for DT systems,
this should be limited to ACPI systems if it's going to be there at all.
It would be nicer if it were implementeded by having some ACPI specific
code link whatever the configured clock name is to "mclk" - I don't know
if the clock API has an equivalent to regulator_register_supply_alias()
but that's the sort of thing I'm thinking of.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH] ASoC: da7219: read fmw property to get mclk for non-dts systems
@ 2024-03-04 21:14 cujomalainey
  2024-03-04 21:23 ` Mark Brown
  0 siblings, 1 reply; 15+ messages in thread
From: cujomalainey @ 2024-03-04 21:14 UTC (permalink / raw)
  To: alsa-devel
  Cc: Akshu Agrawal, Curtis Malainey, Karthik Ramasubramanian,
	Support Opensource, Jaroslav Kysela, Takashi Iwai, Liam Girdwood,
	Mark Brown

From: Akshu Agrawal <akshu.agrawal@amd.com>

Non-dts based systems can use ACPI DSDT to pass on the mclk
to da7219.
This enables da7219 mclk to be linked to system clock.
Enable/Disable of the mclk is already handled in the codec so
platform drivers don't have to explicitly do handling of mclk.

Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
Cc: Karthik Ramasubramanian <kramasub@google.com>
---
 include/sound/da7219.h    | 2 ++
 sound/soc/codecs/da7219.c | 8 +++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/include/sound/da7219.h b/include/sound/da7219.h
index dde4542b084f3..4cf4c52be3f7f 100644
--- a/include/sound/da7219.h
+++ b/include/sound/da7219.h
@@ -40,6 +40,8 @@ struct da7219_pdata {
 
 	const char *dai_clk_names[DA7219_DAI_NUM_CLKS];
 
+	const char *mclk_name;
+
 	/* Mic */
 	enum da7219_micbias_voltage micbias_lvl;
 	enum da7219_mic_amp_in_sel mic_amp_in_sel;
diff --git a/sound/soc/codecs/da7219.c b/sound/soc/codecs/da7219.c
index 311ea7918b312..800f61d993043 100644
--- a/sound/soc/codecs/da7219.c
+++ b/sound/soc/codecs/da7219.c
@@ -1782,6 +1782,8 @@ static struct da7219_pdata *da7219_fw_to_pdata(struct device *dev)
 			 pdata->dai_clk_names[DA7219_DAI_WCLK_IDX],
 			 pdata->dai_clk_names[DA7219_DAI_BCLK_IDX]);
 
+	device_property_read_string(dev, "dlg,mclk-name", &pdata->mclk_name);
+
 	if (device_property_read_u32(dev, "dlg,micbias-lvl", &of_val32) >= 0)
 		pdata->micbias_lvl = da7219_fw_micbias_lvl(dev, of_val32);
 	else
@@ -2521,7 +2523,11 @@ static int da7219_probe(struct snd_soc_component *component)
 	da7219_handle_pdata(component);
 
 	/* Check if MCLK provided */
-	da7219->mclk = clk_get(component->dev, "mclk");
+	if (da7219->pdata->mclk_name)
+		da7219->mclk = clk_get(NULL, da7219->pdata->mclk_name);
+	if (!da7219->mclk)
+		da7219->mclk = clk_get(component->dev, "mclk");
+
 	if (IS_ERR(da7219->mclk)) {
 		if (PTR_ERR(da7219->mclk) != -ENOENT) {
 			ret = PTR_ERR(da7219->mclk);
-- 
2.44.0.rc1.240.g4c46232300-goog


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2024-03-05 22:49 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-30  7:01 [PATCH] ASoC: da7219: read fmw property to get mclk for non-dts systems Akshu Agrawal
2018-04-30  7:01 ` Akshu Agrawal
2018-04-30  7:01 ` Akshu Agrawal
2018-04-30  7:01   ` Akshu Agrawal
2018-04-30  8:57   ` [alsa-devel] " kbuild test robot
2018-04-30  8:57     ` kbuild test robot
2018-04-30  9:28 ` kbuild test robot
2018-04-30  9:28   ` kbuild test robot
2018-04-30  9:31 ` kbuild test robot
2018-04-30  9:31   ` kbuild test robot
2024-03-04 21:14 cujomalainey
2024-03-04 21:23 ` Mark Brown
2024-03-04 21:50   ` Curtis Malainey
2024-03-04 22:20     ` Mark Brown
2024-03-05 22:48     ` Curtis Malainey

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.