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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6B4D417B830BC44B8026029FD256F7F1C2CD7600C9@HKMAIL01.nvidia.com>
Date:	Wed, 3 Aug 2011 12:04:50 +0800
From:	Wei Ni <wni@...dia.com>
To:	"sameo@...ux.intel.com" <sameo@...ux.intel.com>,
	"mike@...pulab.co.il" <mike@...pulab.co.il>,
	"gking@...dia.com" <gking@...dia.com>,
	Nitin Kumbhar <nkumbhar@...dia.com>
CC:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"'dianders@...omium.org'" <dianders@...omium.org>,
	Wei Ni <wni@...dia.com>
Subject: RE: [PATCH] mfd: tps6586x: add api to power off tps6586x

Hello, could anyone review this patch?

Thanks
Wei.
nvpublic

>-----Original Message-----
>From: Wei Ni
>Sent: Thursday, July 28, 2011 2:31 PM
>To: sameo@...ux.intel.com; mike@...pulab.co.il; gking@...dia.com; Nitin Kumbhar
>Cc: linux-kernel@...r.kernel.org; Wei Ni
>Subject: [PATCH] mfd: tps6586x: add api to power off tps6586x
>
>From: Wei Ni <wni@...dia.com>
>
>Add an api to put tps6586x in sleep mode by resetting EXITSLREQ and
>setting SLEEP_MODE in SUPPLYENE register. It will power off ldos.
>
>Signed-off-by: Wei Ni <wni@...dia.com>
>Signed-off-by: Nitin Kumbhar <nkumbhar@...dia.com>
>---
> drivers/mfd/tps6586x.c       |   29 +++++++++++++++++++++++++++++
> include/linux/mfd/tps6586x.h |    1 +
> 2 files changed, 30 insertions(+), 0 deletions(-)
>
>diff --git a/drivers/mfd/tps6586x.c b/drivers/mfd/tps6586x.c
>index bba26d9..d0eaa0a 100644
>--- a/drivers/mfd/tps6586x.c
>+++ b/drivers/mfd/tps6586x.c
>@@ -27,6 +27,10 @@
> #include <linux/mfd/core.h>
> #include <linux/mfd/tps6586x.h>
>
>+#define TPS6586X_SUPPLYENE	0x14
>+#define EXITSLREQ_BIT		BIT(1) /* Exit sleep mode request */
>+#define SLEEP_MODE_BIT		BIT(3) /* Sleep mode */
>+
> /* GPIO control registers */
> #define TPS6586X_GPIOSET1	0x5d
> #define TPS6586X_GPIOSET2	0x5e
>@@ -251,6 +255,29 @@ out:
> }
> EXPORT_SYMBOL_GPL(tps6586x_update);
>
>+static struct i2c_client *tps6586x_i2c_client;
>+int tps6586x_power_off(void)
>+{
>+	struct device *dev = NULL;
>+	int ret = -EINVAL;
>+
>+	if (!tps6586x_i2c_client)
>+		return ret;
>+
>+	dev = &tps6586x_i2c_client->dev;
>+
>+	ret = tps6586x_clr_bits(dev, TPS6586X_SUPPLYENE, EXITSLREQ_BIT);
>+	if (ret)
>+		return ret;
>+
>+	ret = tps6586x_set_bits(dev, TPS6586X_SUPPLYENE, SLEEP_MODE_BIT);
>+	if (ret)
>+		return ret;
>+
>+	return 0;
>+}
>+EXPORT_SYMBOL_GPL(tps6586x_power_off);
>+
> static int tps6586x_gpio_get(struct gpio_chip *gc, unsigned offset)
> {
> 	struct tps6586x *tps6586x = container_of(gc, struct tps6586x, gpio);
>@@ -525,6 +552,8 @@ static int __devinit tps6586x_i2c_probe(struct i2c_client *client,
> 		goto err_add_devs;
> 	}
>
>+	tps6586x_i2c_client = client;
>+
> 	return 0;
>
> err_add_devs:
>diff --git a/include/linux/mfd/tps6586x.h b/include/linux/mfd/tps6586x.h
>index b6bab1b..cfbf387 100644
>--- a/include/linux/mfd/tps6586x.h
>+++ b/include/linux/mfd/tps6586x.h
>@@ -74,5 +74,6 @@ extern int tps6586x_set_bits(struct device *dev, int reg, uint8_t bit_mask);
> extern int tps6586x_clr_bits(struct device *dev, int reg, uint8_t bit_mask);
> extern int tps6586x_update(struct device *dev, int reg, uint8_t val,
> 			   uint8_t mask);
>+extern int tps6586x_power_off(void);
>
> #endif /*__LINUX_MFD_TPS6586X_H */
>--
>1.7.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ