linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: pdeschrijver@nvidia.com (Peter De Schrijver)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v6 03/10] arm/tegra: prepare clock code for multiple tegra variants
Date: Fri, 9 Dec 2011 11:13:20 +0200	[thread overview]
Message-ID: <20111209091319.GI27578@tbergstrom-lnx.Nvidia.com> (raw)
In-Reply-To: <CAMbhsRT97Oq-=8f9++f6Jgg=YVaimKSz68xcDDNbDbvL+V5fJg@mail.gmail.com>

On Thu, Dec 08, 2011 at 07:25:53PM +0100, Colin Cross wrote:
> On Thu, Dec 8, 2011 at 4:43 AM, Peter De Schrijver <pdeschrijver at nvidia.com<mailto:pdeschrijver@nvidia.com>> wrote:
> Rework the tegra20 clock code to support multiple tegra variants :
> 
>  * remove tegra2_periph_reset_assert/tegra2_periph_reset_deassert. This
>   functionality should be in clock.c.
>  * compile tegra_sdmmc_tap_delay only on tegra20 as this feature will not
>   be available in future variants.
>  * don't export clk_measure_input_freq as its functionality is also available
>   using clk_get_rate().
> 
> Signed-off-by: Peter De Schrijver <pdeschrijver at nvidia.com<mailto:pdeschrijver@nvidia.com>>
> ---
>  arch/arm/mach-tegra/clock.c         |   12 +++++++-----
>  arch/arm/mach-tegra/clock.h         |    8 ++++----
>  arch/arm/mach-tegra/tegra2_clocks.c |   14 +-------------
>  arch/arm/mach-tegra/timer.c         |   12 ++++++++----
>  4 files changed, 20 insertions(+), 26 deletions(-)
> 
> diff --git a/arch/arm/mach-tegra/clock.c b/arch/arm/mach-tegra/clock.c
> index f8d41ff..f27bdcc 100644
> --- a/arch/arm/mach-tegra/clock.c
> +++ b/arch/arm/mach-tegra/clock.c
> @@ -387,13 +387,15 @@ EXPORT_SYMBOL(tegra_clk_init_from_table);
> 
>  void tegra_periph_reset_deassert(struct clk *c)
>  {
> -       tegra2_periph_reset_deassert(c);
> +       BUG_ON(!c->ops->reset);
> +       c->ops->reset(c, false);
>  }
>  EXPORT_SYMBOL(tegra_periph_reset_deassert);
> 
>  void tegra_periph_reset_assert(struct clk *c)
>  {
> -       tegra2_periph_reset_assert(c);
> +       BUG_ON(!c->ops->reset);
> +       c->ops->reset(c, true);
>  }
>  EXPORT_SYMBOL(tegra_periph_reset_assert);
> 
> @@ -403,9 +405,9 @@ void __init tegra_init_clock(void)
>  }
> 
>  /*
> - * The SDMMC controllers have extra bits in the clock source register that
> - * adjust the delay between the clock and data to compenstate for delays
> - * on the PCB.
> + * The SDMMC controllers on tegra20 have extra bits in the clock source
> + * register that adjust the delay between the clock and data to compenstate
> + * for delays on the PCB.
>  */
>  void tegra_sdmmc_tap_delay(struct clk *c, int delay)
>  {
> 
> I created this wrapper around tegra2_sdmmc_tap_delay because I guessed the same requirement would be present in tegra3.  If you don't expect this to be required on anything but tegra2, you could drop the wrapper and just have callers use tegra2_sdmmc_tap_delay.
> 

I will ask around if this is needed for tegra30.

> diff --git a/arch/arm/mach-tegra/clock.h b/arch/arm/mach-tegra/clock.h
> index 688316a..135bb5f 100644
> --- a/arch/arm/mach-tegra/clock.h
> +++ b/arch/arm/mach-tegra/clock.h
> @@ -146,15 +146,15 @@ struct tegra_clk_init_table {
>  };
> 
>  void tegra2_init_clocks(void);
> -void tegra2_periph_reset_deassert(struct clk *c);
> -void tegra2_periph_reset_assert(struct clk *c);
>  void clk_init(struct clk *clk);
>  struct clk *tegra_get_clock_by_name(const char *name);
> -unsigned long clk_measure_input_freq(void);
>  int clk_reparent(struct clk *c, struct clk *parent);
>  void tegra_clk_init_from_table(struct tegra_clk_init_table *table);
>  unsigned long clk_get_rate_locked(struct clk *c);
>  int clk_set_rate_locked(struct clk *c, unsigned long rate);
> +#ifdef CONFIG_ARCH_TEGRA_2x_SOC
>  void tegra2_sdmmc_tap_delay(struct clk *c, int delay);
> -
> +#else
> +#define tegra2_sdmmc_tap_delay(c, d) do {} while(0);
> 
> It's more standard to use an empty static inline function here.
> 

clock.h is included in several board files. So making this a static inline
function results in a number of 'static function declared but not used'
warnings.

Cheers,

Peter.

  parent reply	other threads:[~2011-12-09  9:13 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-08 12:43 [PATCH v6 00/10] Add support for tegra30 and cardhu Peter De Schrijver
2011-12-08 12:43 ` [PATCH v6 01/10] arm/tegra: initial device tree for tegra30 Peter De Schrijver
2011-12-09 14:22   ` Rob Herring
2011-12-08 12:43 ` [PATCH v6 02/10] arm/tegra: cleanup tegra20 support Peter De Schrijver
2011-12-08 12:43 ` [PATCH v6 03/10] arm/tegra: prepare clock code for multiple tegra variants Peter De Schrijver
     [not found]   ` <CAMbhsRT97Oq-=8f9++f6Jgg=YVaimKSz68xcDDNbDbvL+V5fJg@mail.gmail.com>
2011-12-09  9:13     ` Peter De Schrijver [this message]
2011-12-09 18:32       ` Colin Cross
2011-12-13 11:21       ` Peter De Schrijver
2011-12-08 12:43 ` [PATCH v6 04/10] arm/tegra: prepare early init " Peter De Schrijver
2011-12-08 17:57   ` Stephen Warren
2011-12-08 18:29     ` Colin Cross
2011-12-09 11:19       ` Peter De Schrijver
2011-12-09 18:35         ` Colin Cross
2011-12-13 11:18           ` Peter De Schrijver
2011-12-12  0:17   ` Olof Johansson
2011-12-08 12:43 ` [PATCH v6 05/10] arm/tegra: rename tegra20 pinmux files Peter De Schrijver
2011-12-08 12:43 ` [PATCH v6 06/10] arm/tegra: prepare pinmux code for multiple tegra variants Peter De Schrijver
2011-12-08 12:43 ` [PATCH v6 07/10] arm/tegra: add new fields to struct tegra_pingroup_desc Peter De Schrijver
2011-12-08 12:43 ` [PATCH v6 08/10] arm/tegra: pinmux tables and definitions for tegra30 Peter De Schrijver
2011-12-08 12:43 ` [PATCH v6 09/10] arm/tegra: implement support " Peter De Schrijver
2011-12-08 12:43 ` [PATCH v6 10/10] arm/tegra: add support for tegra30 based board cardhu Peter De Schrijver
2011-12-08 18:03   ` Stephen Warren
2011-12-09 14:29   ` Rob Herring
2011-12-09 15:52     ` Peter De Schrijver
2011-12-12  0:26     ` Olof Johansson
2011-12-08 18:08 ` [PATCH v6 00/10] Add support for tegra30 and cardhu Stephen Warren

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=20111209091319.GI27578@tbergstrom-lnx.Nvidia.com \
    --to=pdeschrijver@nvidia.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).