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

3 messages, 2 authors, 2016-01-20 · open the first message on its own page

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

From: Peter Korsgaard <peter@korsgaard.com>
Date: 2016-01-15 07:58:16

quoted
quoted
quoted
quoted
"Yang," == Yang, Wenyou [off-list ref] 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.
quoted
quoted
+	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.

-- 
Venlig hilsen,
Peter Korsgaard 

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

From: Yang, Wenyou <hidden>
Date: 2016-01-15 08:39:01

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 <redacted>
Cc: Lee Jones <redacted>; Rob Herring <robh+dt@kernel.org>;
Pawel Moll [off-list ref]; Mark Rutland [off-list ref]; Ian
Campbell [off-list ref]; Kumar Gala [off-list ref];
devicetree at vger.kernel.org; Krzysztof Kozlowski [off-list ref];
Ferre, Nicolas [off-list ref]; linux-kernel at vger.kernel.org;
Javier Martinez Canillas [off-list ref]; linux-arm-
kernel at lists.infradead.org
Subject: Re: [PATCH v5 1/2] mfd: act8945a: add Active-semi ACT8945A PMIC
MFD driver
quoted
quoted
quoted
quoted
quoted
"Yang," == Yang, Wenyou [off-list ref] 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.
quoted
quoted
quoted
+	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-
quoted
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

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

From: Yang, Wenyou <hidden>
Date: 2016-01-20 07:28:08

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 <redacted>
Cc: Lee Jones <redacted>; Rob Herring <robh+dt@kernel.org>;
Pawel Moll [off-list ref]; Mark Rutland [off-list ref]; Ian
Campbell [off-list ref]; Kumar Gala [off-list ref];
devicetree at vger.kernel.org; Krzysztof Kozlowski [off-list ref];
Ferre, Nicolas [off-list ref]; linux-kernel at vger.kernel.org;
Javier Martinez Canillas [off-list ref]; linux-arm-
kernel at lists.infradead.org
Subject: Re: [PATCH v5 1/2] mfd: act8945a: add Active-semi ACT8945A PMIC
MFD driver
quoted
quoted
quoted
quoted
quoted
"Yang," == Yang, Wenyou [off-list ref] 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.
quoted
quoted
quoted
+	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-
quoted
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.
For regulator, it works use the core do dev_get_regmap(dev->parent), but for charger, it need to export *act8945a.


Best Regards,
Wenyou Yang
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help