Re: [PATCH v3 2/3] cpufreq-dt: add suspend frequency support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 03-09-15, 20:11, Bartlomiej Zolnierkiewicz wrote:
> Add suspend frequency support and if needed set it to
> the frequency obtained from the suspend opp (can be defined
> using opp-v2 bindings and is optional).  Also implement
> custom suspend method (needed to not error out on platforms
> which don't require suspend frequency).
> 
> Cc: Viresh Kumar <viresh.kumar@xxxxxxxxxx>
> Cc: Thomas Abraham <thomas.ab@xxxxxxxxxxx>
> Cc: Javier Martinez Canillas <javier@xxxxxxxxxxxxxxx>
> Cc: Krzysztof Kozlowski <k.kozlowski@xxxxxxxxxxx>
> Cc: Marek Szyprowski <m.szyprowski@xxxxxxxxxxx>
> Cc: Tobias Jakobi <tjakobi@xxxxxxxxxxxxxxxxxxxxx>
> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@xxxxxxxxxxx>
> ---
>  drivers/cpufreq/cpufreq-dt.c | 32 ++++++++++++++++++++++++++++++++
>  1 file changed, 32 insertions(+)
> 
> diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c
> +#ifdef CONFIG_PM
> +static int cpufreq_dt_suspend(struct cpufreq_policy *policy)
> +{
> +	int ret;
> +
> +	if (!policy->suspend_freq) {
> +		pr_debug("%s: suspend_freq not defined\n", __func__);
> +		return 0;
> +	}
> +
> +	pr_debug("%s: Setting suspend-freq: %u\n", __func__,
> +			policy->suspend_freq);
> +
> +	ret = __cpufreq_driver_target(policy, policy->suspend_freq,
> +			CPUFREQ_RELATION_H);
> +	if (ret)
> +		pr_err("%s: unable to set suspend-freq: %u. err: %d\n",
> +				__func__, policy->suspend_freq, ret);
> +
> +	return ret;
> +}
> +#else
> +#define cpufreq_dt_suspend NULL
> +#endif

No, there is no point replicating the exactly same routine again.
Rather modify cpufreq_generic_suspend() to not print error and instead
do pr_debug(), on !policy->suspend_freq.

-- 
viresh
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux SoC Development]     [Linux Rockchip Development]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Linux SCSI]     [Yosemite News]

  Powered by Linux