Re: [PATCH] Load triton2 scripts.
Op 11 sep 2008, om 05:20 heeft Steve Sakoman het volgende geschreven: On Wed, Sep 10, 2008 at 5:08 PM, Tony Lindgren [EMAIL PROTECTED] wrote: * Kalle Jokiniemi [EMAIL PROTECTED] [080825 03:28]: From: ext Peter 'p2' De Schrijver [EMAIL PROTECTED] This patch loads the triton2 (twl4030) with scripts that will cut off VDD1 and VDD2 voltages when SYS_OFF_MODE signal is set. Pushing today. I guess we should remove the CONFIG_DISABLE_HFCLK at some point? This patch causes a build error due to a missing define: | CC drivers/i2c/chips/twl4030-power.o | drivers/i2c/chips/twl4030-power.c:152: error: 'RES_TYPE_R7' undeclared here (not in a function) Same here: make[3]: Entering directory `/OE/angstrom-dev/work/beagleboard- angstrom-linux-gnueabi/linux-omap-2.6.26+2.6.27- rc6+r1+gite9e9988a4ded6acee1d5387debb39f006f4c11a3-r1/git' CC drivers/i2c/chips/twl4030-power.o drivers/i2c/chips/twl4030-power.c:152: error: 'RES_TYPE_R7' undeclared here (not in a function) drivers/i2c/chips/twl4030-power.c: In function 'config_sleep_wake_sequence': drivers/i2c/chips/twl4030-power.c:215: warning: unused variable 'data' drivers/i2c/chips/twl4030-power.c: In function 'config_warmreset_sequence': drivers/i2c/chips/twl4030-power.c:275: error: 't2_wrst_seq' undeclared (first use in this function) drivers/i2c/chips/twl4030-power.c:275: error: (Each undeclared identifier is reported only once drivers/i2c/chips/twl4030-power.c:275: error: for each function it appears in.) drivers/i2c/chips/twl4030-power.c:275: error: invalid operands to binary / drivers/i2c/chips/twl4030-power.c:284: error: invalid operands to binary / drivers/i2c/chips/twl4030-power.c:284: warning: passing argument 3 of 'twl4030_write_script' makes integer from pointer without a cast make[3]: *** [drivers/i2c/chips/twl4030-power.o] Error 1 regards, Koen Steve -- To unsubscribe from this list: send the line unsubscribe linux- omap in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html PGP.sig Description: This is a digitally signed message part
Re: [PATCH] Load triton2 scripts.
* Kalle Jokiniemi [EMAIL PROTECTED] [080825 03:28]: From: ext Peter 'p2' De Schrijver [EMAIL PROTECTED] This patch loads the triton2 (twl4030) with scripts that will cut off VDD1 and VDD2 voltages when SYS_OFF_MODE signal is set. Pushing today. I guess we should remove the CONFIG_DISABLE_HFCLK at some point? Tony Signed-off-by: Peter 'p2' De Schrijver [EMAIL PROTECTED] Signed-off-by: Kalle Jokiniemi [EMAIL PROTECTED] --- drivers/i2c/chips/Makefile|2 +- drivers/i2c/chips/twl4030-power.c | 337 + 2 files changed, 338 insertions(+), 1 deletions(-) create mode 100644 drivers/i2c/chips/twl4030-power.c diff --git a/drivers/i2c/chips/Makefile b/drivers/i2c/chips/Makefile index 9e245b1..ad5f5db 100644 --- a/drivers/i2c/chips/Makefile +++ b/drivers/i2c/chips/Makefile @@ -24,7 +24,7 @@ obj-$(CONFIG_GPIOEXPANDER_OMAP) += gpio_expander_omap.o obj-$(CONFIG_MENELAUS) += menelaus.o obj-$(CONFIG_SENSORS_TSL2550)+= tsl2550.o obj-$(CONFIG_SENSORS_TSL2563)+= tsl2563.o -obj-$(CONFIG_TWL4030_CORE) += twl4030-core.o twl4030-pwrirq.o +obj-$(CONFIG_TWL4030_CORE) += twl4030-core.o twl4030-pwrirq.o twl4030-power.o obj-$(CONFIG_TWL4030_GPIO) += twl4030-gpio.o obj-$(CONFIG_TWL4030_USB)+= twl4030-usb.o obj-$(CONFIG_TWL4030_POWEROFF) += twl4030-poweroff.o diff --git a/drivers/i2c/chips/twl4030-power.c b/drivers/i2c/chips/twl4030-power.c new file mode 100644 index 000..195c3c4 --- /dev/null +++ b/drivers/i2c/chips/twl4030-power.c @@ -0,0 +1,337 @@ +/* + * linux/drivers/i2c/chips/twl4030-power.c + * + * Handle TWL4030 Power initialization + * + * Copyright (C) 2008 Nokia Corporation + * Copyright (C) 2006 Texas Instruments, Inc + * + * Written byKalle Jokiniemi + * Peter De Schrijver [EMAIL PROTECTED] + * + * This file is subject to the terms and conditions of the GNU General + * Public License. See the file COPYING in the main directory of this + * archive for more details. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include linux/module.h +#include linux/pm.h +#include linux/i2c/twl4030.h + +#define PWR_P1_SW_EVENTS 0x10 +#define PWR_DEVOFF (10) + +#define PHY_TO_OFF_PM_MASTER(p) (p - 0x36) +#define PHY_TO_OFF_PM_RECIEVER(p)(p - 0x5b) + +/* resource - hfclk */ +#define R_HFCLKOUT_DEV_GRP PHY_TO_OFF_PM_RECIEVER(0xe6) + +/* PM events */ +#define R_P1_SW_EVENTS PHY_TO_OFF_PM_MASTER(0x46) +#define R_P2_SW_EVENTS PHY_TO_OFF_PM_MASTER(0x47) +#define R_P3_SW_EVENTS PHY_TO_OFF_PM_MASTER(0x48) +#define R_CFG_P1_TRANSITION PHY_TO_OFF_PM_MASTER(0x36) +#define R_CFG_P2_TRANSITION PHY_TO_OFF_PM_MASTER(0x37) +#define R_CFG_P3_TRANSITION PHY_TO_OFF_PM_MASTER(0x38) + +#define LVL_WAKEUP 0x08 + +#define ENABLE_WARMRESET (14) + +/* sequence script */ + +#define END_OF_SCRIPT0x3f + +#define R_SEQ_ADD_A2SPHY_TO_OFF_PM_MASTER(0x55) +#define R_SEQ_ADD_SA12 PHY_TO_OFF_PM_MASTER(0x56) +#define R_SEQ_ADD_S2A3 PHY_TO_OFF_PM_MASTER(0x57) +#define R_SEQ_ADD_WARM PHY_TO_OFF_PM_MASTER(0x58) +#define R_MEMORY_ADDRESS PHY_TO_OFF_PM_MASTER(0x59) +#define R_MEMORY_DATAPHY_TO_OFF_PM_MASTER(0x5a) + +/* Power bus message definitions */ + +#define DEV_GRP_NULL 0x0 +#define DEV_GRP_P1 0x1 +#define DEV_GRP_P2 0x2 +#define DEV_GRP_P3 0x4 + +#define RES_GRP_RES 0x0 +#define RES_GRP_PP 0x1 +#define RES_GRP_RC 0x2 +#define RES_GRP_PP_RC0x3 +#define RES_GRP_PR 0x4 +#define RES_GRP_PP_PR0x5 +#define RES_GRP_RC_PR0x6 +#define RES_GRP_ALL 0x7 + +#define RES_TYPE2_R0 0x0 + +#define RES_TYPE_ALL 0x7 + +#define RES_STATE_WRST 0xF +#define RES_STATE_ACTIVE 0xE +#define RES_STATE_SLEEP 0x8 +#define RES_STATE_OFF0x0 + +/* +*Power Bus Message Format +* +*Broadcast Message (16 Bits) +*DEV_GRP[15:13] MT[12] RES_GRP[11:9] RES_TYPE2[8:7] RES_TYPE[6:4] +*RES_STATE[3:0] +* +*Singular Message (16 Bits) +*DEV_GRP[15:13] MT[12] RES_ID[11:4] RES_STATE[3:0] +* +*/ + +#define MSG_BROADCAST(devgrp, grp, type, type2, state) \ + (devgrp 13 | 1 12 | grp 9 | type2 7 | type 4 | state) + +#define MSG_SINGULAR(devgrp,
[PATCH] Load triton2 scripts.
From: ext Peter 'p2' De Schrijver [EMAIL PROTECTED] This patch loads the triton2 (twl4030) with scripts that will cut off VDD1 and VDD2 voltages when SYS_OFF_MODE signal is set. Signed-off-by: Peter 'p2' De Schrijver [EMAIL PROTECTED] Signed-off-by: Kalle Jokiniemi [EMAIL PROTECTED] --- drivers/i2c/chips/Makefile|2 +- drivers/i2c/chips/twl4030-power.c | 337 + 2 files changed, 338 insertions(+), 1 deletions(-) create mode 100644 drivers/i2c/chips/twl4030-power.c diff --git a/drivers/i2c/chips/Makefile b/drivers/i2c/chips/Makefile index 9e245b1..ad5f5db 100644 --- a/drivers/i2c/chips/Makefile +++ b/drivers/i2c/chips/Makefile @@ -24,7 +24,7 @@ obj-$(CONFIG_GPIOEXPANDER_OMAP) += gpio_expander_omap.o obj-$(CONFIG_MENELAUS) += menelaus.o obj-$(CONFIG_SENSORS_TSL2550) += tsl2550.o obj-$(CONFIG_SENSORS_TSL2563) += tsl2563.o -obj-$(CONFIG_TWL4030_CORE) += twl4030-core.o twl4030-pwrirq.o +obj-$(CONFIG_TWL4030_CORE) += twl4030-core.o twl4030-pwrirq.o twl4030-power.o obj-$(CONFIG_TWL4030_GPIO) += twl4030-gpio.o obj-$(CONFIG_TWL4030_USB) += twl4030-usb.o obj-$(CONFIG_TWL4030_POWEROFF) += twl4030-poweroff.o diff --git a/drivers/i2c/chips/twl4030-power.c b/drivers/i2c/chips/twl4030-power.c new file mode 100644 index 000..195c3c4 --- /dev/null +++ b/drivers/i2c/chips/twl4030-power.c @@ -0,0 +1,337 @@ +/* + * linux/drivers/i2c/chips/twl4030-power.c + * + * Handle TWL4030 Power initialization + * + * Copyright (C) 2008 Nokia Corporation + * Copyright (C) 2006 Texas Instruments, Inc + * + * Written by Kalle Jokiniemi + * Peter De Schrijver [EMAIL PROTECTED] + * + * This file is subject to the terms and conditions of the GNU General + * Public License. See the file COPYING in the main directory of this + * archive for more details. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include linux/module.h +#include linux/pm.h +#include linux/i2c/twl4030.h + +#define PWR_P1_SW_EVENTS 0x10 +#define PWR_DEVOFF (10) + +#define PHY_TO_OFF_PM_MASTER(p)(p - 0x36) +#define PHY_TO_OFF_PM_RECIEVER(p) (p - 0x5b) + +/* resource - hfclk */ +#define R_HFCLKOUT_DEV_GRP PHY_TO_OFF_PM_RECIEVER(0xe6) + +/* PM events */ +#define R_P1_SW_EVENTS PHY_TO_OFF_PM_MASTER(0x46) +#define R_P2_SW_EVENTS PHY_TO_OFF_PM_MASTER(0x47) +#define R_P3_SW_EVENTS PHY_TO_OFF_PM_MASTER(0x48) +#define R_CFG_P1_TRANSITIONPHY_TO_OFF_PM_MASTER(0x36) +#define R_CFG_P2_TRANSITIONPHY_TO_OFF_PM_MASTER(0x37) +#define R_CFG_P3_TRANSITIONPHY_TO_OFF_PM_MASTER(0x38) + +#define LVL_WAKEUP 0x08 + +#define ENABLE_WARMRESET (14) + +/* sequence script */ + +#define END_OF_SCRIPT 0x3f + +#define R_SEQ_ADD_A2S PHY_TO_OFF_PM_MASTER(0x55) +#define R_SEQ_ADD_SA12 PHY_TO_OFF_PM_MASTER(0x56) +#defineR_SEQ_ADD_S2A3 PHY_TO_OFF_PM_MASTER(0x57) +#defineR_SEQ_ADD_WARM PHY_TO_OFF_PM_MASTER(0x58) +#define R_MEMORY_ADDRESS PHY_TO_OFF_PM_MASTER(0x59) +#define R_MEMORY_DATA PHY_TO_OFF_PM_MASTER(0x5a) + +/* Power bus message definitions */ + +#define DEV_GRP_NULL 0x0 +#define DEV_GRP_P1 0x1 +#define DEV_GRP_P2 0x2 +#define DEV_GRP_P3 0x4 + +#define RES_GRP_RES0x0 +#define RES_GRP_PP 0x1 +#define RES_GRP_RC 0x2 +#define RES_GRP_PP_RC 0x3 +#define RES_GRP_PR 0x4 +#define RES_GRP_PP_PR 0x5 +#define RES_GRP_RC_PR 0x6 +#define RES_GRP_ALL0x7 + +#define RES_TYPE2_R0 0x0 + +#define RES_TYPE_ALL 0x7 + +#define RES_STATE_WRST 0xF +#define RES_STATE_ACTIVE 0xE +#define RES_STATE_SLEEP0x8 +#define RES_STATE_OFF 0x0 + +/* +* Power Bus Message Format +* +* Broadcast Message (16 Bits) +* DEV_GRP[15:13] MT[12] RES_GRP[11:9] RES_TYPE2[8:7] RES_TYPE[6:4] +* RES_STATE[3:0] +* +* Singular Message (16 Bits) +* DEV_GRP[15:13] MT[12] RES_ID[11:4] RES_STATE[3:0] +* +*/ + +#define MSG_BROADCAST(devgrp, grp, type, type2, state) \ + (devgrp 13 | 1 12 | grp 9 | type2 7 | type 4 | state) + +#define MSG_SINGULAR(devgrp, id, state) \ + (devgrp 13 | 0 12 | id 4 | state) + +#define R_PROTECT_KEY 0x0E +#define KEY_1 0xC0 +#define KEY_2 0x0C + +struct triton_ins { + u16 pmb_message; + u8 delay; +}; + + +#define CONFIG_DISABLE_HFCLK 1 + +#if
Re: [PATCH] Load triton2 scripts.
On ma, 2008-08-18 at 16:31 +0300, ext Tony Lindgren wrote: * Kalle Jokiniemi [EMAIL PROTECTED] [080807 13:10]: Hi Tony, This patch should be safe to apply now as the sys off mode pin polarity was fixed in the patch Add early init for voltage controller configuration and off mode polarity (index a6cfc46..fc72c11 100644). I compile boot tested it on SDP board, on both plain master branch and with Jouni's workarounds. Works for me. Hmm, just to confirm... Isn't this one already applied modified with commits 07667f11a9864671bcec35dd0ee36e47cb3f675c and 3238fb156cf77b537b2df8d897fe62a7feab4939? Can you please check and let me know if something still needs to be patched. I checked. No, those patches do not apply the triton2 script loading. They configure the voltage controller and set the off-mode polarity, which are needed before applying the triton script loading patch. So you still need to apply the Load triton2 scripts patch sent by Peter De Schrijver. If you wish, I can resend it. regards, Kalle Thanks, Tony regards, Kalle On ma, 2008-07-21 at 19:17 +0300, ext Peter 'p2' De Schrijver wrote: Signed-off-by: Peter 'p2' De Schrijver [EMAIL PROTECTED] --- drivers/i2c/chips/Makefile|2 +- drivers/i2c/chips/twl4030-power.c | 337 + 2 files changed, 338 insertions(+), 1 deletions(-) create mode 100644 drivers/i2c/chips/twl4030-power.c diff --git a/drivers/i2c/chips/Makefile b/drivers/i2c/chips/Makefile index 1f81ebd..a44e617 100644 --- a/drivers/i2c/chips/Makefile +++ b/drivers/i2c/chips/Makefile @@ -23,7 +23,7 @@ obj-$(CONFIG_GPIOEXPANDER_OMAP) += gpio_expander_omap.o obj-$(CONFIG_MENELAUS) += menelaus.o obj-$(CONFIG_SENSORS_TSL2550)+= tsl2550.o obj-$(CONFIG_SENSORS_TSL2563)+= tsl2563.o -obj-$(CONFIG_TWL4030_CORE) += twl4030-core.o twl4030-pwrirq.o +obj-$(CONFIG_TWL4030_CORE) += twl4030-core.o twl4030-pwrirq.o twl4030-power.o obj-$(CONFIG_TWL4030_GPIO) += twl4030-gpio.o obj-$(CONFIG_TWL4030_USB)+= twl4030-usb.o obj-$(CONFIG_TWL4030_POWEROFF) += twl4030-poweroff.o diff --git a/drivers/i2c/chips/twl4030-power.c b/drivers/i2c/chips/twl4030-power.c new file mode 100644 index 000..195c3c4 --- /dev/null +++ b/drivers/i2c/chips/twl4030-power.c @@ -0,0 +1,337 @@ +/* + * linux/drivers/i2c/chips/twl4030-power.c + * + * Handle TWL4030 Power initialization + * + * Copyright (C) 2008 Nokia Corporation + * Copyright (C) 2006 Texas Instruments, Inc + * + * Written byKalle Jokiniemi + * Peter De Schrijver [EMAIL PROTECTED] + * + * This file is subject to the terms and conditions of the GNU General + * Public License. See the file COPYING in the main directory of this + * archive for more details. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include linux/module.h +#include linux/pm.h +#include linux/i2c/twl4030.h + +#define PWR_P1_SW_EVENTS 0x10 +#define PWR_DEVOFF (10) + +#define PHY_TO_OFF_PM_MASTER(p) (p - 0x36) +#define PHY_TO_OFF_PM_RECIEVER(p)(p - 0x5b) + +/* resource - hfclk */ +#define R_HFCLKOUT_DEV_GRP PHY_TO_OFF_PM_RECIEVER(0xe6) + +/* PM events */ +#define R_P1_SW_EVENTS PHY_TO_OFF_PM_MASTER(0x46) +#define R_P2_SW_EVENTS PHY_TO_OFF_PM_MASTER(0x47) +#define R_P3_SW_EVENTS PHY_TO_OFF_PM_MASTER(0x48) +#define R_CFG_P1_TRANSITION PHY_TO_OFF_PM_MASTER(0x36) +#define R_CFG_P2_TRANSITION PHY_TO_OFF_PM_MASTER(0x37) +#define R_CFG_P3_TRANSITION PHY_TO_OFF_PM_MASTER(0x38) + +#define LVL_WAKEUP 0x08 + +#define ENABLE_WARMRESET (14) + +/* sequence script */ + +#define END_OF_SCRIPT0x3f + +#define R_SEQ_ADD_A2SPHY_TO_OFF_PM_MASTER(0x55) +#define R_SEQ_ADD_SA12 PHY_TO_OFF_PM_MASTER(0x56) +#define R_SEQ_ADD_S2A3 PHY_TO_OFF_PM_MASTER(0x57) +#define R_SEQ_ADD_WARM PHY_TO_OFF_PM_MASTER(0x58) +#define R_MEMORY_ADDRESS PHY_TO_OFF_PM_MASTER(0x59) +#define R_MEMORY_DATAPHY_TO_OFF_PM_MASTER(0x5a) + +/* Power bus message definitions */ + +#define DEV_GRP_NULL 0x0 +#define DEV_GRP_P1 0x1 +#define DEV_GRP_P2 0x2 +#define DEV_GRP_P3 0x4 + +#define
Re: [PATCH] Load triton2 scripts.
* Kalle Jokiniemi [EMAIL PROTECTED] [080807 13:10]: Hi Tony, This patch should be safe to apply now as the sys off mode pin polarity was fixed in the patch Add early init for voltage controller configuration and off mode polarity (index a6cfc46..fc72c11 100644). I compile boot tested it on SDP board, on both plain master branch and with Jouni's workarounds. Works for me. Hmm, just to confirm... Isn't this one already applied modified with commits 07667f11a9864671bcec35dd0ee36e47cb3f675c and 3238fb156cf77b537b2df8d897fe62a7feab4939? Can you please check and let me know if something still needs to be patched. Thanks, Tony regards, Kalle On ma, 2008-07-21 at 19:17 +0300, ext Peter 'p2' De Schrijver wrote: Signed-off-by: Peter 'p2' De Schrijver [EMAIL PROTECTED] --- drivers/i2c/chips/Makefile|2 +- drivers/i2c/chips/twl4030-power.c | 337 + 2 files changed, 338 insertions(+), 1 deletions(-) create mode 100644 drivers/i2c/chips/twl4030-power.c diff --git a/drivers/i2c/chips/Makefile b/drivers/i2c/chips/Makefile index 1f81ebd..a44e617 100644 --- a/drivers/i2c/chips/Makefile +++ b/drivers/i2c/chips/Makefile @@ -23,7 +23,7 @@ obj-$(CONFIG_GPIOEXPANDER_OMAP) += gpio_expander_omap.o obj-$(CONFIG_MENELAUS) += menelaus.o obj-$(CONFIG_SENSORS_TSL2550) += tsl2550.o obj-$(CONFIG_SENSORS_TSL2563) += tsl2563.o -obj-$(CONFIG_TWL4030_CORE) += twl4030-core.o twl4030-pwrirq.o +obj-$(CONFIG_TWL4030_CORE) += twl4030-core.o twl4030-pwrirq.o twl4030-power.o obj-$(CONFIG_TWL4030_GPIO) += twl4030-gpio.o obj-$(CONFIG_TWL4030_USB) += twl4030-usb.o obj-$(CONFIG_TWL4030_POWEROFF) += twl4030-poweroff.o diff --git a/drivers/i2c/chips/twl4030-power.c b/drivers/i2c/chips/twl4030-power.c new file mode 100644 index 000..195c3c4 --- /dev/null +++ b/drivers/i2c/chips/twl4030-power.c @@ -0,0 +1,337 @@ +/* + * linux/drivers/i2c/chips/twl4030-power.c + * + * Handle TWL4030 Power initialization + * + * Copyright (C) 2008 Nokia Corporation + * Copyright (C) 2006 Texas Instruments, Inc + * + * Written by Kalle Jokiniemi + * Peter De Schrijver [EMAIL PROTECTED] + * + * This file is subject to the terms and conditions of the GNU General + * Public License. See the file COPYING in the main directory of this + * archive for more details. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include linux/module.h +#include linux/pm.h +#include linux/i2c/twl4030.h + +#define PWR_P1_SW_EVENTS 0x10 +#define PWR_DEVOFF (10) + +#define PHY_TO_OFF_PM_MASTER(p)(p - 0x36) +#define PHY_TO_OFF_PM_RECIEVER(p) (p - 0x5b) + +/* resource - hfclk */ +#define R_HFCLKOUT_DEV_GRP PHY_TO_OFF_PM_RECIEVER(0xe6) + +/* PM events */ +#define R_P1_SW_EVENTS PHY_TO_OFF_PM_MASTER(0x46) +#define R_P2_SW_EVENTS PHY_TO_OFF_PM_MASTER(0x47) +#define R_P3_SW_EVENTS PHY_TO_OFF_PM_MASTER(0x48) +#define R_CFG_P1_TRANSITIONPHY_TO_OFF_PM_MASTER(0x36) +#define R_CFG_P2_TRANSITIONPHY_TO_OFF_PM_MASTER(0x37) +#define R_CFG_P3_TRANSITIONPHY_TO_OFF_PM_MASTER(0x38) + +#define LVL_WAKEUP 0x08 + +#define ENABLE_WARMRESET (14) + +/* sequence script */ + +#define END_OF_SCRIPT 0x3f + +#define R_SEQ_ADD_A2S PHY_TO_OFF_PM_MASTER(0x55) +#define R_SEQ_ADD_SA12 PHY_TO_OFF_PM_MASTER(0x56) +#defineR_SEQ_ADD_S2A3 PHY_TO_OFF_PM_MASTER(0x57) +#defineR_SEQ_ADD_WARM PHY_TO_OFF_PM_MASTER(0x58) +#define R_MEMORY_ADDRESS PHY_TO_OFF_PM_MASTER(0x59) +#define R_MEMORY_DATA PHY_TO_OFF_PM_MASTER(0x5a) + +/* Power bus message definitions */ + +#define DEV_GRP_NULL 0x0 +#define DEV_GRP_P1 0x1 +#define DEV_GRP_P2 0x2 +#define DEV_GRP_P3 0x4 + +#define RES_GRP_RES0x0 +#define RES_GRP_PP 0x1 +#define RES_GRP_RC 0x2 +#define RES_GRP_PP_RC 0x3 +#define RES_GRP_PR 0x4 +#define RES_GRP_PP_PR 0x5 +#define RES_GRP_RC_PR 0x6 +#define RES_GRP_ALL0x7 + +#define RES_TYPE2_R0 0x0 + +#define RES_TYPE_ALL 0x7 + +#define RES_STATE_WRST 0xF +#define RES_STATE_ACTIVE 0xE +#define RES_STATE_SLEEP0x8 +#define RES_STATE_OFF
Re: [PATCH] Load triton2 scripts.
Hi Tony, This patch should be safe to apply now as the sys off mode pin polarity was fixed in the patch Add early init for voltage controller configuration and off mode polarity (index a6cfc46..fc72c11 100644). I compile boot tested it on SDP board, on both plain master branch and with Jouni's workarounds. Works for me. regards, Kalle On ma, 2008-07-21 at 19:17 +0300, ext Peter 'p2' De Schrijver wrote: Signed-off-by: Peter 'p2' De Schrijver [EMAIL PROTECTED] --- drivers/i2c/chips/Makefile|2 +- drivers/i2c/chips/twl4030-power.c | 337 + 2 files changed, 338 insertions(+), 1 deletions(-) create mode 100644 drivers/i2c/chips/twl4030-power.c diff --git a/drivers/i2c/chips/Makefile b/drivers/i2c/chips/Makefile index 1f81ebd..a44e617 100644 --- a/drivers/i2c/chips/Makefile +++ b/drivers/i2c/chips/Makefile @@ -23,7 +23,7 @@ obj-$(CONFIG_GPIOEXPANDER_OMAP) += gpio_expander_omap.o obj-$(CONFIG_MENELAUS) += menelaus.o obj-$(CONFIG_SENSORS_TSL2550)+= tsl2550.o obj-$(CONFIG_SENSORS_TSL2563)+= tsl2563.o -obj-$(CONFIG_TWL4030_CORE) += twl4030-core.o twl4030-pwrirq.o +obj-$(CONFIG_TWL4030_CORE) += twl4030-core.o twl4030-pwrirq.o twl4030-power.o obj-$(CONFIG_TWL4030_GPIO) += twl4030-gpio.o obj-$(CONFIG_TWL4030_USB)+= twl4030-usb.o obj-$(CONFIG_TWL4030_POWEROFF) += twl4030-poweroff.o diff --git a/drivers/i2c/chips/twl4030-power.c b/drivers/i2c/chips/twl4030-power.c new file mode 100644 index 000..195c3c4 --- /dev/null +++ b/drivers/i2c/chips/twl4030-power.c @@ -0,0 +1,337 @@ +/* + * linux/drivers/i2c/chips/twl4030-power.c + * + * Handle TWL4030 Power initialization + * + * Copyright (C) 2008 Nokia Corporation + * Copyright (C) 2006 Texas Instruments, Inc + * + * Written byKalle Jokiniemi + * Peter De Schrijver [EMAIL PROTECTED] + * + * This file is subject to the terms and conditions of the GNU General + * Public License. See the file COPYING in the main directory of this + * archive for more details. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include linux/module.h +#include linux/pm.h +#include linux/i2c/twl4030.h + +#define PWR_P1_SW_EVENTS 0x10 +#define PWR_DEVOFF (10) + +#define PHY_TO_OFF_PM_MASTER(p) (p - 0x36) +#define PHY_TO_OFF_PM_RECIEVER(p)(p - 0x5b) + +/* resource - hfclk */ +#define R_HFCLKOUT_DEV_GRP PHY_TO_OFF_PM_RECIEVER(0xe6) + +/* PM events */ +#define R_P1_SW_EVENTS PHY_TO_OFF_PM_MASTER(0x46) +#define R_P2_SW_EVENTS PHY_TO_OFF_PM_MASTER(0x47) +#define R_P3_SW_EVENTS PHY_TO_OFF_PM_MASTER(0x48) +#define R_CFG_P1_TRANSITION PHY_TO_OFF_PM_MASTER(0x36) +#define R_CFG_P2_TRANSITION PHY_TO_OFF_PM_MASTER(0x37) +#define R_CFG_P3_TRANSITION PHY_TO_OFF_PM_MASTER(0x38) + +#define LVL_WAKEUP 0x08 + +#define ENABLE_WARMRESET (14) + +/* sequence script */ + +#define END_OF_SCRIPT0x3f + +#define R_SEQ_ADD_A2SPHY_TO_OFF_PM_MASTER(0x55) +#define R_SEQ_ADD_SA12 PHY_TO_OFF_PM_MASTER(0x56) +#define R_SEQ_ADD_S2A3 PHY_TO_OFF_PM_MASTER(0x57) +#define R_SEQ_ADD_WARM PHY_TO_OFF_PM_MASTER(0x58) +#define R_MEMORY_ADDRESS PHY_TO_OFF_PM_MASTER(0x59) +#define R_MEMORY_DATAPHY_TO_OFF_PM_MASTER(0x5a) + +/* Power bus message definitions */ + +#define DEV_GRP_NULL 0x0 +#define DEV_GRP_P1 0x1 +#define DEV_GRP_P2 0x2 +#define DEV_GRP_P3 0x4 + +#define RES_GRP_RES 0x0 +#define RES_GRP_PP 0x1 +#define RES_GRP_RC 0x2 +#define RES_GRP_PP_RC0x3 +#define RES_GRP_PR 0x4 +#define RES_GRP_PP_PR0x5 +#define RES_GRP_RC_PR0x6 +#define RES_GRP_ALL 0x7 + +#define RES_TYPE2_R0 0x0 + +#define RES_TYPE_ALL 0x7 + +#define RES_STATE_WRST 0xF +#define RES_STATE_ACTIVE 0xE +#define RES_STATE_SLEEP 0x8 +#define RES_STATE_OFF0x0 + +/* +*Power Bus Message Format +* +*Broadcast Message (16 Bits) +*DEV_GRP[15:13] MT[12] RES_GRP[11:9] RES_TYPE2[8:7] RES_TYPE[6:4] +*RES_STATE[3:0] +* +*Singular Message (16 Bits) +*DEV_GRP[15:13] MT[12] RES_ID[11:4] RES_STATE[3:0] +* +*/ + +#define MSG_BROADCAST(devgrp, grp, type, type2, state) \ + (devgrp 13 | 1 12 | grp 9 | type2 7 | type 4 |
[PATCH] Load triton2 scripts.
Signed-off-by: Peter 'p2' De Schrijver [EMAIL PROTECTED] --- drivers/i2c/chips/Makefile|2 +- drivers/i2c/chips/twl4030-power.c | 337 + 2 files changed, 338 insertions(+), 1 deletions(-) create mode 100644 drivers/i2c/chips/twl4030-power.c diff --git a/drivers/i2c/chips/Makefile b/drivers/i2c/chips/Makefile index 1f81ebd..a44e617 100644 --- a/drivers/i2c/chips/Makefile +++ b/drivers/i2c/chips/Makefile @@ -23,7 +23,7 @@ obj-$(CONFIG_GPIOEXPANDER_OMAP) += gpio_expander_omap.o obj-$(CONFIG_MENELAUS) += menelaus.o obj-$(CONFIG_SENSORS_TSL2550) += tsl2550.o obj-$(CONFIG_SENSORS_TSL2563) += tsl2563.o -obj-$(CONFIG_TWL4030_CORE) += twl4030-core.o twl4030-pwrirq.o +obj-$(CONFIG_TWL4030_CORE) += twl4030-core.o twl4030-pwrirq.o twl4030-power.o obj-$(CONFIG_TWL4030_GPIO) += twl4030-gpio.o obj-$(CONFIG_TWL4030_USB) += twl4030-usb.o obj-$(CONFIG_TWL4030_POWEROFF) += twl4030-poweroff.o diff --git a/drivers/i2c/chips/twl4030-power.c b/drivers/i2c/chips/twl4030-power.c new file mode 100644 index 000..195c3c4 --- /dev/null +++ b/drivers/i2c/chips/twl4030-power.c @@ -0,0 +1,337 @@ +/* + * linux/drivers/i2c/chips/twl4030-power.c + * + * Handle TWL4030 Power initialization + * + * Copyright (C) 2008 Nokia Corporation + * Copyright (C) 2006 Texas Instruments, Inc + * + * Written by Kalle Jokiniemi + * Peter De Schrijver [EMAIL PROTECTED] + * + * This file is subject to the terms and conditions of the GNU General + * Public License. See the file COPYING in the main directory of this + * archive for more details. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include linux/module.h +#include linux/pm.h +#include linux/i2c/twl4030.h + +#define PWR_P1_SW_EVENTS 0x10 +#define PWR_DEVOFF (10) + +#define PHY_TO_OFF_PM_MASTER(p)(p - 0x36) +#define PHY_TO_OFF_PM_RECIEVER(p) (p - 0x5b) + +/* resource - hfclk */ +#define R_HFCLKOUT_DEV_GRP PHY_TO_OFF_PM_RECIEVER(0xe6) + +/* PM events */ +#define R_P1_SW_EVENTS PHY_TO_OFF_PM_MASTER(0x46) +#define R_P2_SW_EVENTS PHY_TO_OFF_PM_MASTER(0x47) +#define R_P3_SW_EVENTS PHY_TO_OFF_PM_MASTER(0x48) +#define R_CFG_P1_TRANSITIONPHY_TO_OFF_PM_MASTER(0x36) +#define R_CFG_P2_TRANSITIONPHY_TO_OFF_PM_MASTER(0x37) +#define R_CFG_P3_TRANSITIONPHY_TO_OFF_PM_MASTER(0x38) + +#define LVL_WAKEUP 0x08 + +#define ENABLE_WARMRESET (14) + +/* sequence script */ + +#define END_OF_SCRIPT 0x3f + +#define R_SEQ_ADD_A2S PHY_TO_OFF_PM_MASTER(0x55) +#define R_SEQ_ADD_SA12 PHY_TO_OFF_PM_MASTER(0x56) +#defineR_SEQ_ADD_S2A3 PHY_TO_OFF_PM_MASTER(0x57) +#defineR_SEQ_ADD_WARM PHY_TO_OFF_PM_MASTER(0x58) +#define R_MEMORY_ADDRESS PHY_TO_OFF_PM_MASTER(0x59) +#define R_MEMORY_DATA PHY_TO_OFF_PM_MASTER(0x5a) + +/* Power bus message definitions */ + +#define DEV_GRP_NULL 0x0 +#define DEV_GRP_P1 0x1 +#define DEV_GRP_P2 0x2 +#define DEV_GRP_P3 0x4 + +#define RES_GRP_RES0x0 +#define RES_GRP_PP 0x1 +#define RES_GRP_RC 0x2 +#define RES_GRP_PP_RC 0x3 +#define RES_GRP_PR 0x4 +#define RES_GRP_PP_PR 0x5 +#define RES_GRP_RC_PR 0x6 +#define RES_GRP_ALL0x7 + +#define RES_TYPE2_R0 0x0 + +#define RES_TYPE_ALL 0x7 + +#define RES_STATE_WRST 0xF +#define RES_STATE_ACTIVE 0xE +#define RES_STATE_SLEEP0x8 +#define RES_STATE_OFF 0x0 + +/* +* Power Bus Message Format +* +* Broadcast Message (16 Bits) +* DEV_GRP[15:13] MT[12] RES_GRP[11:9] RES_TYPE2[8:7] RES_TYPE[6:4] +* RES_STATE[3:0] +* +* Singular Message (16 Bits) +* DEV_GRP[15:13] MT[12] RES_ID[11:4] RES_STATE[3:0] +* +*/ + +#define MSG_BROADCAST(devgrp, grp, type, type2, state) \ + (devgrp 13 | 1 12 | grp 9 | type2 7 | type 4 | state) + +#define MSG_SINGULAR(devgrp, id, state) \ + (devgrp 13 | 0 12 | id 4 | state) + +#define R_PROTECT_KEY 0x0E +#define KEY_1 0xC0 +#define KEY_2 0x0C + +struct triton_ins { + u16 pmb_message; + u8 delay; +}; + + +#define CONFIG_DISABLE_HFCLK 1 + +#if defined(CONFIG_MACH_OMAP_3430SDP) || defined(CONFIG_MACH_OMAP_3430LABRADOR) + +struct triton_ins sleep_on_seq[] __initdata = { + {MSG_SINGULAR(DEV_GRP_P1, 0xf, RES_STATE_OFF), 4}, + {MSG_SINGULAR(DEV_GRP_P1, 0x10, RES_STATE_OFF), 2},
Re: [PATCH] Load triton2 scripts.
On Mon, Jul 21, 2008 at 07:02:05PM +0300, Peter 'p2' De Schrijver wrote: +/* +*Power Bus Message Format +* +*Broadcast Message (16 Bits) +*DEV_GRP[15:13] MT[12] RES_GRP[11:9] RES_TYPE2[8:7] RES_TYPE[6:4] +*RES_STATE[3:0] +* +*Singular Message (16 Bits) +*DEV_GRP[15:13] MT[12] RES_ID[11:4] RES_STATE[3:0] +* +*/ This comment should follow the coding style: /* * Power Bus Message Format * * Broadcast Message (16 Bits) * DEV_GRP[15:13] MT[12] RES_GRP[11:9] RES_TYPE2[8:7] RES_TYPE[6:4] * RES_STATE[3:0] * * Singular Message (16 Bits) * DEV_GRP[15:13] MT[12] RES_ID[11:4] RES_STATE[3:0] */ +struct triton_ins { + u16 pmb_message; + u8 delay; +}; + + extra line +#define CONFIG_DISABLE_HFCLK 1 + +#if defined(CONFIG_MACH_OMAP_3430SDP) || defined(CONFIG_MACH_OMAP_3430LABRADOR) + +struct triton_ins sleep_on_seq[] __initdata = { + {MSG_SINGULAR(DEV_GRP_P1, 0xf, RES_STATE_OFF), 4}, could you add spaces here?? { MSG_SINGULAR(DEV_GRP_P1, 0xf, RES_STATE_OFF), 4 }, -- balbi -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html