lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1373030310.1601.30.camel@ankurr1-desktop>
Date:	Fri, 5 Jul 2013 18:48:30 +0530
From:	Ankur Raina <Ankur.Raina@...tcummins.com>
To:	<sameo@...ux.intel.com>
CC:	<broonie@...nel.org>, <axel.lin@...il.com>,
	<linus.walleij@...aro.org>, <linux-kernel@...r.kernel.org>,
	<david.chen@...semi.com>
Subject: [patch v1]mfd: fix for DA9055 driver initialization

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@...tcummins.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


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ