spi: txx9: Use transfer speed unconditionally
Subsystems (8)
PATCH 1/16 spi: txx9: Use transfer speed unconditionally
SPI core validates the transfer speed and defaults to spi->max_speed_hz in case the transfer speed is not set.
--- drivers/spi/spi-txx9.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/spi-txx9.c +1 -1
@@ -181,7 +181,7 @@ static void txx9spi_work_one(struct txx9spi *c, struct spi_message *m)u32 data;unsigned int len = t->len;unsigned int wsize; -u32 speed_hz = t->speed_hz ? : spi->max_speed_hz; +u32 speed_hz = t->speed_hz;u8 bits_per_word = t->bits_per_word; wsize = bits_per_word >>3 ;/* in bytes */
Signature · 6 lines
2.5.1 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1442323588-29642-1-git-send-email-jarkko.nikula-VuQAYsv1563Yd54FQh9/[email protected]
PATCH 2/16 spi: s3c64xx: Use transfer speed unconditionally
SPI core validates the transfer speed and defaults to spi->max_speed_hz in case the transfer speed is not set.
--- drivers/spi/spi-s3c64xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/spi-s3c64xx.c +1 -1
@@ -683,7 +683,7 @@ static int s3c64xx_spi_transfer_one(struct spi_master *master,/* Only BPW and Speed may change across transfers */ bpw = xfer->bits_per_word; - speed = xfer->speed_hz ? : spi->max_speed_hz; + speed = xfer->speed_hz;if (bpw != sdd->cur_bpw || speed != sdd->cur_speed) { sdd->cur_bpw = bpw;
Signature · 6 lines
2.5.1 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1442323588-29642-2-git-send-email-jarkko.nikula-VuQAYsv1563Yd54FQh9/[email protected]
Applied "spi: s3c64xx: Use transfer speed unconditionally" to the spi tree
The patch
spi: s3c64xx: Use transfer speed unconditionally
has been applied to the spi tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
88d4a7440e51754bd44f58fe1f8c6e6fe050e929Mon Sep 17 00:00:00 2001
From: Jarkko Nikula <jarkko.nikula-VuQAYsv1563Yd54FQh9/[email protected]>
Date: Tue, 15 Sep 2015 16:26:14 +0300
Subject: [PATCH] spi: s3c64xx: Use transfer speed unconditionally
SPI core validates the transfer speed and defaults to spi->max_speed_hz in case the transfer speed is not set.
--- drivers/spi/spi-s3c64xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/spi-s3c64xx.c +1 -1
@@ -683,7 +683,7 @@ static int s3c64xx_spi_transfer_one(struct spi_master *master,/* Only BPW and Speed may change across transfers */ bpw = xfer->bits_per_word; - speed = xfer->speed_hz ? : spi->max_speed_hz; + speed = xfer->speed_hz;if (bpw != sdd->cur_bpw || speed != sdd->cur_speed) { sdd->cur_bpw = bpw;
Signature · 6 lines
2.5.0 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 3/16 spi: octeon: Use transfer speed unconditionally
In reply to a message not in the archiveSPI core validates the transfer speed and defaults to spi->max_speed_hz in case the transfer speed is not set.
--- drivers/spi/spi-octeon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/spi-octeon.c +1 -1
@@ -65,7 +65,7 @@ static int octeon_spi_do_transfer(struct octeon_spi *p, cpha = mode &SPI_CPHA ; cpol = mode &SPI_CPOL ; - speed_hz = xfer->speed_hz ? : spi->max_speed_hz; + speed_hz = xfer->speed_hz; clkdiv =octeon_get_io_clock_rate () / (2 * speed_hz);
Signature · 6 lines
2.5.1 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1442323588-29642-3-git-send-email-jarkko.nikula-VuQAYsv1563Yd54FQh9/[email protected]
Applied "spi: octeon: Use transfer speed unconditionally" to the spi tree
The patch
spi: octeon: Use transfer speed unconditionally
has been applied to the spi tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
8cf3af32902d14f6a0fbc4ad9a3025d9e7d4701bMon Sep 17 00:00:00 2001
From: Jarkko Nikula <jarkko.nikula-VuQAYsv1563Yd54FQh9/[email protected]>
Date: Tue, 15 Sep 2015 16:26:15 +0300
Subject: [PATCH] spi: octeon: Use transfer speed unconditionally
SPI core validates the transfer speed and defaults to spi->max_speed_hz in case the transfer speed is not set.
--- drivers/spi/spi-octeon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/spi-octeon.c +1 -1
@@ -65,7 +65,7 @@ static int octeon_spi_do_transfer(struct octeon_spi *p, cpha = mode &SPI_CPHA ; cpol = mode &SPI_CPOL ; - speed_hz = xfer->speed_hz ? : spi->max_speed_hz; + speed_hz = xfer->speed_hz; clkdiv =octeon_get_io_clock_rate () / (2 * speed_hz);
Signature · 6 lines
2.5.0 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 4/16 spi: bfin-sport: Calculate transfer speed unconditionally
In reply to a message not in the archiveSPI core validates the transfer speed and defaults to spi->max_speed_hz in case the transfer speed is not set so code here won't use the chip->baud value (which is derived from spi->max_speed_hz).
Please note driver uses chip->baud at the beginning of message transmission by calling the bfin_sport_spi_restore_state() but then programs per transfer speed in bfin_sport_spi_pump_transfers(). I'm not familiar with the HW so I don't know would it be possible to remove chip->baud completely by either using constant value in bfin_sport_spi_restore_state() or by removing the tclkdiv register write there.
--- drivers/spi/spi-bfin-sport.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/spi/spi-bfin-sport.c +1 -4
@@ -352,10 +352,7 @@ bfin_sport_spi_pump_transfers(unsigned long data) transfer = drv_data->cur_transfer; chip = drv_data->cur_chip; -if (transfer->speed_hz) - transfer_speed =bfin_sport_hz_to_spi_baud (transfer->speed_hz); -else - transfer_speed = chip->baud; + transfer_speed =bfin_sport_hz_to_spi_baud (transfer->speed_hz);bfin_write (&drv_data->regs->tclkdiv, transfer_speed);SSYNC ();
Signature · 6 lines
2.5.1 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1442323588-29642-4-git-send-email-jarkko.nikula-VuQAYsv1563Yd54FQh9/[email protected]
Applied "spi: bfin-sport: Calculate transfer speed unconditionally" to the spi tree
The patch
spi: bfin-sport: Calculate transfer speed unconditionally
has been applied to the spi tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
57b48ab49b7a9ac5ff94402ade2ccb5d63579816Mon Sep 17 00:00:00 2001
From: Jarkko Nikula <jarkko.nikula-VuQAYsv1563Yd54FQh9/[email protected]>
Date: Tue, 15 Sep 2015 16:26:16 +0300
Subject: [PATCH] spi: bfin-sport: Calculate transfer speed unconditionally
SPI core validates the transfer speed and defaults to spi->max_speed_hz in case the transfer speed is not set so code here won't use the chip->baud value (which is derived from spi->max_speed_hz).
Please note driver uses chip->baud at the beginning of message transmission by calling the bfin_sport_spi_restore_state() but then programs per transfer speed in bfin_sport_spi_pump_transfers(). I'm not familiar with the HW so I don't know would it be possible to remove chip->baud completely by either using constant value in bfin_sport_spi_restore_state() or by removing the tclkdiv register write there.
--- drivers/spi/spi-bfin-sport.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/spi/spi-bfin-sport.c +1 -4
@@ -352,10 +352,7 @@ bfin_sport_spi_pump_transfers(unsigned long data) transfer = drv_data->cur_transfer; chip = drv_data->cur_chip; -if (transfer->speed_hz) - transfer_speed =bfin_sport_hz_to_spi_baud (transfer->speed_hz); -else - transfer_speed = chip->baud; + transfer_speed =bfin_sport_hz_to_spi_baud (transfer->speed_hz);bfin_write (&drv_data->regs->tclkdiv, transfer_speed);SSYNC ();
Signature · 6 lines
2.5.0 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 5/16 spi: spi-bfin5xx: Calculate transfer speed unconditionally
In reply to a message not in the archiveSPI core validates the transfer speed and defaults to spi->max_speed_hz in case the transfer speed is not set so code here won't use the chip->baud value (which is derived from spi->max_speed_hz).
Please note driver uses chip->baud at the beginning of message transmission by calling the bfin_spi_restore_state() but then programs per transfer speed in bfin_spi_pump_transfers(). I'm not familiar with the HW so I don't know would it be possible to remove chip->baud completely by either using constant value in bfin_spi_restore_state() or by removing the baud register write there.
--- drivers/spi/spi-bfin5xx.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/spi/spi-bfin5xx.c +1 -5
@@ -661,11 +661,7 @@ static void bfin_spi_pump_transfers(unsigned long data) message->state =RUNNING_STATE ; dma_config =0 ; -/* Speed setup (surely valid because already checked) */ -if (transfer->speed_hz) -bfin_write (&drv_data->regs->baud,hz_to_spi_baud (transfer->speed_hz)); -else -bfin_write (&drv_data->regs->baud, chip->baud); +bfin_write (&drv_data->regs->baud,hz_to_spi_baud (transfer->speed_hz));bfin_write (&drv_data->regs->stat,BIT_STAT_CLR );bfin_spi_cs_active (drv_data, chip);
Signature · 6 lines
2.5.1 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1442323588-29642-5-git-send-email-jarkko.nikula-VuQAYsv1563Yd54FQh9/[email protected]
Applied "spi: spi-bfin5xx: Calculate transfer speed unconditionally" to the spi tree
The patch
spi: spi-bfin5xx: Calculate transfer speed unconditionally
has been applied to the spi tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
95a8fde23ef426aeee579bc99f35dc854e711225Mon Sep 17 00:00:00 2001
From: Jarkko Nikula <jarkko.nikula-VuQAYsv1563Yd54FQh9/[email protected]>
Date: Tue, 15 Sep 2015 16:26:17 +0300
Subject: [PATCH] spi: spi-bfin5xx: Calculate transfer speed unconditionally
SPI core validates the transfer speed and defaults to spi->max_speed_hz in case the transfer speed is not set so code here won't use the chip->baud value (which is derived from spi->max_speed_hz).
Please note driver uses chip->baud at the beginning of message transmission by calling the bfin_spi_restore_state() but then programs per transfer speed in bfin_spi_pump_transfers(). I'm not familiar with the HW so I don't know would it be possible to remove chip->baud completely by either using constant value in bfin_spi_restore_state() or by removing the baud register write there.
--- drivers/spi/spi-bfin5xx.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/spi/spi-bfin5xx.c +1 -5
@@ -661,11 +661,7 @@ static void bfin_spi_pump_transfers(unsigned long data) message->state =RUNNING_STATE ; dma_config =0 ; -/* Speed setup (surely valid because already checked) */ -if (transfer->speed_hz) -bfin_write (&drv_data->regs->baud,hz_to_spi_baud (transfer->speed_hz)); -else -bfin_write (&drv_data->regs->baud, chip->baud); +bfin_write (&drv_data->regs->baud,hz_to_spi_baud (transfer->speed_hz));bfin_write (&drv_data->regs->stat,BIT_STAT_CLR );bfin_spi_cs_active (drv_data, chip);
Signature · 6 lines
2.5.0 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 6/16 spi: au1550: Simplify au1550_spi_setupxfer()
In reply to a message not in the archiveSPI core validates both bits_per_word and speed_hz transfer parameters and defaults to spi->bits_per_word and spi->max_speed_hz in case these per transfer parameters are not set. This can simplify a little the au1550_spi_setupxfer() as there is need to check only for valid "struct spi_transfer" pointer.
--- drivers/spi/spi-au1550.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
drivers/spi/spi-au1550.c +5 -6
@@ -233,13 +233,12 @@ static int au1550_spi_setupxfer(struct spi_device *spi, struct spi_transfer *t)unsigned bpw, hz;u32 cfg, stat; - bpw = spi->bits_per_word; - hz = spi->max_speed_hz;if (t) { -if (t->bits_per_word) - bpw = t->bits_per_word; -if (t->speed_hz) - hz = t->speed_hz; + bpw = t->bits_per_word; + hz = t->speed_hz; + }else { + bpw = spi->bits_per_word; + hz = spi->max_speed_hz; }if (!hz)
Signature · 6 lines
2.5.1 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1442323588-29642-6-git-send-email-jarkko.nikula-VuQAYsv1563Yd54FQh9/[email protected]
Applied "spi: au1550: Simplify au1550_spi_setupxfer()" to the spi tree
The patch
spi: au1550: Simplify au1550_spi_setupxfer()
has been applied to the spi tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
0beb0a6da8896da14287b1caa77596057690901aMon Sep 17 00:00:00 2001
From: Jarkko Nikula <jarkko.nikula-VuQAYsv1563Yd54FQh9/[email protected]>
Date: Tue, 15 Sep 2015 16:26:18 +0300
Subject: [PATCH] spi: au1550: Simplify au1550_spi_setupxfer()
SPI core validates both bits_per_word and speed_hz transfer parameters and defaults to spi->bits_per_word and spi->max_speed_hz in case these per transfer parameters are not set. This can simplify a little the au1550_spi_setupxfer() as there is need to check only for valid "struct spi_transfer" pointer.
--- drivers/spi/spi-au1550.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
drivers/spi/spi-au1550.c +5 -6
@@ -233,13 +233,12 @@ static int au1550_spi_setupxfer(struct spi_device *spi, struct spi_transfer *t)unsigned bpw, hz;u32 cfg, stat; - bpw = spi->bits_per_word; - hz = spi->max_speed_hz;if (t) { -if (t->bits_per_word) - bpw = t->bits_per_word; -if (t->speed_hz) - hz = t->speed_hz; + bpw = t->bits_per_word; + hz = t->speed_hz; + }else { + bpw = spi->bits_per_word; + hz = spi->max_speed_hz; }if (!hz)
Signature · 6 lines
2.5.0 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 7/16 spi: mpc512x: Call mpc512x_psc_spi_transfer_setup() unconditionally
In reply to a message not in the archiveSPI core validates both bits_per_word and speed_hz transfer parameters and thus the if statement here is needless as it will always call the mpc512x_psc_spi_transfer_setup().
--- drivers/spi/spi-mpc512x-psc.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/spi/spi-mpc512x-psc.c +3 -5
@@ -302,11 +302,9 @@ static int mpc512x_psc_spi_msg_xfer(struct spi_master *master, cs_change =1 ; status =0 ;list_for_each_entry (t, &m->transfers, transfer_list) { -if (t->bits_per_word || t->speed_hz) { - status =mpc512x_psc_spi_transfer_setup (spi, t); -if (status <0 ) -break ; - } + status =mpc512x_psc_spi_transfer_setup (spi, t); +if (status <0 ) +break ;if (cs_change)mpc512x_psc_spi_activate_cs (spi);
Signature · 6 lines
2.5.1 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1442323588-29642-7-git-send-email-jarkko.nikula-VuQAYsv1563Yd54FQh9/[email protected]
Applied "spi: mpc512x: Call mpc512x_psc_spi_transfer_setup() unconditionally" to the spi tree
The patch
spi: mpc512x: Call mpc512x_psc_spi_transfer_setup() unconditionally
has been applied to the spi tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
85c1912d44081173b9cd796955959a8201aa7a4eMon Sep 17 00:00:00 2001
From: Jarkko Nikula <jarkko.nikula-VuQAYsv1563Yd54FQh9/[email protected]>
Date: Tue, 15 Sep 2015 16:26:19 +0300
Subject: [PATCH] spi: mpc512x: Call mpc512x_psc_spi_transfer_setup()
unconditionally
SPI core validates both bits_per_word and speed_hz transfer parameters and thus the if statement here is needless as it will always call the mpc512x_psc_spi_transfer_setup().
--- drivers/spi/spi-mpc512x-psc.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/spi/spi-mpc512x-psc.c +3 -5
@@ -302,11 +302,9 @@ static int mpc512x_psc_spi_msg_xfer(struct spi_master *master, cs_change =1 ; status =0 ;list_for_each_entry (t, &m->transfers, transfer_list) { -if (t->bits_per_word || t->speed_hz) { - status =mpc512x_psc_spi_transfer_setup (spi, t); -if (status <0 ) -break ; - } + status =mpc512x_psc_spi_transfer_setup (spi, t); +if (status <0 ) +break ;if (cs_change)mpc512x_psc_spi_activate_cs (spi);
Signature · 6 lines
2.5.0 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 8/16 spi: omap-uwire: Remove needless bits_per_word and speed_hz tests
In reply to a message not in the archiveSPI core validates both bits_per_word and speed_hz transfer parameters and defaults to spi->bits_per_word and spi->max_speed_hz in case these per transfer parameters are not set. This allows to remove two needless tests from uwire_txrx() and uwire_setup_transfer().
--- drivers/spi/spi-omap-uwire.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/spi/spi-omap-uwire.c +4 -3
@@ -205,7 +205,7 @@ static void uwire_chipselect(struct spi_device *spi, int value)static int uwire_txrx (struct spi_device *spi,struct spi_transfer *t) {unsigned len = t->len; -unsigned bits = t->bits_per_word ? : spi->bits_per_word; +unsigned bits = t->bits_per_word;unsigned bytes;u16 val, w;int status =0 ;
@@ -344,9 +344,10 @@ static int uwire_setup_transfer(struct spi_device *spi, struct spi_transfer *t)/* assume it's already enabled */ rate =clk_get_rate (uwire->ck); - hz = spi->max_speed_hz; -if (t !=NULL && t->speed_hz) +if (t !=NULL ) hz = t->speed_hz; +else + hz = spi->max_speed_hz;if (!hz) {pr_debug ("%s: zero speed?\n" ,dev_name (&spi->dev));
Signature · 6 lines
2.5.1 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1442323588-29642-8-git-send-email-jarkko.nikula-VuQAYsv1563Yd54FQh9/[email protected]
Applied "spi: omap-uwire: Remove needless bits_per_word and speed_hz tests" to the spi tree
The patch
spi: omap-uwire: Remove needless bits_per_word and speed_hz tests
has been applied to the spi tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
160f8d0691659b65a97494c151c95b1287c377aeMon Sep 17 00:00:00 2001
From: Jarkko Nikula <jarkko.nikula-VuQAYsv1563Yd54FQh9/[email protected]>
Date: Tue, 15 Sep 2015 16:26:20 +0300
Subject: [PATCH] spi: omap-uwire: Remove needless bits_per_word and speed_hz
tests
SPI core validates both bits_per_word and speed_hz transfer parameters and defaults to spi->bits_per_word and spi->max_speed_hz in case these per transfer parameters are not set. This allows to remove two needless tests from uwire_txrx() and uwire_setup_transfer().
--- drivers/spi/spi-omap-uwire.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/spi/spi-omap-uwire.c +4 -3
@@ -205,7 +205,7 @@ static void uwire_chipselect(struct spi_device *spi, int value)static int uwire_txrx (struct spi_device *spi,struct spi_transfer *t) {unsigned len = t->len; -unsigned bits = t->bits_per_word ? : spi->bits_per_word; +unsigned bits = t->bits_per_word;unsigned bytes;u16 val, w;int status =0 ;
@@ -344,9 +344,10 @@ static int uwire_setup_transfer(struct spi_device *spi, struct spi_transfer *t)/* assume it's already enabled */ rate =clk_get_rate (uwire->ck); - hz = spi->max_speed_hz; -if (t !=NULL && t->speed_hz) +if (t !=NULL ) hz = t->speed_hz; +else + hz = spi->max_speed_hz;if (!hz) {pr_debug ("%s: zero speed?\n" ,dev_name (&spi->dev));
Signature · 6 lines
2.5.0 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 9/16 spi: omap-100k: Rely on validations done by spi core
In reply to a message not in the archiveSPI core validates both bits_per_word and speed_hz transfer parameters and defaults to spi->bits_per_word and spi->max_speed_hz in case these per transfer parameters are not set.
This allows to remove a few if statements around per transfer bits_per_word and speed_hz tests as they evaluate always to true.
Also defaulting word_len to 8 is needless since spi_setup() has already made sure spi->bits_per_word is 8 in case it is not set.
--- drivers/spi/spi-omap-100k.c | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-)
drivers/spi/spi-omap-100k.c +8 -18
@@ -244,12 +244,12 @@ static int omap1_spi100k_setup_transfer(struct spi_device *spi, {struct omap1_spi100k *spi100k =spi_master_get_devdata (spi->master);struct omap1_spi100k_cs *cs = spi->controller_state; -u8 word_len = spi->bits_per_word; +u8 word_len; -if (t !=NULL && t->bits_per_word) +if (t !=NULL ) word_len = t->bits_per_word; -if (!word_len) - word_len =8 ; +else + word_len = spi->bits_per_word;if (spi->bits_per_word >32 )return -EINVAL ;
@@ -302,7 +302,6 @@ static int omap1_spi100k_transfer_one_message(struct spi_master *master,struct spi_device *spi = m->spi;struct spi_transfer *t =NULL ;int cs_active =0 ; -int par_override =0 ;int status =0 ;list_for_each_entry (t, &m->transfers, transfer_list) {
@@ -310,14 +309,9 @@ static int omap1_spi100k_transfer_one_message(struct spi_master *master, status = -EINVAL ;break ; } -if (par_override || t->speed_hz || t->bits_per_word) { - par_override =1 ; - status =omap1_spi100k_setup_transfer (spi, t); -if (status <0 ) -break ; -if (!t->speed_hz && !t->bits_per_word) - par_override =0 ; - } + status =omap1_spi100k_setup_transfer (spi, t); +if (status <0 ) +break ;if (!cs_active) {omap1_spi100k_force_cs (spi100k,1 );
@@ -347,11 +341,7 @@ static int omap1_spi100k_transfer_one_message(struct spi_master *master, } } -/* Restore defaults if they were overriden */ -if (par_override) { - par_override =0 ; - status =omap1_spi100k_setup_transfer (spi,NULL ); - } + status =omap1_spi100k_setup_transfer (spi,NULL );if (cs_active)omap1_spi100k_force_cs (spi100k,0 );
Signature · 6 lines
2.5.1 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1442323588-29642-9-git-send-email-jarkko.nikula-VuQAYsv1563Yd54FQh9/[email protected]
Applied "spi: omap-100k: Rely on validations done by spi core" to the spi tree
The patch
spi: omap-100k: Rely on validations done by spi core
has been applied to the spi tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
76f67ea9bf27b045eacf8f1e148fd13149f51823Mon Sep 17 00:00:00 2001
From: Jarkko Nikula <jarkko.nikula-VuQAYsv1563Yd54FQh9/[email protected]>
Date: Tue, 15 Sep 2015 16:26:21 +0300
Subject: [PATCH] spi: omap-100k: Rely on validations done by spi core
SPI core validates both bits_per_word and speed_hz transfer parameters and defaults to spi->bits_per_word and spi->max_speed_hz in case these per transfer parameters are not set.
This allows to remove a few if statements around per transfer bits_per_word and speed_hz tests as they evaluate always to true.
Also defaulting word_len to 8 is needless since spi_setup() has already made sure spi->bits_per_word is 8 in case it is not set.
--- drivers/spi/spi-omap-100k.c | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-)
drivers/spi/spi-omap-100k.c +8 -18
@@ -244,12 +244,12 @@ static int omap1_spi100k_setup_transfer(struct spi_device *spi, {struct omap1_spi100k *spi100k =spi_master_get_devdata (spi->master);struct omap1_spi100k_cs *cs = spi->controller_state; -u8 word_len = spi->bits_per_word; +u8 word_len; -if (t !=NULL && t->bits_per_word) +if (t !=NULL ) word_len = t->bits_per_word; -if (!word_len) - word_len =8 ; +else + word_len = spi->bits_per_word;if (spi->bits_per_word >32 )return -EINVAL ;
@@ -302,7 +302,6 @@ static int omap1_spi100k_transfer_one_message(struct spi_master *master,struct spi_device *spi = m->spi;struct spi_transfer *t =NULL ;int cs_active =0 ; -int par_override =0 ;int status =0 ;list_for_each_entry (t, &m->transfers, transfer_list) {
@@ -310,14 +309,9 @@ static int omap1_spi100k_transfer_one_message(struct spi_master *master, status = -EINVAL ;break ; } -if (par_override || t->speed_hz || t->bits_per_word) { - par_override =1 ; - status =omap1_spi100k_setup_transfer (spi, t); -if (status <0 ) -break ; -if (!t->speed_hz && !t->bits_per_word) - par_override =0 ; - } + status =omap1_spi100k_setup_transfer (spi, t); +if (status <0 ) +break ;if (!cs_active) {omap1_spi100k_force_cs (spi100k,1 );
@@ -347,11 +341,7 @@ static int omap1_spi100k_transfer_one_message(struct spi_master *master, } } -/* Restore defaults if they were overriden */ -if (par_override) { - par_override =0 ; - status =omap1_spi100k_setup_transfer (spi,NULL ); - } + status =omap1_spi100k_setup_transfer (spi,NULL );if (cs_active)omap1_spi100k_force_cs (spi100k,0 );
Signature · 6 lines
2.5.0 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 10/16 spi: atmel: Remove needless bits_per_word and speed_hz tests
In reply to a message not in the archiveSPI core validates both bits_per_word and speed_hz transfer parameters and defaults to spi->bits_per_word and spi->max_speed_hz in case these per transfer parameters are not set. This makes possible to remove two if statements and remove one code block that is never executed.
--- drivers/spi/spi-atmel.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-)
drivers/spi/spi-atmel.c +6 -15
@@ -871,14 +871,7 @@ static int atmel_spi_set_xfer_speed(struct atmel_spi *as,* Calculate the lowest divider that satisfies the * constraint, assuming div32/fdiv/mbz == 0. */ -if (xfer->speed_hz) - scbr =DIV_ROUND_UP (bus_hz, xfer->speed_hz); -else -/* -* This can happend if max_speed is null. -* In this case, we set the lowest possible speed -*/ - scbr =0xff ; + scbr =DIV_ROUND_UP (bus_hz, xfer->speed_hz);/* * If the resulting divider doesn't fit into the
@@ -1300,14 +1293,12 @@ static int atmel_spi_one_transfer(struct spi_master *master,return -EINVAL ; } -if (xfer->bits_per_word) { - asd = spi->controller_state; - bits = (asd->csr >>4 ) &0xf ; -if (bits != xfer->bits_per_word -8 ) { -dev_dbg (&spi->dev, + asd = spi->controller_state; + bits = (asd->csr >>4 ) &0xf ; +if (bits != xfer->bits_per_word -8 ) { +dev_dbg (&spi->dev,"you can't yet change bits_per_word in transfers\n" ); -return -ENOPROTOOPT ; - } +return -ENOPROTOOPT ; }/*
Signature · 6 lines
2.5.1 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1442323588-29642-10-git-send-email-jarkko.nikula-VuQAYsv1563Yd54FQh9/[email protected]
Nicolas Ferre
Acked-byRe: [PATCH 10/16] spi: atmel: Remove needless bits_per_word and speed_hz tests
Quoted 6 lines · Jarkko Nikula
SPI core validates both
bits_per_wordandspeed_hztransfer parameters and defaults tospi->bits_per_wordandspi->max_speed_hzin case these per transfer parameters are not set. This makes possible to remove two if statements and remove one code block that is never executed.
It seems okay:
Quoted 45 lines
--- drivers/spi/spi-atmel.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-)drivers/spi/spi-atmel.c +6
-15@@ -871,14 +871,7 @@ static int atmel_spi_set_xfer_speed(struct atmel_spi *as,* Calculate the lowest divider that satisfies the * constraint, assuming div32/fdiv/mbz == 0. */ -if (xfer->speed_hz) - scbr =DIV_ROUND_UP (bus_hz, xfer->speed_hz); -else -/* -* This can happend if max_speed is null. -* In this case, we set the lowest possible speed -*/ - scbr =0xff ; + scbr =DIV_ROUND_UP (bus_hz, xfer->speed_hz);/* * If the resulting divider doesn't fit into the @@ -1300,14 +1293,12 @@ static int atmel_spi_one_transfer(struct spi_master *master,return -EINVAL ; } -if (xfer->bits_per_word) { - asd = spi->controller_state; - bits = (asd->csr >>4 ) &0xf ; -if (bits != xfer->bits_per_word -8 ) { -dev_dbg (&spi->dev, + asd = spi->controller_state; + bits = (asd->csr >>4 ) &0xf ; +if (bits != xfer->bits_per_word -8 ) { +dev_dbg (&spi->dev,"you can't yet change bits_per_word in transfers\n" ); -return -ENOPROTOOPT ; - } +return -ENOPROTOOPT ; }/*
Signature · 5 lines
Nicolas Ferre -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Applied "spi: atmel: Remove needless bits_per_word and speed_hz tests" to the spi tree
In reply to a message not in the archiveThe patch
spi: atmel: Remove needless bits_per_word and speed_hz tests
has been applied to the spi tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
e8646580cc9a6ae24ab3d05f90e71334f50cdedfMon Sep 17 00:00:00 2001
From: Jarkko Nikula <jarkko.nikula-VuQAYsv1563Yd54FQh9/[email protected]>
Date: Fri, 25 Sep 2015 09:03:01 +0300
Subject: [PATCH] spi: atmel: Remove needless bits_per_word and speed_hz tests
SPI core validates both bits_per_word and speed_hz transfer parameters and defaults to spi->bits_per_word and spi->max_speed_hz in case these per transfer parameters are not set. This makes possible to remove two if statements and remove one code block that is never executed.
--- drivers/spi/spi-atmel.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-)
drivers/spi/spi-atmel.c +6 -15
@@ -871,14 +871,7 @@ static int atmel_spi_set_xfer_speed(struct atmel_spi *as,* Calculate the lowest divider that satisfies the * constraint, assuming div32/fdiv/mbz == 0. */ -if (xfer->speed_hz) - scbr =DIV_ROUND_UP (bus_hz, xfer->speed_hz); -else -/* -* This can happend if max_speed is null. -* In this case, we set the lowest possible speed -*/ - scbr =0xff ; + scbr =DIV_ROUND_UP (bus_hz, xfer->speed_hz);/* * If the resulting divider doesn't fit into the
@@ -1300,14 +1293,12 @@ static int atmel_spi_one_transfer(struct spi_master *master,return -EINVAL ; } -if (xfer->bits_per_word) { - asd = spi->controller_state; - bits = (asd->csr >>4 ) &0xf ; -if (bits != xfer->bits_per_word -8 ) { -dev_dbg (&spi->dev, + asd = spi->controller_state; + bits = (asd->csr >>4 ) &0xf ; +if (bits != xfer->bits_per_word -8 ) { +dev_dbg (&spi->dev,"you can't yet change bits_per_word in transfers\n" ); -return -ENOPROTOOPT ; - } +return -ENOPROTOOPT ; }/*
Signature · 6 lines
2.5.0 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 11/16 spi: dw: Remove needless if statements
In reply to a message not in the archiveSPI core validates both bits_per_word and speed_hz transfer parameters and defaults to spi->bits_per_word and spi->max_speed_hz in case these per transfer parameters are not set. This allows to remove related if statements as they evaluate always to true and reduce indentation.
--- drivers/spi/spi-dw.c | 41 ++++++++++++++++++----------------------- 1 file changed, 18 insertions(+), 23 deletions(-)
drivers/spi/spi-dw.c +18 -23
@@ -309,34 +309,29 @@ static int dw_spi_transfer_one(struct spi_master *master, cr0 = chip->cr0;/* Handle per transfer options for bpw and speed */ -if (transfer->speed_hz) { - speed = chip->speed_hz; + speed = chip->speed_hz; +if ((transfer->speed_hz != speed) || !chip->clk_div) { + speed = transfer->speed_hz; -if ((transfer->speed_hz != speed) || !chip->clk_div) { - speed = transfer->speed_hz; +/* clk_div doesn't support odd number */ + clk_div = (dws->max_freq / speed +1 ) &0xfffe ; -/* clk_div doesn't support odd number */ - clk_div = (dws->max_freq / speed +1 ) &0xfffe ; + chip->speed_hz = speed; + chip->clk_div = clk_div; - chip->speed_hz = speed; - chip->clk_div = clk_div; - -spi_set_clk (dws, chip->clk_div); - } +spi_set_clk (dws, chip->clk_div); } -if (transfer->bits_per_word) { -if (transfer->bits_per_word ==8 ) { - dws->n_bytes =1 ; - dws->dma_width =1 ; - }else if (transfer->bits_per_word ==16 ) { - dws->n_bytes =2 ; - dws->dma_width =2 ; - } - cr0 = (transfer->bits_per_word -1 ) - | (chip->type <<SPI_FRF_OFFSET ) - | (spi->mode <<SPI_MODE_OFFSET ) - | (chip->tmode <<SPI_TMOD_OFFSET ); +if (transfer->bits_per_word ==8 ) { + dws->n_bytes =1 ; + dws->dma_width =1 ; + }else if (transfer->bits_per_word ==16 ) { + dws->n_bytes =2 ; + dws->dma_width =2 ; } + cr0 = (transfer->bits_per_word -1 ) + | (chip->type <<SPI_FRF_OFFSET ) + | (spi->mode <<SPI_MODE_OFFSET ) + | (chip->tmode <<SPI_TMOD_OFFSET );/* * Adjust transfer mode if necessary. Requires platform dependent
Signature · 6 lines
2.5.1 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1442323588-29642-11-git-send-email-jarkko.nikula-VuQAYsv1563Yd54FQh9/[email protected]
Applied "spi: dw: Remove needless if statements" to the spi tree
The patch
spi: dw: Remove needless if statements
has been applied to the spi tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
0ed36990a93b23c4873c77cdc1423429e40ed469Mon Sep 17 00:00:00 2001
From: Jarkko Nikula <jarkko.nikula-VuQAYsv1563Yd54FQh9/[email protected]>
Date: Tue, 15 Sep 2015 16:26:23 +0300
Subject: [PATCH] spi: dw: Remove needless if statements
SPI core validates both bits_per_word and speed_hz transfer parameters and defaults to spi->bits_per_word and spi->max_speed_hz in case these per transfer parameters are not set. This allows to remove related if statements as they evaluate always to true and reduce indentation.
--- drivers/spi/spi-dw.c | 41 ++++++++++++++++++----------------------- 1 file changed, 18 insertions(+), 23 deletions(-)
drivers/spi/spi-dw.c +18 -23
@@ -309,34 +309,29 @@ static int dw_spi_transfer_one(struct spi_master *master, cr0 = chip->cr0;/* Handle per transfer options for bpw and speed */ -if (transfer->speed_hz) { - speed = chip->speed_hz; + speed = chip->speed_hz; +if ((transfer->speed_hz != speed) || !chip->clk_div) { + speed = transfer->speed_hz; -if ((transfer->speed_hz != speed) || !chip->clk_div) { - speed = transfer->speed_hz; +/* clk_div doesn't support odd number */ + clk_div = (dws->max_freq / speed +1 ) &0xfffe ; -/* clk_div doesn't support odd number */ - clk_div = (dws->max_freq / speed +1 ) &0xfffe ; + chip->speed_hz = speed; + chip->clk_div = clk_div; - chip->speed_hz = speed; - chip->clk_div = clk_div; - -spi_set_clk (dws, chip->clk_div); - } +spi_set_clk (dws, chip->clk_div); } -if (transfer->bits_per_word) { -if (transfer->bits_per_word ==8 ) { - dws->n_bytes =1 ; - dws->dma_width =1 ; - }else if (transfer->bits_per_word ==16 ) { - dws->n_bytes =2 ; - dws->dma_width =2 ; - } - cr0 = (transfer->bits_per_word -1 ) - | (chip->type <<SPI_FRF_OFFSET ) - | (spi->mode <<SPI_MODE_OFFSET ) - | (chip->tmode <<SPI_TMOD_OFFSET ); +if (transfer->bits_per_word ==8 ) { + dws->n_bytes =1 ; + dws->dma_width =1 ; + }else if (transfer->bits_per_word ==16 ) { + dws->n_bytes =2 ; + dws->dma_width =2 ; } + cr0 = (transfer->bits_per_word -1 ) + | (chip->type <<SPI_FRF_OFFSET ) + | (spi->mode <<SPI_MODE_OFFSET ) + | (chip->tmode <<SPI_TMOD_OFFSET );/* * Adjust transfer mode if necessary. Requires platform dependent
Signature · 6 lines
2.5.0 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 12/16 spi: dw: Remove test for non-zero spi->max_speed_hz
In reply to a message not in the archiveTest for non-zero spi->max_speed_hz in dw_spi_setup() looks needless as spi_setup() defaults to master->max_speed_hz in case it is not set. This drivers sets the master->max_speed_hz based on max_freq data passed to it via dw_spi_add_host() call. I suppose things have already fallen apart if dw_spi_mmio_probe() or spi_pci_probe() ever passes zero max_freq.
--- drivers/spi/spi-dw.c | 5 ----- 1 file changed, 5 deletions(-)
drivers/spi/spi-dw.c +0 -5
@@ -448,11 +448,6 @@ static int dw_spi_setup(struct spi_device *spi) } chip->bits_per_word = spi->bits_per_word; -if (!spi->max_speed_hz) { -dev_err (&spi->dev,"No max speed HZ parameter\n" ); -return -EINVAL ; - } - chip->tmode =0 ;/* Tx & Rx */ /* Default SPI mode is SCPOL = 0, SCPH = 0 */ chip->cr0 = (chip->bits_per_word -1 )
Signature · 6 lines
2.5.1 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1442323588-29642-12-git-send-email-jarkko.nikula-VuQAYsv1563Yd54FQh9/[email protected]
Applied "spi: dw: Remove test for non-zero spi->max_speed_hz" to the spi tree
The patch
spi: dw: Remove test for non-zero spi->max_speed_hz
has been applied to the spi tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
55f9a0706f60df4639010c91d6f28ce6b2351179Mon Sep 17 00:00:00 2001
From: Jarkko Nikula <jarkko.nikula-VuQAYsv1563Yd54FQh9/[email protected]>
Date: Tue, 15 Sep 2015 16:26:24 +0300
Subject: [PATCH] spi: dw: Remove test for non-zero spi->max_speed_hz
Test for non-zero spi->max_speed_hz in dw_spi_setup() looks needless as spi_setup() defaults to master->max_speed_hz in case it is not set. This drivers sets the master->max_speed_hz based on max_freq data passed to it via dw_spi_add_host() call. I suppose things have already fallen apart if dw_spi_mmio_probe() or spi_pci_probe() ever passes zero max_freq.
--- drivers/spi/spi-dw.c | 5 ----- 1 file changed, 5 deletions(-)
drivers/spi/spi-dw.c +0 -5
@@ -448,11 +448,6 @@ static int dw_spi_setup(struct spi_device *spi) } chip->bits_per_word = spi->bits_per_word; -if (!spi->max_speed_hz) { -dev_err (&spi->dev,"No max speed HZ parameter\n" ); -return -EINVAL ; - } - chip->tmode =0 ;/* Tx & Rx */ /* Default SPI mode is SCPOL = 0, SCPH = 0 */ chip->cr0 = (chip->bits_per_word -1 )
Signature · 6 lines
2.5.0 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 13/16 spi: spi-fsl-dspi: Remove duplicated register write
In reply to a message not in the archiveSPI core makes sure that transfer speed is always set so code here writes the same register with the same value twice. Code has been doing this from the beginning.
This looks to me some sort of copy paste error so I'm removing the second write. If this is not the case we can bring it back with a comment.
--- drivers/spi/spi-fsl-dspi.c | 3 --- 1 file changed, 3 deletions(-)
drivers/spi/spi-fsl-dspi.c +0 -3
@@ -409,9 +409,6 @@ static int dspi_transfer_one_message(struct spi_master *master, SPI_MCR_CLR_TXF | SPI_MCR_CLR_RXF);regmap_write (dspi->regmap,SPI_CTAR (dspi->cs), dspi->cur_chip->ctar_val); -if (transfer->speed_hz) -regmap_write (dspi->regmap,SPI_CTAR (dspi->cs), - dspi->cur_chip->ctar_val); trans_mode = dspi->devtype_data->trans_mode;switch (trans_mode) {
Signature · 6 lines
2.5.1 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1442323588-29642-13-git-send-email-jarkko.nikula-VuQAYsv1563Yd54FQh9/[email protected]
Applied "spi: spi-fsl-dspi: Remove duplicated register write" to the spi tree
The patch
spi: spi-fsl-dspi: Remove duplicated register write
has been applied to the spi tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
fa14e47fc409390f1be92da679a365faef187937Mon Sep 17 00:00:00 2001
From: Jarkko Nikula <jarkko.nikula-VuQAYsv1563Yd54FQh9/[email protected]>
Date: Tue, 15 Sep 2015 16:26:25 +0300
Subject: [PATCH] spi: spi-fsl-dspi: Remove duplicated register write
SPI core makes sure that transfer speed is always set so code here writes the same register with the same value twice. Code has been doing this from the beginning.
This looks to me some sort of copy paste error so I'm removing the second write. If this is not the case we can bring it back with a comment.
--- drivers/spi/spi-fsl-dspi.c | 3 --- 1 file changed, 3 deletions(-)
drivers/spi/spi-fsl-dspi.c +0 -3
@@ -409,9 +409,6 @@ static int dspi_transfer_one_message(struct spi_master *master, SPI_MCR_CLR_TXF | SPI_MCR_CLR_RXF);regmap_write (dspi->regmap,SPI_CTAR (dspi->cs), dspi->cur_chip->ctar_val); -if (transfer->speed_hz) -regmap_write (dspi->regmap,SPI_CTAR (dspi->cs), - dspi->cur_chip->ctar_val); trans_mode = dspi->devtype_data->trans_mode;switch (trans_mode) {
Signature · 6 lines
2.5.0 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 14/16 spi: pxa2xx: Remove two variables from struct chip_data
In reply to a message not in the archiveThere is no need to carry spi->max_speed_hz and spi->bits_per_word from setup() in "struct chip_data" since pump_transfers() will anyway take the transfer parameters from "struct spi_transfer". This is since SPI core validates both bits_per_word and speed_hz transfer parameters and defaults to spi->bits_per_word and spi->max_speed_hz in case these per transfer parameters are not set.
--- drivers/spi/spi-pxa2xx.c | 12 ++---------- drivers/spi/spi-pxa2xx.h | 2 -- 2 files changed, 2 insertions(+), 12 deletions(-)
drivers/spi/spi-pxa2xx.c +2 -10
@@ -925,14 +925,8 @@ static void pump_transfers(unsigned long data) cr0 = chip->cr0;if (transfer->speed_hz || transfer->bits_per_word) { - bits = chip->bits_per_word; - speed = chip->speed_hz; - -if (transfer->speed_hz) - speed = transfer->speed_hz; - -if (transfer->bits_per_word) - bits = transfer->bits_per_word; + bits = transfer->bits_per_word; + speed = transfer->speed_hz; clk_div =pxa2xx_ssp_get_clk_div (drv_data, chip, speed);
@@ -1204,7 +1198,6 @@ static int setup(struct spi_device *spi) } clk_div =pxa2xx_ssp_get_clk_div (drv_data, chip, spi->max_speed_hz); - chip->speed_hz = spi->max_speed_hz; chip->cr0 =pxa2xx_configure_sscr0 (drv_data, clk_div, spi->bits_per_word);
@@ -1255,7 +1248,6 @@ static int setup(struct spi_device *spi) chip->read = u32_reader; chip->write = u32_writer; } - chip->bits_per_word = spi->bits_per_word;spi_set_ctldata (spi, chip);
drivers/spi/spi-pxa2xx.h +0 -2
@@ -98,8 +98,6 @@ struct chip_data {u16 lpss_rx_threshold;u16 lpss_tx_threshold;u8 enable_dma; -u8 bits_per_word; -u32 speed_hz;union {int gpio_cs;unsigned int frm;
Signature · 6 lines
2.5.1 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1442323588-29642-14-git-send-email-jarkko.nikula-VuQAYsv1563Yd54FQh9/[email protected]
Applied "spi: pxa2xx: Remove two variables from struct chip_data" to the spi tree
The patch
spi: pxa2xx: Remove two variables from struct chip_data
has been applied to the spi tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
4f1474b3b786305d77c93c232f65d40018043e9fMon Sep 17 00:00:00 2001
From: Jarkko Nikula <jarkko.nikula-VuQAYsv1563Yd54FQh9/[email protected]>
Date: Tue, 15 Sep 2015 16:26:26 +0300
Subject: [PATCH] spi: pxa2xx: Remove two variables from struct chip_data
There is no need to carry spi->max_speed_hz and spi->bits_per_word from setup() in "struct chip_data" since pump_transfers() will anyway take the transfer parameters from "struct spi_transfer". This is since SPI core validates both bits_per_word and speed_hz transfer parameters and defaults to spi->bits_per_word and spi->max_speed_hz in case these per transfer parameters are not set.
--- drivers/spi/spi-pxa2xx.c | 12 ++---------- drivers/spi/spi-pxa2xx.h | 2 -- 2 files changed, 2 insertions(+), 12 deletions(-)
drivers/spi/spi-pxa2xx.c +2 -10
@@ -921,14 +921,8 @@ static void pump_transfers(unsigned long data) cr0 = chip->cr0;if (transfer->speed_hz || transfer->bits_per_word) { - bits = chip->bits_per_word; - speed = chip->speed_hz; - -if (transfer->speed_hz) - speed = transfer->speed_hz; - -if (transfer->bits_per_word) - bits = transfer->bits_per_word; + bits = transfer->bits_per_word; + speed = transfer->speed_hz; clk_div =pxa2xx_ssp_get_clk_div (drv_data, chip, speed);
@@ -1200,7 +1194,6 @@ static int setup(struct spi_device *spi) } clk_div =pxa2xx_ssp_get_clk_div (drv_data, chip, spi->max_speed_hz); - chip->speed_hz = spi->max_speed_hz; chip->cr0 =pxa2xx_configure_sscr0 (drv_data, clk_div, spi->bits_per_word);
@@ -1251,7 +1244,6 @@ static int setup(struct spi_device *spi) chip->read = u32_reader; chip->write = u32_writer; } - chip->bits_per_word = spi->bits_per_word;spi_set_ctldata (spi, chip);
drivers/spi/spi-pxa2xx.h +0 -2
@@ -98,8 +98,6 @@ struct chip_data {u16 lpss_rx_threshold;u16 lpss_tx_threshold;u8 enable_dma; -u8 bits_per_word; -u32 speed_hz;union {int gpio_cs;unsigned int frm;
Signature · 6 lines
2.5.0 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 15/16 spi: pxa2xx: Remove if statement that is always true in pump_transfers()
In reply to a message not in the archiveThis is continuation to previous commit by separating unindentation from variable removal done in previous commit. As said SPI core have validated both the speed_hz and bits_per_word and the if statement here evaluates always to true.
Remove the test and unindent the code block accordingly. While at it remove also needless "cr0 = chip->cr0" as cr0 will be overwritten anyway and fix block comment style.
--- drivers/spi/spi-pxa2xx.c | 76 +++++++++++++++++++++++------------------------- 1 file changed, 37 insertions(+), 39 deletions(-)
drivers/spi/spi-pxa2xx.c +37 -39
@@ -922,47 +922,45 @@ static void pump_transfers(unsigned long data) drv_data->read = drv_data->rx ? chip->read : null_reader;/* Change speed and bit per word on a per transfer */ - cr0 = chip->cr0; -if (transfer->speed_hz || transfer->bits_per_word) { - - bits = transfer->bits_per_word; - speed = transfer->speed_hz; - - clk_div =pxa2xx_ssp_get_clk_div (drv_data, chip, speed); - -if (bits <=8 ) { - drv_data->n_bytes =1 ; - drv_data->read = drv_data->read != null_reader ? - u8_reader : null_reader; - drv_data->write = drv_data->write != null_writer ? - u8_writer : null_writer; - }else if (bits <=16 ) { - drv_data->n_bytes =2 ; - drv_data->read = drv_data->read != null_reader ? - u16_reader : null_reader; - drv_data->write = drv_data->write != null_writer ? - u16_writer : null_writer; - }else if (bits <=32 ) { - drv_data->n_bytes =4 ; - drv_data->read = drv_data->read != null_reader ? - u32_reader : null_reader; - drv_data->write = drv_data->write != null_writer ? - u32_writer : null_writer; - } -/* if bits/word is changed in dma mode, then must check the -* thresholds and burst also */ -if (chip->enable_dma) { -if (pxa2xx_spi_set_dma_burst_and_threshold (chip, - message->spi, - bits, &dma_burst, - &dma_thresh)) -dev_warn_ratelimited (&message->spi->dev, -"pump_transfers: DMA burst size reduced to match bits_per_word\n" ); - } - - cr0 =pxa2xx_configure_sscr0 (drv_data, clk_div, bits); + bits = transfer->bits_per_word; + speed = transfer->speed_hz; + + clk_div =pxa2xx_ssp_get_clk_div (drv_data, chip, speed); + +if (bits <=8 ) { + drv_data->n_bytes =1 ; + drv_data->read = drv_data->read != null_reader ? + u8_reader : null_reader; + drv_data->write = drv_data->write != null_writer ? + u8_writer : null_writer; + }else if (bits <=16 ) { + drv_data->n_bytes =2 ; + drv_data->read = drv_data->read != null_reader ? + u16_reader : null_reader; + drv_data->write = drv_data->write != null_writer ? + u16_writer : null_writer; + }else if (bits <=32 ) { + drv_data->n_bytes =4 ; + drv_data->read = drv_data->read != null_reader ? + u32_reader : null_reader; + drv_data->write = drv_data->write != null_writer ? + u32_writer : null_writer; + } +/* +* if bits/word is changed in dma mode, then must check the +* thresholds and burst also +*/ +if (chip->enable_dma) { +if (pxa2xx_spi_set_dma_burst_and_threshold (chip, + message->spi, + bits, &dma_burst, + &dma_thresh)) +dev_warn_ratelimited (&message->spi->dev, +"pump_transfers: DMA burst size reduced to match bits_per_word\n" ); } + cr0 =pxa2xx_configure_sscr0 (drv_data, clk_div, bits); + message->state =RUNNING_STATE ; drv_data->dma_mapped =0 ;
Signature · 6 lines
2.5.1 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1442323588-29642-15-git-send-email-jarkko.nikula-VuQAYsv1563Yd54FQh9/[email protected]
Applied "spi: pxa2xx: Remove if statement that is always true in pump_transfers()" to the spi tree
The patch
spi: pxa2xx: Remove if statement that is always true in pump_transfers()
has been applied to the spi tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
196b0e2cf2373f43d7b0e8c1a63e9d528c06e1dfMon Sep 17 00:00:00 2001
From: Jarkko Nikula <jarkko.nikula-VuQAYsv1563Yd54FQh9/[email protected]>
Date: Tue, 15 Sep 2015 16:26:27 +0300
Subject: [PATCH] spi: pxa2xx: Remove if statement that is always true in
pump_transfers()
This is continuation to previous commit by separating unindentation from variable removal done in previous commit. As said SPI core have validated both the speed_hz and bits_per_word and the if statement here evaluates always to true.
Remove the test and unindent the code block accordingly. While at it remove also needless "cr0 = chip->cr0" as cr0 will be overwritten anyway and fix block comment style.
--- drivers/spi/spi-pxa2xx.c | 76 +++++++++++++++++++++++------------------------- 1 file changed, 37 insertions(+), 39 deletions(-)
drivers/spi/spi-pxa2xx.c +37 -39
@@ -918,47 +918,45 @@ static void pump_transfers(unsigned long data) drv_data->read = drv_data->rx ? chip->read : null_reader;/* Change speed and bit per word on a per transfer */ - cr0 = chip->cr0; -if (transfer->speed_hz || transfer->bits_per_word) { - - bits = transfer->bits_per_word; - speed = transfer->speed_hz; - - clk_div =pxa2xx_ssp_get_clk_div (drv_data, chip, speed); - -if (bits <=8 ) { - drv_data->n_bytes =1 ; - drv_data->read = drv_data->read != null_reader ? - u8_reader : null_reader; - drv_data->write = drv_data->write != null_writer ? - u8_writer : null_writer; - }else if (bits <=16 ) { - drv_data->n_bytes =2 ; - drv_data->read = drv_data->read != null_reader ? - u16_reader : null_reader; - drv_data->write = drv_data->write != null_writer ? - u16_writer : null_writer; - }else if (bits <=32 ) { - drv_data->n_bytes =4 ; - drv_data->read = drv_data->read != null_reader ? - u32_reader : null_reader; - drv_data->write = drv_data->write != null_writer ? - u32_writer : null_writer; - } -/* if bits/word is changed in dma mode, then must check the -* thresholds and burst also */ -if (chip->enable_dma) { -if (pxa2xx_spi_set_dma_burst_and_threshold (chip, - message->spi, - bits, &dma_burst, - &dma_thresh)) -dev_warn_ratelimited (&message->spi->dev, -"pump_transfers: DMA burst size reduced to match bits_per_word\n" ); - } - - cr0 =pxa2xx_configure_sscr0 (drv_data, clk_div, bits); + bits = transfer->bits_per_word; + speed = transfer->speed_hz; + + clk_div =pxa2xx_ssp_get_clk_div (drv_data, chip, speed); + +if (bits <=8 ) { + drv_data->n_bytes =1 ; + drv_data->read = drv_data->read != null_reader ? + u8_reader : null_reader; + drv_data->write = drv_data->write != null_writer ? + u8_writer : null_writer; + }else if (bits <=16 ) { + drv_data->n_bytes =2 ; + drv_data->read = drv_data->read != null_reader ? + u16_reader : null_reader; + drv_data->write = drv_data->write != null_writer ? + u16_writer : null_writer; + }else if (bits <=32 ) { + drv_data->n_bytes =4 ; + drv_data->read = drv_data->read != null_reader ? + u32_reader : null_reader; + drv_data->write = drv_data->write != null_writer ? + u32_writer : null_writer; + } +/* +* if bits/word is changed in dma mode, then must check the +* thresholds and burst also +*/ +if (chip->enable_dma) { +if (pxa2xx_spi_set_dma_burst_and_threshold (chip, + message->spi, + bits, &dma_burst, + &dma_thresh)) +dev_warn_ratelimited (&message->spi->dev, +"pump_transfers: DMA burst size reduced to match bits_per_word\n" ); } + cr0 =pxa2xx_configure_sscr0 (drv_data, clk_div, bits); + message->state =RUNNING_STATE ; drv_data->dma_mapped =0 ;
Signature · 6 lines
2.5.0 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 16/16 spi: pxa2xx: Remove cr0 variable from struct chip_data
In reply to a message not in the archiveThere hasn't been need to carry chip->cr0 after SPI core started to validate speed_hz and bits_per_word transfer parameters. That effectively caused that pump_transfers() always recalculated it and practically chip->cr0 is used locally in setup() for debug prints only.
--- drivers/spi/spi-pxa2xx.c | 10 ++++------ drivers/spi/spi-pxa2xx.h | 1 - 2 files changed, 4 insertions(+), 7 deletions(-)
drivers/spi/spi-pxa2xx.c +4 -6
@@ -1105,6 +1105,7 @@ static int setup(struct spi_device *spi)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 :
@@ -1197,8 +1198,6 @@ static int setup(struct spi_device *spi) clk_div =pxa2xx_ssp_get_clk_div (drv_data, chip, spi->max_speed_hz); - chip->cr0 =pxa2xx_configure_sscr0 (drv_data, clk_div, - spi->bits_per_word);switch (drv_data->ssp_type) {case QUARK_X1000_SSP : chip->threshold = (QUARK_X1000_SSCR1_RxTresh(rx_thres)
@@ -1220,15 +1219,16 @@ static int setup(struct spi_device *spi) 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,"%ld Hz actual, %s\n" , drv_data->max_clk_rate - / (1 + ((chip->cr0 &SSCR0_SCR (0xfff )) >>8 )), + / (1 + ((cr0 &SSCR0_SCR (0xfff )) >>8 )), chip->enable_dma ?"DMA" :"PIO" );else dev_dbg (&spi->dev,"%ld Hz actual, %s\n" , drv_data->max_clk_rate /2 - / (1 + ((chip->cr0 &SSCR0_SCR (0x0ff )) >>8 )), + / (1 + ((cr0 &SSCR0_SCR (0x0ff )) >>8 )), chip->enable_dma ?"DMA" :"PIO" );if (spi->bits_per_word <=8 ) {
@@ -1240,8 +1240,6 @@ static int setup(struct spi_device *spi) chip->read = u16_reader; chip->write = u16_writer; }else if (spi->bits_per_word <=32 ) { -if (!is_quark_x1000_ssp (drv_data)) - chip->cr0 |=SSCR0_EDSS ; chip->n_bytes =4 ; chip->read = u32_reader; chip->write = u32_writer;
drivers/spi/spi-pxa2xx.h +0 -1
@@ -86,7 +86,6 @@ struct driver_data { };struct chip_data { -u32 cr0;u32 cr1;u32 dds_rate;u32 psp;
Signature · 6 lines
2.5.1 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1442323588-29642-16-git-send-email-jarkko.nikula-VuQAYsv1563Yd54FQh9/[email protected]
Applied "spi: pxa2xx: Remove cr0 variable from struct chip_data" to the spi tree
The patch
spi: pxa2xx: Remove cr0 variable from struct chip_data
has been applied to the spi tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
b69d42b5c44bcfc1c73fe185d4644487f1bd3193Mon Sep 17 00:00:00 2001
From: Jarkko Nikula <jarkko.nikula-VuQAYsv1563Yd54FQh9/[email protected]>
Date: Tue, 15 Sep 2015 16:26:28 +0300
Subject: [PATCH] spi: pxa2xx: Remove cr0 variable from struct chip_data
There hasn't been need to carry chip->cr0 after SPI core started to validate speed_hz and bits_per_word transfer parameters. That effectively caused that pump_transfers() always recalculated it and practically chip->cr0 is used locally in setup() for debug prints only.
--- drivers/spi/spi-pxa2xx.c | 10 ++++------ drivers/spi/spi-pxa2xx.h | 1 - 2 files changed, 4 insertions(+), 7 deletions(-)
drivers/spi/spi-pxa2xx.c +4 -6
@@ -1101,6 +1101,7 @@ static int setup(struct spi_device *spi)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 :
@@ -1193,8 +1194,6 @@ static int setup(struct spi_device *spi) clk_div =pxa2xx_ssp_get_clk_div (drv_data, chip, spi->max_speed_hz); - chip->cr0 =pxa2xx_configure_sscr0 (drv_data, clk_div, - spi->bits_per_word);switch (drv_data->ssp_type) {case QUARK_X1000_SSP : chip->threshold = (QUARK_X1000_SSCR1_RxTresh(rx_thres)
@@ -1216,15 +1215,16 @@ static int setup(struct spi_device *spi) 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,"%ld Hz actual, %s\n" , drv_data->max_clk_rate - / (1 + ((chip->cr0 &SSCR0_SCR (0xfff )) >>8 )), + / (1 + ((cr0 &SSCR0_SCR (0xfff )) >>8 )), chip->enable_dma ?"DMA" :"PIO" );else dev_dbg (&spi->dev,"%ld Hz actual, %s\n" , drv_data->max_clk_rate /2 - / (1 + ((chip->cr0 &SSCR0_SCR (0x0ff )) >>8 )), + / (1 + ((cr0 &SSCR0_SCR (0x0ff )) >>8 )), chip->enable_dma ?"DMA" :"PIO" );if (spi->bits_per_word <=8 ) {
@@ -1236,8 +1236,6 @@ static int setup(struct spi_device *spi) chip->read = u16_reader; chip->write = u16_writer; }else if (spi->bits_per_word <=32 ) { -if (!is_quark_x1000_ssp (drv_data)) - chip->cr0 |=SSCR0_EDSS ; chip->n_bytes =4 ; chip->read = u32_reader; chip->write = u32_writer;
drivers/spi/spi-pxa2xx.h +0 -1
@@ -86,7 +86,6 @@ struct driver_data { };struct chip_data { -u32 cr0;u32 cr1;u32 dds_rate;u32 psp;
Signature · 6 lines
2.5.0 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 2 lines · Jarkko Nikula
SPI core validates the transfer speed and defaults to
spi->max_speed_hzin case the transfer speed is not set.
Please don't send large collections of unrelated changes as a single series - this isn't one change done to a lot of drivers, this is a bunch of unrelated changes. Having things grouped into a patch series affects how they get handled and reviewed, if this is misleading it can get in the way (eg, not reading patches after one that has problems).
Applied "spi: txx9: Use transfer speed unconditionally" to the spi tree
In reply to a message not in the archiveThe patch
spi: txx9: Use transfer speed unconditionally
has been applied to the spi tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
fc306de9b54e94a2949fee452741c00259d7dd4aMon Sep 17 00:00:00 2001
From: Jarkko Nikula <jarkko.nikula-VuQAYsv1563Yd54FQh9/[email protected]>
Date: Tue, 15 Sep 2015 16:26:13 +0300
Subject: [PATCH] spi: txx9: Use transfer speed unconditionally
SPI core validates the transfer speed and defaults to spi->max_speed_hz in case the transfer speed is not set.
--- drivers/spi/spi-txx9.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/spi-txx9.c +1 -1
@@ -181,7 +181,7 @@ static void txx9spi_work_one(struct txx9spi *c, struct spi_message *m)u32 data;unsigned int len = t->len;unsigned int wsize; -u32 speed_hz = t->speed_hz ? : spi->max_speed_hz; +u32 speed_hz = t->speed_hz;u8 bits_per_word = t->bits_per_word; wsize = bits_per_word >>3 ;/* in bytes */
Signature · 6 lines
2.5.0 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html