All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Nishanth Menon <nm@ti.com>
Cc: l-o <linux-omap@vger.kernel.org>, Kevin H <khilman@deeprootsystems.com>
Subject: Re: [PATCH 1/3 v2] omap: opp: add OMAP3 OPP table data and common init
Date: Thu, 4 Nov 2010 16:10:15 -0700	[thread overview]
Message-ID: <20101104231014.GD9264@atomide.com> (raw)
In-Reply-To: <1287536543-9729-2-git-send-email-nm@ti.com>

Hi Nishant,

You can make the opp init more generic by changing omap_init_opp_table to be:

int __init omap_init_opp_table(struct omap_opp_def *opp_list)

instead of below. And then..

> +int __init omap_init_opp_table(void)
> +{
> +	struct omap_opp_def *opp_def;
> +	u32 opp_def_size;
> +	int i, r;
> +
> +	/*
> +	 * Allow multiple calls, but initialize only if not already initalized
> +	 * even if the previous call failed, coz, no reason we'd succeed again
> +	 */
> +	if (omap_table_init)
> +		return 0;
> +	omap_table_init = 1;
> +
> +	/* Select the OPP table we'd like to enable based on cpu we are on */
> +	if (cpu_is_omap34xx()) {
> +		opp_def = cpu_is_omap3630() ? omap36xx_opp_def_list :
> +			omap34xx_opp_def_list;
> +		opp_def_size = cpu_is_omap3630() ?
> +			ARRAY_SIZE(omap36xx_opp_def_list) :
> +			ARRAY_SIZE(omap34xx_opp_def_list);
> +	} else {
> +		pr_err("%s: called for an unsupported cpu type\n", __func__);
> +		return -EINVAL;
> +	}

..the above can go into omap3 and omap4 specific init functions so this
function stays generic.

Regards,

Tony

      parent reply	other threads:[~2010-11-04 23:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-20  1:02 [PATCH 0/3 v2] omap: opp: Add opp data Nishanth Menon
2010-10-20  1:02 ` [PATCH 1/3 v2] omap: opp: add OMAP3 OPP table data and common init Nishanth Menon
2010-10-20  1:02   ` [PATCH 2/3 v2] omap4: opp: add OPP table data Nishanth Menon
2010-10-20  1:02     ` [PATCH 3/3 v2] OMAP3: remove OPP interfaces from OMAP PM layer Nishanth Menon
2010-11-04 23:20       ` Tony Lindgren
2010-11-04 23:13     ` [PATCH 2/3 v2] omap4: opp: add OPP table data Tony Lindgren
2010-11-05  0:05       ` Menon, Nishanth
2010-11-04 23:10   ` Tony Lindgren [this message]

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=20101104231014.GD9264@atomide.com \
    --to=tony@atomide.com \
    --cc=khilman@deeprootsystems.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=nm@ti.com \
    /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.