Commit be9070b
spi: axi-spi-engine: fix sleep ticks calculation
This fixes the sleep ticks calculation when generating sleep
instructions in the AXI SPI Engine driver. The previous calculation
was ignoring delays less than one microsecond and missed a microsecond
to second conversion factor.
This fixes the first issue by not rounding to microseconds. Now that
xfer->effective_speed_hz is guaranteed to be set correctly, we can use
that to simplify the calculation. This new calculation replaces the old
incorrect math.
Also add unit suffix to the delay variable for clarity while we are
touching this.
Signed-off-by: David Lechner <dlechner@baylibre.com>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Acked-by: Nuno Sa <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20231204-axi-spi-engine-series-2-v1-4-063672323fce@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>1 parent 1fc8dc5 commit be9070b
1 file changed
Lines changed: 10 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
172 | 171 | | |
173 | 172 | | |
174 | | - | |
175 | 173 | | |
176 | | - | |
| 174 | + | |
177 | 175 | | |
178 | | - | |
179 | | - | |
| 176 | + | |
| 177 | + | |
180 | 178 | | |
181 | | - | |
182 | 179 | | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
| 180 | + | |
| 181 | + | |
187 | 182 | | |
188 | 183 | | |
189 | 184 | | |
| |||
224 | 219 | | |
225 | 220 | | |
226 | 221 | | |
227 | | - | |
228 | | - | |
| 222 | + | |
| 223 | + | |
229 | 224 | | |
230 | 225 | | |
231 | 226 | | |
| |||
261 | 256 | | |
262 | 257 | | |
263 | 258 | | |
264 | | - | |
| 259 | + | |
265 | 260 | | |
266 | 261 | | |
267 | 262 | | |
| |||
515 | 510 | | |
516 | 511 | | |
517 | 512 | | |
518 | | - | |
| 513 | + | |
519 | 514 | | |
520 | 515 | | |
521 | 516 | | |
| |||
533 | 528 | | |
534 | 529 | | |
535 | 530 | | |
536 | | - | |
| 531 | + | |
537 | 532 | | |
538 | 533 | | |
539 | 534 | | |
| |||
0 commit comments