2012-06-22 12:36:23

by Graeme Gregory

[permalink] [raw]
Subject: [PATCH 0/1] Palmas Bugfixes

Hi, this patch series is three small bugfixes for the palmas MFD and
regulator device. These are essential for the correct operation of
the drivers and device.

Thanks

Graeme


2012-06-22 12:36:24

by Graeme Gregory

[permalink] [raw]
Subject: [PATCH 1/3] MFD: palmas fix regulator pdata missing

Due to a merge error the section of code passing the pdata for the
regulator driver to the mfd_add_devices via the children structure
was missing. This corrects this problem.

Signed-off-by: Graeme Gregory <[email protected]>
---
drivers/mfd/palmas.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/mfd/palmas.c b/drivers/mfd/palmas.c
index 00c0aba..7dfb018 100644
--- a/drivers/mfd/palmas.c
+++ b/drivers/mfd/palmas.c
@@ -441,6 +441,9 @@ static int __devinit palmas_i2c_probe(struct i2c_client *i2c,
goto err;
}

+ children[PALMAS_PMIC_ID].platform_data = pdata->pmic_pdata;
+ children[PALMAS_PMIC_ID].pdata_size = sizeof(*pdata->pmic_pdata);
+
ret = mfd_add_devices(palmas->dev, -1,
children, ARRAY_SIZE(palmas_children),
NULL, regmap_irq_chip_get_base(palmas->irq_data));
--
1.7.9.5

2012-06-22 12:36:46

by Graeme Gregory

[permalink] [raw]
Subject: [PATCH 3/3] REGULATOR: fix regmap offsets for enable/disable

I forgot to apply the offsets for the regmap helper functions for
enable/disable on SMPS10 and the LDO regulators. This means regulators
will not enable/disable correctly.

Signed-off-by: Graeme Gregory <[email protected]>
Tested-by: Sebastien Guiriec <[email protected]>
---
drivers/regulator/palmas-regulator.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/regulator/palmas-regulator.c b/drivers/regulator/palmas-regulator.c
index 6c48511..7540c95 100644
--- a/drivers/regulator/palmas-regulator.c
+++ b/drivers/regulator/palmas-regulator.c
@@ -667,7 +667,9 @@ static __devinit int palmas_probe(struct platform_device *pdev)
pmic->desc[id].ops = &palmas_ops_smps10;
pmic->desc[id].vsel_reg = PALMAS_SMPS10_CTRL;
pmic->desc[id].vsel_mask = SMPS10_VSEL;
- pmic->desc[id].enable_reg = PALMAS_SMPS10_STATUS;
+ pmic->desc[id].enable_reg =
+ PALMAS_BASE_TO_REG(PALMAS_SMPS_BASE,
+ PALMAS_SMPS10_STATUS);
pmic->desc[id].enable_mask = SMPS10_BOOST_EN;
pmic->desc[id].min_uV = 3750000;
pmic->desc[id].uV_step = 1250000;
@@ -739,7 +741,8 @@ static __devinit int palmas_probe(struct platform_device *pdev)

pmic->desc[id].type = REGULATOR_VOLTAGE;
pmic->desc[id].owner = THIS_MODULE;
- pmic->desc[id].enable_reg = palmas_regs_info[id].ctrl_addr;
+ pmic->desc[id].enable_reg = PALMAS_BASE_TO_REG(PALMAS_LDO_BASE,
+ palmas_regs_info[id].ctrl_addr);
pmic->desc[id].enable_mask = PALMAS_LDO1_CTRL_MODE_ACTIVE;

if (pdata && pdata->reg_data)
--
1.7.9.5

2012-06-22 12:36:58

by Graeme Gregory

[permalink] [raw]
Subject: [PATCH 2/3] MFD: add missing hunk to change irq to clear on read

During conversion to regmap_irq this hunk was missing being moved
to MFD driver to put the chip into clear on read mode. Also as slave
is now set use it to determine which slave for the register call.

Signed-off-by: Graeme Gregory <[email protected]>
---
drivers/mfd/palmas.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/mfd/palmas.c b/drivers/mfd/palmas.c
index 7dfb018..7ec7d8d 100644
--- a/drivers/mfd/palmas.c
+++ b/drivers/mfd/palmas.c
@@ -356,7 +356,14 @@ static int __devinit palmas_i2c_probe(struct i2c_client *i2c,
}
}

- ret = regmap_add_irq_chip(palmas->regmap[1], palmas->irq,
+ /* Change IRQ into clear on read mode for efficiency */
+ slave = PALMAS_BASE_TO_SLAVE(PALMAS_INTERRUPT_BASE);
+ addr = PALMAS_BASE_TO_REG(PALMAS_INTERRUPT_BASE, PALMAS_INT_CTRL);
+ reg = PALMAS_INT_CTRL_INT_CLEAR;
+
+ regmap_write(palmas->regmap[slave], addr, reg);
+
+ ret = regmap_add_irq_chip(palmas->regmap[slave], palmas->irq,
IRQF_ONESHOT | IRQF_TRIGGER_LOW, -1, &palmas_irq_chip,
&palmas->irq_data);
if (ret < 0)
--
1.7.9.5

2012-06-23 10:38:40

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 3/3] REGULATOR: fix regmap offsets for enable/disable

On Fri, Jun 22, 2012 at 01:36:20PM +0100, Graeme Gregory wrote:
> I forgot to apply the offsets for the regmap helper functions for
> enable/disable on SMPS10 and the LDO regulators. This means regulators
> will not enable/disable correctly.

APPLIED, THANKS, after cleaning up the subject line.


Attachments:
(No filename) (296.00 B)
signature.asc (836.00 B)
Digital signature
Download all attachments