spi: amd: Configure device speed
authorLucas Tanure <tanureal@opensource.cirrus.com>
Thu, 25 Aug 2022 14:31:32 +0000 (20:01 +0530)
committerMark Brown <broonie@kernel.org>
Thu, 25 Aug 2022 14:59:10 +0000 (15:59 +0100)
commit3fe26121dc3a9bf64e18fe0075cd9a92c9cd1b1a
tree8fa970dcaf67b5881286a0f05db6dd9721ed32ba
parentd294e99cdc823f368530b8169e33a599fa2a1afe
spi: amd: Configure device speed

Number of clock frequencies are supported by AMD controller
which are mentioned in the amd_spi_freq structure table.

Create mechanism to configure device clock frequency such
that it is strictly less than the requested frequency.

Give priority to the device transfer speed and in case
it is not set then use the max clock speed supported
by the device.

Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
Co-developed-by: Shreeya Patel <shreeya.patel@collabora.com>
Signed-off-by: Shreeya Patel <shreeya.patel@collabora.com>
Link: https://lore.kernel.org/r/20220825143132.253224-1-shreeya.patel@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-amd.c