drivers: spi: siwx91x: Add helper to round GSPI freq to valid range

Add gspi_siwx91x_pick_lower_freq() to select the nearest lower
supported GSPI clock frequency based on the requested value.
The GSPI clock can operate only at discrete frequencies such as
80 MHz, 40 MHz, 26.6 MHz, 20 MHz, and so on (80 MHz divided by
integer factors). If the requested frequency does not match one
of these valid steps, it is rounded down to the nearest lower
supported frequency.

The driver now logs both the requested and the actual programmed
frequency along with the divider value, helping users verify the
effective SPI clock configuration.

Signed-off-by: Sai Santhosh Malae <Santhosh.Malae@silabs.com>
1 file changed