Stefan Wahren
730bbfaf7d
spi: spi-fsl-lpspi: Fix scldiv calculation
...
The effective SPI clock frequency should never exceed speed_hz
otherwise this might result in undefined behavior of the SPI device.
Currently the scldiv calculation could violate this constraint.
For the example parameters perclk_rate = 24 MHz and speed_hz = 7 MHz,
the function fsl_lpspi_set_bitrate will determine perscale = 0 and
scldiv = 1, which is a effective SPI clock of 8 MHz.
So fix this by rounding up the quotient of perclk_rate and speed_hz.
While this never change within the loop, we can pull this out.
Fixes: 5314987de5 ("spi: imx: add lpspi bus driver")
Signed-off-by: Stefan Wahren <wahrenst@gmx.net >
Link: https://patch.msgid.link/20240804113611.83613-1-wahrenst@gmx.net
Signed-off-by: Mark Brown <broonie@kernel.org >
2024-08-07 23:45:12 +01:00
..
2024-07-27 10:14:34 -07:00
2024-07-12 11:31:37 +02:00
2024-07-19 15:55:08 -07:00
2024-07-26 11:04:28 -07:00
2024-07-27 12:26:09 -07:00
2024-07-27 15:28:53 -07:00
2024-07-19 11:57:55 -07:00
2024-07-27 12:46:16 -07:00
2024-07-24 20:59:29 +02:00
2024-07-24 20:59:29 +02:00
2024-07-27 12:46:16 -07:00
2024-07-25 06:53:47 -05:00
2024-07-19 15:55:08 -07:00
2024-07-16 15:54:03 -07:00
2024-07-20 12:41:03 -07:00
2024-07-28 09:33:28 -07:00
2024-07-25 10:42:22 -07:00
2024-07-25 10:42:22 -07:00
2024-07-10 15:38:14 +02:00
2024-07-25 10:42:22 -07:00
2024-07-21 17:15:46 -07:00
2024-07-28 13:41:14 -07:00
2024-07-25 10:42:22 -07:00
2024-07-27 10:14:34 -07:00
2024-07-25 10:42:22 -07:00
2024-07-25 10:42:22 -07:00
2024-07-27 12:54:06 -07:00
2024-07-28 13:41:14 -07:00
2024-07-25 10:42:22 -07:00
2024-07-25 10:42:22 -07:00
2024-07-25 10:42:22 -07:00
2024-07-25 10:42:22 -07:00
2024-07-19 15:55:08 -07:00
2024-07-25 10:42:22 -07:00
2024-07-25 10:42:22 -07:00
2024-07-27 10:53:06 -07:00
2024-07-25 06:53:47 -05:00
2024-07-19 09:59:58 -07:00
2024-07-25 10:42:22 -07:00
2024-07-19 15:55:08 -07:00
2024-07-27 12:39:55 -07:00
2024-07-25 06:53:47 -05:00
2024-07-25 08:05:05 -07:00
2024-07-17 17:51:30 -07:00
2024-07-25 12:58:36 -07:00
2024-07-19 21:25:23 -05:00
2024-07-25 10:42:22 -07:00
2024-07-28 13:41:14 -07:00
2024-07-26 10:26:33 -07:00
2024-07-25 10:42:22 -07:00
2024-07-27 12:46:16 -07:00
2024-07-25 10:42:22 -07:00
2024-07-25 10:42:22 -07:00
2024-07-25 10:42:22 -07:00
2024-07-28 11:51:51 -07:00
2024-07-28 13:41:14 -07:00
2024-07-25 10:42:22 -07:00
2024-07-25 10:42:22 -07:00
2024-07-26 08:06:15 -06:00
2024-07-25 10:42:22 -07:00
2024-07-19 09:59:58 -07:00
2024-07-15 18:55:14 +02:00
2024-07-25 12:58:36 -07:00
2024-07-25 10:42:22 -07:00
2024-07-25 10:42:22 -07:00
2024-07-25 10:42:22 -07:00
2024-07-27 10:14:34 -07:00
2024-07-24 13:11:28 -07:00
2024-07-25 06:53:47 -05:00
2024-07-25 10:42:22 -07:00
2024-07-23 09:38:27 -07:00
2024-07-25 10:42:22 -07:00
2024-07-16 19:28:34 -07:00
2024-07-25 06:53:47 -05:00
2024-07-15 18:20:24 -07:00
2024-07-27 12:27:52 -07:00
2024-07-23 13:41:59 -07:00
2024-07-25 10:42:22 -07:00
2024-07-25 10:42:22 -07:00
2024-07-10 17:15:33 +02:00
2024-07-26 10:47:53 -07:00
2024-07-11 15:42:03 +02:00
2024-07-25 10:42:22 -07:00
2024-07-25 10:42:22 -07:00
2024-07-25 10:42:22 -07:00
2024-07-25 10:42:22 -07:00
2024-07-25 10:42:22 -07:00
2024-08-07 23:45:12 +01:00
2024-07-25 10:42:22 -07:00
2024-07-25 10:42:22 -07:00
2024-07-25 10:42:22 -07:00
2024-07-24 12:40:23 +02:00
2024-07-25 10:42:22 -07:00
2024-07-27 12:46:16 -07:00
2024-07-19 10:56:58 -07:00
2024-07-27 12:46:16 -07:00
2024-07-25 10:42:22 -07:00
2024-07-25 10:42:22 -07:00
2024-07-19 11:57:55 -07:00
2024-07-21 17:15:46 -07:00
2024-07-20 12:41:03 -07:00
2024-07-25 10:42:22 -07:00
2024-07-25 10:18:35 -07:00
2024-07-25 10:42:22 -07:00
2024-07-25 10:42:22 -07:00