linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/7] spi: pxa2xx: move debug messages to pump_transfer()
@ 2015-10-22 13:44 Jarkko Nikula
       [not found] ` <1445521485-2029-1-git-send-email-jarkko.nikula-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
  0 siblings, 1 reply; 19+ messages in thread
From: Jarkko Nikula @ 2015-10-22 13:44 UTC (permalink / raw)
  To: linux-spi-u79uwXL29TY76Z2rM5mHXA
  Cc: Mark Brown, Daniel Mack, Haojian Zhuang, Robert Jarzmik,
	Andy Shevchenko, Jarkko Nikula

From: Andy Shevchenko <andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>

The speed can be changed from transfer to transfer, that's why the messages
do not depict the actual values during ->setup(). Move debug messages from
->setup() to pump_transfers(). Get rid of leftovers as well.

Signed-off-by: Andy Shevchenko <andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
Signed-off-by: Jarkko Nikula <jarkko.nikula-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
---
 drivers/spi/spi-pxa2xx.c | 28 +++++++++++-----------------
 1 file changed, 11 insertions(+), 17 deletions(-)

diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c
index 82493c26d4e0..573a28b13a09 100644
--- a/drivers/spi/spi-pxa2xx.c
+++ b/drivers/spi/spi-pxa2xx.c
@@ -959,7 +959,18 @@ static void pump_transfers(unsigned long data)
 					     "pump_transfers: DMA burst size reduced to match bits_per_word\n");
 	}
 
+	/* NOTE:  PXA25x_SSP _could_ use external clocking ... */
 	cr0 = pxa2xx_configure_sscr0(drv_data, clk_div, bits);
+	if (!pxa25x_ssp_comp(drv_data))
+		dev_dbg(&message->spi->dev, "%u Hz actual, %s\n",
+			drv_data->master->max_speed_hz
+				/ (1 + ((cr0 & SSCR0_SCR(0xfff)) >> 8)),
+			chip->enable_dma ? "DMA" : "PIO");
+	else
+		dev_dbg(&message->spi->dev, "%u Hz actual, %s\n",
+			drv_data->master->max_speed_hz / 2
+				/ (1 + ((cr0 & SSCR0_SCR(0x0ff)) >> 8)),
+			chip->enable_dma ? "DMA" : "PIO");
 
 	message->state = RUNNING_STATE;
 
@@ -1103,9 +1114,7 @@ static int setup(struct spi_device *spi)
 	struct chip_data *chip;
 	const struct lpss_config *config;
 	struct driver_data *drv_data = spi_master_get_devdata(spi->master);
-	unsigned int clk_div;
 	uint tx_thres, tx_hi_thres, rx_thres;
-	u32 cr0;
 
 	switch (drv_data->ssp_type) {
 	case QUARK_X1000_SSP:
@@ -1196,8 +1205,6 @@ static int setup(struct spi_device *spi)
 		}
 	}
 
-	clk_div = pxa2xx_ssp_get_clk_div(drv_data, chip, spi->max_speed_hz);
-
 	switch (drv_data->ssp_type) {
 	case QUARK_X1000_SSP:
 		chip->threshold = (QUARK_X1000_SSCR1_RxTresh(rx_thres)
@@ -1218,19 +1225,6 @@ static int setup(struct spi_device *spi)
 	if (spi->mode & SPI_LOOP)
 		chip->cr1 |= SSCR1_LBM;
 
-	/* NOTE:  PXA25x_SSP _could_ use external clocking ... */
-	cr0 = pxa2xx_configure_sscr0(drv_data, clk_div, spi->bits_per_word);
-	if (!pxa25x_ssp_comp(drv_data))
-		dev_dbg(&spi->dev, "%u Hz actual, %s\n",
-			drv_data->master->max_speed_hz
-				/ (1 + ((cr0 & SSCR0_SCR(0xfff)) >> 8)),
-			chip->enable_dma ? "DMA" : "PIO");
-	else
-		dev_dbg(&spi->dev, "%u Hz actual, %s\n",
-			drv_data->master->max_speed_hz / 2
-				/ (1 + ((cr0 & SSCR0_SCR(0x0ff)) >> 8)),
-			chip->enable_dma ? "DMA" : "PIO");
-
 	if (spi->bits_per_word <= 8) {
 		chip->n_bytes = 1;
 		chip->read = u8_reader;
-- 
2.6.1

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2015-10-30  2:20 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-22 13:44 [PATCH 1/7] spi: pxa2xx: move debug messages to pump_transfer() Jarkko Nikula
     [not found] ` <1445521485-2029-1-git-send-email-jarkko.nikula-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2015-10-22 13:44   ` [PATCH 2/7] spi: pxa2xx: derive struct chip_data from struct drv_data Jarkko Nikula
     [not found]     ` <1445521485-2029-2-git-send-email-jarkko.nikula-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2015-10-22 23:57       ` Applied "spi: pxa2xx: derive struct chip_data from struct drv_data" to the spi tree Mark Brown
2015-10-25 11:42       ` [PATCH 2/7] spi: pxa2xx: derive struct chip_data from struct drv_data Robert Jarzmik
2015-10-22 13:44   ` [PATCH 3/7] spi: pxa2xx: Convert unique ID string of ACPI device as unsigned integer Jarkko Nikula
     [not found]     ` <1445521485-2029-3-git-send-email-jarkko.nikula-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2015-10-22 23:57       ` Applied "spi: pxa2xx: Convert unique ID string of ACPI device as unsigned integer" to the spi tree Mark Brown
2015-10-22 13:44   ` [PATCH 4/7] spi: pxa2xx: Save other reg_cs_ctrl bits when configuring chip select Jarkko Nikula
     [not found]     ` <1445521485-2029-4-git-send-email-jarkko.nikula-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2015-10-22 23:57       ` Applied "spi: pxa2xx: Save other reg_cs_ctrl bits when configuring chip select" to the spi tree Mark Brown
2015-10-25 11:49       ` [PATCH 4/7] spi: pxa2xx: Save other reg_cs_ctrl bits when configuring chip select Robert Jarzmik
2015-10-22 13:44   ` [PATCH 5/7] spi: pxa2xx: Align a few defines Jarkko Nikula
     [not found]     ` <1445521485-2029-5-git-send-email-jarkko.nikula-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2015-10-22 23:57       ` Applied "spi: pxa2xx: Align a few defines" to the spi tree Mark Brown
2015-10-25 11:50       ` [PATCH 5/7] spi: pxa2xx: Align a few defines Robert Jarzmik
2015-10-22 13:44   ` [PATCH 6/7] spi: pxa2xx: Add support for multiple LPSS chip select signals Jarkko Nikula
     [not found]     ` <1445521485-2029-6-git-send-email-jarkko.nikula-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2015-10-25 12:02       ` Robert Jarzmik
     [not found]         ` <87bnbnkvg9.fsf-4ty26DBLk+jEm7gnYqmdkQ@public.gmane.org>
2015-10-26  9:35           ` Jarkko Nikula
2015-10-22 13:44   ` [PATCH 7/7] spi: pxa2xx: Add support for Intel Broxton Jarkko Nikula
     [not found]     ` <1445521485-2029-7-git-send-email-jarkko.nikula-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2015-10-30  2:20       ` Mark Brown
2015-10-22 23:57   ` Applied "spi: pxa2xx: move debug messages to pump_transfer()" to the spi tree Mark Brown
2015-10-25 11:39   ` [PATCH 1/7] spi: pxa2xx: move debug messages to pump_transfer() Robert Jarzmik

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).