Skip to content

Commit

Permalink
ASoC: rt5640: add an of_match table
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Mark Brown <broonie@linaro.org>
  • Loading branch information
Stephen Warren authored and Mark Brown committed Mar 31, 2014
1 parent c159a85 commit 03a620d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions sound/soc/codecs/rt5640.c
Original file line number Diff line number Diff line change
Expand Up @@ -2074,6 +2074,14 @@ static const struct i2c_device_id rt5640_i2c_id[] = {
};
MODULE_DEVICE_TABLE(i2c, rt5640_i2c_id);

#if defined(CONFIG_OF)
static const struct of_device_id rt5640_of_match[] = {
{ .compatible = "realtek,rt5640", },
{},
};
MODULE_DEVICE_TABLE(of, rt5640_of_match);
#endif

#ifdef CONFIG_ACPI
static struct acpi_device_id rt5640_acpi_match[] = {
{ "INT33CA", 0 },
Expand Down Expand Up @@ -2203,6 +2211,7 @@ static struct i2c_driver rt5640_i2c_driver = {
.name = "rt5640",
.owner = THIS_MODULE,
.acpi_match_table = ACPI_PTR(rt5640_acpi_match),
.of_match_table = of_match_ptr(rt5640_of_match),
},
.probe = rt5640_i2c_probe,
.remove = rt5640_i2c_remove,
Expand Down

0 comments on commit 03a620d

Please sign in to comment.