All of lore.kernel.org
 help / color / mirror / Atom feed
From: bilhuang <bilhuang@nvidia.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Stephen Warren <swarren@wwwdotorg.org>,
	Thierry Reding <thierry.reding@gmail.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"cpufreq@vger.kernel.org" <cpufreq@vger.kernel.org>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>
Subject: Re: [PATCH v5 1/1] cpufreq: tegra: Re-model Tegra20 cpufreq driver
Date: Fri, 20 Dec 2013 18:25:28 +0800	[thread overview]
Message-ID: <52B41B18.30302@nvidia.com> (raw)
In-Reply-To: <CAKohpomCPJYd+d_NnM9gxwQ7bH6C6=iLxbiWZbfNcjZ8Bi+2wA@mail.gmail.com>

On 12/20/2013 05:31 PM, Viresh Kumar wrote:
> On 19 December 2013 16:48, Bill Huang <bilhuang@nvidia.com> wrote:
>> diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm
>> index ce52ed9..22dfc43 100644
>> --- a/drivers/cpufreq/Kconfig.arm
>> +++ b/drivers/cpufreq/Kconfig.arm
>> @@ -225,6 +225,18 @@ config ARM_TEGRA_CPUFREQ
>>          help
>>            This adds the CPUFreq driver support for TEGRA SOCs.
>>
>> +config ARM_TEGRA20_CPUFREQ
>> +       bool "NVIDIA TEGRA20"
>> +       depends on ARM_TEGRA_CPUFREQ && ARCH_TEGRA_2x_SOC
>
> Probably just in case you agree to my next comment:
>
>              depends on ARCH_TEGRA_2x_SOC
>
>
>> +       default y
>> +       help
>> +         This enables Tegra20 cpufreq functionality, it adds
>> +         Tegra20 CPU frequency ladder and the call back functions
>> +         to set CPU rate. All the non-SoC dependant codes are
>> +         controlled by the config ARM_TEGRA_CPUFREQ.
>> +
>> +         If in doubt, say N.
>
>
>> diff --git a/drivers/cpufreq/tegra-cpufreq.c b/drivers/cpufreq/tegra-cpufreq.c
>>   /*
>> + * Copyright (c) 2013, NVIDIA Corporation. All rights reserved.
>>    *
>> + * This program is free software; you can redistribute it and/or modify it
>> + * under the terms and conditions of the GNU General Public License,
>> + * version 2, as published by the Free Software Foundation.
>>    *
>> + * This program is distributed in the hope it will be useful, but WITHOUT
>> + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
>> + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
>> + * more details.
>>    */
>>
>>   #include <linux/kernel.h>
>> +#include <linux/platform_device.h>
>> +#include <linux/of.h>
>> +#include <linux/tegra-cpufreq.h>
>> +
>> +int __init tegra_cpufreq_init(void)
>> +{
>> +       struct device_node *root;
>> +
>> +       root = of_find_node_by_path("/");
>> +       if (root) {
>> +               struct platform_device_info devinfo;
>> +               const char *compat;
>> +               int i;
>> +
>> +               memset(&devinfo, 0, sizeof(devinfo));
>> +               i = of_property_count_strings(root, "compatible");
>> +               if (i > 0) {
>> +                       of_property_read_string_index(
>> +                               root, "compatible", i - 1, &compat);
>> +                       devinfo.name = kasprintf(
>> +                                       GFP_KERNEL, "%s-cpufreq", compat);
>> +                       platform_device_register_full(&devinfo);
>> +               }
>>          }
>> +EXPORT_SYMBOL(tegra_cpufreq_init);
>
> Probably above is all that is present in this file. This is just about adding
> the right cpufreq device so that right driver can get probed.
>
> I don't think this code is present at the right place. We don't need a file
> in cpufreq/ which is there just to add a device :) ..
>
> Probably move this piece of code to arch/mach-tegra where you are calling
> init.
>
> And so remove ARM_TEGRA_CPUFREQ config option completely.
>
Don't you think it worth creating a file here so this can be shared to 
arm64?

  reply	other threads:[~2013-12-20 10:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-19 11:18 [PATCH v5 1/1] cpufreq: tegra: Re-model Tegra20 cpufreq driver Bill Huang
2013-12-19 11:18 ` Bill Huang
2013-12-19 19:33 ` Stephen Warren
2013-12-20  9:31 ` Viresh Kumar
2013-12-20 10:25   ` bilhuang [this message]
2013-12-20 10:33     ` Viresh Kumar
2013-12-20 10:42       ` bilhuang
2013-12-20 16:29         ` Stephen Warren
2013-12-23  5:06           ` Viresh Kumar
2014-01-02 11:08             ` bilhuang
2014-01-03  5:47               ` Viresh Kumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52B41B18.30302@nvidia.com \
    --to=bilhuang@nvidia.com \
    --cc=cpufreq@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=swarren@wwwdotorg.org \
    --cc=thierry.reding@gmail.com \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.