From: Jan Kiszka <jan.kiszka@siemens.com>
To: linux-arm-kernel@lists.infradead.org
Cc: Daniel Mack <daniel@zonque.org>,
Haojian Zhuang <haojian.zhuang@gmail.com>,
Robert Jarzmik <robert.jarzmik@free.fr>,
linux-kernel@vger.kernel.org,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Mika Westerberg <mika.westerberg@linux.intel.com>,
Jarkko Nikula <jarkko.nikula@bitmer.com>,
Sascha Weisenberger <sascha.weisenberger@siemens.com>
Subject: [PATCH 2/2] spi: pca2xx-pci: Allow MSI
Date: Mon, 16 Jan 2017 10:06:00 +0100 [thread overview]
Message-ID: <4061bba80ecc632b219b56d8a8cd25d62658d48a.1484557560.git.jan.kiszka@siemens.com> (raw)
In-Reply-To: <cover.1484557560.git.jan.kiszka@siemens.com>
In-Reply-To: <cover.1484557560.git.jan.kiszka@siemens.com>
Now that the core is ready for edge-triggered interrupts, we can safely
allow the PCI versions that provide this to enable the feature and,
thus, have less shared interrupts.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
drivers/spi/spi-pxa2xx-pci.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/drivers/spi/spi-pxa2xx-pci.c b/drivers/spi/spi-pxa2xx-pci.c
index 58d2d48..e7e5b08 100644
--- a/drivers/spi/spi-pxa2xx-pci.c
+++ b/drivers/spi/spi-pxa2xx-pci.c
@@ -203,16 +203,24 @@ static int pxa2xx_spi_pci_probe(struct pci_dev *dev,
ssp = &spi_pdata.ssp;
ssp->phys_base = pci_resource_start(dev, 0);
ssp->mmio_base = pcim_iomap_table(dev)[0];
- ssp->irq = dev->irq;
ssp->port_id = (c->port_id >= 0) ? c->port_id : dev->devfn;
ssp->type = c->type;
snprintf(buf, sizeof(buf), "pxa2xx-spi.%d", ssp->port_id);
ssp->clk = clk_register_fixed_rate(&dev->dev, buf , NULL, 0,
c->max_clk_rate);
- if (IS_ERR(ssp->clk))
+ if (IS_ERR(ssp->clk))
return PTR_ERR(ssp->clk);
+ pci_set_master(dev);
+
+ ret = pci_alloc_irq_vectors(dev, 1, 1, PCI_IRQ_ALL_TYPES);
+ if (ret < 0) {
+ clk_unregister(ssp->clk);
+ return ret;
+ }
+ ssp->irq = pci_irq_vector(dev, 0);
+
memset(&pi, 0, sizeof(pi));
pi.fwnode = dev->dev.fwnode;
pi.parent = &dev->dev;
@@ -224,6 +232,7 @@ static int pxa2xx_spi_pci_probe(struct pci_dev *dev,
pdev = platform_device_register_full(&pi);
if (IS_ERR(pdev)) {
clk_unregister(ssp->clk);
+ pci_free_irq_vectors(dev);
return PTR_ERR(pdev);
}
@@ -241,6 +250,7 @@ static void pxa2xx_spi_pci_remove(struct pci_dev *dev)
platform_device_unregister(pdev);
clk_unregister(spi_pdata->ssp.clk);
+ pci_free_irq_vectors(dev);
}
static const struct pci_device_id pxa2xx_spi_pci_devices[] = {
--
2.1.4
next prev parent reply other threads:[~2017-01-16 9:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-16 9:05 [PATCH 0/2] spi: pca2xx: Prepare for and enable MSI support Jan Kiszka
2017-01-16 9:05 ` [PATCH 1/2] spi: pxa2xx: Prepare for edge-triggered interrupts Jan Kiszka
2017-01-16 9:24 ` Andy Shevchenko
2017-01-16 11:18 ` Jan Kiszka
2017-01-16 17:53 ` Andy Shevchenko
2017-01-16 18:19 ` Jan Kiszka
2017-01-16 9:06 ` Jan Kiszka [this message]
2017-01-16 9:29 ` [PATCH 2/2] spi: pca2xx-pci: Allow MSI Andy Shevchenko
2017-01-16 17:33 ` Jan Kiszka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4061bba80ecc632b219b56d8a8cd25d62658d48a.1484557560.git.jan.kiszka@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=daniel@zonque.org \
--cc=haojian.zhuang@gmail.com \
--cc=jarkko.nikula@bitmer.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=robert.jarzmik@free.fr \
--cc=sascha.weisenberger@siemens.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).