2 * linux/drivers/i2c/chips/twl4030_poweroff.c
6 * Copyright (C) 2008 Nokia Corporation
8 * Written by Peter De Schrijver <peter.de-schrijver@nokia.com>
10 * This file is subject to the terms and conditions of the GNU General
11 * Public License. See the file "COPYING" in the main directory of this
12 * archive for more details.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 #include <linux/module.h>
26 #include <linux/i2c/twl4030.h>
28 #define PWR_P1_SW_EVENTS 0x10
29 #define PWR_DEVOFF (1<<0)
31 static void twl4030_poweroff(void)
36 err
= twl4030_i2c_read_u8(TWL4030_MODULE_PM_MASTER
, &val
,
39 printk(KERN_WARNING
"I2C error %d while reading TWL4030"
40 "PM_MASTER P1_SW_EVENTS\n", err
);
46 err
= twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER
, val
,
50 printk(KERN_WARNING
"I2C error %d while writing TWL4030"
51 "PM_MASTER P1_SW_EVENTS\n", err
);
58 static int __init
twl4030_poweroff_init(void)
60 pm_power_off
= twl4030_poweroff
;
65 static void __exit
twl4030_poweroff_exit(void)
70 module_init(twl4030_poweroff_init
);
71 module_exit(twl4030_poweroff_exit
);
73 MODULE_DESCRIPTION("Triton2 device power off");
74 MODULE_LICENSE("GPL");
75 MODULE_AUTHOR("Peter De Schrijver");