diff mbox series

[platform-next,11/16] platform: mellanox: mlx-platform: Introduce ACPI init flow

Message ID 20230814085910.56069-12-vadimp@nvidia.com (mailing list archive)
State Superseded, archived
Headers show
Series Add new features and amendments for Nvidia systems | expand

Commit Message

Vadim Pasternak Aug. 14, 2023, 8:59 a.m. UTC
Introduce support for ACPI initialization flow - add ACPI match hook.

Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Michael Shych <michaelsh@nvidia.com>
---
 drivers/platform/x86/mlx-platform.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff mbox series

Patch

diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c
index 68bfa446738e..e2226c218a54 100644
--- a/drivers/platform/x86/mlx-platform.c
+++ b/drivers/platform/x86/mlx-platform.c
@@ -6398,6 +6398,9 @@  static int mlxplat_probe(struct platform_device *pdev)
 	struct mlxplat_priv *priv;
 	int i, err;
 
+	if (ACPI_COMPANION(&pdev->dev))
+		mlxplat_dev = pdev;
+
 	err = mlxplat_pre_init(&hotplug_resources, &hotplug_resources_size);
 	if (err)
 		return err;
@@ -6475,9 +6478,16 @@  static int mlxplat_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static const struct acpi_device_id mlxplat_acpi_table[] = {
+	{ "MLNXBF49", 0 },
+	{}
+};
+MODULE_DEVICE_TABLE(acpi, mlxplat_acpi_table);
+
 static struct platform_driver mlxplat_driver = {
 	.driver		= {
 		.name	= "mlxplat",
+		.acpi_match_table = ACPI_PTR(mlxplat_acpi_table),
 		.probe_type = PROBE_FORCE_SYNCHRONOUS,
 	},
 	.probe		= mlxplat_probe,