[linux-pm] [RFC] PowerOP, OMAP1 PM Core 2/3

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [Linux ACPI]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [CPU Freq]     [Kernel Newbies]     [Fedora Kernel]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux