Re: [PATCH platform-next 12/16] platform: mellanox: mlx-platform: Get interrupt line through ACPI

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 14 Aug 2023, Vadim Pasternak wrote:

> Add support for getting system interrupt line from ACPI table.
> 
> Signed-off-by: Vadim Pasternak <vadimp@xxxxxxxxxx>
> Reviewed-by: Michael Shych <michaelsh@xxxxxxxxxx>
> ---
>  drivers/platform/x86/mlx-platform.c | 15 +++++++++++++--
>  1 file changed, 13 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/platform/x86/mlx-platform.c b/drivers/platform/x86/mlx-platform.c
> index e2226c218a54..a70b86e60721 100644
> --- a/drivers/platform/x86/mlx-platform.c
> +++ b/drivers/platform/x86/mlx-platform.c
> @@ -342,6 +342,7 @@
>   * @hotplug_resources: system hotplug resources
>   * @hotplug_resources_size: size of system hotplug resources
>   * @hi2c_main_init_status: init status of I2C main bus
> + * @irq_fpga: FPGA IRQ number
>   */
>  struct mlxplat_priv {
>  	struct platform_device *pdev_i2c;
> @@ -355,6 +356,7 @@ struct mlxplat_priv {
>  	struct resource *hotplug_resources;
>  	unsigned int hotplug_resources_size;
>  	u8 i2c_main_init_status;
> +	int irq_fpga;
>  };
>  
>  static struct platform_device *mlxplat_dev;
> @@ -6187,6 +6189,8 @@ static int mlxplat_post_init(struct mlxplat_priv *priv)
>  	/* Add hotplug driver */
>  	if (mlxplat_hotplug) {
>  		mlxplat_hotplug->regmap = priv->regmap;
> +		if (priv->irq_fpga)
> +			mlxplat_hotplug->irq = priv->irq_fpga;
>  		priv->pdev_hotplug =
>  		platform_device_register_resndata(&mlxplat_dev->dev,
>  						  "mlxreg-hotplug", PLATFORM_DEVID_NONE,
> @@ -6395,11 +6399,17 @@ static int mlxplat_probe(struct platform_device *pdev)
>  {
>  	unsigned int hotplug_resources_size = 0;
>  	struct resource *hotplug_resources = NULL;
> +	struct acpi_device *acpi_dev;
>  	struct mlxplat_priv *priv;
> -	int i, err;
> +	int irq_fpga = 0, i, err;
>  
> -	if (ACPI_COMPANION(&pdev->dev))
> +	acpi_dev = ACPI_COMPANION(&pdev->dev);
> +	if (acpi_dev) {

Just add this intermediate variable in the previous patch to have less 
churn in this patch.

-- 
 i.

> +		irq_fpga = acpi_dev_gpio_irq_get(acpi_dev, 0);
> +		if (irq_fpga < 0)
> +			return -ENODEV;
>  		mlxplat_dev = pdev;
> +	}
>  
>  	err = mlxplat_pre_init(&hotplug_resources, &hotplug_resources_size);
>  	if (err)
> @@ -6414,6 +6424,7 @@ static int mlxplat_probe(struct platform_device *pdev)
>  	platform_set_drvdata(mlxplat_dev, priv);
>  	priv->hotplug_resources = hotplug_resources;
>  	priv->hotplug_resources_size = hotplug_resources_size;
> +	priv->irq_fpga = irq_fpga;
>  
>  	if (!mlxplat_regmap_config)
>  		mlxplat_regmap_config = &mlxplat_mlxcpld_regmap_config;
> 



[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux