linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch v1]mfd: fix for DA9055 driver initialization
@ 2013-07-05 13:18 Ankur Raina
  2013-07-11 11:10 ` Lee Jones
  0 siblings, 1 reply; 2+ messages in thread
From: Ankur Raina @ 2013-07-05 13:18 UTC (permalink / raw)
  To: sameo; +Cc: broonie, axel.lin, linus.walleij, linux-kernel, david.chen

This patch clears all the events received while powering up DA9055.
While powering up DA9055,power sequencer and gpio events are received.
These events remain uncleared after boot up, due to which further event handling also fails.
DA9055 has three event registers.The event register bits are set to '1' on receiving an event.
The events can be cleared on writing a '1' to the set bit, which would then clear that bit to '0'
After applying this patch we have a clean state after boot up.

Signed-off-by: Ankur Raina <Ankur.Raina@kpitcummins.com>
---
 drivers/mfd/da9055-core.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/mfd/da9055-core.c b/drivers/mfd/da9055-core.c
index 49cb23d..e4c0596 100644
--- a/drivers/mfd/da9055-core.c
+++ b/drivers/mfd/da9055-core.c
@@ -381,6 +381,7 @@ int da9055_device_init(struct da9055 *da9055)
 {
 	struct da9055_pdata *pdata = da9055->dev->platform_data;
 	int ret;
+	uint8_t clear_events[3] = {0xFF, 0xFF, 0xFF};
 
 	if (pdata && pdata->init != NULL)
 		pdata->init(da9055);
@@ -390,6 +391,10 @@ int da9055_device_init(struct da9055 *da9055)
 	else
 		da9055->irq_base = pdata->irq_base;
 
+	ret = da9055_group_write(da9055, DA9055_REG_EVENT_A, 3, clear_events);
+	if (ret < 0)
+		return ret;
+
 	ret = regmap_add_irq_chip(da9055->regmap, da9055->chip_irq,
 				  IRQF_TRIGGER_LOW | IRQF_ONESHOT,
 				  da9055->irq_base, &da9055_regmap_irq_chip,
-- 
1.7.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch v1]mfd: fix for DA9055 driver initialization
  2013-07-05 13:18 [patch v1]mfd: fix for DA9055 driver initialization Ankur Raina
@ 2013-07-11 11:10 ` Lee Jones
  0 siblings, 0 replies; 2+ messages in thread
From: Lee Jones @ 2013-07-11 11:10 UTC (permalink / raw)
  To: Ankur Raina
  Cc: sameo, broonie, axel.lin, linus.walleij, linux-kernel, david.chen

On Fri, 05 Jul 2013, Ankur Raina wrote:

> This patch clears all the events received while powering up DA9055.
> While powering up DA9055,power sequencer and gpio events are received.
> These events remain uncleared after boot up, due to which further event handling also fails.
> DA9055 has three event registers.The event register bits are set to '1' on receiving an event.
> The events can be cleared on writing a '1' to the set bit, which would then clear that bit to '0'
> After applying this patch we have a clean state after boot up.
> 
> Signed-off-by: Ankur Raina <Ankur.Raina@kpitcummins.com>
> ---
>  drivers/mfd/da9055-core.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)

I'm going to clean up the commit message a little then apply this patch.

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-07-11 11:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-05 13:18 [patch v1]mfd: fix for DA9055 driver initialization Ankur Raina
2013-07-11 11:10 ` Lee Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).