Skip to content

Commit ada9ecc

Browse files
vadimp-nvidiajwrdegoede
authored andcommitted
platform: mellanox: mlx-platform: Get interrupt line through ACPI
Add support for getting system interrupt line from ACPI table. 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-13-vadimp@nvidia.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
1 parent 1316e0a commit ada9ecc

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

drivers/platform/x86/mlx-platform.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,7 @@
343343
* @hotplug_resources: system hotplug resources
344344
* @hotplug_resources_size: size of system hotplug resources
345345
* @hi2c_main_init_status: init status of I2C main bus
346+
* @irq_fpga: FPGA IRQ number
346347
*/
347348
struct mlxplat_priv {
348349
struct platform_device *pdev_i2c;
@@ -356,6 +357,7 @@ struct mlxplat_priv {
356357
struct resource *hotplug_resources;
357358
unsigned int hotplug_resources_size;
358359
u8 i2c_main_init_status;
360+
int irq_fpga;
359361
};
360362

361363
static struct platform_device *mlxplat_dev;
@@ -6188,6 +6190,8 @@ static int mlxplat_post_init(struct mlxplat_priv *priv)
61886190
/* Add hotplug driver */
61896191
if (mlxplat_hotplug) {
61906192
mlxplat_hotplug->regmap = priv->regmap;
6193+
if (priv->irq_fpga)
6194+
mlxplat_hotplug->irq = priv->irq_fpga;
61916195
priv->pdev_hotplug =
61926196
platform_device_register_resndata(&mlxplat_dev->dev,
61936197
"mlxreg-hotplug", PLATFORM_DEVID_NONE,
@@ -6398,11 +6402,15 @@ static int mlxplat_probe(struct platform_device *pdev)
63986402
struct resource *hotplug_resources = NULL;
63996403
struct acpi_device *acpi_dev;
64006404
struct mlxplat_priv *priv;
6401-
int i, err;
6405+
int irq_fpga = 0, i, err;
64026406

64036407
acpi_dev = ACPI_COMPANION(&pdev->dev);
6404-
if (acpi_dev)
6408+
if (acpi_dev) {
6409+
irq_fpga = acpi_dev_gpio_irq_get(acpi_dev, 0);
6410+
if (irq_fpga < 0)
6411+
return -ENODEV;
64056412
mlxplat_dev = pdev;
6413+
}
64066414

64076415
err = mlxplat_pre_init(&hotplug_resources, &hotplug_resources_size);
64086416
if (err)
@@ -6417,6 +6425,7 @@ static int mlxplat_probe(struct platform_device *pdev)
64176425
platform_set_drvdata(mlxplat_dev, priv);
64186426
priv->hotplug_resources = hotplug_resources;
64196427
priv->hotplug_resources_size = hotplug_resources_size;
6428+
priv->irq_fpga = irq_fpga;
64206429

64216430
if (!mlxplat_regmap_config)
64226431
mlxplat_regmap_config = &mlxplat_mlxcpld_regmap_config;

0 commit comments

Comments
 (0)