alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] ASoC: rt5682: fix Kconfig/compilation issues when I2C is not selected
@ 2020-03-10 16:35 Pierre-Louis Bossart
  2020-03-10 16:35 ` [PATCH 1/3] ASoC: rt5682: fix unmet dependencies Pierre-Louis Bossart
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Pierre-Louis Bossart @ 2020-03-10 16:35 UTC (permalink / raw)
  To: alsa-devel; +Cc: tiwai, broonie, Pierre-Louis Bossart, kbuild test robot

RT5682 can work in I2C or SoundWire mode, but the code will not
compile if I2C is not selected.

Reported-by: kbuild test robot <lkp@intel.com>

Pierre-Louis Bossart (3):
  ASoC: rt5682: fix unmet dependencies
  ASoC: rt5682: fix compilation issues without I2C
  ASoC: rt5682-sdw: fix 'defined but not used' pm functions

 sound/soc/codecs/Kconfig      |  2 +-
 sound/soc/codecs/rt5682-sdw.c |  4 ++--
 sound/soc/codecs/rt5682.c     | 10 ++++++++++
 3 files changed, 13 insertions(+), 3 deletions(-)

-- 
2.20.1


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

* [PATCH 1/3] ASoC: rt5682: fix unmet dependencies
  2020-03-10 16:35 [PATCH 0/3] ASoC: rt5682: fix Kconfig/compilation issues when I2C is not selected Pierre-Louis Bossart
@ 2020-03-10 16:35 ` Pierre-Louis Bossart
  2020-03-10 18:19   ` Applied "ASoC: rt5682: fix unmet dependencies" to the asoc tree Mark Brown
  2020-03-10 16:35 ` [PATCH 2/3] ASoC: rt5682: fix compilation issues without I2C Pierre-Louis Bossart
  2020-03-10 16:35 ` [PATCH 3/3] ASoC: rt5682-sdw: fix 'defined but not used' pm functions Pierre-Louis Bossart
  2 siblings, 1 reply; 8+ messages in thread
From: Pierre-Louis Bossart @ 2020-03-10 16:35 UTC (permalink / raw)
  To: alsa-devel
  Cc: tiwai, Oder Chiou, broonie, Pierre-Louis Bossart, kbuild test robot

The rt5682 code can be used in I2C or SoundWire mode. When I2C is not
selected, we have the following issue:

WARNING: unmet direct dependencies detected for SND_SOC_RT5682
  Depends on [n]: SOUND [=m] && !UML && SND [=m] && SND_SOC [=m] &&
  I2C [=n]
  Selected by [m]:
  - SND_SOC_RT5682_SDW [=m] && SOUND [=m] && !UML && SND [=m] &&
    SND_SOC [=m] && SOUNDWIRE [=m]

Fix by adding SOUNDWIRE as a dependency.

Reported-by: kbuild test robot <lkp@intel.com>
Fixes: 03f6fc6de9192f ('ASoC: rt5682: Add the soundwire support')
Cc: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/codecs/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig
index 6aee70ed43df..78be69e9b618 100644
--- a/sound/soc/codecs/Kconfig
+++ b/sound/soc/codecs/Kconfig
@@ -1135,7 +1135,7 @@ config SND_SOC_RT5677_SPI
 
 config SND_SOC_RT5682
 	tristate
-	depends on I2C
+	depends on I2C || SOUNDWIRE
 
 config SND_SOC_RT5682_SDW
 	tristate "Realtek RT5682 Codec - SDW"
-- 
2.20.1


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

* [PATCH 2/3] ASoC: rt5682: fix compilation issues without I2C
  2020-03-10 16:35 [PATCH 0/3] ASoC: rt5682: fix Kconfig/compilation issues when I2C is not selected Pierre-Louis Bossart
  2020-03-10 16:35 ` [PATCH 1/3] ASoC: rt5682: fix unmet dependencies Pierre-Louis Bossart
@ 2020-03-10 16:35 ` Pierre-Louis Bossart
  2020-03-10 17:19   ` Mark Brown
  2020-03-10 16:35 ` [PATCH 3/3] ASoC: rt5682-sdw: fix 'defined but not used' pm functions Pierre-Louis Bossart
  2 siblings, 1 reply; 8+ messages in thread
From: Pierre-Louis Bossart @ 2020-03-10 16:35 UTC (permalink / raw)
  To: alsa-devel
  Cc: tiwai, Oder Chiou, broonie, Pierre-Louis Bossart, kbuild test robot

Exclude all I2C-related code from compilation to avoid compilation
errors and defined but not used warnings.

sound/soc/codecs/rt5682.c:3688:26: warning: 'rt5682_i2c_driver'
defined but not used [-Wunused-variable]
    static struct i2c_driver rt5682_i2c_driver = {
                             ^~~~~~~~~~~~~~~~~

Reported-by: kbuild test robot <lkp@intel.com>
Fixes: 03f6fc6de9192f ('ASoC: rt5682: Add the soundwire support')
Cc: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/codecs/rt5682.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/sound/soc/codecs/rt5682.c b/sound/soc/codecs/rt5682.c
index e1df2d076533..8828ed5db58d 100644
--- a/sound/soc/codecs/rt5682.c
+++ b/sound/soc/codecs/rt5682.c
@@ -33,6 +33,7 @@
 #include "rt5682.h"
 #include "rt5682-sdw.h"
 
+#if IS_ENABLED(CONFIG_I2C)
 static const char *rt5682_supply_names[RT5682_NUM_SUPPLIES] = {
 	"AVDD",
 	"MICVDD",
@@ -47,6 +48,7 @@ static const struct rt5682_platform_data i2s_default_platform_data = {
 	.dai_clk_names[RT5682_DAI_WCLK_IDX] = "rt5682-dai-wclk",
 	.dai_clk_names[RT5682_DAI_BCLK_IDX] = "rt5682-dai-bclk",
 };
+#endif
 
 static const struct reg_sequence patch_list[] = {
 	{RT5682_HP_IMP_SENS_CTRL_19, 0x1000},
@@ -974,6 +976,7 @@ static int rt5682_headset_detect(struct snd_soc_component *component,
 	return rt5682->jack_type;
 }
 
+#if IS_ENABLED(CONFIG_I2C)
 static irqreturn_t rt5682_irq(int irq, void *data)
 {
 	struct rt5682_priv *rt5682 = data;
@@ -1002,6 +1005,7 @@ static void rt5682_jd_check_handler(struct work_struct *work)
 		schedule_delayed_work(&rt5682->jd_check_work, 500);
 	}
 }
+#endif
 
 static int rt5682_set_jack_detect(struct snd_soc_component *component,
 	struct snd_soc_jack *hs_jack, void *data)
@@ -3214,6 +3218,7 @@ static const struct regmap_config rt5682_regmap = {
 	.use_single_write = true,
 };
 
+#if IS_ENABLED(CONFIG_I2C)
 static const struct i2c_device_id rt5682_i2c_id[] = {
 	{"rt5682", 0},
 	{}
@@ -3244,6 +3249,7 @@ static int rt5682_parse_dt(struct rt5682_priv *rt5682, struct device *dev)
 
 	return 0;
 }
+#endif
 
 static void rt5682_calibrate(struct rt5682_priv *rt5682)
 {
@@ -3510,6 +3516,7 @@ int rt5682_io_init(struct device *dev, struct sdw_slave *slave)
 EXPORT_SYMBOL_GPL(rt5682_io_init);
 #endif
 
+#if IS_ENABLED(CONFIG_I2C)
 static int rt5682_i2c_probe(struct i2c_client *i2c,
 		    const struct i2c_device_id *id)
 {
@@ -3668,6 +3675,7 @@ static void rt5682_i2c_shutdown(struct i2c_client *client)
 
 	rt5682_reset(rt5682);
 }
+#endif
 
 #ifdef CONFIG_OF
 static const struct of_device_id rt5682_of_match[] = {
@@ -3685,6 +3693,7 @@ static const struct acpi_device_id rt5682_acpi_match[] = {
 MODULE_DEVICE_TABLE(acpi, rt5682_acpi_match);
 #endif
 
+#if IS_ENABLED(CONFIG_I2C)
 static struct i2c_driver rt5682_i2c_driver = {
 	.driver = {
 		.name = "rt5682",
@@ -3696,6 +3705,7 @@ static struct i2c_driver rt5682_i2c_driver = {
 	.id_table = rt5682_i2c_id,
 };
 module_i2c_driver(rt5682_i2c_driver);
+#endif
 
 MODULE_DESCRIPTION("ASoC RT5682 driver");
 MODULE_AUTHOR("Bard Liao <bardliao@realtek.com>");
-- 
2.20.1


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

* [PATCH 3/3] ASoC: rt5682-sdw: fix 'defined but not used' pm functions
  2020-03-10 16:35 [PATCH 0/3] ASoC: rt5682: fix Kconfig/compilation issues when I2C is not selected Pierre-Louis Bossart
  2020-03-10 16:35 ` [PATCH 1/3] ASoC: rt5682: fix unmet dependencies Pierre-Louis Bossart
  2020-03-10 16:35 ` [PATCH 2/3] ASoC: rt5682: fix compilation issues without I2C Pierre-Louis Bossart
@ 2020-03-10 16:35 ` Pierre-Louis Bossart
  2020-03-10 18:19   ` Applied "ASoC: rt5682-sdw: fix 'defined but not used' pm functions" to the asoc tree Mark Brown
  2 siblings, 1 reply; 8+ messages in thread
From: Pierre-Louis Bossart @ 2020-03-10 16:35 UTC (permalink / raw)
  To: alsa-devel
  Cc: tiwai, Oder Chiou, broonie, Pierre-Louis Bossart, kbuild test robot

Gcc reports the following warnings:

sound/soc/codecs/rt5682-sdw.c:286:12: warning: 'rt5682_dev_resume'
defined but not used [-Wunused-function]
 static int rt5682_dev_resume(struct device *dev)
            ^~~~~~~~~~~~~~~~~

sound/soc/codecs/rt5682-sdw.c:273:12: warning: 'rt5682_dev_suspend'
defined but not used [-Wunused-function]
 static int rt5682_dev_suspend(struct device *dev)
            ^~~~~~~~~~~~~~~~~~

Fix by adding maybe_unused as done for other SoundWire codecs

Reported-by: kbuild test robot <lkp@intel.com>
Fixes: 03f6fc6de9192f ('ASoC: rt5682: Add the soundwire support')
Cc: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/codecs/rt5682-sdw.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/rt5682-sdw.c b/sound/soc/codecs/rt5682-sdw.c
index fc31d04b5203..e456bdd15207 100644
--- a/sound/soc/codecs/rt5682-sdw.c
+++ b/sound/soc/codecs/rt5682-sdw.c
@@ -270,7 +270,7 @@ static const struct sdw_device_id rt5682_id[] = {
 };
 MODULE_DEVICE_TABLE(sdw, rt5682_id);
 
-static int rt5682_dev_suspend(struct device *dev)
+static int __maybe_unused rt5682_dev_suspend(struct device *dev)
 {
 	struct rt5682_priv *rt5682 = dev_get_drvdata(dev);
 
@@ -283,7 +283,7 @@ static int rt5682_dev_suspend(struct device *dev)
 	return 0;
 }
 
-static int rt5682_dev_resume(struct device *dev)
+static int __maybe_unused rt5682_dev_resume(struct device *dev)
 {
 	struct sdw_slave *slave = dev_to_sdw_dev(dev);
 	struct rt5682_priv *rt5682 = dev_get_drvdata(dev);
-- 
2.20.1


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

* Re: [PATCH 2/3] ASoC: rt5682: fix compilation issues without I2C
  2020-03-10 16:35 ` [PATCH 2/3] ASoC: rt5682: fix compilation issues without I2C Pierre-Louis Bossart
@ 2020-03-10 17:19   ` Mark Brown
  2020-03-10 18:50     ` Pierre-Louis Bossart
  0 siblings, 1 reply; 8+ messages in thread
From: Mark Brown @ 2020-03-10 17:19 UTC (permalink / raw)
  To: Pierre-Louis Bossart; +Cc: tiwai, Oder Chiou, alsa-devel, kbuild test robot

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

On Tue, Mar 10, 2020 at 11:35:08AM -0500, Pierre-Louis Bossart wrote:
> Exclude all I2C-related code from compilation to avoid compilation
> errors and defined but not used warnings.

I think it would be better to do this by factoring the bus code out into
a separate file like we've done with I2C and SPI, it's neater than
ifdefs and easier to get right going forwards.

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

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

* Applied "ASoC: rt5682-sdw: fix 'defined but not used' pm functions" to the asoc tree
  2020-03-10 16:35 ` [PATCH 3/3] ASoC: rt5682-sdw: fix 'defined but not used' pm functions Pierre-Louis Bossart
@ 2020-03-10 18:19   ` Mark Brown
  0 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2020-03-10 18:19 UTC (permalink / raw)
  To: Pierre-Louis Bossart
  Cc: Oder Chiou, tiwai, alsa-devel, Mark Brown, kbuild test robot

The patch

   ASoC: rt5682-sdw: fix 'defined but not used' pm functions

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From 724cc62f7a71e3a04112126806c62d9c639ab92c Mon Sep 17 00:00:00 2001
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Date: Tue, 10 Mar 2020 11:35:09 -0500
Subject: [PATCH] ASoC: rt5682-sdw: fix 'defined but not used' pm functions

Gcc reports the following warnings:

sound/soc/codecs/rt5682-sdw.c:286:12: warning: 'rt5682_dev_resume'
defined but not used [-Wunused-function]
 static int rt5682_dev_resume(struct device *dev)
            ^~~~~~~~~~~~~~~~~

sound/soc/codecs/rt5682-sdw.c:273:12: warning: 'rt5682_dev_suspend'
defined but not used [-Wunused-function]
 static int rt5682_dev_suspend(struct device *dev)
            ^~~~~~~~~~~~~~~~~~

Fix by adding maybe_unused as done for other SoundWire codecs

Fixes: 03f6fc6de9192f ('ASoC: rt5682: Add the soundwire support')
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Oder Chiou <oder_chiou@realtek.com>
Link: https://lore.kernel.org/r/20200310163509.14466-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/codecs/rt5682-sdw.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/rt5682-sdw.c b/sound/soc/codecs/rt5682-sdw.c
index 1d6963dd6403..a2d1d3ae1e31 100644
--- a/sound/soc/codecs/rt5682-sdw.c
+++ b/sound/soc/codecs/rt5682-sdw.c
@@ -270,7 +270,7 @@ static const struct sdw_device_id rt5682_id[] = {
 };
 MODULE_DEVICE_TABLE(sdw, rt5682_id);
 
-static int rt5682_dev_suspend(struct device *dev)
+static int __maybe_unused rt5682_dev_suspend(struct device *dev)
 {
 	struct rt5682_priv *rt5682 = dev_get_drvdata(dev);
 
@@ -283,7 +283,7 @@ static int rt5682_dev_suspend(struct device *dev)
 	return 0;
 }
 
-static int rt5682_dev_resume(struct device *dev)
+static int __maybe_unused rt5682_dev_resume(struct device *dev)
 {
 	struct sdw_slave *slave = dev_to_sdw_dev(dev);
 	struct rt5682_priv *rt5682 = dev_get_drvdata(dev);
-- 
2.20.1


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

* Applied "ASoC: rt5682: fix unmet dependencies" to the asoc tree
  2020-03-10 16:35 ` [PATCH 1/3] ASoC: rt5682: fix unmet dependencies Pierre-Louis Bossart
@ 2020-03-10 18:19   ` Mark Brown
  0 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2020-03-10 18:19 UTC (permalink / raw)
  To: Pierre-Louis Bossart
  Cc: Oder Chiou, tiwai, alsa-devel, Mark Brown, kbuild test robot

The patch

   ASoC: rt5682: fix unmet dependencies

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From 5549ea64799784308cc03313a86dea3de56d48ce Mon Sep 17 00:00:00 2001
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Date: Tue, 10 Mar 2020 11:35:07 -0500
Subject: [PATCH] ASoC: rt5682: fix unmet dependencies

The rt5682 code can be used in I2C or SoundWire mode. When I2C is not
selected, we have the following issue:

WARNING: unmet direct dependencies detected for SND_SOC_RT5682
  Depends on [n]: SOUND [=m] && !UML && SND [=m] && SND_SOC [=m] &&
  I2C [=n]
  Selected by [m]:
  - SND_SOC_RT5682_SDW [=m] && SOUND [=m] && !UML && SND [=m] &&
    SND_SOC [=m] && SOUNDWIRE [=m]

Fix by adding SOUNDWIRE as a dependency.

Fixes: 03f6fc6de9192f ('ASoC: rt5682: Add the soundwire support')
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Oder Chiou <oder_chiou@realtek.com>
Link: https://lore.kernel.org/r/20200310163509.14466-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/codecs/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig
index 6aee70ed43df..78be69e9b618 100644
--- a/sound/soc/codecs/Kconfig
+++ b/sound/soc/codecs/Kconfig
@@ -1135,7 +1135,7 @@ config SND_SOC_RT5677_SPI
 
 config SND_SOC_RT5682
 	tristate
-	depends on I2C
+	depends on I2C || SOUNDWIRE
 
 config SND_SOC_RT5682_SDW
 	tristate "Realtek RT5682 Codec - SDW"
-- 
2.20.1


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

* Re: [PATCH 2/3] ASoC: rt5682: fix compilation issues without I2C
  2020-03-10 17:19   ` Mark Brown
@ 2020-03-10 18:50     ` Pierre-Louis Bossart
  0 siblings, 0 replies; 8+ messages in thread
From: Pierre-Louis Bossart @ 2020-03-10 18:50 UTC (permalink / raw)
  To: Mark Brown; +Cc: tiwai, Oder Chiou, alsa-devel, kbuild test robot



On 3/10/20 12:19 PM, Mark Brown wrote:
> On Tue, Mar 10, 2020 at 11:35:08AM -0500, Pierre-Louis Bossart wrote:
>> Exclude all I2C-related code from compilation to avoid compilation
>> errors and defined but not used warnings.
> 
> I think it would be better to do this by factoring the bus code out into
> a separate file like we've done with I2C and SPI, it's neater than
> ifdefs and easier to get right going forwards.

Agree, this was just a quick fix to solve compilation issues.

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

end of thread, other threads:[~2020-03-10 18:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-10 16:35 [PATCH 0/3] ASoC: rt5682: fix Kconfig/compilation issues when I2C is not selected Pierre-Louis Bossart
2020-03-10 16:35 ` [PATCH 1/3] ASoC: rt5682: fix unmet dependencies Pierre-Louis Bossart
2020-03-10 18:19   ` Applied "ASoC: rt5682: fix unmet dependencies" to the asoc tree Mark Brown
2020-03-10 16:35 ` [PATCH 2/3] ASoC: rt5682: fix compilation issues without I2C Pierre-Louis Bossart
2020-03-10 17:19   ` Mark Brown
2020-03-10 18:50     ` Pierre-Louis Bossart
2020-03-10 16:35 ` [PATCH 3/3] ASoC: rt5682-sdw: fix 'defined but not used' pm functions Pierre-Louis Bossart
2020-03-10 18:19   ` Applied "ASoC: rt5682-sdw: fix 'defined but not used' pm functions" to the asoc tree Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).