From 1944de0e9d9c23f071ec1a75177ea7adbb87ba26 Mon Sep 17 00:00:00 2001
From: Hal Feng <hal.feng@starfivetech.com>
Date: Thu, 6 Jun 2024 11:01:58 +0800
Subject: [PATCH 24/55] spi: pl022: Prompt warning when frequency does not
 support

Prompt warning when the frequency does not support.

Signed-off-by: Hal Feng <hal.feng@starfivetech.com>
---
 drivers/spi/spi-pl022.c | 4 ++++
 1 file changed, 4 insertions(+)

--- a/drivers/spi/spi-pl022.c
+++ b/drivers/spi/spi-pl022.c
@@ -1553,6 +1553,10 @@ static int calculate_effective_freq(stru
 	WARN(!best_freq, "pl022: Matching cpsdvsr and scr not found for %d Hz rate \n",
 			freq);
 
+	if (best_freq != freq)
+		dev_warn(&pl022->adev->dev,
+			 "Requested frequency: %d Hz is unsupported,select by default %d Hz\n",
+			 freq, best_freq);
 	clk_freq->cpsdvsr = (u8) (best_cpsdvsr & 0xFF);
 	clk_freq->scr = (u8) (best_scr & 0xFF);
 	dev_dbg(&pl022->adev->dev,
