Commit ada9ecc3 authored by Vadim Pasternak's avatar Vadim Pasternak Committed by Hans de Goede

platform: mellanox: mlx-platform: Get interrupt line through ACPI

Add support for getting system interrupt line from ACPI table.
Signed-off-by: default avatarVadim Pasternak <vadimp@nvidia.com>
Reviewed-by: default avatarMichael Shych <michaelsh@nvidia.com>
Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
Reviewed-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20230822113451.13785-13-vadimp@nvidia.comSigned-off-by: default avatarHans de Goede <hdegoede@redhat.com>
parent 1316e0af
...@@ -343,6 +343,7 @@ ...@@ -343,6 +343,7 @@
* @hotplug_resources: system hotplug resources * @hotplug_resources: system hotplug resources
* @hotplug_resources_size: size of system hotplug resources * @hotplug_resources_size: size of system hotplug resources
* @hi2c_main_init_status: init status of I2C main bus * @hi2c_main_init_status: init status of I2C main bus
* @irq_fpga: FPGA IRQ number
*/ */
struct mlxplat_priv { struct mlxplat_priv {
struct platform_device *pdev_i2c; struct platform_device *pdev_i2c;
...@@ -356,6 +357,7 @@ struct mlxplat_priv { ...@@ -356,6 +357,7 @@ struct mlxplat_priv {
struct resource *hotplug_resources; struct resource *hotplug_resources;
unsigned int hotplug_resources_size; unsigned int hotplug_resources_size;
u8 i2c_main_init_status; u8 i2c_main_init_status;
int irq_fpga;
}; };
static struct platform_device *mlxplat_dev; static struct platform_device *mlxplat_dev;
...@@ -6188,6 +6190,8 @@ static int mlxplat_post_init(struct mlxplat_priv *priv) ...@@ -6188,6 +6190,8 @@ static int mlxplat_post_init(struct mlxplat_priv *priv)
/* Add hotplug driver */ /* Add hotplug driver */
if (mlxplat_hotplug) { if (mlxplat_hotplug) {
mlxplat_hotplug->regmap = priv->regmap; mlxplat_hotplug->regmap = priv->regmap;
if (priv->irq_fpga)
mlxplat_hotplug->irq = priv->irq_fpga;
priv->pdev_hotplug = priv->pdev_hotplug =
platform_device_register_resndata(&mlxplat_dev->dev, platform_device_register_resndata(&mlxplat_dev->dev,
"mlxreg-hotplug", PLATFORM_DEVID_NONE, "mlxreg-hotplug", PLATFORM_DEVID_NONE,
...@@ -6398,11 +6402,15 @@ static int mlxplat_probe(struct platform_device *pdev) ...@@ -6398,11 +6402,15 @@ static int mlxplat_probe(struct platform_device *pdev)
struct resource *hotplug_resources = NULL; struct resource *hotplug_resources = NULL;
struct acpi_device *acpi_dev; struct acpi_device *acpi_dev;
struct mlxplat_priv *priv; struct mlxplat_priv *priv;
int i, err; int irq_fpga = 0, i, err;
acpi_dev = ACPI_COMPANION(&pdev->dev); acpi_dev = ACPI_COMPANION(&pdev->dev);
if (acpi_dev) if (acpi_dev) {
irq_fpga = acpi_dev_gpio_irq_get(acpi_dev, 0);
if (irq_fpga < 0)
return -ENODEV;
mlxplat_dev = pdev; mlxplat_dev = pdev;
}
err = mlxplat_pre_init(&hotplug_resources, &hotplug_resources_size); err = mlxplat_pre_init(&hotplug_resources, &hotplug_resources_size);
if (err) if (err)
...@@ -6417,6 +6425,7 @@ static int mlxplat_probe(struct platform_device *pdev) ...@@ -6417,6 +6425,7 @@ static int mlxplat_probe(struct platform_device *pdev)
platform_set_drvdata(mlxplat_dev, priv); platform_set_drvdata(mlxplat_dev, priv);
priv->hotplug_resources = hotplug_resources; priv->hotplug_resources = hotplug_resources;
priv->hotplug_resources_size = hotplug_resources_size; priv->hotplug_resources_size = hotplug_resources_size;
priv->irq_fpga = irq_fpga;
if (!mlxplat_regmap_config) if (!mlxplat_regmap_config)
mlxplat_regmap_config = &mlxplat_mlxcpld_regmap_config; mlxplat_regmap_config = &mlxplat_mlxcpld_regmap_config;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment