[2/2] cpufreq: imx-cpufreq-dt: Add i.MX8MP support
diff mbox series

Message ID 1577343167-16376-2-git-send-email-Anson.Huang@nxp.com
State New, archived
Delegated to: viresh kumar
Headers show
Series
  • [1/2] cpufreq: Use imx-cpufreq-dt for i.MX8MP's speed grading
Related show

Commit Message

Anson Huang Dec. 26, 2019, 6:52 a.m. UTC
Add i.MX8MP cpufreq DT support for speed grading and market
segment check.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
 drivers/cpufreq/imx-cpufreq-dt.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Abel Vesa Dec. 26, 2019, 2:04 p.m. UTC | #1
On 19-12-26 14:52:47, Anson Huang wrote:
> Add i.MX8MP cpufreq DT support for speed grading and market
> segment check.
> 
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> ---
>  drivers/cpufreq/imx-cpufreq-dt.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/cpufreq/imx-cpufreq-dt.c b/drivers/cpufreq/imx-cpufreq-dt.c
> index 85a6efd..912e93d 100644
> --- a/drivers/cpufreq/imx-cpufreq-dt.c
> +++ b/drivers/cpufreq/imx-cpufreq-dt.c
> @@ -35,7 +35,7 @@ static int imx_cpufreq_dt_probe(struct platform_device *pdev)
>  	if (ret)
>  		return ret;
>  
> -	if (of_machine_is_compatible("fsl,imx8mn"))
> +	if (of_machine_is_compatible("fsl,imx8mn") || of_machine_is_compatible("fsl,imx8mp"))

Is there a way we could do this more generic so we won't have to add
another of_machine_is_compatible if a new imx8m comes around ?

If not, please drop the second one on a new line to follow the 80 chars rule.

Then you can add:
Reviewed-by: Abel Vesa <abel.vesa@nxp.com>

>  		speed_grade = (cell_value & IMX8MN_OCOTP_CFG3_SPEED_GRADE_MASK)
>  			      >> OCOTP_CFG3_SPEED_GRADE_SHIFT;
>  	else
> @@ -54,7 +54,8 @@ static int imx_cpufreq_dt_probe(struct platform_device *pdev)
>  		if (of_machine_is_compatible("fsl,imx8mm") ||
>  		    of_machine_is_compatible("fsl,imx8mq"))
>  			speed_grade = 1;
> -		if (of_machine_is_compatible("fsl,imx8mn"))
> +		if (of_machine_is_compatible("fsl,imx8mn") ||
> +			of_machine_is_compatible("fsl,imx8mp"))
>  			speed_grade = 0xb;
>  	}
>  
> -- 
> 2.7.4
>

Patch
diff mbox series

diff --git a/drivers/cpufreq/imx-cpufreq-dt.c b/drivers/cpufreq/imx-cpufreq-dt.c
index 85a6efd..912e93d 100644
--- a/drivers/cpufreq/imx-cpufreq-dt.c
+++ b/drivers/cpufreq/imx-cpufreq-dt.c
@@ -35,7 +35,7 @@  static int imx_cpufreq_dt_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
-	if (of_machine_is_compatible("fsl,imx8mn"))
+	if (of_machine_is_compatible("fsl,imx8mn") || of_machine_is_compatible("fsl,imx8mp"))
 		speed_grade = (cell_value & IMX8MN_OCOTP_CFG3_SPEED_GRADE_MASK)
 			      >> OCOTP_CFG3_SPEED_GRADE_SHIFT;
 	else
@@ -54,7 +54,8 @@  static int imx_cpufreq_dt_probe(struct platform_device *pdev)
 		if (of_machine_is_compatible("fsl,imx8mm") ||
 		    of_machine_is_compatible("fsl,imx8mq"))
 			speed_grade = 1;
-		if (of_machine_is_compatible("fsl,imx8mn"))
+		if (of_machine_is_compatible("fsl,imx8mn") ||
+			of_machine_is_compatible("fsl,imx8mp"))
 			speed_grade = 0xb;
 	}