Skip to content

Commit 1316e0a

Browse files
vadimp-nvidiajwrdegoede
authored andcommitted
platform: mellanox: mlx-platform: Introduce ACPI init flow
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> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/20230822113451.13785-12-vadimp@nvidia.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
1 parent 2229544 commit 1316e0a

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

drivers/platform/x86/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -965,6 +965,7 @@ config SERIAL_MULTI_INSTANTIATE
965965

966966
config MLX_PLATFORM
967967
tristate "Mellanox Technologies platform support"
968+
depends on ACPI
968969
depends on I2C
969970
select REGMAP
970971
help

drivers/platform/x86/mlx-platform.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6396,9 +6396,14 @@ static int mlxplat_probe(struct platform_device *pdev)
63966396
{
63976397
unsigned int hotplug_resources_size = 0;
63986398
struct resource *hotplug_resources = NULL;
6399+
struct acpi_device *acpi_dev;
63996400
struct mlxplat_priv *priv;
64006401
int i, err;
64016402

6403+
acpi_dev = ACPI_COMPANION(&pdev->dev);
6404+
if (acpi_dev)
6405+
mlxplat_dev = pdev;
6406+
64026407
err = mlxplat_pre_init(&hotplug_resources, &hotplug_resources_size);
64036408
if (err)
64046409
return err;
@@ -6476,9 +6481,16 @@ static int mlxplat_remove(struct platform_device *pdev)
64766481
return 0;
64776482
}
64786483

6484+
static const struct acpi_device_id mlxplat_acpi_table[] = {
6485+
{ "MLNXBF49", 0 },
6486+
{}
6487+
};
6488+
MODULE_DEVICE_TABLE(acpi, mlxplat_acpi_table);
6489+
64796490
static struct platform_driver mlxplat_driver = {
64806491
.driver = {
64816492
.name = "mlxplat",
6493+
.acpi_match_table = mlxplat_acpi_table,
64826494
.probe_type = PROBE_FORCE_SYNCHRONOUS,
64836495
},
64846496
.probe = mlxplat_probe,

0 commit comments

Comments
 (0)