From: Ankur Raina <Ankur.Raina@kpitcummins.com>
To: <sameo@linux.intel.com>
Cc: <broonie@kernel.org>, <axel.lin@gmail.com>,
<linus.walleij@linaro.org>, <linux-kernel@vger.kernel.org>,
<david.chen@diasemi.com>
Subject: [patch v1]mfd: fix for DA9055 driver initialization
Date: Fri, 5 Jul 2013 18:48:30 +0530 [thread overview]
Message-ID: <1373030310.1601.30.camel@ankurr1-desktop> (raw)
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
next reply other threads:[~2013-07-05 13:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-05 13:18 Ankur Raina [this message]
2013-07-11 11:10 ` Lee Jones
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1373030310.1601.30.camel@ankurr1-desktop \
--to=ankur.raina@kpitcummins.com \
--cc=axel.lin@gmail.com \
--cc=broonie@kernel.org \
--cc=david.chen@diasemi.com \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sameo@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®