Skip to content

Commit

Permalink
ASoC: pcm512x: Add ACPI support
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
plbossart authored and broonie committed May 18, 2018
1 parent 3a4f4f2 commit b84f48d
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion sound/soc/codecs/pcm512x-i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <linux/init.h>
#include <linux/module.h>
#include <linux/i2c.h>
#include <linux/acpi.h>

#include "pcm512x.h"

Expand Down Expand Up @@ -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", },
Expand All @@ -60,14 +62,27 @@ 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,
.remove = pcm512x_i2c_remove,
.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,
},
};
Expand Down

0 comments on commit b84f48d

Please sign in to comment.