]>
Commit | Line | Data |
---|---|---|
1408c354 GKH |
1 | From foo@baz Tue Oct 16 12:20:44 CEST 2018 |
2 | From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> | |
3 | Date: Wed, 22 Aug 2018 22:49:36 -0500 | |
4 | Subject: ASoC: wm8804: Add ACPI support | |
5 | ||
6 | From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> | |
7 | ||
8 | [ Upstream commit 960cdd50ca9fdfeb82c2757107bcb7f93c8d7d41 ] | |
9 | ||
10 | HID made of either Wolfson/CirrusLogic PCI ID + 8804 identifier. | |
11 | ||
12 | This helps enumerate the HifiBerry Digi+ HAT boards on the Up2 platform. | |
13 | ||
14 | The scripts at https://github.com/thesofproject/acpi-scripts can be | |
15 | used to add the ACPI initrd overlays. | |
16 | ||
17 | Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> | |
18 | Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com> | |
19 | Signed-off-by: Mark Brown <broonie@kernel.org> | |
20 | Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> | |
21 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
22 | --- | |
23 | sound/soc/codecs/wm8804-i2c.c | 15 ++++++++++++++- | |
24 | 1 file changed, 14 insertions(+), 1 deletion(-) | |
25 | ||
26 | --- a/sound/soc/codecs/wm8804-i2c.c | |
27 | +++ b/sound/soc/codecs/wm8804-i2c.c | |
28 | @@ -13,6 +13,7 @@ | |
29 | #include <linux/init.h> | |
30 | #include <linux/module.h> | |
31 | #include <linux/i2c.h> | |
32 | +#include <linux/acpi.h> | |
33 | ||
34 | #include "wm8804.h" | |
35 | ||
36 | @@ -40,17 +41,29 @@ static const struct i2c_device_id wm8804 | |
37 | }; | |
38 | MODULE_DEVICE_TABLE(i2c, wm8804_i2c_id); | |
39 | ||
40 | +#if defined(CONFIG_OF) | |
41 | static const struct of_device_id wm8804_of_match[] = { | |
42 | { .compatible = "wlf,wm8804", }, | |
43 | { } | |
44 | }; | |
45 | MODULE_DEVICE_TABLE(of, wm8804_of_match); | |
46 | +#endif | |
47 | + | |
48 | +#ifdef CONFIG_ACPI | |
49 | +static const struct acpi_device_id wm8804_acpi_match[] = { | |
50 | + { "1AEC8804", 0 }, /* Wolfson PCI ID + part ID */ | |
51 | + { "10138804", 0 }, /* Cirrus Logic PCI ID + part ID */ | |
52 | + { }, | |
53 | +}; | |
54 | +MODULE_DEVICE_TABLE(acpi, wm8804_acpi_match); | |
55 | +#endif | |
56 | ||
57 | static struct i2c_driver wm8804_i2c_driver = { | |
58 | .driver = { | |
59 | .name = "wm8804", | |
60 | .pm = &wm8804_pm, | |
61 | - .of_match_table = wm8804_of_match, | |
62 | + .of_match_table = of_match_ptr(wm8804_of_match), | |
63 | + .acpi_match_table = ACPI_PTR(wm8804_acpi_match), | |
64 | }, | |
65 | .probe = wm8804_i2c_probe, | |
66 | .remove = wm8804_i2c_remove, |