Skip to content

Commit

Permalink
power off bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
Hashcode committed May 13, 2012
1 parent 97e7c64 commit 83ec6f5
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions drivers/mfd/twl6030-poweroff.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <linux/pm.h>
#include <linux/i2c/twl.h>

#define TWL6030_PHONIX_DEV_ON 0x25
#define APP_DEVOFF (1<<0)
#define CON_DEVOFF (1<<1)
#define MOD_DEVOFF (1<<2)
Expand All @@ -34,17 +35,21 @@ void twl6030_poweroff(void)
u8 val = 0;
int err = 0;

err = twl_i2c_read_u8(TWL_MODULE_PM_MASTER, &val,
TWL6030_PHOENIX_DEV_ON);
// err = twl_i2c_read_u8(TWL_MODULE_PM_MASTER, &val,
// TWL6030_PHOENIX_DEV_ON);
err = twl_i2c_read_u8(TWL6030_MODULE_ID0, &val,
TWL6030_PHONIX_DEV_ON);
if (err) {
pr_warning("I2C error %d reading PHOENIX_DEV_ON\n", err);
return;
}

val |= APP_DEVOFF | CON_DEVOFF | MOD_DEVOFF;

err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, val,
TWL6030_PHOENIX_DEV_ON);
err = twl_i2c_write_u8(TWL6030_MODULE_ID0, val,
TWL6030_PHONIX_DEV_ON);
// err = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, val,
// TWL6030_PHOENIX_DEV_ON);

if (err) {
pr_warning("I2C error %d writing PHOENIX_DEV_ON\n", err);
Expand Down

0 comments on commit 83ec6f5

Please sign in to comment.