diff mbox

[5/5] ARM: imx53: add cpufreq support

Message ID 1411143381-10516-6-git-send-email-l.stach@pengutronix.de (mailing list archive)
State New, archived
Headers show

Commit Message

Lucas Stach Sept. 19, 2014, 4:16 p.m. UTC
Instanciate the platform device for the generic cpufreq-cpu0
driver and add all required properties to the DT.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
 arch/arm/boot/dts/imx53.dtsi   | 13 ++++++++++++-
 arch/arm/mach-imx/mach-imx53.c |  4 ++++
 2 files changed, 16 insertions(+), 1 deletion(-)

Comments

Shawn Guo Sept. 26, 2014, 3:02 a.m. UTC | #1
On Fri, Sep 19, 2014 at 06:16:21PM +0200, Lucas Stach wrote:
> Instanciate the platform device for the generic cpufreq-cpu0
> driver and add all required properties to the DT.
> 
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> ---
>  arch/arm/boot/dts/imx53.dtsi   | 13 ++++++++++++-
>  arch/arm/mach-imx/mach-imx53.c |  4 ++++

Please split dts and kernel changes.

>  2 files changed, 16 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/boot/dts/imx53.dtsi b/arch/arm/boot/dts/imx53.dtsi
> index 64fa27b36be0..bd5226a7ea20 100644
> --- a/arch/arm/boot/dts/imx53.dtsi
> +++ b/arch/arm/boot/dts/imx53.dtsi
> @@ -46,10 +46,21 @@
>  	cpus {
>  		#address-cells = <1>;
>  		#size-cells = <0>;
> -		cpu@0 {
> +		cpu0: cpu@0 {
>  			device_type = "cpu";
>  			compatible = "arm,cortex-a8";
>  			reg = <0x0>;
> +			clocks = <&clks IMX5_CLK_ARM>;
> +			clock-latency = <61036>;
> +			voltage-tolerance = <5>;
> +			operating-points = <
> +				/* kHz */
> +				 166666  850000
> +				 400000  900000
> +				 800000 1050000
> +				1000000 1200000
> +				1200000 1300000
> +			>;
>  		};
>  	};
>  
> diff --git a/arch/arm/mach-imx/mach-imx53.c b/arch/arm/mach-imx/mach-imx53.c
> index 03dd6ea13acc..4eb6849c52d2 100644
> --- a/arch/arm/mach-imx/mach-imx53.c
> +++ b/arch/arm/mach-imx/mach-imx53.c
> @@ -38,9 +38,13 @@ static void __init imx53_dt_init(void)
>  	imx_aips_allow_unprivileged_access("fsl,imx53-aipstz");
>  }
>  
> +static struct platform_device imx53_cpufreq_pdev = { .name = "cpufreq-cpu0", };
> +
>  static void __init imx53_init_late(void)
>  {
>  	imx53_pm_init();
> +
> +	platform_device_register(&imx53_cpufreq_pdev);

It should be a bit easier to call the following.

	platform_device_register_simple("cpufreq-cpu0", -1, NULL, 0);

Shawn

>  }
>  
>  static const char * const imx53_dt_board_compat[] __initconst = {
> -- 
> 2.1.0
>
diff mbox

Patch

diff --git a/arch/arm/boot/dts/imx53.dtsi b/arch/arm/boot/dts/imx53.dtsi
index 64fa27b36be0..bd5226a7ea20 100644
--- a/arch/arm/boot/dts/imx53.dtsi
+++ b/arch/arm/boot/dts/imx53.dtsi
@@ -46,10 +46,21 @@ 
 	cpus {
 		#address-cells = <1>;
 		#size-cells = <0>;
-		cpu@0 {
+		cpu0: cpu@0 {
 			device_type = "cpu";
 			compatible = "arm,cortex-a8";
 			reg = <0x0>;
+			clocks = <&clks IMX5_CLK_ARM>;
+			clock-latency = <61036>;
+			voltage-tolerance = <5>;
+			operating-points = <
+				/* kHz */
+				 166666  850000
+				 400000  900000
+				 800000 1050000
+				1000000 1200000
+				1200000 1300000
+			>;
 		};
 	};
 
diff --git a/arch/arm/mach-imx/mach-imx53.c b/arch/arm/mach-imx/mach-imx53.c
index 03dd6ea13acc..4eb6849c52d2 100644
--- a/arch/arm/mach-imx/mach-imx53.c
+++ b/arch/arm/mach-imx/mach-imx53.c
@@ -38,9 +38,13 @@  static void __init imx53_dt_init(void)
 	imx_aips_allow_unprivileged_access("fsl,imx53-aipstz");
 }
 
+static struct platform_device imx53_cpufreq_pdev = { .name = "cpufreq-cpu0", };
+
 static void __init imx53_init_late(void)
 {
 	imx53_pm_init();
+
+	platform_device_register(&imx53_cpufreq_pdev);
 }
 
 static const char * const imx53_dt_board_compat[] __initconst = {