All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: pcm512x: Add ACPI support
@ 2018-05-17 22:53 Pierre-Louis Bossart
  2018-05-18  4:36 ` Vinod
  2018-05-18 16:46 ` Applied "ASoC: pcm512x: Add ACPI support" to the asoc tree Mark Brown
  0 siblings, 2 replies; 5+ messages in thread
From: Pierre-Louis Bossart @ 2018-05-17 22:53 UTC (permalink / raw)
  To: alsa-devel
  Cc: tiwai, Keyon Jie, Pierre-Louis Bossart, liam.r.girdwood, vkoul, broonie

HID is assumed to be made of TI PCI ID (0x104C) + part number, so all
four 104C5121, 104C5122, 104C5141 104C5142 are valid.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/codecs/pcm512x-i2c.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/sound/soc/codecs/pcm512x-i2c.c b/sound/soc/codecs/pcm512x-i2c.c
index 5f9c069569d5..0fe5ced841a3 100644
--- a/sound/soc/codecs/pcm512x-i2c.c
+++ b/sound/soc/codecs/pcm512x-i2c.c
@@ -17,6 +17,7 @@
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/i2c.h>
+#include <linux/acpi.h>
 
 #include "pcm512x.h"
 
@@ -52,6 +53,7 @@ static const struct i2c_device_id pcm512x_i2c_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, pcm512x_i2c_id);
 
+#if defined(CONFIG_OF)
 static const struct of_device_id pcm512x_of_match[] = {
 	{ .compatible = "ti,pcm5121", },
 	{ .compatible = "ti,pcm5122", },
@@ -60,6 +62,18 @@ static const struct of_device_id pcm512x_of_match[] = {
 	{ }
 };
 MODULE_DEVICE_TABLE(of, pcm512x_of_match);
+#endif
+
+#ifdef CONFIG_ACPI
+static const struct acpi_device_id pcm512x_acpi_match[] = {
+	{ "104C5121", 0 },
+	{ "104C5122", 0 },
+	{ "104C5141", 0 },
+	{ "104C5142", 0 },
+	{ },
+};
+MODULE_DEVICE_TABLE(acpi, pcm512x_acpi_match);
+#endif
 
 static struct i2c_driver pcm512x_i2c_driver = {
 	.probe 		= pcm512x_i2c_probe,
@@ -67,7 +81,8 @@ static struct i2c_driver pcm512x_i2c_driver = {
 	.id_table	= pcm512x_i2c_id,
 	.driver		= {
 		.name	= "pcm512x",
-		.of_match_table = pcm512x_of_match,
+		.of_match_table = of_match_ptr(pcm512x_of_match),
+		.acpi_match_table = ACPI_PTR(pcm512x_acpi_match),
 		.pm     = &pcm512x_pm_ops,
 	},
 };
-- 
2.14.1

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

* Re: [PATCH] ASoC: pcm512x: Add ACPI support
  2018-05-17 22:53 [PATCH] ASoC: pcm512x: Add ACPI support Pierre-Louis Bossart
@ 2018-05-18  4:36 ` Vinod
  2018-05-18 16:07   ` Pierre-Louis Bossart
  2018-05-18 16:46 ` Applied "ASoC: pcm512x: Add ACPI support" to the asoc tree Mark Brown
  1 sibling, 1 reply; 5+ messages in thread
From: Vinod @ 2018-05-18  4:36 UTC (permalink / raw)
  To: Pierre-Louis Bossart
  Cc: tiwai, liam.r.girdwood, alsa-devel, broonie, Keyon Jie

On 17-05-18, 17:53, Pierre-Louis Bossart wrote:
> HID is assumed to be made of TI PCI ID (0x104C) + part number, so all
> four 104C5121, 104C5122, 104C5141 104C5142 are valid.
> 
> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> ---

...

>  static struct i2c_driver pcm512x_i2c_driver = {
>  	.probe 		= pcm512x_i2c_probe,
> @@ -67,7 +81,8 @@ static struct i2c_driver pcm512x_i2c_driver = {
>  	.id_table	= pcm512x_i2c_id,
>  	.driver		= {
>  		.name	= "pcm512x",
> -		.of_match_table = pcm512x_of_match,
> +		.of_match_table = of_match_ptr(pcm512x_of_match),

this change may not be part of this and should be mentioned in the log

Also quick grep tells me kernel has both :(

> +		.acpi_match_table = ACPI_PTR(pcm512x_acpi_match),
>  		.pm     = &pcm512x_pm_ops,
>  	},
>  };
> -- 
> 2.14.1

-- 
~Vinod

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

* Re: [PATCH] ASoC: pcm512x: Add ACPI support
  2018-05-18  4:36 ` Vinod
@ 2018-05-18 16:07   ` Pierre-Louis Bossart
  2018-05-18 16:16     ` Takashi Iwai
  0 siblings, 1 reply; 5+ messages in thread
From: Pierre-Louis Bossart @ 2018-05-18 16:07 UTC (permalink / raw)
  To: Vinod; +Cc: tiwai, liam.r.girdwood, alsa-devel, broonie, Keyon Jie

On 5/17/18 11:36 PM, Vinod wrote:
> On 17-05-18, 17:53, Pierre-Louis Bossart wrote:
>> HID is assumed to be made of TI PCI ID (0x104C) + part number, so all
>> four 104C5121, 104C5122, 104C5141 104C5142 are valid.
>>
>> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
>> ---
> 
> ...
> 
>>   static struct i2c_driver pcm512x_i2c_driver = {
>>   	.probe 		= pcm512x_i2c_probe,
>> @@ -67,7 +81,8 @@ static struct i2c_driver pcm512x_i2c_driver = {
>>   	.id_table	= pcm512x_i2c_id,
>>   	.driver		= {
>>   		.name	= "pcm512x",
>> -		.of_match_table = pcm512x_of_match,
>> +		.of_match_table = of_match_ptr(pcm512x_of_match),
> 
> this change may not be part of this and should be mentioned in the log
> 
> Also quick grep tells me kernel has both :(

I don't get your point. This is how we've added support for ACPI for 
every codec so far, and using those macros is the way to make sure the 
DT case still builds and isn't impacted.

> 
>> +		.acpi_match_table = ACPI_PTR(pcm512x_acpi_match),
>>   		.pm     = &pcm512x_pm_ops,
>>   	},
>>   };
>> -- 
>> 2.14.1
> 

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

* Re: [PATCH] ASoC: pcm512x: Add ACPI support
  2018-05-18 16:07   ` Pierre-Louis Bossart
@ 2018-05-18 16:16     ` Takashi Iwai
  0 siblings, 0 replies; 5+ messages in thread
From: Takashi Iwai @ 2018-05-18 16:16 UTC (permalink / raw)
  To: Pierre-Louis Bossart
  Cc: liam.r.girdwood, Vinod, broonie, Keyon Jie, alsa-devel

On Fri, 18 May 2018 18:07:26 +0200,
Pierre-Louis Bossart wrote:
> 
> On 5/17/18 11:36 PM, Vinod wrote:
> > On 17-05-18, 17:53, Pierre-Louis Bossart wrote:
> >> HID is assumed to be made of TI PCI ID (0x104C) + part number, so all
> >> four 104C5121, 104C5122, 104C5141 104C5142 are valid.
> >>
> >> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> >> ---
> >
> > ...
> >
> >>   static struct i2c_driver pcm512x_i2c_driver = {
> >>   	.probe 		= pcm512x_i2c_probe,
> >> @@ -67,7 +81,8 @@ static struct i2c_driver pcm512x_i2c_driver = {
> >>   	.id_table	= pcm512x_i2c_id,
> >>   	.driver		= {
> >>   		.name	= "pcm512x",
> >> -		.of_match_table = pcm512x_of_match,
> >> +		.of_match_table = of_match_ptr(pcm512x_of_match),
> >
> > this change may not be part of this and should be mentioned in the log
> >
> > Also quick grep tells me kernel has both :(
> 
> I don't get your point. This is how we've added support for ACPI for
> every codec so far, and using those macros is the way to make sure the
> DT case still builds and isn't impacted.

Well, my interpretation is that this change is needed to allow the
driver built without CONFIG_OF, and it's not only about ACPI, per se.


Takashi

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

* Applied "ASoC: pcm512x: Add ACPI support" to the asoc tree
  2018-05-17 22:53 [PATCH] ASoC: pcm512x: Add ACPI support Pierre-Louis Bossart
  2018-05-18  4:36 ` Vinod
@ 2018-05-18 16:46 ` Mark Brown
  1 sibling, 0 replies; 5+ messages in thread
From: Mark Brown @ 2018-05-18 16:46 UTC (permalink / raw)
  To: Pierre-Louis Bossart
  Cc: alsa-devel, tiwai, Keyon Jie, liam.r.girdwood, vkoul, broonie

The patch

   ASoC: pcm512x: Add ACPI support

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 b84f48d18124da49a06e5d4ba6525b2955f15899 Mon Sep 17 00:00:00 2001
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Date: Thu, 17 May 2018 17:53:26 -0500
Subject: [PATCH] ASoC: pcm512x: Add ACPI support

HID is assumed to be made of TI PCI ID (0x104C) + part number, so all
four 104C5121, 104C5122, 104C5141 104C5142 are valid.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/codecs/pcm512x-i2c.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/sound/soc/codecs/pcm512x-i2c.c b/sound/soc/codecs/pcm512x-i2c.c
index 5f9c069569d5..0fe5ced841a3 100644
--- a/sound/soc/codecs/pcm512x-i2c.c
+++ b/sound/soc/codecs/pcm512x-i2c.c
@@ -17,6 +17,7 @@
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/i2c.h>
+#include <linux/acpi.h>
 
 #include "pcm512x.h"
 
@@ -52,6 +53,7 @@ static const struct i2c_device_id pcm512x_i2c_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, pcm512x_i2c_id);
 
+#if defined(CONFIG_OF)
 static const struct of_device_id pcm512x_of_match[] = {
 	{ .compatible = "ti,pcm5121", },
 	{ .compatible = "ti,pcm5122", },
@@ -60,6 +62,18 @@ static const struct of_device_id pcm512x_of_match[] = {
 	{ }
 };
 MODULE_DEVICE_TABLE(of, pcm512x_of_match);
+#endif
+
+#ifdef CONFIG_ACPI
+static const struct acpi_device_id pcm512x_acpi_match[] = {
+	{ "104C5121", 0 },
+	{ "104C5122", 0 },
+	{ "104C5141", 0 },
+	{ "104C5142", 0 },
+	{ },
+};
+MODULE_DEVICE_TABLE(acpi, pcm512x_acpi_match);
+#endif
 
 static struct i2c_driver pcm512x_i2c_driver = {
 	.probe 		= pcm512x_i2c_probe,
@@ -67,7 +81,8 @@ static struct i2c_driver pcm512x_i2c_driver = {
 	.id_table	= pcm512x_i2c_id,
 	.driver		= {
 		.name	= "pcm512x",
-		.of_match_table = pcm512x_of_match,
+		.of_match_table = of_match_ptr(pcm512x_of_match),
+		.acpi_match_table = ACPI_PTR(pcm512x_acpi_match),
 		.pm     = &pcm512x_pm_ops,
 	},
 };
-- 
2.17.0

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

end of thread, other threads:[~2018-05-18 16:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-17 22:53 [PATCH] ASoC: pcm512x: Add ACPI support Pierre-Louis Bossart
2018-05-18  4:36 ` Vinod
2018-05-18 16:07   ` Pierre-Louis Bossart
2018-05-18 16:16     ` Takashi Iwai
2018-05-18 16:46 ` Applied "ASoC: pcm512x: Add ACPI support" to the asoc tree Mark Brown

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.