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


Groups > linux.kernel > #1596958

Re: [PATCH] cpufreq: qoriq: enhance bus frequency calculation

From Viresh Kumar <viresh.kumar@linaro.org>
Newsgroups linux.kernel
Subject Re: [PATCH] cpufreq: qoriq: enhance bus frequency calculation
Date 2017-03-10 11:10 +0100
Message-ID <tjpEJ-2rf-9@gated-at.bofh.it> (permalink)
References <tj2RQ-3lW-29@gated-at.bofh.it> <tj2RQ-3lW-27@gated-at.bofh.it> <tjhQS-4Yq-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

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


Thread

Re: [PATCH] cpufreq: qoriq: enhance bus frequency calculation Viresh Kumar <viresh.kumar@linaro.org> - 2017-03-09 10:50 +0100
  RE: [PATCH] cpufreq: qoriq: enhance bus frequency calculation Andy Tang <andy.tang@nxp.com> - 2017-03-10 02:50 +0100
    Re: [PATCH] cpufreq: qoriq: enhance bus frequency calculation Viresh Kumar <viresh.kumar@linaro.org> - 2017-03-10 11:10 +0100
      RE: [PATCH] cpufreq: qoriq: enhance bus frequency calculation Andy Tang <andy.tang@nxp.com> - 2017-03-10 11:20 +0100

csiph-web