diff mbox series

[v2,05/11] media: ccs-pll: Print a debug message on too high VT PLL OP clock

Message ID 20250417065354.311617-6-sakari.ailus@linux.intel.com
State New
Headers show
Series CCS PLL fixes and improvements | expand

Commit Message

Sakari Ailus April 17, 2025, 6:53 a.m. UTC
In general the CCS PLL calculator prints debugging information on the
process to ease debugging. This case was not annotated, do that now.

Remove an extra multiplication while at it.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 drivers/media/i2c/ccs-pll.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

Comments

Laurent Pinchart April 21, 2025, 8:02 p.m. UTC | #1
Hi Sakari,

Thank you for the patch.

On Thu, Apr 17, 2025 at 09:53:48AM +0300, Sakari Ailus wrote:
> In general the CCS PLL calculator prints debugging information on the
> process to ease debugging. This case was not annotated, do that now.
> 
> Remove an extra multiplication while at it.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/media/i2c/ccs-pll.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/media/i2c/ccs-pll.c b/drivers/media/i2c/ccs-pll.c
> index d985686b0a36..66d046d576f7 100644
> --- a/drivers/media/i2c/ccs-pll.c
> +++ b/drivers/media/i2c/ccs-pll.c
> @@ -318,12 +318,13 @@ __ccs_pll_calculate_vt_tree(struct device *dev,
>  		return -EINVAL;
>  	}
>  
> -	if (pll_fr->pll_multiplier * pll_fr->pll_ip_clk_freq_hz >
> -	    lim_fr->max_pll_op_clk_freq_hz)
> -		return -EINVAL;
> -
>  	pll_fr->pll_op_clk_freq_hz =
>  		pll_fr->pll_ip_clk_freq_hz * pll_fr->pll_multiplier;
> +	if (pll_fr->pll_op_clk_freq_hz > lim_fr->max_pll_op_clk_freq_hz) {
> +		dev_dbg(dev, "too high OP clock %u\n",
> +			pll_fr->pll_op_clk_freq_hz);
> +		return -EINVAL;
> +	}
>  
>  	vt_div = div * more_mul;
>
diff mbox series

Patch

diff --git a/drivers/media/i2c/ccs-pll.c b/drivers/media/i2c/ccs-pll.c
index d985686b0a36..66d046d576f7 100644
--- a/drivers/media/i2c/ccs-pll.c
+++ b/drivers/media/i2c/ccs-pll.c
@@ -318,12 +318,13 @@  __ccs_pll_calculate_vt_tree(struct device *dev,
 		return -EINVAL;
 	}
 
-	if (pll_fr->pll_multiplier * pll_fr->pll_ip_clk_freq_hz >
-	    lim_fr->max_pll_op_clk_freq_hz)
-		return -EINVAL;
-
 	pll_fr->pll_op_clk_freq_hz =
 		pll_fr->pll_ip_clk_freq_hz * pll_fr->pll_multiplier;
+	if (pll_fr->pll_op_clk_freq_hz > lim_fr->max_pll_op_clk_freq_hz) {
+		dev_dbg(dev, "too high OP clock %u\n",
+			pll_fr->pll_op_clk_freq_hz);
+		return -EINVAL;
+	}
 
 	vt_div = div * more_mul;