From: "vimal singh" <vimalsingh@ti.com>
To: linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: felipe.balbi@nokia.com
Subject: [PATCH 2/2]: twl4030: initialize pm_power_off in twl4030-core.c
Date: Thu, 3 Sep 2009 20:44:20 +0530 (IST) [thread overview]
Message-ID: <55730.192.168.10.89.1251990860.squirrel@dbdmail.itg.ti.com> (raw)
In-Reply-To:
'twl4030-poweroff' module was removed sometime back. This patch adds back
this capability.
We don't really need a whole new driver just for initializing one pointer.
Initialize pm_power_off in twl4030-core.c
Signed-off-by: Vimal Singh <vimalsingh@ti.com>
CC: Felipe Balbi <felipe.balbi@nokia.com>
---
This patch is compile tested only.
This patch is based on Felipe Balbi's patch posted earlier:
http://markmail.org/message/ts4if3553qnauket
drivers/mfd/twl4030-core.c | 31 +++++++++++++++++++++++++++++++
1 files changed, 31 insertions(+)
Index: linux-omap-2.6/drivers/mfd/twl4030-core.c
===================================================================
--- linux-omap-2.6.orig/drivers/mfd/twl4030-core.c
+++ linux-omap-2.6/drivers/mfd/twl4030-core.c
@@ -178,6 +178,10 @@
#define TWL4030_VAUX2 BIT(0) /* pre-5030 voltage ranges */
#define TPS_SUBSET BIT(1) /* tps659[23]0 have fewer LDOs */
+/* for pm_power_off */
+#define PWR_P1_SW_EVENTS 0x10
+#define PWR_DEVOFF (1 << 0)
+
/*----------------------------------------------------------------------*/
/* is driver active, bound to a chip? */
@@ -754,6 +758,30 @@ static int twl4030_remove(struct i2c_cli
return 0;
}
+static void twl4030_poweroff(void)
+{
+ int err;
+ u8 val;
+
+ err = twl4030_i2c_read_u8(TWL4030_MODULE_PM_MASTER, &val,
+ PWR_P1_SW_EVENTS);
+ if (err) {
+ pr_err("%s: i2c error %d while reading TWL4030"
+ "PM_MASTER P1_SW_EVENTS\n",
+ DRIVER_NAME, err);
+ return;
+ }
+
+ val |= PWR_DEVOFF;
+
+ err = twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, val,
+ PWR_P1_SW_EVENTS);
+ if (err)
+ pr_err("%s: i2c error %d while writing TWL4030"
+ "PM_MASTER P1_SW_EVENTS\n",
+ DRIVER_NAME, err);
+}
+
/* NOTE: this driver only handles a single twl4030/tps659x0 chip */
static int
twl4030_probe(struct i2c_client *client, const struct i2c_device_id *id)
@@ -811,6 +839,9 @@ twl4030_probe(struct i2c_client *client,
goto fail;
}
+ /* initialize pm_power_off routine */
+ pm_power_off = twl4030_poweroff;
+
status = add_children(pdata, id->driver_data);
fail:
if (status < 0)
reply other threads:[~2009-09-03 15:14 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=55730.192.168.10.89.1251990860.squirrel@dbdmail.itg.ti.com \
--to=vimalsingh@ti.com \
--cc=felipe.balbi@nokia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
/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®