diff options
author | Javier Martinez Canillas <javier@osg.samsung.com> | 2017-04-04 15:26:26 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2017-04-05 13:20:19 -0400 |
commit | 71c314d7ef2442cd798584a3dece8151215e1777 (patch) | |
tree | 97d8664a3f789b996281137a1bb021069b469efd | |
parent | a5de5b74a50113564a1e0850e2da96c37c35e55d (diff) |
ASoC: ssm4567: Add OF device ID table
The driver doesn't have a struct of_device_id table but supported devices
are registered via Device Trees. This is working on the assumption that a
I2C device registered via OF will always match a legacy I2C device ID and
that the MODALIAS reported will always be of the form i2c:<device>.
But this could change in the future so the correct approach is to have an
OF device ID table if the devices are registered via OF.
Before this patch:
$ modinfo sound/soc/codecs/snd-soc-ssm4567.ko | grep alias
alias: acpi*:INT343B:*
alias: i2c:ssm4567
After this patch:
$ modinfo sound/soc/codecs/snd-soc-ssm4567.ko | grep alias
alias: acpi*:INT343B:*
alias: of:N*T*Cadi,ssm4567C*
alias: of:N*T*Cadi,ssm4567
alias: i2c:ssm4567
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/codecs/ssm4567.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sound/soc/codecs/ssm4567.c b/sound/soc/codecs/ssm4567.c index 2bb5a11c9ba1..a622623e8558 100644 --- a/sound/soc/codecs/ssm4567.c +++ b/sound/soc/codecs/ssm4567.c | |||
@@ -485,6 +485,14 @@ static const struct i2c_device_id ssm4567_i2c_ids[] = { | |||
485 | }; | 485 | }; |
486 | MODULE_DEVICE_TABLE(i2c, ssm4567_i2c_ids); | 486 | MODULE_DEVICE_TABLE(i2c, ssm4567_i2c_ids); |
487 | 487 | ||
488 | #ifdef CONFIG_OF | ||
489 | static const struct of_device_id ssm4567_of_match[] = { | ||
490 | { .compatible = "adi,ssm4567", }, | ||
491 | { } | ||
492 | }; | ||
493 | MODULE_DEVICE_TABLE(of, ssm4567_of_match); | ||
494 | #endif | ||
495 | |||
488 | #ifdef CONFIG_ACPI | 496 | #ifdef CONFIG_ACPI |
489 | 497 | ||
490 | static const struct acpi_device_id ssm4567_acpi_match[] = { | 498 | static const struct acpi_device_id ssm4567_acpi_match[] = { |
@@ -498,6 +506,7 @@ MODULE_DEVICE_TABLE(acpi, ssm4567_acpi_match); | |||
498 | static struct i2c_driver ssm4567_driver = { | 506 | static struct i2c_driver ssm4567_driver = { |
499 | .driver = { | 507 | .driver = { |
500 | .name = "ssm4567", | 508 | .name = "ssm4567", |
509 | .of_match_table = of_match_ptr(ssm4567_of_match), | ||
501 | .acpi_match_table = ACPI_PTR(ssm4567_acpi_match), | 510 | .acpi_match_table = ACPI_PTR(ssm4567_acpi_match), |
502 | }, | 511 | }, |
503 | .probe = ssm4567_i2c_probe, | 512 | .probe = ssm4567_i2c_probe, |