linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: viresh.kumar@st.com (Viresh Kumar)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V2 1/6] SPEAr: clk: Add VCO-PLL Synthesizer clock
Date: Tue, 24 Apr 2012 09:10:59 +0530	[thread overview]
Message-ID: <4F9620CB.9030801@st.com> (raw)
In-Reply-To: <CAJOA=zOmV12j+hp90dzK=XtNh0QKw2r-jeE2A4bagDmesGpSKw@mail.gmail.com>

On 4/24/2012 1:01 AM, Turquette, Mike wrote:
> On Thu, Apr 19, 2012 at 9:28 AM, Viresh Kumar <viresh.linux@gmail.com> wrote:
>> diff --git a/drivers/clk/spear/clk.h b/drivers/clk/spear/clk.h
>> new file mode 100644
>> index 0000000..a66024e
>> --- /dev/null
>> +++ b/drivers/clk/spear/clk.h
>> @@ -0,0 +1,76 @@
>> +/*
>> + * Clock framework definitions for SPEAr platform
>> + *
>> + * Copyright (C) 2012 ST Microelectronics
>> + * Viresh Kumar <viresh.kumar@st.com>
>> + *
>> + * This file is licensed under the terms of the GNU General Public
>> + * License version 2. This program is licensed "as is" without any
>> + * warranty of any kind, whether express or implied.
>> + */
>> +
>> +#ifndef __PLAT_CLOCK_H
>> +#define __PLAT_CLOCK_H
> 
> Any reason to use __PLAT_CLOCK_H from drivers/clk/ now?  Is it
> copy/paste from your old platform code?

Ya. Will fix it to __SPEAR_CLK_H

>> +static inline long clk_round_rate_index(struct clk_hw *hw, unsigned long drate,
>> +               clk_calc_rate calc_rate, u8 rtbl_cnt, int *index)
>> +{
>> +       unsigned long prev_rate, rate = 0;
>> +       unsigned long parent_rate = __clk_get_rate(__clk_get_parent(hw->clk));
>> +
>> +       for (*index = 0; *index < rtbl_cnt; (*index)++) {
>> +               prev_rate = rate;
>> +               rate = calc_rate(hw, parent_rate, *index);
>> +               if (drate < rate) {
>> +                       /* previous clock was best */
>> +                       if (*index) {
>> +                               rate = prev_rate;
>> +                               (*index)--;
>> +                       }
>> +                       break;
>> +               }
>> +       }
>> +
>> +       return rate;
>> +}
> 
> Any reason for this code to exist in a header?  I prefer code in C
> files.  Also it is a bit large for an inline function.

There is no C file common to entire SPEAr clock framework, so kept it in header.
Because this is called only from 2-3 places, inline would also be fine.

But if you insist, i can create clk.c in spear, where i can keep it.

-- 
viresh

  reply	other threads:[~2012-04-24  3:40 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-19 16:28 [PATCH V2 0/6] SPEAr: Move to common clock framework Viresh Kumar
2012-04-19 16:28 ` [PATCH V2 1/6] SPEAr: clk: Add VCO-PLL Synthesizer clock Viresh Kumar
2012-04-23 19:15   ` Turquette, Mike
2012-04-23 19:31   ` Turquette, Mike
2012-04-24  3:40     ` Viresh Kumar [this message]
2012-04-19 16:28 ` [PATCH V2 2/6] SPEAr: clk: Add Auxiliary " Viresh Kumar
2012-04-23 12:33   ` viresh kumar
2012-04-19 16:28 ` [PATCH V2 3/6] SPEAr: clk: Add Fractional " Viresh Kumar
2012-04-19 16:28 ` [PATCH V2 4/6] SPEAr: clk: Add General Purpose Timer " Viresh Kumar
2012-04-19 16:28 ` [PATCH V2 5/6] SPEAr: Call clk_prepare() before calling clk_enable Viresh Kumar
     [not found] ` <ddade82f0666c3186b8a694aa2b79acd3f7e5d50.1334852395.git.viresh.kumar@st.com>
2012-04-19 19:59   ` [PATCH V2 6/6] SPEAr: Switch to common clock framework Arnd Bergmann
2012-04-20  3:28     ` Viresh Kumar
2012-04-20 16:02       ` Arnd Bergmann
2012-04-20 16:57         ` viresh kumar
2012-04-23 20:56   ` Turquette, Mike
     [not found]   ` <CAJOA=zOvyJ9pqEqnhmU1CqHy1uPUOyC=c7VtKjkjK91cbHkGHw@mail.gmail.com>
2012-04-24  4:09     ` 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=4F9620CB.9030801@st.com \
    --to=viresh.kumar@st.com \
    --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;
as well as URLs for NNTP newsgroup(s).