* [v2 PATCH] regulator: palmas: Store pdata pointer in palmas struct
@ 2013-07-25 17:04 Rhyland Klein
2013-07-25 18:02 ` Mark Brown
0 siblings, 1 reply; 3+ messages in thread
From: Rhyland Klein @ 2013-07-25 17:04 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown
Cc: Joseph Lo, Stephen Warren, linux-kernel, Rhyland Klein
Store a pointer to the pdata so that if it needs to be used after
probe it can be. In the case of booting from DeviceTree, the
dev.platform_data may be null, so we need to store this pointer
explicitly.
Based on work by Joseph Lo.
Cc: Joseph Lo <josephl@nvidia.com>
Signed-off-by: Rhyland Klein <rklein@nvidia.com>
---
v2:
- Renamed patch from "regulator: palmas: fix pdata ptr not be updated
after it has been allocated" to be appropriate to the current change.
- Instead of updating dev.platform_data, store the pdata pointer in the
pmic struct which we already have access to via drvdata.
drivers/regulator/palmas-regulator.c | 2 +-
include/linux/mfd/palmas.h | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/regulator/palmas-regulator.c b/drivers/regulator/palmas-regulator.c
index d0c8785..750ce55 100644
--- a/drivers/regulator/palmas-regulator.c
+++ b/drivers/regulator/palmas-regulator.c
@@ -761,7 +761,6 @@ static void palmas_dt_to_pdata(struct device *dev,
pdata->ldo6_vibrator = of_property_read_bool(node, "ti,ldo6-vibrator");
}
-
static int palmas_regulators_probe(struct platform_device *pdev)
{
struct palmas *palmas = dev_get_drvdata(pdev->dev.parent);
@@ -789,6 +788,7 @@ static int palmas_regulators_probe(struct platform_device *pdev)
pmic->dev = &pdev->dev;
pmic->palmas = palmas;
+ pmic->pdata = pdata;
palmas->pmic = pmic;
platform_set_drvdata(pdev, pmic);
diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h
index 1a8dd7a..1703f18 100644
--- a/include/linux/mfd/palmas.h
+++ b/include/linux/mfd/palmas.h
@@ -352,6 +352,8 @@ struct palmas_pmic {
struct regulator_dev *rdev[PALMAS_NUM_REGS];
struct mutex mutex;
+ struct palmas_pmic_platform_data *pdata;
+
int smps123;
int smps457;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [v2 PATCH] regulator: palmas: Store pdata pointer in palmas struct
2013-07-25 17:04 [v2 PATCH] regulator: palmas: Store pdata pointer in palmas struct Rhyland Klein
@ 2013-07-25 18:02 ` Mark Brown
2013-07-25 18:06 ` Rhyland Klein
0 siblings, 1 reply; 3+ messages in thread
From: Mark Brown @ 2013-07-25 18:02 UTC (permalink / raw)
To: Rhyland Klein; +Cc: Liam Girdwood, Joseph Lo, Stephen Warren, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 399 bytes --]
On Thu, Jul 25, 2013 at 01:04:59PM -0400, Rhyland Klein wrote:
> Store a pointer to the pdata so that if it needs to be used after
> probe it can be. In the case of booting from DeviceTree, the
> dev.platform_data may be null, so we need to store this pointer
> explicitly.
This doesn't seem to adjust any places where pdata is used to refer to
the new pointer so does it actually have any effect?
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [v2 PATCH] regulator: palmas: Store pdata pointer in palmas struct
2013-07-25 18:02 ` Mark Brown
@ 2013-07-25 18:06 ` Rhyland Klein
0 siblings, 0 replies; 3+ messages in thread
From: Rhyland Klein @ 2013-07-25 18:06 UTC (permalink / raw)
To: Mark Brown
Cc: Liam Girdwood, Joseph Lo, Stephen Warren,
linux-kernel@vger.kernel.org
On 7/25/2013 2:02 PM, Mark Brown wrote:
> * PGP Signed by an unknown key
>
> On Thu, Jul 25, 2013 at 01:04:59PM -0400, Rhyland Klein wrote:
>> Store a pointer to the pdata so that if it needs to be used after
>> probe it can be. In the case of booting from DeviceTree, the
>> dev.platform_data may be null, so we need to store this pointer
>> explicitly.
>
> This doesn't seem to adjust any places where pdata is used to refer to
> the new pointer so does it actually have any effect?
I was thinking the same thing after I sent this. Right now, no this has
no effect. The expectation is that when ldo8-tracking support is posted,
it needs to have access to the pdata. I suppose it could make sense then
to either make this part of that series, or to flatten this directly
into it.
I think it can be fine to merge on its own, but it might make sense then
to include the ldo8 tracking support. Let me see how ready that is to be
posted, and if it is close, this can join it in a patchset.
-rhyland
>
> * Unknown Key
> * 0x7EA229BD
>
--
nvpublic
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-07-25 18:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-25 17:04 [v2 PATCH] regulator: palmas: Store pdata pointer in palmas struct Rhyland Klein
2013-07-25 18:02 ` Mark Brown
2013-07-25 18:06 ` Rhyland Klein
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox