Skip to content

Commit 7e0bdba

Browse files
nicola-lunghibroonie
authored andcommitted
ASoC: wm8960: Add ACPI support
HID made of either Wolfson/CirrusLogic PCI ID + 8960 identifier This helps enumerate the Waveshare WM8960 WM8960 Hi-Fi Sound Card HAT on the Up2 platform. The scripts at https://github.com/thesofproject/acpi-scripts can be used to add the ACPI initrd overlay. This commit is similar to the commit: 960cdd5 ("ASoC: wm8804: Add ACPI support") Signed-off-by: Nicola Lunghi <[email protected]> Acked-by: Charles Keepax <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent c61711c commit 7e0bdba

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

sound/soc/codecs/wm8960.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <linux/pm.h>
1515
#include <linux/clk.h>
1616
#include <linux/i2c.h>
17+
#include <linux/acpi.h>
1718
#include <linux/slab.h>
1819
#include <sound/core.h>
1920
#include <sound/pcm.h>
@@ -1498,16 +1499,28 @@ static const struct i2c_device_id wm8960_i2c_id[] = {
14981499
};
14991500
MODULE_DEVICE_TABLE(i2c, wm8960_i2c_id);
15001501

1502+
#if defined(CONFIG_OF)
15011503
static const struct of_device_id wm8960_of_match[] = {
15021504
{ .compatible = "wlf,wm8960", },
15031505
{ }
15041506
};
15051507
MODULE_DEVICE_TABLE(of, wm8960_of_match);
1508+
#endif
1509+
1510+
#if defined(CONFIG_ACPI)
1511+
static const struct acpi_device_id wm8960_acpi_match[] = {
1512+
{ "1AEC8960", 0 }, /* Wolfson PCI ID + part ID */
1513+
{ "10138960", 0 }, /* Cirrus Logic PCI ID + part ID */
1514+
{ },
1515+
};
1516+
MODULE_DEVICE_TABLE(acpi, wm8960_acpi_match);
1517+
#endif
15061518

15071519
static struct i2c_driver wm8960_i2c_driver = {
15081520
.driver = {
15091521
.name = "wm8960",
1510-
.of_match_table = wm8960_of_match,
1522+
.of_match_table = of_match_ptr(wm8960_of_match),
1523+
.acpi_match_table = ACPI_PTR(wm8960_acpi_match),
15111524
},
15121525
.probe = wm8960_i2c_probe,
15131526
.remove = wm8960_i2c_remove,

0 commit comments

Comments
 (0)