All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] spi: stm32: comments & SIMPLEX_RX fixes
@ 2022-01-19  9:32 ` Alain Volmat
  0 siblings, 0 replies; 8+ messages in thread
From: Alain Volmat @ 2022-01-19  9:32 UTC (permalink / raw)
  To: broonie, amelie.delaunay
  Cc: mcoquelin.stm32, alexandre.torgue, linux-spi, linux-stm32,
	linux-arm-kernel, linux-kernel, fabrice.gasnier, alain.volmat

This series contains 2 fixes within the spi-stm32.c driver.  One is
removing comments regarding struct variables that do not exist and the
second one correct a previous STM32F4 related commit for SIMPLEX_RX which
happens to break SIMPLEX_RX for H7 since it enforces MUST_TX flags.

Alain Volmat (2):
  spi: stm32: remove inexistant variables in struct stm32_spi_cfg
    comment
  spi: stm32: make SPI_MASTER_MUST_TX flags only specific to STM32F4

 drivers/spi/spi-stm32.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

-- 
2.25.1


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

* [PATCH 0/2] spi: stm32: comments & SIMPLEX_RX fixes
@ 2022-01-19  9:32 ` Alain Volmat
  0 siblings, 0 replies; 8+ messages in thread
From: Alain Volmat @ 2022-01-19  9:32 UTC (permalink / raw)
  To: broonie, amelie.delaunay
  Cc: mcoquelin.stm32, alexandre.torgue, linux-spi, linux-stm32,
	linux-arm-kernel, linux-kernel, fabrice.gasnier, alain.volmat

This series contains 2 fixes within the spi-stm32.c driver.  One is
removing comments regarding struct variables that do not exist and the
second one correct a previous STM32F4 related commit for SIMPLEX_RX which
happens to break SIMPLEX_RX for H7 since it enforces MUST_TX flags.

Alain Volmat (2):
  spi: stm32: remove inexistant variables in struct stm32_spi_cfg
    comment
  spi: stm32: make SPI_MASTER_MUST_TX flags only specific to STM32F4

 drivers/spi/spi-stm32.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 1/2] spi: stm32: remove inexistant variables in struct stm32_spi_cfg comment
  2022-01-19  9:32 ` Alain Volmat
@ 2022-01-19  9:32   ` Alain Volmat
  -1 siblings, 0 replies; 8+ messages in thread
From: Alain Volmat @ 2022-01-19  9:32 UTC (permalink / raw)
  To: broonie, amelie.delaunay
  Cc: mcoquelin.stm32, alexandre.torgue, linux-spi, linux-stm32,
	linux-arm-kernel, linux-kernel, fabrice.gasnier, alain.volmat

Variables 'can_dma' and 'has_startbit' are described within the
struct stm32_spi_cfg comment but have never existed in this structure
so remove them.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
---
 drivers/spi/spi-stm32.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/spi/spi-stm32.c b/drivers/spi/spi-stm32.c
index 9bd3fd1652f7..b5ef2470cefe 100644
--- a/drivers/spi/spi-stm32.c
+++ b/drivers/spi/spi-stm32.c
@@ -221,7 +221,6 @@ struct stm32_spi;
  * time between frames (if driver has this functionality)
  * @set_number_of_data: optional routine to configure registers to desired
  * number of data (if driver has this functionality)
- * @can_dma: routine to determine if the transfer is eligible for DMA use
  * @transfer_one_dma_start: routine to start transfer a single spi_transfer
  * using DMA
  * @dma_rx_cb: routine to call after DMA RX channel operation is complete
@@ -232,7 +231,6 @@ struct stm32_spi;
  * @baud_rate_div_min: minimum baud rate divisor
  * @baud_rate_div_max: maximum baud rate divisor
  * @has_fifo: boolean to know if fifo is used for driver
- * @has_startbit: boolean to know if start bit is used to start transfer
  */
 struct stm32_spi_cfg {
 	const struct stm32_spi_regspec *regs;
-- 
2.25.1


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

* [PATCH 1/2] spi: stm32: remove inexistant variables in struct stm32_spi_cfg comment
@ 2022-01-19  9:32   ` Alain Volmat
  0 siblings, 0 replies; 8+ messages in thread
From: Alain Volmat @ 2022-01-19  9:32 UTC (permalink / raw)
  To: broonie, amelie.delaunay
  Cc: mcoquelin.stm32, alexandre.torgue, linux-spi, linux-stm32,
	linux-arm-kernel, linux-kernel, fabrice.gasnier, alain.volmat

Variables 'can_dma' and 'has_startbit' are described within the
struct stm32_spi_cfg comment but have never existed in this structure
so remove them.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
---
 drivers/spi/spi-stm32.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/spi/spi-stm32.c b/drivers/spi/spi-stm32.c
index 9bd3fd1652f7..b5ef2470cefe 100644
--- a/drivers/spi/spi-stm32.c
+++ b/drivers/spi/spi-stm32.c
@@ -221,7 +221,6 @@ struct stm32_spi;
  * time between frames (if driver has this functionality)
  * @set_number_of_data: optional routine to configure registers to desired
  * number of data (if driver has this functionality)
- * @can_dma: routine to determine if the transfer is eligible for DMA use
  * @transfer_one_dma_start: routine to start transfer a single spi_transfer
  * using DMA
  * @dma_rx_cb: routine to call after DMA RX channel operation is complete
@@ -232,7 +231,6 @@ struct stm32_spi;
  * @baud_rate_div_min: minimum baud rate divisor
  * @baud_rate_div_max: maximum baud rate divisor
  * @has_fifo: boolean to know if fifo is used for driver
- * @has_startbit: boolean to know if start bit is used to start transfer
  */
 struct stm32_spi_cfg {
 	const struct stm32_spi_regspec *regs;
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 2/2] spi: stm32: make SPI_MASTER_MUST_TX flags only specific to STM32F4
  2022-01-19  9:32 ` Alain Volmat
@ 2022-01-19  9:32   ` Alain Volmat
  -1 siblings, 0 replies; 8+ messages in thread
From: Alain Volmat @ 2022-01-19  9:32 UTC (permalink / raw)
  To: broonie, amelie.delaunay
  Cc: mcoquelin.stm32, alexandre.torgue, linux-spi, linux-stm32,
	linux-arm-kernel, linux-kernel, fabrice.gasnier, alain.volmat

Commit 61367d0b8f5e ("spi: stm32: Add 'SPI_SIMPLEX_RX', 'SPI_3WIRE_RX' support for stm32f4")
allowed to properly communicate with the st-gyro-spi even when
there is no tx_buf provided by setting the flag SPI_MASTER_MUST_TX and
thus forcing a dummy TX buffer to work in Full Duplex.
This behavior should kept only for the STM32F4 and not for other
compatible since the STM32H7 do support SIMPLEX_RX and SIMPLEX_TX.
Add the flags variable within the struct stm32_spi_cfg so that flags
used at master registration time are compatible specific.

Fixes: 61367d0b8f5e ("spi: stm32: Add 'SPI_SIMPLEX_RX', 'SPI_3WIRE_RX' support for stm32f4")

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
---
 drivers/spi/spi-stm32.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi-stm32.c b/drivers/spi/spi-stm32.c
index b5ef2470cefe..7fc24505a72c 100644
--- a/drivers/spi/spi-stm32.c
+++ b/drivers/spi/spi-stm32.c
@@ -231,6 +231,7 @@ struct stm32_spi;
  * @baud_rate_div_min: minimum baud rate divisor
  * @baud_rate_div_max: maximum baud rate divisor
  * @has_fifo: boolean to know if fifo is used for driver
+ * @flags: compatible specific SPI controller flags used at registration time
  */
 struct stm32_spi_cfg {
 	const struct stm32_spi_regspec *regs;
@@ -251,6 +252,7 @@ struct stm32_spi_cfg {
 	unsigned int baud_rate_div_min;
 	unsigned int baud_rate_div_max;
 	bool has_fifo;
+	u16 flags;
 };
 
 /**
@@ -1720,6 +1722,7 @@ static const struct stm32_spi_cfg stm32f4_spi_cfg = {
 	.baud_rate_div_min = STM32F4_SPI_BR_DIV_MIN,
 	.baud_rate_div_max = STM32F4_SPI_BR_DIV_MAX,
 	.has_fifo = false,
+	.flags = SPI_MASTER_MUST_TX,
 };
 
 static const struct stm32_spi_cfg stm32h7_spi_cfg = {
@@ -1852,7 +1855,7 @@ static int stm32_spi_probe(struct platform_device *pdev)
 	master->prepare_message = stm32_spi_prepare_msg;
 	master->transfer_one = stm32_spi_transfer_one;
 	master->unprepare_message = stm32_spi_unprepare_msg;
-	master->flags = SPI_MASTER_MUST_TX;
+	master->flags = spi->cfg->flags;
 
 	spi->dma_tx = dma_request_chan(spi->dev, "tx");
 	if (IS_ERR(spi->dma_tx)) {
-- 
2.25.1


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

* [PATCH 2/2] spi: stm32: make SPI_MASTER_MUST_TX flags only specific to STM32F4
@ 2022-01-19  9:32   ` Alain Volmat
  0 siblings, 0 replies; 8+ messages in thread
From: Alain Volmat @ 2022-01-19  9:32 UTC (permalink / raw)
  To: broonie, amelie.delaunay
  Cc: mcoquelin.stm32, alexandre.torgue, linux-spi, linux-stm32,
	linux-arm-kernel, linux-kernel, fabrice.gasnier, alain.volmat

Commit 61367d0b8f5e ("spi: stm32: Add 'SPI_SIMPLEX_RX', 'SPI_3WIRE_RX' support for stm32f4")
allowed to properly communicate with the st-gyro-spi even when
there is no tx_buf provided by setting the flag SPI_MASTER_MUST_TX and
thus forcing a dummy TX buffer to work in Full Duplex.
This behavior should kept only for the STM32F4 and not for other
compatible since the STM32H7 do support SIMPLEX_RX and SIMPLEX_TX.
Add the flags variable within the struct stm32_spi_cfg so that flags
used at master registration time are compatible specific.

Fixes: 61367d0b8f5e ("spi: stm32: Add 'SPI_SIMPLEX_RX', 'SPI_3WIRE_RX' support for stm32f4")

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
---
 drivers/spi/spi-stm32.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi-stm32.c b/drivers/spi/spi-stm32.c
index b5ef2470cefe..7fc24505a72c 100644
--- a/drivers/spi/spi-stm32.c
+++ b/drivers/spi/spi-stm32.c
@@ -231,6 +231,7 @@ struct stm32_spi;
  * @baud_rate_div_min: minimum baud rate divisor
  * @baud_rate_div_max: maximum baud rate divisor
  * @has_fifo: boolean to know if fifo is used for driver
+ * @flags: compatible specific SPI controller flags used at registration time
  */
 struct stm32_spi_cfg {
 	const struct stm32_spi_regspec *regs;
@@ -251,6 +252,7 @@ struct stm32_spi_cfg {
 	unsigned int baud_rate_div_min;
 	unsigned int baud_rate_div_max;
 	bool has_fifo;
+	u16 flags;
 };
 
 /**
@@ -1720,6 +1722,7 @@ static const struct stm32_spi_cfg stm32f4_spi_cfg = {
 	.baud_rate_div_min = STM32F4_SPI_BR_DIV_MIN,
 	.baud_rate_div_max = STM32F4_SPI_BR_DIV_MAX,
 	.has_fifo = false,
+	.flags = SPI_MASTER_MUST_TX,
 };
 
 static const struct stm32_spi_cfg stm32h7_spi_cfg = {
@@ -1852,7 +1855,7 @@ static int stm32_spi_probe(struct platform_device *pdev)
 	master->prepare_message = stm32_spi_prepare_msg;
 	master->transfer_one = stm32_spi_transfer_one;
 	master->unprepare_message = stm32_spi_unprepare_msg;
-	master->flags = SPI_MASTER_MUST_TX;
+	master->flags = spi->cfg->flags;
 
 	spi->dma_tx = dma_request_chan(spi->dev, "tx");
 	if (IS_ERR(spi->dma_tx)) {
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 0/2] spi: stm32: comments & SIMPLEX_RX fixes
  2022-01-19  9:32 ` Alain Volmat
@ 2022-01-19 18:02   ` Mark Brown
  -1 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2022-01-19 18:02 UTC (permalink / raw)
  To: amelie.delaunay, Alain Volmat
  Cc: alexandre.torgue, fabrice.gasnier, linux-spi, linux-kernel,
	linux-arm-kernel, mcoquelin.stm32, linux-stm32

On Wed, 19 Jan 2022 10:32:43 +0100, Alain Volmat wrote:
> This series contains 2 fixes within the spi-stm32.c driver.  One is
> removing comments regarding struct variables that do not exist and the
> second one correct a previous STM32F4 related commit for SIMPLEX_RX which
> happens to break SIMPLEX_RX for H7 since it enforces MUST_TX flags.
> 
> Alain Volmat (2):
>   spi: stm32: remove inexistant variables in struct stm32_spi_cfg
>     comment
>   spi: stm32: make SPI_MASTER_MUST_TX flags only specific to STM32F4
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-linus

Thanks!

[1/2] spi: stm32: remove inexistant variables in struct stm32_spi_cfg comment
      commit: 3cefddb72f80dc8d49ce605628ceb6525cfd64da
[2/2] spi: stm32: make SPI_MASTER_MUST_TX flags only specific to STM32F4
      commit: 9df15d842a0f77f2b8ee29386f6d714e4220df57

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

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

* Re: [PATCH 0/2] spi: stm32: comments & SIMPLEX_RX fixes
@ 2022-01-19 18:02   ` Mark Brown
  0 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2022-01-19 18:02 UTC (permalink / raw)
  To: amelie.delaunay, Alain Volmat
  Cc: alexandre.torgue, fabrice.gasnier, linux-spi, linux-kernel,
	linux-arm-kernel, mcoquelin.stm32, linux-stm32

On Wed, 19 Jan 2022 10:32:43 +0100, Alain Volmat wrote:
> This series contains 2 fixes within the spi-stm32.c driver.  One is
> removing comments regarding struct variables that do not exist and the
> second one correct a previous STM32F4 related commit for SIMPLEX_RX which
> happens to break SIMPLEX_RX for H7 since it enforces MUST_TX flags.
> 
> Alain Volmat (2):
>   spi: stm32: remove inexistant variables in struct stm32_spi_cfg
>     comment
>   spi: stm32: make SPI_MASTER_MUST_TX flags only specific to STM32F4
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-linus

Thanks!

[1/2] spi: stm32: remove inexistant variables in struct stm32_spi_cfg comment
      commit: 3cefddb72f80dc8d49ce605628ceb6525cfd64da
[2/2] spi: stm32: make SPI_MASTER_MUST_TX flags only specific to STM32F4
      commit: 9df15d842a0f77f2b8ee29386f6d714e4220df57

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2022-01-19 18:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-19  9:32 [PATCH 0/2] spi: stm32: comments & SIMPLEX_RX fixes Alain Volmat
2022-01-19  9:32 ` Alain Volmat
2022-01-19  9:32 ` [PATCH 1/2] spi: stm32: remove inexistant variables in struct stm32_spi_cfg comment Alain Volmat
2022-01-19  9:32   ` Alain Volmat
2022-01-19  9:32 ` [PATCH 2/2] spi: stm32: make SPI_MASTER_MUST_TX flags only specific to STM32F4 Alain Volmat
2022-01-19  9:32   ` Alain Volmat
2022-01-19 18:02 ` [PATCH 0/2] spi: stm32: comments & SIMPLEX_RX fixes Mark Brown
2022-01-19 18:02   ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.