Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: viresh.kumar@linaro.org (Viresh Kumar)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] cpufreq: qoriq: enhance bus frequency calculation
Date: Fri, 10 Mar 2017 15:35:11 +0530	[thread overview]
Message-ID: <20170310100511.GD3341@vireshk-i7> (raw)
In-Reply-To: <DB6PR0402MB2837F020F46C802207B81D2BF3200@DB6PR0402MB2837.eurprd04.prod.outlook.com>

On 10-03-17, 01:44, Andy Tang wrote:
> > Will this always work? If yes, then what about dropping the code parsing DT
> > completely ? That is, just rely on clk_get_rate() in all cases.
> > 
> We put all the clock tree configuration in driver, not in dts.
> cg-pll0-div1 is hardcoded in driver since we don't depend on dts.
> We kind of don't have other choices but use the hardcode clock name
> here too.

Looks like you misread my comment. Let me try again. Will it be fine
to write get_bus_freq() this way?

static u32 get_bus_freq(void)
{
	struct clk *pltclk;

	/* get platform freq by its clock name */
	pltclk = clk_get(NULL, "cg-pll0-div1");
	if (IS_ERR(pltclk)) {
		pr_err("%s: can't get bus frequency %ld\n",
		       __func__, PTR_ERR(pltclk));
		return PTR_ERR(pltclk);
	}

	return clk_get_rate(pltclk);
}

-- 
viresh

  reply	other threads:[~2017-03-10 10:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-09  8:15 [PATCH] cpufreq: qoriq: enhance bus frequency calculation YuanTian Tang
2017-03-09  9:39 ` Viresh Kumar
2017-03-10  1:44   ` Andy Tang
2017-03-10 10:05     ` Viresh Kumar [this message]
2017-03-10 10:12       ` Andy Tang

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=20170310100511.GD3341@vireshk-i7 \
    --to=viresh.kumar@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox