public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: "Eugeny S. Mints" <eugeny.mints@gmail.com>
Cc: linux-pm@lists.osdl.org
Subject: Re: [RFC] PowerOP, OMAP1 PM Core 2/3
Date: Tue, 15 Aug 2006 20:42:53 +0000	[thread overview]
Message-ID: <20060815204253.GA5950@ucw.cz> (raw)
In-Reply-To: <44D7EA82.9090306@gmail.com>

Hi!

Not only it does string parsing in generc code, it pushes it to
architectures, too. Ouch.


> +static char *pwr_param_names_list = "cpu_vltg dpll cpu tc per dsp dspmmu lcd ";
...

> +#define PWR_PARAM_SET	1
> +#define PWR_PARAM_GET	2
> +/* FIXME: very temporary implementation, just to prove the concept !! */
> +static int 
> +process_pwr_param(struct pm_core_point *opt, int op, char *param_name,
> +		  int va_arg)
> +{
> +	if (strcmp(param_name, "cpu_vltg") == 0) {
> +		if (op == PWR_PARAM_SET)
> +			opt->cpu_vltg = va_arg;
> +		else if (opt != NULL)
> +			*(int *)va_arg = opt->cpu_vltg;
> +		else if (unlikely((*(int *)va_arg = get_vtg("v1")) <= 0))
> +			return -EINVAL;
> +
> +		return 0;
> +	}
> +
> +	if (strcmp(param_name, "dpll") == 0) {
> +		if (op == PWR_PARAM_SET)
> +			opt->dpll = va_arg;
> +		else if (opt != NULL)
> +			*(int *)va_arg = opt->dpll;
> +		else if ((*(int *)va_arg = get_clk_rate("ck_dpll1")) <= 0)
> +			return -EINVAL;
> +
> +		return 0;
> +	}
> +
> +	if (strcmp(param_name, "cpu") == 0) {
> +		if (op == PWR_PARAM_SET)
> +			opt->cpu = va_arg;
> +		else if (opt != NULL)
> +			*(int *)va_arg = opt->cpu;
> +		else if ((*(int *)va_arg = get_clk_rate("arm_ck")) <= 0)
> +			return -EINVAL;
> +
> +		return 0;
> +	}
> +
> +	/* FIXME: more parameters to process */
> +
> +	return -EINVAL;
> +}

It certainly tells me I do not like the concept :-(.

-- 
Thanks for all the (sleeping) penguins.

  reply	other threads:[~2006-08-15 20:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-08  1:36 [RFC] PowerOP, OMAP1 PM Core 2/3 Eugeny S. Mints
2006-08-15 20:42 ` Pavel Machek [this message]
2006-08-17 22:33   ` Eugeny S. Mints

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=20060815204253.GA5950@ucw.cz \
    --to=pavel@ucw.cz \
    --cc=eugeny.mints@gmail.com \
    --cc=linux-pm@lists.osdl.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