From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: spi-devel-general@lists.sourceforge.net, russ.gorby@intel.com,
grant.likely@secretlab.ca, linux-kernel@vger.kernel.org
Subject: [PATCH 6/8] intel_mid_ssp_spi: Add the QoS quirk for slave mode
Date: Wed, 09 Feb 2011 10:09:08 +0000 [thread overview]
Message-ID: <20110209100857.555.54454.stgit@bob.linux.org.uk> (raw)
In-Reply-To: <20110209100231.555.90520.stgit@bob.linux.org.uk>
From: Alan Cox <alan@linux.intel.com>
This is needed for Moorestown. Again we add this so that the default is off
and the code changed is all within if (quirks & ).
Baed on previous generic driver work by Mathieu SOULARD
<mathieux.soulard@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
---
drivers/spi/intel_mid_ssp_spi.c | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/drivers/spi/intel_mid_ssp_spi.c b/drivers/spi/intel_mid_ssp_spi.c
index c8cd3bb..26e41c2 100644
--- a/drivers/spi/intel_mid_ssp_spi.c
+++ b/drivers/spi/intel_mid_ssp_spi.c
@@ -186,6 +186,8 @@ struct driver_data {
int rxdma_done;
struct callback_param tx_param;
struct callback_param rx_param;
+ /* PM_QOS request (for Moorestown) */
+ struct pm_qos_request_list pm_qos_req;
};
struct chip_data {
@@ -443,6 +445,10 @@ static void dma_transfer_complete(void *arg)
/* Stop getting Time Outs */
iowrite32(0, reg + SSTO);
+ if (drv_data->quirks & QUIRKS_USE_PM_QOS)
+ pm_qos_update_request(&drv_data->pm_qos_req,
+ PM_QOS_DEFAULT_VALUE);
+
/* release DMA mappings */
unmap_dma_buffers(drv_data, drv_data->cur_msg);
@@ -556,6 +562,8 @@ static void dma_transfer(struct driver_data *drv_data)
struct dma_slave_config *txconf, *rxconf;
struct device *dev = &drv_data->pdev->dev;
+ if (drv_data->quirks & QUIRKS_USE_PM_QOS)
+ pm_qos_update_request(&drv_data->pm_qos_req, MIN_EXIT_LATENCY);
/* get Data Read/Write address */
ssdr_addr = (dma_addr_t)(drv_data->paddr + 0x10);
flag = DMA_PREP_INTERRUPT | DMA_CTRL_ACK;
@@ -1186,6 +1194,9 @@ static void cleanup(struct spi_device *spi)
if (drv_data->dma_inited)
intel_mid_ssp_spi_dma_exit(drv_data);
+ /* Remove the PM_QOS request */
+ if (drv_data->quirks & QUIRKS_USE_PM_QOS)
+ pm_qos_remove_request(&drv_data->pm_qos_req);
kfree(chip);
spi_set_ctldata(spi, NULL);
}
@@ -1332,6 +1343,11 @@ static int intel_mid_ssp_spi_probe(struct pci_dev *pdev,
pci_set_drvdata(pdev, drv_data);
+ /* Create the PM_QOS request */
+ if (drv_data->quirks & QUIRKS_USE_PM_QOS)
+ pm_qos_add_request(&drv_data->pm_qos_req,
+ PM_QOS_CPU_DMA_LATENCY, PM_QOS_DEFAULT_VALUE);
+
pm_runtime_set_active(&pdev->dev);
pm_runtime_enable(&pdev->dev);
pm_runtime_idle(&pdev->dev);
next prev parent reply other threads:[~2011-02-09 10:09 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-09 10:06 [PATCH 0/8] Intel MID SSP SPI merged driver Alan Cox
2011-02-09 10:07 ` [PATCH 1/8] Intel SPI master controller driver for the Medfield platform Alan Cox
2011-02-15 5:19 ` Grant Likely
2011-02-09 10:07 ` [PATCH 2/8] intel_mid_ssp_spi: Re-introduce quirks fields Alan Cox
2011-02-15 5:21 ` Grant Likely
2011-02-09 10:08 ` [PATCH 3/8] intel_mid_ssp_spi: Implement the MRST quirk Alan Cox
2011-02-09 10:08 ` [PATCH 4/8] intel_mid_ssp_spi: Add the uglies needed for Moorestown master mode Alan Cox
2011-02-09 10:08 ` [PATCH 5/8] intel_mid_ssp_spi: Add chip definitions Alan Cox
2011-02-09 10:09 ` Alan Cox [this message]
2011-02-09 10:09 ` [PATCH 7/8] intel_mid_ssp_spi: Bounce data through the Langwell SRAM when needed Alan Cox
2011-02-09 10:09 ` [PATCH 8/8] intel_mid_ssp_spi: Implement slave side quirk Alan Cox
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=20110209100857.555.54454.stgit@bob.linux.org.uk \
--to=alan@lxorguk.ukuu.org.uk \
--cc=grant.likely@secretlab.ca \
--cc=linux-kernel@vger.kernel.org \
--cc=russ.gorby@intel.com \
--cc=spi-devel-general@lists.sourceforge.net \
/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).