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

Pavel Machek wrote:
> Hi!
>
> Not only it does string parsing in generc code, it pushes it to
> architectures, too. Ouch.
>   
are you talking about particular implementation of the parsing or about 
interfaces? Please note that the patches were mainly introduced now for 
_interfaces_ discussion and may contain suboptimal or just reference 
implementations.
If you are talking about  having parsing implementation itself  in a 
separate arch independent library then that's is intention.

I already addressed the question why parsing is needed at this level in 
separate reply to you.
>
>   
>> +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 :-(.
Concept is interfaces. And the concept addresses important design 
requirements (again as I've  mentioned already in previous reply) while 
leading to some "parsing" at this level. So what is your point here?

Thanks,
Eugeny

      reply	other threads:[~2006-08-17 22:33 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
2006-08-17 22:33   ` Eugeny S. Mints [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=44E4EEAA.7070607@gmail.com \
    --to=eugeny.mints@gmail.com \
    --cc=linux-pm@lists.osdl.org \
    --cc=pavel@ucw.cz \
    /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