[PATCH v5 1/2] mfd: act8945a: add Active-semi ACT8945A PMIC MFD driver

Yang, Wenyou Wenyou.Yang at atmel.com
Fri Jan 15 00:38:50 PST 2016


Hi Peter,

> -----Original Message-----
> From: Peter Korsgaard [mailto:jacmet at gmail.com] On Behalf Of Peter Korsgaard
> Sent: 2016年1月15日 15:58
> To: Yang, Wenyou <Wenyou.Yang at atmel.com>
> Cc: Lee Jones <lee.jones at linaro.org>; Rob Herring <robh+dt at kernel.org>;
> Pawel Moll <pawel.moll at arm.com>; Mark Rutland <mark.rutland at arm.com>; Ian
> Campbell <ijc+devicetree at hellion.org.uk>; Kumar Gala <galak at codeaurora.org>;
> devicetree at vger.kernel.org; Krzysztof Kozlowski <k.kozlowski at samsung.com>;
> Ferre, Nicolas <Nicolas.FERRE at atmel.com>; linux-kernel at vger.kernel.org;
> Javier Martinez Canillas <javier at dowhile0.org>; linux-arm-
> kernel at lists.infradead.org
> Subject: Re: [PATCH v5 1/2] mfd: act8945a: add Active-semi ACT8945A PMIC
> MFD driver
> 
> >>>>> "Yang," == Yang, Wenyou <Wenyou.Yang at atmel.com> writes:
> 
> Hi,
> 
>  >> Why not make it a tristate instead? Having regulators as modules is perhaps
> not a  >> very wise thing to do, but conceptually I don't see why this code couldn't
> be a  >> module.
> 
>  > Yes, you are right. it can be use a tristate.
> 
> Ok, good.
> 
> >> > +	act8945a = devm_kzalloc(&i2c->dev, sizeof(*act8945a),
> >> > +GFP_KERNEL);
>  >> > +	if (!act8945a)
>  >> > +		return -ENOMEM;
>  >> > +
>  >>
>  >> What is the point of this structure (and the header file)? Can't the subdevices
> just  >> do dev_get_regmap(dev->parent)? regulator_register() afaik already does
> this by  >> default.
> 
>  > Yes, I re-read regulator_register() code. It did do dev_get_regmap(dev-
> >parent).
> 
>  > I think this structure should be pointed by dev->parent, this structure is
> necessary.
> 
>  > Yes regulator driver should be simpler.
> 
>  > Moreover, it is used by another sub device, charger. Which don't such code.
> 
> But the charger driver can just as well do:
> 
> dev_get_regmap(dev->parent);
> 
> instead of:
> 
> dev_get_drvdata(pdev->dev.parent)->regmap.

Understand. 

Thank you!


Best Regards,
Wenyou Yang


More information about the linux-arm-kernel mailing list