* [PATCH 1/3] ASoC: alc5632: add an of_match table
@ 2014-03-31 18:38 Stephen Warren
2014-03-31 18:38 ` [PATCH 2/3] ASoC: tlv320aic23: " Stephen Warren
` (4 more replies)
0 siblings, 5 replies; 14+ messages in thread
From: Stephen Warren @ 2014-03-31 18:38 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown; +Cc: alsa-devel, Stephen Warren
From: Stephen Warren <swarren@nvidia.com>
Add a device tree match table. This serves to make the driver's support
of device tree more explicit. Perhaps the fallback for DT matching to
using the i2c_device_id table will go away one day, since it fails in
face of devices from different vendors with the same name.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
sound/soc/codecs/alc5632.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/sound/soc/codecs/alc5632.c b/sound/soc/codecs/alc5632.c
index 3ee8d4e41a99..85942ca36cbf 100644
--- a/sound/soc/codecs/alc5632.c
+++ b/sound/soc/codecs/alc5632.c
@@ -1190,11 +1190,18 @@ static const struct i2c_device_id alc5632_i2c_table[] = {
};
MODULE_DEVICE_TABLE(i2c, alc5632_i2c_table);
+static const struct of_device_id alc5632_of_match[] = {
+ { .compatible = "realtek,alc5632", },
+ { }
+};
+MODULE_DEVICE_TABLE(of, alc5632_of_match);
+
/* i2c codec control layer */
static struct i2c_driver alc5632_i2c_driver = {
.driver = {
.name = "alc5632",
.owner = THIS_MODULE,
+ .of_match_table = of_match_ptr(alc5632_of_match),
},
.probe = alc5632_i2c_probe,
.remove = alc5632_i2c_remove,
--
1.8.1.5
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 2/3] ASoC: tlv320aic23: add an of_match table
2014-03-31 18:38 [PATCH 1/3] ASoC: alc5632: add an of_match table Stephen Warren
@ 2014-03-31 18:38 ` Stephen Warren
2014-04-01 11:45 ` Mark Brown
2014-03-31 18:38 ` [PATCH 3/3] ASoC: max98090: " Stephen Warren
` (3 subsequent siblings)
4 siblings, 1 reply; 14+ messages in thread
From: Stephen Warren @ 2014-03-31 18:38 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown; +Cc: alsa-devel, Stephen Warren
From: Stephen Warren <swarren@nvidia.com>
Add a device tree match table. This serves to make the driver's support
of device tree more explicit. Perhaps the fallback for DT matching to
using the i2c_device_id table will go away one day, since it fails in
face of devices from different vendors with the same name.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
sound/soc/codecs/tlv320aic23-i2c.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/sound/soc/codecs/tlv320aic23-i2c.c b/sound/soc/codecs/tlv320aic23-i2c.c
index 20fc46092c2c..b73c94ebcc2a 100644
--- a/sound/soc/codecs/tlv320aic23-i2c.c
+++ b/sound/soc/codecs/tlv320aic23-i2c.c
@@ -43,9 +43,16 @@ static const struct i2c_device_id tlv320aic23_id[] = {
MODULE_DEVICE_TABLE(i2c, tlv320aic23_id);
+static const struct of_device_id tlv320aic23_of_match[] = {
+ { .compatible = "ti,tlv320aic23", },
+ { }
+};
+MODULE_DEVICE_TABLE(of, tlv320aic23_of_match);
+
static struct i2c_driver tlv320aic23_i2c_driver = {
.driver = {
.name = "tlv320aic23-codec",
+ .of_match_table = of_match_ptr(tlv320aic23_of_match),
},
.probe = tlv320aic23_i2c_probe,
.remove = __exit_p(tlv320aic23_i2c_remove),
--
1.8.1.5
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 3/3] ASoC: max98090: add an of_match table
2014-03-31 18:38 [PATCH 1/3] ASoC: alc5632: add an of_match table Stephen Warren
2014-03-31 18:38 ` [PATCH 2/3] ASoC: tlv320aic23: " Stephen Warren
@ 2014-03-31 18:38 ` Stephen Warren
2014-04-01 11:46 ` Mark Brown
2014-03-31 18:53 ` [PATCH 1/3] ASoC: alc5632: " Daniel Mack
` (2 subsequent siblings)
4 siblings, 1 reply; 14+ messages in thread
From: Stephen Warren @ 2014-03-31 18:38 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown; +Cc: alsa-devel, Stephen Warren
From: Stephen Warren <swarren@nvidia.com>
Add a device tree match table. This serves to make the driver's support
of device tree more explicit. Perhaps the fallback for DT matching to
using the i2c_device_id table will go away one day, since it fails in
face of devices from different vendors with the same name.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
sound/soc/codecs/max98090.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c
index 98c6e104357c..f7b0b37aa858 100644
--- a/sound/soc/codecs/max98090.c
+++ b/sound/soc/codecs/max98090.c
@@ -2399,11 +2399,18 @@ static const struct i2c_device_id max98090_i2c_id[] = {
};
MODULE_DEVICE_TABLE(i2c, max98090_i2c_id);
+static const struct of_device_id max98090_of_match[] = {
+ { .compatible = "maxim,max98090", },
+ { }
+};
+MODULE_DEVICE_TABLE(of, max98090_of_match);
+
static struct i2c_driver max98090_i2c_driver = {
.driver = {
.name = "max98090",
.owner = THIS_MODULE,
.pm = &max98090_pm,
+ .of_match_table = of_match_ptr(max98090_of_match),
},
.probe = max98090_i2c_probe,
.remove = max98090_i2c_remove,
--
1.8.1.5
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH 1/3] ASoC: alc5632: add an of_match table
2014-03-31 18:38 [PATCH 1/3] ASoC: alc5632: add an of_match table Stephen Warren
2014-03-31 18:38 ` [PATCH 2/3] ASoC: tlv320aic23: " Stephen Warren
2014-03-31 18:38 ` [PATCH 3/3] ASoC: max98090: " Stephen Warren
@ 2014-03-31 18:53 ` Daniel Mack
2014-03-31 18:58 ` Stephen Warren
2014-03-31 19:23 ` Thierry Reding
2014-04-01 11:40 ` Mark Brown
4 siblings, 1 reply; 14+ messages in thread
From: Daniel Mack @ 2014-03-31 18:53 UTC (permalink / raw)
To: Stephen Warren, Liam Girdwood, Mark Brown; +Cc: alsa-devel, Stephen Warren
On 03/31/2014 08:38 PM, Stephen Warren wrote:
> From: Stephen Warren <swarren@nvidia.com>
>
> Add a device tree match table. This serves to make the driver's support
> of device tree more explicit. Perhaps the fallback for DT matching to
> using the i2c_device_id table will go away one day, since it fails in
> face of devices from different vendors with the same name.
>
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
> ---
> sound/soc/codecs/alc5632.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/sound/soc/codecs/alc5632.c b/sound/soc/codecs/alc5632.c
> index 3ee8d4e41a99..85942ca36cbf 100644
> --- a/sound/soc/codecs/alc5632.c
> +++ b/sound/soc/codecs/alc5632.c
> @@ -1190,11 +1190,18 @@ static const struct i2c_device_id alc5632_i2c_table[] = {
> };
> MODULE_DEVICE_TABLE(i2c, alc5632_i2c_table);
>
> +static const struct of_device_id alc5632_of_match[] = {
> + { .compatible = "realtek,alc5632", },
In order to make them usable with the simple-card machine driver, all
codecs that have DT bindings should be visible in Kconfig. Maybe this
can be done in a subsequent patch though.
Daniel
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/3] ASoC: alc5632: add an of_match table
2014-03-31 18:53 ` [PATCH 1/3] ASoC: alc5632: " Daniel Mack
@ 2014-03-31 18:58 ` Stephen Warren
0 siblings, 0 replies; 14+ messages in thread
From: Stephen Warren @ 2014-03-31 18:58 UTC (permalink / raw)
To: Daniel Mack, Liam Girdwood, Mark Brown; +Cc: alsa-devel, Stephen Warren
On 03/31/2014 12:53 PM, Daniel Mack wrote:
> On 03/31/2014 08:38 PM, Stephen Warren wrote:
>> From: Stephen Warren <swarren@nvidia.com>
>>
>> Add a device tree match table. This serves to make the driver's support
>> of device tree more explicit. Perhaps the fallback for DT matching to
>> using the i2c_device_id table will go away one day, since it fails in
>> face of devices from different vendors with the same name.
>>
>> Signed-off-by: Stephen Warren <swarren@nvidia.com>
>> ---
>> sound/soc/codecs/alc5632.c | 7 +++++++
>> 1 file changed, 7 insertions(+)
>>
>> diff --git a/sound/soc/codecs/alc5632.c b/sound/soc/codecs/alc5632.c
>> index 3ee8d4e41a99..85942ca36cbf 100644
>> --- a/sound/soc/codecs/alc5632.c
>> +++ b/sound/soc/codecs/alc5632.c
>> @@ -1190,11 +1190,18 @@ static const struct i2c_device_id alc5632_i2c_table[] = {
>> };
>> MODULE_DEVICE_TABLE(i2c, alc5632_i2c_table);
>>
>> +static const struct of_device_id alc5632_of_match[] = {
>> + { .compatible = "realtek,alc5632", },
>
> In order to make them usable with the simple-card machine driver, all
> codecs that have DT bindings should be visible in Kconfig. Maybe this
> can be done in a subsequent patch though.
I personally don't need to use that machine driver; the drivers patched
in this series are all already in use on Tegra using DT via other
machine drivers.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/3] ASoC: alc5632: add an of_match table
2014-03-31 18:38 [PATCH 1/3] ASoC: alc5632: add an of_match table Stephen Warren
` (2 preceding siblings ...)
2014-03-31 18:53 ` [PATCH 1/3] ASoC: alc5632: " Daniel Mack
@ 2014-03-31 19:23 ` Thierry Reding
2014-03-31 19:47 ` Stephen Warren
2014-04-01 11:40 ` Mark Brown
4 siblings, 1 reply; 14+ messages in thread
From: Thierry Reding @ 2014-03-31 19:23 UTC (permalink / raw)
To: Stephen Warren; +Cc: alsa-devel, Mark Brown, Stephen Warren, Liam Girdwood
[-- Attachment #1.1: Type: text/plain, Size: 407 bytes --]
On Mon, Mar 31, 2014 at 12:38:16PM -0600, Stephen Warren wrote:
[...]
> diff --git a/sound/soc/codecs/alc5632.c b/sound/soc/codecs/alc5632.c
[...]
> +static const struct of_device_id alc5632_of_match[] = {
> + { .compatible = "realtek,alc5632", },
> + { }
> +};
> +MODULE_DEVICE_TABLE(of, alc5632_of_match);
Doesn't this need #ifdef protection to prevent warnings about this being
unused for !OF?
Thierry
[-- Attachment #1.2: Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/3] ASoC: alc5632: add an of_match table
2014-03-31 19:23 ` Thierry Reding
@ 2014-03-31 19:47 ` Stephen Warren
2014-03-31 22:45 ` Mark Brown
0 siblings, 1 reply; 14+ messages in thread
From: Stephen Warren @ 2014-03-31 19:47 UTC (permalink / raw)
To: Thierry Reding; +Cc: alsa-devel, Mark Brown, Stephen Warren, Liam Girdwood
On 03/31/2014 01:23 PM, Thierry Reding wrote:
> On Mon, Mar 31, 2014 at 12:38:16PM -0600, Stephen Warren wrote:
> [...]
>> diff --git a/sound/soc/codecs/alc5632.c b/sound/soc/codecs/alc5632.c
> [...]
>> +static const struct of_device_id alc5632_of_match[] = {
>> + { .compatible = "realtek,alc5632", },
>> + { }
>> +};
>> +MODULE_DEVICE_TABLE(of, alc5632_of_match);
>
> Doesn't this need #ifdef protection to prevent warnings about this being
> unused for !OF?
What I really meant to do was reference these tables directly rather
than using of_match_ptr().
There seems to be a mix of ifdef'ing the table and using of_match_ptr()
vs. the other way around in ASoC. Mark, do you have a preference which
way to go?
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/3] ASoC: alc5632: add an of_match table
2014-03-31 19:47 ` Stephen Warren
@ 2014-03-31 22:45 ` Mark Brown
2014-03-31 22:53 ` Stephen Warren
0 siblings, 1 reply; 14+ messages in thread
From: Mark Brown @ 2014-03-31 22:45 UTC (permalink / raw)
To: Stephen Warren; +Cc: alsa-devel, Thierry Reding, Stephen Warren, Liam Girdwood
[-- Attachment #1.1: Type: text/plain, Size: 427 bytes --]
On Mon, Mar 31, 2014 at 01:47:04PM -0600, Stephen Warren wrote:
> There seems to be a mix of ifdef'ing the table and using of_match_ptr()
> vs. the other way around in ASoC. Mark, do you have a preference which
> way to go?
of_match_ptr() is supposed to avoid the warnings that the ifdefs fixed
more prettily - I suspect you'll find that the ones that don't use it
either predate of_match_ptr() or copied something that did.
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/3] ASoC: alc5632: add an of_match table
2014-03-31 22:45 ` Mark Brown
@ 2014-03-31 22:53 ` Stephen Warren
2014-03-31 23:05 ` Mark Brown
0 siblings, 1 reply; 14+ messages in thread
From: Stephen Warren @ 2014-03-31 22:53 UTC (permalink / raw)
To: Mark Brown; +Cc: alsa-devel, Thierry Reding, Stephen Warren, Liam Girdwood
On 03/31/2014 04:45 PM, Mark Brown wrote:
> On Mon, Mar 31, 2014 at 01:47:04PM -0600, Stephen Warren wrote:
>
>> There seems to be a mix of ifdef'ing the table and using of_match_ptr()
>> vs. the other way around in ASoC. Mark, do you have a preference which
>> way to go?
>
> of_match_ptr() is supposed to avoid the warnings that the ifdefs fixed
> more prettily - I suspect you'll find that the ones that don't use it
> either predate of_match_ptr() or copied something that did.
I believe you either have the ifdef and the of_match_ptr(), or you have
neither. The use of of_match_ptr() is required when you wrap the
struct/array in an ifdef, so that the struct/array is only referenced
when it's declared.
I guess from your response you want the struct/array wrapped in an
ifdef, and to use of_match_ptr() when referencing it. I'll go ahead with
that; no need to reply if that's what you meant.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/3] ASoC: alc5632: add an of_match table
2014-03-31 22:53 ` Stephen Warren
@ 2014-03-31 23:05 ` Mark Brown
2014-04-04 9:06 ` Thierry Reding
0 siblings, 1 reply; 14+ messages in thread
From: Mark Brown @ 2014-03-31 23:05 UTC (permalink / raw)
To: Stephen Warren; +Cc: alsa-devel, Thierry Reding, Stephen Warren, Liam Girdwood
[-- Attachment #1.1: Type: text/plain, Size: 887 bytes --]
On Mon, Mar 31, 2014 at 04:53:57PM -0600, Stephen Warren wrote:
> On 03/31/2014 04:45 PM, Mark Brown wrote:
> > of_match_ptr() is supposed to avoid the warnings that the ifdefs fixed
> > more prettily - I suspect you'll find that the ones that don't use it
> > either predate of_match_ptr() or copied something that did.
> I believe you either have the ifdef and the of_match_ptr(), or you have
> neither. The use of of_match_ptr() is required when you wrap the
> struct/array in an ifdef, so that the struct/array is only referenced
> when it's declared.
> I guess from your response you want the struct/array wrapped in an
> ifdef, and to use of_match_ptr() when referencing it. I'll go ahead with
> that; no need to reply if that's what you meant.
No, what I'm saying is you shouldn't need the ifdef any more if you use
of_match_ptr() and that's the more modern way to do things.
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/3] ASoC: alc5632: add an of_match table
2014-03-31 18:38 [PATCH 1/3] ASoC: alc5632: add an of_match table Stephen Warren
` (3 preceding siblings ...)
2014-03-31 19:23 ` Thierry Reding
@ 2014-04-01 11:40 ` Mark Brown
4 siblings, 0 replies; 14+ messages in thread
From: Mark Brown @ 2014-04-01 11:40 UTC (permalink / raw)
To: Stephen Warren; +Cc: alsa-devel, Stephen Warren, Liam Girdwood
[-- Attachment #1.1: Type: text/plain, Size: 417 bytes --]
On Mon, Mar 31, 2014 at 12:38:16PM -0600, Stephen Warren wrote:
> From: Stephen Warren <swarren@nvidia.com>
>
> Add a device tree match table. This serves to make the driver's support
> of device tree more explicit. Perhaps the fallback for DT matching to
> using the i2c_device_id table will go away one day, since it fails in
> face of devices from different vendors with the same name.
Applied, thanks.
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 2/3] ASoC: tlv320aic23: add an of_match table
2014-03-31 18:38 ` [PATCH 2/3] ASoC: tlv320aic23: " Stephen Warren
@ 2014-04-01 11:45 ` Mark Brown
0 siblings, 0 replies; 14+ messages in thread
From: Mark Brown @ 2014-04-01 11:45 UTC (permalink / raw)
To: Stephen Warren; +Cc: alsa-devel, Stephen Warren, Liam Girdwood
[-- Attachment #1.1: Type: text/plain, Size: 417 bytes --]
On Mon, Mar 31, 2014 at 12:38:17PM -0600, Stephen Warren wrote:
> From: Stephen Warren <swarren@nvidia.com>
>
> Add a device tree match table. This serves to make the driver's support
> of device tree more explicit. Perhaps the fallback for DT matching to
> using the i2c_device_id table will go away one day, since it fails in
> face of devices from different vendors with the same name.
Applied, thanks.
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 3/3] ASoC: max98090: add an of_match table
2014-03-31 18:38 ` [PATCH 3/3] ASoC: max98090: " Stephen Warren
@ 2014-04-01 11:46 ` Mark Brown
0 siblings, 0 replies; 14+ messages in thread
From: Mark Brown @ 2014-04-01 11:46 UTC (permalink / raw)
To: Stephen Warren; +Cc: alsa-devel, Stephen Warren, Liam Girdwood
[-- Attachment #1.1: Type: text/plain, Size: 417 bytes --]
On Mon, Mar 31, 2014 at 12:38:18PM -0600, Stephen Warren wrote:
> From: Stephen Warren <swarren@nvidia.com>
>
> Add a device tree match table. This serves to make the driver's support
> of device tree more explicit. Perhaps the fallback for DT matching to
> using the i2c_device_id table will go away one day, since it fails in
> face of devices from different vendors with the same name.
Applied, thanks.
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/3] ASoC: alc5632: add an of_match table
2014-03-31 23:05 ` Mark Brown
@ 2014-04-04 9:06 ` Thierry Reding
0 siblings, 0 replies; 14+ messages in thread
From: Thierry Reding @ 2014-04-04 9:06 UTC (permalink / raw)
To: Mark Brown; +Cc: alsa-devel, Stephen Warren, Liam Girdwood, Stephen Warren
[-- Attachment #1.1: Type: text/plain, Size: 1420 bytes --]
On Tue, Apr 01, 2014 at 12:05:17AM +0100, Mark Brown wrote:
> On Mon, Mar 31, 2014 at 04:53:57PM -0600, Stephen Warren wrote:
> > On 03/31/2014 04:45 PM, Mark Brown wrote:
>
> > > of_match_ptr() is supposed to avoid the warnings that the ifdefs fixed
> > > more prettily - I suspect you'll find that the ones that don't use it
> > > either predate of_match_ptr() or copied something that did.
>
> > I believe you either have the ifdef and the of_match_ptr(), or you have
> > neither. The use of of_match_ptr() is required when you wrap the
> > struct/array in an ifdef, so that the struct/array is only referenced
> > when it's declared.
>
> > I guess from your response you want the struct/array wrapped in an
> > ifdef, and to use of_match_ptr() when referencing it. I'll go ahead with
> > that; no need to reply if that's what you meant.
>
> No, what I'm saying is you shouldn't need the ifdef any more if you use
> of_match_ptr() and that's the more modern way to do things.
But I don't think that's the way it works. If you drop the #ifdef around
the struct of_device_id table and use of_match_ptr() when referencing it
then you'll get a warning from the compiler because the table is in fact
unreferenced. So all that of_match_ptr() really gives you is a way to
omit the:
#else
# define of_match_table NULL
So it doesn't really give you all that much in the end.
Thierry
[-- Attachment #1.2: Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2014-04-04 9:07 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-31 18:38 [PATCH 1/3] ASoC: alc5632: add an of_match table Stephen Warren
2014-03-31 18:38 ` [PATCH 2/3] ASoC: tlv320aic23: " Stephen Warren
2014-04-01 11:45 ` Mark Brown
2014-03-31 18:38 ` [PATCH 3/3] ASoC: max98090: " Stephen Warren
2014-04-01 11:46 ` Mark Brown
2014-03-31 18:53 ` [PATCH 1/3] ASoC: alc5632: " Daniel Mack
2014-03-31 18:58 ` Stephen Warren
2014-03-31 19:23 ` Thierry Reding
2014-03-31 19:47 ` Stephen Warren
2014-03-31 22:45 ` Mark Brown
2014-03-31 22:53 ` Stephen Warren
2014-03-31 23:05 ` Mark Brown
2014-04-04 9:06 ` Thierry Reding
2014-04-01 11:40 ` 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.