[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210324102931.GH2916463@dell>
Date: Wed, 24 Mar 2021 10:29:31 +0000
From: Lee Jones <lee.jones@...aro.org>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 2/2] mfd: intel_quark_i2c_gpio: enable MSI interrupt
On Tue, 23 Mar 2021, Andy Shevchenko wrote:
> Allow interrupts to be MSI if supported by hardware.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> ---
> v2: new patch
> drivers/mfd/intel_quark_i2c_gpio.c | 21 +++++++++++++++------
> 1 file changed, 15 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/mfd/intel_quark_i2c_gpio.c b/drivers/mfd/intel_quark_i2c_gpio.c
> index 52728a963c17..16ce9cb3aa2f 100644
> --- a/drivers/mfd/intel_quark_i2c_gpio.c
> +++ b/drivers/mfd/intel_quark_i2c_gpio.c
> @@ -169,8 +169,8 @@ static int intel_quark_i2c_setup(struct pci_dev *pdev, struct mfd_cell *cell)
> res[INTEL_QUARK_IORES_MEM].end =
> pci_resource_end(pdev, MFD_I2C_BAR);
>
> - res[INTEL_QUARK_IORES_IRQ].start = pdev->irq;
> - res[INTEL_QUARK_IORES_IRQ].end = pdev->irq;
> + res[INTEL_QUARK_IORES_IRQ].start = pci_irq_vector(pdev, 0);
> + res[INTEL_QUARK_IORES_IRQ].end = pci_irq_vector(pdev, 0);
>
> pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
> if (!pdata)
> @@ -217,7 +217,7 @@ static int intel_quark_gpio_setup(struct pci_dev *pdev, struct mfd_cell *cell)
> pdata->properties->idx = 0;
> pdata->properties->ngpio = INTEL_QUARK_MFD_NGPIO;
> pdata->properties->gpio_base = INTEL_QUARK_MFD_GPIO_BASE;
> - pdata->properties->irq[0] = pdev->irq;
> + pdata->properties->irq[0] = pci_irq_vector(pdev, 0);
>
> cell->platform_data = pdata;
> cell->pdata_size = sizeof(*pdata);
> @@ -245,22 +245,30 @@ static int intel_quark_mfd_probe(struct pci_dev *pdev,
> if (ret)
> return ret;
>
> + pci_set_master(pdev);
> +
> + ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES);
Is there any way these magic number can be defined or sizeof()'ed?
[...]
--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
Powered by blists - more mailing lists