Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1363885

Re: [PATCH v2] cpufreq: rockchip: add driver

From Feng Xiao <xf@rock-chips.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2] cpufreq: rockchip: add driver
Date 2016-03-24 04:10 +0100
Message-ID <rg3OO-4FE-15@gated-at.bofh.it> (permalink)
References <rft8C-3Pc-13@gated-at.bofh.it> <rfGIx-54a-1@gated-at.bofh.it> <rfIU1-6Hf-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


hi all,
      I found that it could match the cpufreq-dt driver succesfully only 
with the following changes.
--- a/arch/arm64/boot/dts/rockchip/rk3366.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3366.dtsi
@@ -139,6 +139,10 @@
                 };
         };

+       cpufreq-dt {   //the node name must be cpufreq-dt
+               compatible = "rockchip,cpufreq";  //  the compatible 
name is insignificant
+       };
+

This was supported by the commit 07e461cd7e73a84f0e3757932b93cc80976fd749

commit 07e461cd7e73a84f0e3757932b93cc80976fd749
Author: Grant Likely <grant.likely@linaro.org>
Date:   Wed May 21 15:40:31 2014 +0900

     of: Ensure unique names without sacrificing determinism

     The way the driver core is implemented, every device using the same bus
     type is required to have a unique name because a symlink to each device
     is created in the appropriate /sys/bus/*/devices directory, and two
     identical names causes a collision.

     The current code handles the requirement by using an globally
     incremented counter that is appended to the device name. It works, but
     it means any change to device registration will change the assigned
     numbers. Instead, if we build up the name by using information from the
     parent nodes, then it can be guaranteed to be unique without adding a
     random number to the end of it.

     Signed-off-by: Grant Likely <grant.likely@linaro.org>
     Cc: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
     Cc: Rob Herring <robh@kernel.org>

If so, do I need to continue to add the new cpufreq driver ?

在 2016/3/23 12:40, Viresh Kumar 写道:
> On 23-03-16, 10:18, Feng Xiao wrote:
>> diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm
>> index 14b1f93..1786315 100644
>> --- a/drivers/cpufreq/Kconfig.arm
>> +++ b/drivers/cpufreq/Kconfig.arm
>> @@ -97,6 +97,16 @@ config ARM_OMAP2PLUS_CPUFREQ
>>   	depends on ARCH_OMAP2PLUS
>>   	default ARCH_OMAP2PLUS
>>   
>> +config ARM_ROCKCHIP_CPUFREQ
>> +	tristate "Rockchip CPUfreq driver"
> Since you are allowing it to be built as a module ...
>
>> +	depends on ARCH_ROCKCHIP && CPUFREQ_DT
>> +	select PM_OPP
>> +	help
>> +	  This adds the CPUFreq driver support for Rockchip SoCs.
>> +	  The driver will directly use cpufreq-dt driver as backend.
>> +
>> +	  If in doubt, say N.
>> +++ b/drivers/cpufreq/rockchip-cpufreq.c
>> +static int __init rockchip_cpufreq_driver_init(void)
>> +{
>> +	struct platform_device *pdev;
>> +	int i;
>> +
>> +	for (i = 0; i < ARRAY_SIZE(rockchip_compat); i++) {
>> +		if (of_machine_is_compatible(rockchip_compat[i])) {
>> +			pdev = platform_device_register_simple("cpufreq-dt",
>> +							       -1, NULL, 0);
>> +			return PTR_ERR_OR_ZERO(pdev);
>> +		}
>> +	}
>> +
>> +	return -ENODEV;
>> +}
>> +module_init(rockchip_cpufreq_driver_init);
> You need a module exit as well to remove the device. Otherwise following
> sequence will give you errors:
>
> insmod rockchip-cpufreq.ko
> rmmod rockchip-cpufreq.ko
> insmod rockchip-cpufreq.ko //Errors on this..
>
> So, either don't allow it to be built as a module or fix the module-exit path.
>

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] cpufreq: rockchip: add driver Feng Xiao <xf@rock-chips.com> - 2016-03-18 13:20 +0100
  Re: [PATCH] cpufreq: rockchip: add driver Heiko Stübner <heiko@sntech.de> - 2016-03-18 14:00 +0100
    Re: [PATCH] cpufreq: rockchip: add driver Heiko Stübner <heiko@sntech.de> - 2016-03-21 11:00 +0100
      Re: [PATCH] cpufreq: rockchip: add driver Viresh Kumar <viresh.kumar@linaro.org> - 2016-03-21 11:00 +0100
        Re: [PATCH] cpufreq: rockchip: add driver Feng Xiao <xf@rock-chips.com> - 2016-03-21 14:30 +0100
          Re: [PATCH] cpufreq: rockchip: add driver Heiko Stübner <heiko@sntech.de> - 2016-03-21 16:20 +0100
            Re: [PATCH] cpufreq: rockchip: add driver Heiko Stübner <heiko@sntech.de> - 2016-03-21 17:00 +0100
              Re: [PATCH] cpufreq: rockchip: add driver Feng Xiao <xf@rock-chips.com> - 2016-03-22 02:30 +0100
          Re: [PATCH] cpufreq: rockchip: add driver Viresh Kumar <viresh.kumar@linaro.org> - 2016-03-21 16:20 +0100
    Re: [PATCH] cpufreq: rockchip: add driver Viresh Kumar <viresh.kumar@linaro.org> - 2016-03-21 11:00 +0100
  [PATCH v1] cpufreq: rockchip: add driver Feng Xiao <xf@rock-chips.com> - 2016-03-22 13:00 +0100
    Re: [PATCH v1] cpufreq: rockchip: add driver Heiko Stübner <heiko@sntech.de> - 2016-03-22 17:10 +0100
    [PATCH v2] cpufreq: rockchip: add driver Feng Xiao <xf@rock-chips.com> - 2016-03-23 03:30 +0100
      Re: [PATCH v2] cpufreq: rockchip: add driver Viresh Kumar <viresh.kumar@linaro.org> - 2016-03-23 05:50 +0100
        Re: [PATCH v2] cpufreq: rockchip: add driver Feng Xiao <xf@rock-chips.com> - 2016-03-24 04:10 +0100
          Re: [PATCH v2] cpufreq: rockchip: add driver Viresh Kumar <viresh.kumar@linaro.org> - 2016-03-24 07:50 +0100
            Re: [PATCH v2] cpufreq: rockchip: add driver Finley Xiao <finley.xiao@rock-chips.com> - 2016-03-24 16:10 +0100
              Re: [PATCH v2] cpufreq: rockchip: add driver Viresh Kumar <viresh.kumar@linaro.org> - 2016-03-25 05:50 +0100

csiph-web