diff mbox series

ASoC: rt1015p: add acpi device id for rt1015p

Message ID 20210225084545.13359-1-jack.yu@realtek.com
State Superseded
Headers show
Series ASoC: rt1015p: add acpi device id for rt1015p | expand

Commit Message

Jack Yu Feb. 25, 2021, 8:45 a.m. UTC
From: Jack Yu <jack.yu@realtek.com>

Add acpi device id for rt1015p.

Signed-off-by: Jack Yu <jack.yu@realtek.com>
---
 sound/soc/codecs/rt1015p.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Comments

Tzung-Bi Shih Feb. 25, 2021, 9:40 a.m. UTC | #1
On Thu, Feb 25, 2021 at 4:47 PM <jack.yu@realtek.com> wrote:
>  static struct platform_driver rt1015p_platform_driver = {
>         .driver = {
>                 .name = "rt1015p",
>                 .of_match_table = of_match_ptr(rt1015p_device_id),
> +#ifdef CONFIG_ACPI
> +               .acpi_match_table = ACPI_PTR(rt1015p_acpi_match),
> +#endif

You don't need the guard because ACPI_PTR() returns NULL if
CONFIG_ACPI is not defined.
Pierre-Louis Bossart Feb. 25, 2021, 5:15 p.m. UTC | #2
> +static const struct acpi_device_id rt1015p_acpi_match[] = {
> +	{ "RT1015", 0},

This is not an ACPI compliant HID, please don't do this. acpica-tools 
will flag an error on this.

And this is super confusing since you already have this in rt1015.c

static struct acpi_device_id rt1015_acpi_match[] = {
	{"10EC1015", 0,},
	{},
};
diff mbox series

Patch

diff --git a/sound/soc/codecs/rt1015p.c b/sound/soc/codecs/rt1015p.c
index 671f2a2130fe..4a00e7a4ef6f 100644
--- a/sound/soc/codecs/rt1015p.c
+++ b/sound/soc/codecs/rt1015p.c
@@ -4,6 +4,7 @@ 
 //
 // Copyright 2020 The Linux Foundation. All rights reserved.
 
+#include <linux/acpi.h>
 #include <linux/delay.h>
 #include <linux/device.h>
 #include <linux/err.h>
@@ -130,10 +131,21 @@  static const struct of_device_id rt1015p_device_id[] = {
 MODULE_DEVICE_TABLE(of, rt1015p_device_id);
 #endif
 
+#ifdef CONFIG_ACPI
+static const struct acpi_device_id rt1015p_acpi_match[] = {
+	{ "RT1015", 0},
+	{ },
+};
+MODULE_DEVICE_TABLE(acpi, rt1015p_acpi_match);
+#endif
+
 static struct platform_driver rt1015p_platform_driver = {
 	.driver = {
 		.name = "rt1015p",
 		.of_match_table = of_match_ptr(rt1015p_device_id),
+#ifdef CONFIG_ACPI
+		.acpi_match_table = ACPI_PTR(rt1015p_acpi_match),
+#endif
 	},
 	.probe = rt1015p_platform_probe,
 };