Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1306929

Re: [PATCH v5 4/5] regulator: add regulator driver of hi655x pmic

From chenfeng <puck.chen@hisilicon.com>
Newsgroups linux.kernel
Subject Re: [PATCH v5 4/5] regulator: add regulator driver of hi655x pmic
Date 2016-01-12 03:20 +0100
Message-ID <qPWIW-2PA-13@gated-at.bofh.it> (permalink)
References <qPJLI-2jg-13@gated-at.bofh.it> <qPJLI-2jg-23@gated-at.bofh.it> <qPPo6-67U-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw



On 2016/1/12 2:24, Mark Brown wrote:
> On Mon, Jan 11, 2016 at 08:20:16PM +0800, Chen Feng wrote:
> 
>> +config REGULATOR_HI655X
>> +	tristate "Hisilicon HI655X PMIC regulators support"
>> +	depends on ARCH_HISI || (COMPILE_TEST && ARM64)
> 
> Why does this depend on ARM64?  If it's needed it probably indicates a
> problem...
> 
There will be compile warning with arch parisc.

Add the current support platform is ARM64.
>> +	np = of_get_child_by_name(dev->parent->of_node, "regulators");
>> +	if (!np)
>> +		return -ENODEV;
>> +
>> +	ret = of_regulator_match(dev, np,
>> +				 hi655x_regulator_match,
>> +				 ARRAY_SIZE(hi655x_regulator_match));
> 
> Like I said on the previous version:
> 
> | Don't open code this, use the standard support with of_match and
> | regulators_node.
> 
> The code is now using of_match but still open coding regulators_node.
> 
I am not sure about open coding regulators_node.

I take max8907-regulator.c for reference. The code there is:
224 static int max8907_regulator_parse_dt(struct platform_device *pdev)
225 {
226         struct device_node *np, *regulators;
227         int ret;
228
229         np = pdev->dev.parent->of_node;
230         if (!np)
231                 return 0;
232
233         regulators = of_get_child_by_name(np, "regulators");
	    ...
238
239         ret = of_regulator_match(&pdev->dev, regulators, max8907_matches,
240                                  ARRAY_SIZE(max8907_matches));

249 }

Can you give me some references? Really thanks for your help.

ChenFeng

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH v5 4/5] regulator: add regulator driver of hi655x pmic Chen Feng <puck.chen@hisilicon.com> - 2016-01-11 13:30 +0100
  Re: [PATCH v5 4/5] regulator: add regulator driver of hi655x pmic Mark Brown <broonie@kernel.org> - 2016-01-11 19:30 +0100
    Re: [PATCH v5 4/5] regulator: add regulator driver of hi655x pmic chenfeng <puck.chen@hisilicon.com> - 2016-01-12 03:20 +0100

csiph-web