Home
last modified time | relevance | path

Searched hist:"448 ceaf5078c9aa0cd7d92c6d8d0b3d8e23e61c4" (Results 1 – 1 of 1) sorted by relevance

/rk3399_rockchip-uboot/drivers/spi/
H A Dspi-uclass.c448ceaf5078c9aa0cd7d92c6d8d0b3d8e23e61c4 Tue Oct 30 20:09:48 UTC 2018 Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> UPSTREAM: dm: spi: prevent setting a speed of 0 Hz

When the device tree is missing a correct spi slave description below
the bus (compatible "spi-flash" or spi-max-frequency are missing),
the 'set_speed' callback can be called with 'speed' == 0 Hz.
At least with cadence qspi, this leads to a division by zero.

Prevent this by initializing speed to 100 kHz in this case (same
fallback value as is done in 'dm_spi_claim_bus') and issue a warning
to console.

Change-Id: Ie9e619fd2fe894be6b3043a6a8843ac8c621d6c0
Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 12bfb2e05fc29bfbec7eb76ea8cc02e130268801)