linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] Integrate the twl4030 power code into new twl4030 mfd
@ 2008-10-15 13:37 Peter 'p2' De Schrijver
  0 siblings, 0 replies; 14+ messages in thread
From: Peter 'p2' De Schrijver @ 2008-10-15 13:37 UTC (permalink / raw)
  To: linux-omap; +Cc: Peter 'p2' De Schrijver

This patchset integrates the twl4030 power code into the new twl4030 mfd framework. The scripts will be moved to the board specific data.

Peter 'p2' De Schrijver (6):
  Add defines and data types for twl4030.
  Move existing TWL4030 code to drivers/mfd
  Hook twl4030 power code into twl4030 core.
  3430sdp and ldp use custom twl4030 power scripts.
  Generic twl4030 power script for 3430 based boards.
  omap3 evm, beagle and overo use the generic twl4030 script

 arch/arm/mach-omap2/Makefile                  |    9 +-
 arch/arm/mach-omap2/board-3430sdp.c           |   84 ++++++
 arch/arm/mach-omap2/board-ldp.c               |   84 ++++++
 arch/arm/mach-omap2/board-omap3beagle.c       |    4 +-
 arch/arm/mach-omap2/board-omap3evm.c          |    4 +-
 arch/arm/mach-omap2/board-overo.c             |    4 +-
 arch/arm/mach-omap2/twl4030-generic-scripts.c |   78 ++++++
 arch/arm/mach-omap2/twl4030-generic-scripts.h |    8 +
 drivers/i2c/chips/Makefile                    |    2 +-
 drivers/i2c/chips/twl4030-power.c             |  343 -------------------------
 drivers/mfd/Kconfig                           |    9 +
 drivers/mfd/Makefile                          |    1 +
 drivers/mfd/twl4030-core.c                    |   11 +
 drivers/mfd/twl4030-power.c                   |  270 +++++++++++++++++++
 include/linux/i2c/twl4030.h                   |   64 +++++
 15 files changed, 622 insertions(+), 353 deletions(-)
 create mode 100644 arch/arm/mach-omap2/twl4030-generic-scripts.c
 create mode 100644 arch/arm/mach-omap2/twl4030-generic-scripts.h
 delete mode 100644 drivers/i2c/chips/twl4030-power.c
 create mode 100644 drivers/mfd/twl4030-power.c


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 0/6] Integrate the twl4030 power code into new twl4030 mfd
@ 2008-10-20  8:37 Peter 'p2' De Schrijver
  2008-10-20  8:37 ` [PATCH 1/6] Add defines and data types for twl4030 Peter 'p2' De Schrijver
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Peter 'p2' De Schrijver @ 2008-10-20  8:37 UTC (permalink / raw)
  To: linux-omap; +Cc: Peter 'p2' De Schrijver

This patchset integrates the twl4030 power code into the new twl4030 mfd framework.
The scripts will be moved to the board specific data.

Peter 'p2' De Schrijver (6):
  Add defines and data types for twl4030.
  Move existing TWL4030 code to drivers/mfd
  Hook twl4030 power code into twl4030 core.
  3430sdp and ldp use custom twl4030 power scripts.
  Generic twl4030 power script for 3430 based boards.
  omap3 evm, beagle and overo use the generic twl4030 script

 arch/arm/mach-omap2/Makefile                  |    9 +-
 arch/arm/mach-omap2/board-3430sdp.c           |   84 ++++++
 arch/arm/mach-omap2/board-ldp.c               |   84 ++++++
 arch/arm/mach-omap2/board-omap3beagle.c       |    4 +-
 arch/arm/mach-omap2/board-omap3evm.c          |    4 +-
 arch/arm/mach-omap2/board-overo.c             |    4 +-
 arch/arm/mach-omap2/twl4030-generic-scripts.c |   78 ++++++
 arch/arm/mach-omap2/twl4030-generic-scripts.h |    8 +
 drivers/i2c/chips/Makefile                    |    1 -
 drivers/i2c/chips/twl4030-power.c             |  343 -------------------------
 drivers/mfd/Kconfig                           |    9 +
 drivers/mfd/Makefile                          |    1 +
 drivers/mfd/twl4030-core.c                    |   11 +
 drivers/mfd/twl4030-power.c                   |  270 +++++++++++++++++++
 include/linux/i2c/twl4030.h                   |   64 +++++
 15 files changed, 621 insertions(+), 353 deletions(-)
 create mode 100644 arch/arm/mach-omap2/twl4030-generic-scripts.c
 create mode 100644 arch/arm/mach-omap2/twl4030-generic-scripts.h
 delete mode 100644 drivers/i2c/chips/twl4030-power.c
 create mode 100644 drivers/mfd/twl4030-power.c


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 1/6] Add defines and data types for twl4030.
  2008-10-20  8:37 [PATCH 0/6] Integrate the twl4030 power code into new twl4030 mfd Peter 'p2' De Schrijver
@ 2008-10-20  8:37 ` Peter 'p2' De Schrijver
  2008-10-20  8:37   ` [PATCH 2/6] Move existing TWL4030 code to drivers/mfd Peter 'p2' De Schrijver
  2008-10-20  9:02 ` [PATCH 0/6] Integrate the twl4030 power code into new twl4030 mfd David Brownell
  2008-10-24 22:39 ` Kevin Hilman
  2 siblings, 1 reply; 14+ messages in thread
From: Peter 'p2' De Schrijver @ 2008-10-20  8:37 UTC (permalink / raw)
  To: linux-omap; +Cc: Peter 'p2' De Schrijver

This patch adds a bunch of data types and defines to handle the twl4030 power sequence scripts.

Signed-off-by: Peter 'p2' De Schrijver <peter.de-schrijver@nokia.com>
---
 include/linux/i2c/twl4030.h |   64 +++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 64 insertions(+), 0 deletions(-)

diff --git a/include/linux/i2c/twl4030.h b/include/linux/i2c/twl4030.h
index fb604dc..517e605 100644
--- a/include/linux/i2c/twl4030.h
+++ b/include/linux/i2c/twl4030.h
@@ -270,6 +270,69 @@ struct twl4030_usb_data {
 	enum twl4030_usb_mode	usb_mode;
 };
 
+struct twl4030_ins {
+	u16 pmb_message;
+	u8 delay;
+};
+
+struct twl4030_script {
+	struct twl4030_ins *script;
+	unsigned size;
+	u8 flags;
+};
+#define TRITON_WRST_SCRIPT	(1<<0)
+#define TRITON_WAKEUP12_SCRIPT	(1<<1)
+#define TRITON_WAKEUP3_SCRIPT	(1<<2)
+#define TRITON_SLEEP_SCRIPT	(1<<3)
+
+struct twl4030_power_data {
+	struct twl4030_script **scripts;
+	unsigned size;
+};
+
+/* 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_RC		0x3
+#define RES_GRP_PR		0x4
+#define RES_GRP_PP_PR		0x5
+#define RES_GRP_RC_PR		0x6
+#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_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)
+
 struct twl4030_platform_data {
 	unsigned				irq_base, irq_end;
 	struct twl4030_bci_platform_data	*bci;
@@ -277,6 +340,7 @@ struct twl4030_platform_data {
 	struct twl4030_madc_platform_data	*madc;
 	struct twl4030_keypad_data		*keypad;
 	struct twl4030_usb_data			*usb;
+	struct twl4030_power_data		*power;
 
 	/* REVISIT more to come ... _nothing_ should be hard-wired */
 };
-- 
1.5.6.3


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 2/6] Move existing TWL4030 code to drivers/mfd
  2008-10-20  8:37 ` [PATCH 1/6] Add defines and data types for twl4030 Peter 'p2' De Schrijver
@ 2008-10-20  8:37   ` Peter 'p2' De Schrijver
  2008-10-20  8:37     ` [PATCH 3/6] Hook twl4030 power code into twl4030 core Peter 'p2' De Schrijver
  0 siblings, 1 reply; 14+ messages in thread
From: Peter 'p2' De Schrijver @ 2008-10-20  8:37 UTC (permalink / raw)
  To: linux-omap; +Cc: Peter 'p2' De Schrijver

This patches moves the twl4030 power sequencer code to drivers/mfd and
updates the code for the new twl4030 framework. The code handles downloading
the scripts provided by the board configuration and configuring the chip
to call the relevant script for each event (processor group 1 and 2 sleep,
processor group 3 sleep, wakeup or warm reset).

Signed-off-by: Peter 'p2' De Schrijver <peter.de-schrijver@nokia.com>
---
 drivers/i2c/chips/Makefile        |    1 -
 drivers/i2c/chips/twl4030-power.c |  343 -------------------------------------
 drivers/mfd/twl4030-power.c       |  270 +++++++++++++++++++++++++++++
 3 files changed, 270 insertions(+), 344 deletions(-)
 delete mode 100644 drivers/i2c/chips/twl4030-power.c
 create mode 100644 drivers/mfd/twl4030-power.c

diff --git a/drivers/i2c/chips/Makefile b/drivers/i2c/chips/Makefile
index 2b6287b..07a29fe 100644
--- a/drivers/i2c/chips/Makefile
+++ b/drivers/i2c/chips/Makefile
@@ -24,7 +24,6 @@ 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-power.o
 obj-$(CONFIG_TWL4030_USB)	+= twl4030-usb.o
 obj-$(CONFIG_TWL4030_POWEROFF)	+= twl4030-poweroff.o
 obj-$(CONFIG_TWL4030_PWRBUTTON)	+= twl4030-pwrbutton.o
diff --git a/drivers/i2c/chips/twl4030-power.c b/drivers/i2c/chips/twl4030-power.c
deleted file mode 100644
index cb325b0..0000000
--- a/drivers/i2c/chips/twl4030-power.c
+++ /dev/null
@@ -1,343 +0,0 @@
-/*
- * 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 <peter.de-schrijver@nokia.com>
- *
- * 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>
-
-#include <asm/mach-types.h>
-
-#define PWR_P1_SW_EVENTS	0x10
-#define PWR_DEVOFF	(1<<0)
-
-#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 (1<<4)
-
-/* 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)
-#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_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_RES		0x0
-#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_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_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},
-#ifdef CONFIG_DISABLE_HFCLK
-	{MSG_SINGULAR(DEV_GRP_P1, 0x7, RES_STATE_OFF), 3},
-	{MSG_SINGULAR(DEV_GRP_P1, 0x19, RES_STATE_OFF), 3},
-#endif /* #ifdef CONFIG_DISABLE_HFCLK */
-};
-
-struct triton_ins sleep_off_seq[] __initdata = {
-#ifndef CONFIG_DISABLE_HFCLK
-	{MSG_SINGULAR(DEV_GRP_P1, 0xf, RES_STATE_ACTIVE), 4},
-	{MSG_SINGULAR(DEV_GRP_P1, 0x10, RES_STATE_ACTIVE), 2},
-#else
-	{MSG_SINGULAR(DEV_GRP_P1, 0x7, RES_STATE_ACTIVE), 0x30},
-	{MSG_SINGULAR(DEV_GRP_P1, 0xf, RES_STATE_ACTIVE), 0x30},
-	{MSG_SINGULAR(DEV_GRP_P1, 0x10, RES_STATE_ACTIVE), 0x37},
-	{MSG_SINGULAR(DEV_GRP_P1, 0x19, RES_STATE_ACTIVE), 3},
-#endif /* #ifndef CONFIG_DISABLE_HFCLK */
-};
-
-struct triton_ins t2_wrst_seq[] __initdata = {
-	{MSG_SINGULAR(DEV_GRP_NULL, 0x1b, RES_STATE_OFF), 2},
-	{MSG_SINGULAR(DEV_GRP_P1, 0xf, RES_STATE_WRST), 15},
-	{MSG_SINGULAR(DEV_GRP_P1, 0x10, RES_STATE_WRST), 15},
-	{MSG_SINGULAR(DEV_GRP_P1, 0x7, RES_STATE_WRST), 0x60},
-	{MSG_SINGULAR(DEV_GRP_P1, 0x19, RES_STATE_ACTIVE), 2},
-	{MSG_SINGULAR(DEV_GRP_NULL, 0x1b, RES_STATE_ACTIVE), 2},
-};
-#else
-struct triton_ins sleep_on_seq[] __initdata = {
-	{MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_RC, RES_TYPE_ALL, RES_TYPE2_R0,
-			RES_STATE_SLEEP), 4},
-	{MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_ALL, RES_TYPE_ALL, RES_TYPE2_R0,
-			RES_STATE_SLEEP), 4},
-};
-
-struct triton_ins sleep_off_seq[] __initdata = {
-	{MSG_SINGULAR(DEV_GRP_NULL, 0x17, RES_STATE_ACTIVE), 0x30},
-	{MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_PP_PR, RES_TYPE_ALL, RES_TYPE2_R0,
-			RES_STATE_ACTIVE), 0x37},
-	{MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_ALL, RES_TYPE_ALL, RES_TYPE2_R0,
-			RES_STATE_ACTIVE), 0x2},
-};
-
-struct triton_ins t2_wrst_seq[] __initdata = { };
-
-#endif
-
-static int __init twl4030_write_script_byte(u8 address, u8 byte)
-{
-	int err;
-
-	err = twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, address,
-					R_MEMORY_ADDRESS);
-	err |= twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, byte,
-					R_MEMORY_DATA);
-
-	return err;
-}
-
-static int __init twl4030_write_script_ins(u8 address, u16 pmb_message,
-						u8 delay, u8 next)
-{
-	int err = 0;
-
-	address *= 4;
-	err |= twl4030_write_script_byte(address++, pmb_message >> 8);
-	err |= twl4030_write_script_byte(address++, pmb_message & 0xff);
-	err |= twl4030_write_script_byte(address++, delay);
-	err |= twl4030_write_script_byte(address++, next);
-
-	return err;
-}
-
-static int __init twl4030_write_script(u8 address, struct triton_ins *script,
-					int len)
-{
-	int err = 0;
-
-	for (; len; len--, address++, script++) {
-		if (len == 1)
-			err |= twl4030_write_script_ins(address,
-							script->pmb_message,
-							script->delay,
-							END_OF_SCRIPT);
-		else
-			err |= twl4030_write_script_ins(address,
-							script->pmb_message,
-							script->delay,
-							address + 1);
-	}
-
-	return err;
-}
-
-static int __init config_sleep_wake_sequence(void)
-{
-	int err = 0;
-
-	/*
-	 * CLKREQ is pulled high on the 2430SDP, therefore, we need to take
-	 * it out of the HFCLKOUT DEV_GRP for P1 else HFCLKOUT can't be stopped.
-	 */
-
-	err |= twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
-				  0x20, R_HFCLKOUT_DEV_GRP);
-
-	/* Set ACTIVE to SLEEP SEQ address in T2 memory*/
-	err |= twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, 0x2B,
-				  R_SEQ_ADD_A2S);
-
-	/* Set SLEEP to ACTIVE SEQ address for P1 and P2 */
-	err |= twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, 0x2F,
-				  R_SEQ_ADD_SA12);
-
-	/* Set SLEEP to ACTIVE SEQ address for P3 */
-	err |= twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, 0x2F,
-				  R_SEQ_ADD_S2A3);
-
-	/* Install Active->Sleep (A2S) sequence */
-	err |= twl4030_write_script(0x2B, sleep_on_seq,
-					ARRAY_SIZE(sleep_on_seq));
-
-	/* Install Sleep->Active (S2A) sequence */
-	err |= twl4030_write_script(0x2F, sleep_off_seq,
-					ARRAY_SIZE(sleep_off_seq));
-
-	if (machine_is_omap_3430sdp() || machine_is_omap_ldp()) {
-		u8 data;
-		/* Disabling AC charger effect on sleep-active transitions */
-		err |= twl4030_i2c_read_u8(TWL4030_MODULE_PM_MASTER, &data,
-						R_CFG_P1_TRANSITION);
-		data &= ~(1<<1);
-		err |= twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, data ,
-						R_CFG_P1_TRANSITION);
-	}
-
-	/* P1/P2/P3 LVL_WAKEUP should be on LEVEL */
-	err |= twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, LVL_WAKEUP,
-					R_P1_SW_EVENTS);
-	err |= twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, LVL_WAKEUP,
-					R_P2_SW_EVENTS);
-	err |= twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, LVL_WAKEUP,
-				R_P3_SW_EVENTS);
-
-	if (err)
-		printk(KERN_ERR "TWL4030 sleep-wake sequence config error\n");
-
-	return err;
-}
-
-
-/* Programming the WARMRESET Sequence on TRITON */
-static int __init config_warmreset_sequence(void)
-{
-
-	int e = 0;
-	u8 rd_data;
-
-	if (!ARRAY_SIZE(t2_wrst_seq))
-		return 0;
-
-	/* Set WARM RESET SEQ address for P1 */
-	e |= twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, 0x38,
-				R_SEQ_ADD_WARM);
-
-	/* Install Warm Reset sequence */
-	e |= twl4030_write_script(0x38, t2_wrst_seq,
-					ARRAY_SIZE(t2_wrst_seq));
-
-	/* P1/P2/P3 enable WARMRESET */
-	e |= twl4030_i2c_read_u8(TWL4030_MODULE_PM_MASTER, &rd_data,
-				R_P1_SW_EVENTS);
-	rd_data |= ENABLE_WARMRESET;
-	e |= twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, rd_data,
-				R_P1_SW_EVENTS);
-
-	e |= twl4030_i2c_read_u8(TWL4030_MODULE_PM_MASTER, &rd_data,
-				R_P2_SW_EVENTS);
-	rd_data |= ENABLE_WARMRESET;
-	e |= twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, rd_data,
-				R_P2_SW_EVENTS);
-
-	e |= twl4030_i2c_read_u8(TWL4030_MODULE_PM_MASTER, &rd_data,
-				R_P3_SW_EVENTS);
-	rd_data |= ENABLE_WARMRESET;
-	e |= twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, rd_data,
-				R_P3_SW_EVENTS);
-
-	if (e)
-		printk(KERN_ERR
-			"TWL4030 Power Companion Warmreset seq config error\n");
-	return e;
-}
-
-static int __init twl4030_power_init(void)
-{
-	int err = 0;
-
-	err = twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, KEY_1,
-				R_PROTECT_KEY);
-	err |= twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, KEY_2,
-				R_PROTECT_KEY);
-
-	if (err)
-		return err;
-
-	err = config_sleep_wake_sequence();
-	if (err)
-		return err;
-
-	err = config_warmreset_sequence();
-	if (err)
-		return err;
-
-	err = twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, 0, R_PROTECT_KEY);
-
-	return err;
-
-}
-
-module_init(twl4030_power_init);
diff --git a/drivers/mfd/twl4030-power.c b/drivers/mfd/twl4030-power.c
new file mode 100644
index 0000000..d9d1655
--- /dev/null
+++ b/drivers/mfd/twl4030-power.c
@@ -0,0 +1,270 @@
+/*
+ * 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 <peter.de-schrijver@nokia.com>
+ *
+ * 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>
+#include <linux/platform_device.h>
+
+#include <asm/mach-types.h>
+
+static u8 triton_next_free_address = 0x2b;
+
+#define PWR_P1_SW_EVENTS	0x10
+#define PWR_DEVOFF	(1<<0)
+
+#define PHY_TO_OFF_PM_MASTER(p)		(p - 0x36)
+#define PHY_TO_OFF_PM_RECEIVER(p)	(p - 0x5b)
+
+/* resource - hfclk */
+#define R_HFCLKOUT_DEV_GRP 	PHY_TO_OFF_PM_RECEIVER(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 (1<<4)
+
+#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)
+#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_DATA		PHY_TO_OFF_PM_MASTER(0x5a)
+
+#define R_PROTECT_KEY		0x0E
+#define KEY_1			0xC0
+#define KEY_2			0x0C
+
+static int __init twl4030_write_script_byte(u8 address, u8 byte)
+{
+	int err;
+
+	err = twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, address,
+					R_MEMORY_ADDRESS);
+	err |= twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, byte,
+					R_MEMORY_DATA);
+
+	return err;
+}
+
+static int __init twl4030_write_script_ins(u8 address, u16 pmb_message,
+						u8 delay, u8 next)
+{
+	int err = 0;
+
+	address *= 4;
+	err |= twl4030_write_script_byte(address++, pmb_message >> 8);
+	err |= twl4030_write_script_byte(address++, pmb_message & 0xff);
+	err |= twl4030_write_script_byte(address++, delay);
+	err |= twl4030_write_script_byte(address++, next);
+
+	return err;
+}
+
+static int __init twl4030_write_script(u8 address, struct twl4030_ins *script,
+					int len)
+{
+	int err = 0;
+
+	for (; len; len--, address++, script++) {
+		if (len == 1)
+			err |= twl4030_write_script_ins(address,
+							script->pmb_message,
+							script->delay,
+							END_OF_SCRIPT);
+		else
+			err |= twl4030_write_script_ins(address,
+							script->pmb_message,
+							script->delay,
+							address + 1);
+	}
+
+	return err;
+}
+
+static int __init config_wakeup3_sequence(u8 address)
+{
+
+	int err = 0;
+
+	/* Set SLEEP to ACTIVE SEQ address for P3 */
+	err |= twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, address,
+				  R_SEQ_ADD_S2A3);
+
+	err |= twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, LVL_WAKEUP,
+					R_P3_SW_EVENTS);
+	if (err)
+		printk(KERN_ERR "TWL4030 wakeup sequence for P3" \
+				"config error\n");
+
+	return err;
+}
+
+static int __init config_wakeup12_sequence(u8 address)
+{
+	int err = 0;
+
+	/* Set SLEEP to ACTIVE SEQ address for P1 and P2 */
+	err |= twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, address,
+				  R_SEQ_ADD_SA12);
+
+	/* P1/P2/P3 LVL_WAKEUP should be on LEVEL */
+	err |= twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, LVL_WAKEUP,
+					R_P1_SW_EVENTS);
+	err |= twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, LVL_WAKEUP,
+					R_P2_SW_EVENTS);
+
+	if (machine_is_omap_3430sdp() || machine_is_omap_ldp()) {
+		u8 data;
+		/* Disabling AC charger effect on sleep-active transitions */
+		err |= twl4030_i2c_read_u8(TWL4030_MODULE_PM_MASTER, &data,
+						R_CFG_P1_TRANSITION);
+		data &= ~(1<<1);
+		err |= twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, data ,
+						R_CFG_P1_TRANSITION);
+	}
+
+	if (err)
+		printk(KERN_ERR "TWL4030 wakeup sequence for P1 and P2" \
+				"config error\n");
+
+	return err;
+}
+
+static int __init config_sleep_sequence(u8 address)
+{
+	int err = 0;
+
+	/*
+	 * CLKREQ is pulled high on the 2430SDP, therefore, we need to take
+	 * it out of the HFCLKOUT DEV_GRP for P1 else HFCLKOUT can't be stopped.
+	 */
+
+	err |= twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
+				  0x20, R_HFCLKOUT_DEV_GRP);
+
+	/* Set ACTIVE to SLEEP SEQ address in T2 memory*/
+	err |= twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, address,
+				  R_SEQ_ADD_A2S);
+
+	if (err)
+		printk(KERN_ERR "TWL4030 sleep sequence config error\n");
+
+	return err;
+}
+
+static int __init config_warmreset_sequence(u8 address)
+{
+
+	int err = 0;
+	u8 rd_data;
+
+	/* Set WARM RESET SEQ address for P1 */
+	err |= twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, address,
+					R_SEQ_ADD_WARM);
+
+	/* P1/P2/P3 enable WARMRESET */
+	err |= twl4030_i2c_read_u8(TWL4030_MODULE_PM_MASTER, &rd_data,
+					R_P1_SW_EVENTS);
+	rd_data |= ENABLE_WARMRESET;
+	err |= twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, rd_data,
+					R_P1_SW_EVENTS);
+
+	err |= twl4030_i2c_read_u8(TWL4030_MODULE_PM_MASTER, &rd_data,
+					R_P2_SW_EVENTS);
+	rd_data |= ENABLE_WARMRESET;
+	err |= twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, rd_data,
+					R_P2_SW_EVENTS);
+
+	err |= twl4030_i2c_read_u8(TWL4030_MODULE_PM_MASTER, &rd_data,
+					R_P3_SW_EVENTS);
+	rd_data |= ENABLE_WARMRESET;
+	err |= twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, rd_data,
+					R_P3_SW_EVENTS);
+
+	if (err)
+		printk(KERN_ERR
+			"TWL4030 warmreset seq config error\n");
+	return err;
+}
+
+static int __init load_triton_script(struct twl4030_script *tscript)
+{
+	u8 address = triton_next_free_address;
+	int err;
+
+	err = twl4030_write_script(address, tscript->script, tscript->size);
+	if (err)
+		return err;
+
+	triton_next_free_address += tscript->size;
+
+	if (tscript->flags & TRITON_WRST_SCRIPT)
+		err |= config_warmreset_sequence(address);
+
+	if (tscript->flags & TRITON_WAKEUP12_SCRIPT)
+		err |= config_wakeup12_sequence(address);
+
+	if (tscript->flags & TRITON_WAKEUP3_SCRIPT)
+		err |= config_wakeup3_sequence(address);
+
+	if (tscript->flags & TRITON_SLEEP_SCRIPT)
+		err |= config_sleep_sequence(address);
+
+	return err;
+}
+
+void __init twl4030_power_init(struct twl4030_power_data *triton2_scripts)
+{
+	int err = 0;
+	int i;
+
+	err = twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, KEY_1,
+				R_PROTECT_KEY);
+	err |= twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, KEY_2,
+				R_PROTECT_KEY);
+	if (err)
+		printk(KERN_ERR
+			"TWL4030 Unable to unlock registers\n");
+
+	for (i = 0; i < triton2_scripts->size; i++) {
+		err = load_triton_script(triton2_scripts->scripts[i]);
+		if (err)
+			break;
+	}
+
+	if (twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, 0, R_PROTECT_KEY))
+		printk(KERN_ERR
+			"TWL4030 Unable to relock registers\n");
+}
-- 
1.5.6.3


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 3/6] Hook twl4030 power code into twl4030 core.
  2008-10-20  8:37   ` [PATCH 2/6] Move existing TWL4030 code to drivers/mfd Peter 'p2' De Schrijver
@ 2008-10-20  8:37     ` Peter 'p2' De Schrijver
  2008-10-20  8:37       ` [PATCH 4/6] 3430sdp and ldp use custom twl4030 power scripts Peter 'p2' De Schrijver
  0 siblings, 1 reply; 14+ messages in thread
From: Peter 'p2' De Schrijver @ 2008-10-20  8:37 UTC (permalink / raw)
  To: linux-omap; +Cc: Peter 'p2' De Schrijver

This patch makes twl4030 core call the power code in case the scripts are present in the platform data.

Signed-off-by: Peter 'p2' De Schrijver <peter.de-schrijver@nokia.com>
---
 drivers/mfd/Kconfig        |    9 +++++++++
 drivers/mfd/Makefile       |    1 +
 drivers/mfd/twl4030-core.c |   11 +++++++++++
 3 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index e643f6b..91c0417 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -64,6 +64,15 @@ config TWL4030_CORE
 	  high speed USB OTG transceiver, an audio codec (on most
 	  versions) and many other features.
 
+config TWL4030_POWER
+	bool "Support power sequencing scripts on TWL4030/TPS659x0"
+	depends on TWL4030_CORE
+	help
+	  Say yes here if you want to use the power sequencing scripts on
+	  the TWL4030/TPS659x0. These scripts control which regulators or
+	  oscillators are switched off or on or reset when a sleep, wakeup
+	  or warm reset event occurs.
+
 config MFD_TMIO
 	bool
 	default n
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index 92531f0..baa15bd 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -13,6 +13,7 @@ obj-$(CONFIG_MFD_TC6387XB)	+= tc6387xb.o
 obj-$(CONFIG_MFD_TC6393XB)	+= tc6393xb.o
 
 obj-$(CONFIG_TWL4030_CORE)	+= twl4030-core.o twl4030-irq.o
+obj-$(CONFIG_TWL4030_POWER)    += twl4030-power.o
 
 obj-$(CONFIG_MFD_CORE)		+= mfd-core.o
 
diff --git a/drivers/mfd/twl4030-core.c b/drivers/mfd/twl4030-core.c
index dd843c4..3fc54bf 100644
--- a/drivers/mfd/twl4030-core.c
+++ b/drivers/mfd/twl4030-core.c
@@ -77,6 +77,12 @@
 #define twl_has_madc()	false
 #endif
 
+#ifdef CONFIG_TWL4030_POWER
+#define twl_has_power()        true
+#else
+#define twl_has_power()        false
+#endif
+
 #if defined(CONFIG_RTC_DRV_TWL4030) || defined(CONFIG_RTC_DRV_TWL4030_MODULE)
 #define twl_has_rtc()	true
 #else
@@ -209,6 +215,8 @@ static struct twl4030mapping twl4030_map[TWL4030_MODULE_LAST + 1] = {
 	{ 3, TWL4030_BASEADD_SECURED_REG },
 };
 
+extern void twl4030_power_init(struct twl4030_power_data *triton2_scripts);
+
 /*----------------------------------------------------------------------*/
 
 /* Exported Functions */
@@ -514,6 +522,9 @@ static int add_children(struct twl4030_platform_data *pdata)
 		}
 	}
 
+	if (twl_has_power() && pdata->power)
+		twl4030_power_init(pdata->power);
+
 	if (twl_has_rtc()) {
 		twl = &twl4030_modules[3];
 
-- 
1.5.6.3


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 4/6] 3430sdp and ldp use custom twl4030 power scripts.
  2008-10-20  8:37     ` [PATCH 3/6] Hook twl4030 power code into twl4030 core Peter 'p2' De Schrijver
@ 2008-10-20  8:37       ` Peter 'p2' De Schrijver
  2008-10-20  8:37         ` [PATCH 5/6] Generic twl4030 power script for 3430 based boards Peter 'p2' De Schrijver
  0 siblings, 1 reply; 14+ messages in thread
From: Peter 'p2' De Schrijver @ 2008-10-20  8:37 UTC (permalink / raw)
  To: linux-omap; +Cc: Peter 'p2' De Schrijver

The TI 3430dsp and ldp boards have a custom power script to handle sleep and off modes.

Signed-off-by: Peter 'p2' De Schrijver <peter.de-schrijver@nokia.com>
---
 arch/arm/mach-omap2/board-3430sdp.c |   84 +++++++++++++++++++++++++++++++++++
 arch/arm/mach-omap2/board-ldp.c     |   84 +++++++++++++++++++++++++++++++++++
 2 files changed, 168 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
index 56f28ae..bb591bb 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -47,6 +47,8 @@
 
 #include "sdram-qimonda-hyb18m512160af-6.h"
 
+#define CONFIG_DISABLE_HFCLK 1
+
 #define	SDP3430_SMC91X_CS	3
 
 #define ENABLE_VAUX3_DEDICATED	0x03
@@ -329,6 +331,87 @@ static struct twl4030_madc_platform_data sdp3430_madc_data = {
 	.irq_line	= 1,
 };
 
+
+static struct twl4030_ins __initdata sleep_on_seq[] = {
+/*
+ * Turn off VDD1 and VDD2.
+ */
+	{MSG_SINGULAR(DEV_GRP_P1, 0xf, RES_STATE_OFF), 4},
+	{MSG_SINGULAR(DEV_GRP_P1, 0x10, RES_STATE_OFF), 2},
+#ifdef CONFIG_DISABLE_HFCLK
+/*
+ * And also turn off the OMAP3 PLLs and the sysclk output.
+ */
+	{MSG_SINGULAR(DEV_GRP_P1, 0x7, RES_STATE_OFF), 3},
+	{MSG_SINGULAR(DEV_GRP_P1, 0x19, RES_STATE_OFF), 3},
+#endif
+};
+
+static struct twl4030_script sleep_on_script __initdata = {
+	.script	= sleep_on_seq,
+	.size	= ARRAY_SIZE(sleep_on_seq),
+	.flags	= TRITON_SLEEP_SCRIPT,
+};
+
+static struct twl4030_ins wakeup_seq[] __initdata = {
+#ifndef CONFIG_DISABLE_HFCLK
+/*
+ * Wakeup VDD1 and VDD2.
+ */
+	{MSG_SINGULAR(DEV_GRP_P1, 0xf, RES_STATE_ACTIVE), 4},
+	{MSG_SINGULAR(DEV_GRP_P1, 0x10, RES_STATE_ACTIVE), 2},
+#else
+/*
+ * Reenable the OMAP3 PLLs.
+ * Wakeup VDD1 and VDD2.
+ * Reenable sysclk output.
+ */
+	{MSG_SINGULAR(DEV_GRP_P1, 0x7, RES_STATE_ACTIVE), 0x30},
+	{MSG_SINGULAR(DEV_GRP_P1, 0xf, RES_STATE_ACTIVE), 0x30},
+	{MSG_SINGULAR(DEV_GRP_P1, 0x10, RES_STATE_ACTIVE), 0x37},
+	{MSG_SINGULAR(DEV_GRP_P1, 0x19, RES_STATE_ACTIVE), 3},
+#endif /* #ifndef CONFIG_DISABLE_HFCLK */
+};
+
+static struct twl4030_script wakeup_script __initdata = {
+	.script	= wakeup_seq,
+	.size	= ARRAY_SIZE(wakeup_seq),
+	.flags	= TRITON_WAKEUP12_SCRIPT | TRITON_WAKEUP3_SCRIPT,
+};
+
+static struct twl4030_ins wrst_seq[] __initdata = {
+/*
+ * Reset twl4030.
+ * Reset VDD1 regulator.
+ * Reset VDD2 regulator.
+ * Reset VPLL1 regulator.
+ * Enable sysclk output.
+ * Reenable twl4030.
+ */
+	{MSG_SINGULAR(DEV_GRP_NULL, 0x1b, RES_STATE_OFF), 2},
+	{MSG_SINGULAR(DEV_GRP_P1, 0xf, RES_STATE_WRST), 15},
+	{MSG_SINGULAR(DEV_GRP_P1, 0x10, RES_STATE_WRST), 15},
+	{MSG_SINGULAR(DEV_GRP_P1, 0x7, RES_STATE_WRST), 0x60},
+	{MSG_SINGULAR(DEV_GRP_P1, 0x19, RES_STATE_ACTIVE), 2},
+	{MSG_SINGULAR(DEV_GRP_NULL, 0x1b, RES_STATE_ACTIVE), 2},
+};
+static struct twl4030_script wrst_script __initdata = {
+	.script = wrst_seq,
+	.size   = ARRAY_SIZE(wakeup_seq),
+	.flags  = TRITON_WRST_SCRIPT,
+};
+
+static struct twl4030_script *twl4030_scripts[] __initdata = {
+	&sleep_on_script,
+	&wakeup_script,
+	&wrst_script,
+};
+
+static struct twl4030_power_data sdp3430_t2scripts_data __initdata = {
+	.scripts	= twl4030_scripts,
+	.size		= ARRAY_SIZE(twl4030_scripts),
+};
+
 static struct twl4030_platform_data sdp3430_twldata = {
 	.irq_base	= TWL4030_IRQ_BASE,
 	.irq_end	= TWL4030_IRQ_END,
@@ -338,6 +421,7 @@ static struct twl4030_platform_data sdp3430_twldata = {
 	.gpio		= &sdp3430_gpio_data,
 	.madc		= &sdp3430_madc_data,
 	.keypad		= &sdp3430_kp_data,
+	.power		= &sdp3430_t2scripts_data,
 	.usb		= &sdp3430_usb_data,
 };
 
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index 92710c3..d4d4e90 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -41,6 +41,8 @@
 #include <asm/delay.h>
 #include <mach/control.h>
 
+#define CONFIG_DISABLE_HFCLK 1
+
 #define ENABLE_VAUX1_DEDICATED	0x03
 #define ENABLE_VAUX1_DEV_GRP	0x20
 
@@ -195,6 +197,87 @@ static int ldp_batt_table[] = {
 4040,   3910,   3790,   3670,   3550
 };
 
+static struct twl4030_ins __initdata sleep_on_seq[] = {
+/*
+ * Turn off VDD1 and VDD2.
+ */
+	{MSG_SINGULAR(DEV_GRP_P1, 0xf, RES_STATE_OFF), 4},
+	{MSG_SINGULAR(DEV_GRP_P1, 0x10, RES_STATE_OFF), 2},
+#ifdef CONFIG_DISABLE_HFCLK
+/*
+ * And also turn off the OMAP3 PLLs and the sysclk output.
+ */
+	{MSG_SINGULAR(DEV_GRP_P1, 0x7, RES_STATE_OFF), 3},
+	{MSG_SINGULAR(DEV_GRP_P1, 0x19, RES_STATE_OFF), 3},
+#endif
+};
+
+static struct twl4030_script sleep_on_script __initdata = {
+	.script	= sleep_on_seq,
+	.size	= ARRAY_SIZE(sleep_on_seq),
+	.flags	= TRITON_SLEEP_SCRIPT,
+};
+
+static struct twl4030_ins wakeup_seq[] __initdata = {
+#ifndef CONFIG_DISABLE_HFCLK
+/*
+ * Wakeup VDD1 and VDD2.
+ */
+	{MSG_SINGULAR(DEV_GRP_P1, 0xf, RES_STATE_ACTIVE), 4},
+	{MSG_SINGULAR(DEV_GRP_P1, 0x10, RES_STATE_ACTIVE), 2},
+#else
+/*
+ * Reenable the OMAP3 PLLs.
+ * Wakeup VDD1 and VDD2.
+ * Reenable sysclk output.
+ */
+	{MSG_SINGULAR(DEV_GRP_P1, 0x7, RES_STATE_ACTIVE), 0x30},
+	{MSG_SINGULAR(DEV_GRP_P1, 0xf, RES_STATE_ACTIVE), 0x30},
+	{MSG_SINGULAR(DEV_GRP_P1, 0x10, RES_STATE_ACTIVE), 0x37},
+	{MSG_SINGULAR(DEV_GRP_P1, 0x19, RES_STATE_ACTIVE), 3},
+#endif /* #ifndef CONFIG_DISABLE_HFCLK */
+};
+
+static struct twl4030_script wakeup_script __initdata = {
+	.script	= wakeup_seq,
+	.size	= ARRAY_SIZE(wakeup_seq),
+	.flags	= TRITON_WAKEUP12_SCRIPT | TRITON_WAKEUP3_SCRIPT,
+};
+
+static struct twl4030_ins wrst_seq[] __initdata = {
+/*
+ * Reset twl4030.
+ * Reset VDD1 regulator.
+ * Reset VDD2 regulator.
+ * Reset VPLL1 regulator.
+ * Enable sysclk output.
+ * Reenable twl4030.
+ */
+	{MSG_SINGULAR(DEV_GRP_NULL, 0x1b, RES_STATE_OFF), 2},
+	{MSG_SINGULAR(DEV_GRP_P1, 0xf, RES_STATE_WRST), 15},
+	{MSG_SINGULAR(DEV_GRP_P1, 0x10, RES_STATE_WRST), 15},
+	{MSG_SINGULAR(DEV_GRP_P1, 0x7, RES_STATE_WRST), 0x60},
+	{MSG_SINGULAR(DEV_GRP_P1, 0x19, RES_STATE_ACTIVE), 2},
+	{MSG_SINGULAR(DEV_GRP_NULL, 0x1b, RES_STATE_ACTIVE), 2},
+};
+
+static struct twl4030_script wrst_script __initdata = {
+	.script = wrst_seq,
+	.size   = ARRAY_SIZE(wakeup_seq),
+	.flags  = TRITON_WRST_SCRIPT,
+};
+
+static struct twl4030_script *twl4030_scripts[] __initdata = {
+	&sleep_on_script,
+	&wakeup_script,
+	&wrst_script,
+};
+
+static struct twl4030_power_data sdp3430_t2scripts_data __initdata = {
+	.scripts	= twl4030_scripts,
+	.size		= ARRAY_SIZE(twl4030_scripts),
+};
+
 static struct twl4030_bci_platform_data ldp_bci_data = {
 	.battery_tmp_tbl	= ldp_batt_table,
 	.tblsize		= ARRAY_SIZE(ldp_batt_table),
@@ -222,6 +305,7 @@ static struct twl4030_platform_data ldp_twldata = {
 	.bci		= &ldp_bci_data,
 	.madc		= &ldp_madc_data,
 	.usb		= &ldp_usb_data,
+	.power		= &sdp3430_t2scripts_data,
 	.gpio		= &ldp_gpio_data,
 };
 
-- 
1.5.6.3


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 5/6] Generic twl4030 power script for 3430 based boards.
  2008-10-20  8:37       ` [PATCH 4/6] 3430sdp and ldp use custom twl4030 power scripts Peter 'p2' De Schrijver
@ 2008-10-20  8:37         ` Peter 'p2' De Schrijver
  2008-10-20  8:37           ` [PATCH 6/6] omap3 evm, beagle and overo use the generic twl4030 script Peter 'p2' De Schrijver
  2008-10-31 19:50           ` [PATCH 5/6] Generic twl4030 power script for 3430 based boards Grazvydas Ignotas
  0 siblings, 2 replies; 14+ messages in thread
From: Peter 'p2' De Schrijver @ 2008-10-20  8:37 UTC (permalink / raw)
  To: linux-omap; +Cc: Peter 'p2' De Schrijver

This is a generic twl4030 power script for 3430 based boards. It handles
sleep and wakeup events. In case of a sleep event it will first put the
Reset and Control (RC) resources to sleep and then put the voltage regulators
to sleep. In case of a wakeup event, the system clock will be started first,
then the voltage regulators will be woken up and finally the RC resources will
be woken up.

Signed-off-by: Peter 'p2' De Schrijver <peter.de-schrijver@nokia.com>
---
 arch/arm/mach-omap2/twl4030-generic-scripts.c |   78 +++++++++++++++++++++++++
 arch/arm/mach-omap2/twl4030-generic-scripts.h |    8 +++
 2 files changed, 86 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-omap2/twl4030-generic-scripts.c
 create mode 100644 arch/arm/mach-omap2/twl4030-generic-scripts.h

diff --git a/arch/arm/mach-omap2/twl4030-generic-scripts.c b/arch/arm/mach-omap2/twl4030-generic-scripts.c
new file mode 100644
index 0000000..f41c9ef
--- /dev/null
+++ b/arch/arm/mach-omap2/twl4030-generic-scripts.c
@@ -0,0 +1,78 @@
+/*
+ * arch/arm/mach-omap2/twl4030-generic-scripts.c
+ *
+ * Generic power control scripts for TWL4030
+ *
+ * Copyright (C) 2008 Nokia Corporation
+ * Copyright (C) 2006 Texas Instruments, Inc
+ *
+ * Written by 	Kalle Jokiniemi
+ *		Peter De Schrijver <peter.de-schrijver@nokia.com>
+ *
+ * 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/kernel.h>
+#include <linux/device.h>
+#include <linux/init.h>
+#include <linux/i2c/twl4030.h>
+
+/*
+ * This script instructs twl4030 to first put the Reset and Control (RC)
+ * resources to sleep and then all the other resources.
+ */
+
+static struct twl4030_ins sleep_on_seq[] __initdata = {
+	{MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_RC, RES_TYPE_ALL, RES_TYPE2_R0,
+			RES_STATE_SLEEP), 4},
+	{MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_ALL, RES_TYPE_ALL, RES_TYPE2_R0,
+			RES_STATE_SLEEP), 4},
+};
+
+static struct twl4030_script sleep_on_script __initdata = {
+	.script = sleep_on_seq,
+	.size   = ARRAY_SIZE(sleep_on_seq),
+	.flags  = TRITON_SLEEP_SCRIPT,
+};
+
+/*
+ * This script instructs twl4030 to first enable CLKEN, then wakeup the
+ * regulators and then all other resources.
+ */
+
+static struct twl4030_ins wakeup_seq[] __initdata = {
+	{MSG_SINGULAR(DEV_GRP_NULL, 0x17, RES_STATE_ACTIVE), 0x30},
+	{MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_PP_PR, RES_TYPE_ALL, RES_TYPE2_R0,
+			RES_STATE_ACTIVE), 0x37},
+	{MSG_BROADCAST(DEV_GRP_NULL, RES_GRP_ALL, RES_TYPE_ALL, RES_TYPE2_R0,
+			RES_STATE_ACTIVE), 0x2},
+};
+
+static struct twl4030_script wakeup_script __initdata = {
+	.script = wakeup_seq,
+	.size   = ARRAY_SIZE(wakeup_seq),
+	.flags  = TRITON_WAKEUP12_SCRIPT | TRITON_WAKEUP3_SCRIPT,
+};
+
+static struct twl4030_script *twl4030_scripts[] __initdata = {
+	&sleep_on_script,
+	&wakeup_script,
+};
+
+struct twl4030_power_data generic3430_t2scripts_data __initdata = {
+	.scripts        = twl4030_scripts,
+	.size           = ARRAY_SIZE(twl4030_scripts),
+};
+
+
diff --git a/arch/arm/mach-omap2/twl4030-generic-scripts.h b/arch/arm/mach-omap2/twl4030-generic-scripts.h
new file mode 100644
index 0000000..64d8d3f
--- /dev/null
+++ b/arch/arm/mach-omap2/twl4030-generic-scripts.h
@@ -0,0 +1,8 @@
+#ifndef __TWL4030_GENERIC_SCRIPTS_H
+#define __TWL4030_GENERIC_SCRIPTS_H
+
+#include <linux/i2c/twl4030.h>
+
+extern struct twl4030_power_data generic3430_t2scripts_data;
+
+#endif
-- 
1.5.6.3


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 6/6] omap3 evm, beagle and overo use the generic twl4030 script
  2008-10-20  8:37         ` [PATCH 5/6] Generic twl4030 power script for 3430 based boards Peter 'p2' De Schrijver
@ 2008-10-20  8:37           ` Peter 'p2' De Schrijver
  2008-10-31 19:50           ` [PATCH 5/6] Generic twl4030 power script for 3430 based boards Grazvydas Ignotas
  1 sibling, 0 replies; 14+ messages in thread
From: Peter 'p2' De Schrijver @ 2008-10-20  8:37 UTC (permalink / raw)
  To: linux-omap; +Cc: Peter 'p2' De Schrijver

Make omap3 evm, beagle and overo use the generic twl4030 script.

Signed-off-by: Peter 'p2' De Schrijver <peter.de-schrijver@nokia.com>
---
 arch/arm/mach-omap2/Makefile            |    9 ++++++---
 arch/arm/mach-omap2/board-omap3beagle.c |    4 ++--
 arch/arm/mach-omap2/board-omap3evm.c    |    4 ++--
 arch/arm/mach-omap2/board-overo.c       |    4 ++--
 4 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 33de217..ed0cd7a 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -58,10 +58,12 @@ obj-$(CONFIG_MACH_OMAP_3430SDP)		+= board-3430sdp.o \
 obj-$(CONFIG_MACH_OMAP3EVM)		+= board-omap3evm.o \
 					   hsmmc.o \
 					   usb-musb.o usb-ehci.o \
-					   board-omap3evm-flash.o
+					   board-omap3evm-flash.o \
+					   twl4030-generic-scripts.o
 obj-$(CONFIG_MACH_OMAP3_BEAGLE)		+= board-omap3beagle.o \
 					   usb-musb.o usb-ehci.o \
-					   hsmmc.o
+					   hsmmc.o \
+					   twl4030-generic-scripts.o
 obj-$(CONFIG_MACH_OMAP_LDP)		+= board-ldp.o \
 					   hsmmc.o \
 					   usb-musb.o
@@ -77,7 +79,8 @@ obj-$(CONFIG_MACH_NOKIA_N810)		+= board-n810.o
 obj-$(CONFIG_MACH_OVERO)		+= board-overo.o \
 					   hsmmc.o \
 					   usb-musb.o \
-					   usb-ehci.o
+					   usb-ehci.o \
+					   twl4030-generic-scripts.o
 
 # TUSB 6010 chips
 obj-$(CONFIG_MACH_OMAP2_TUSB6010)	+= usb-tusb6010.o
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 88d25b1..ce6c7b4 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -24,8 +24,6 @@
 #include <linux/input.h>
 #include <linux/gpio_keys.h>
 
-#include <linux/i2c/twl4030.h>
-
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
 #include <linux/mtd/nand.h>
@@ -45,6 +43,7 @@
 #include <mach/nand.h>
 #include <mach/mux.h>
 
+#include "twl4030-generic-scripts.h"
 
 #define GPMC_CS0_BASE  0x60
 #define GPMC_CS_SIZE   0x30
@@ -157,6 +156,7 @@ static struct twl4030_platform_data beagle_twldata = {
 	/* platform_data for children goes here */
 	.usb		= &beagle_usb_data,
 	.gpio		= &beagle_gpio_data,
+	.power		= &generic3430_t2scripts_data,
 };
 
 static struct i2c_board_info __initdata beagle_i2c_boardinfo[] = {
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index 3538067..a72772f 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -20,8 +20,6 @@
 #include <linux/clk.h>
 #include <linux/input.h>
 
-#include <linux/i2c/twl4030.h>
-
 #include <linux/spi/spi.h>
 #include <linux/spi/ads7846.h>
 #include <linux/i2c/twl4030.h>
@@ -41,6 +39,7 @@
 #include <mach/mcspi.h>
 
 #include "sdram-micron-mt46h32m32lf-6.h"
+#include "twl4030-generic-scripts.h"
 
 static struct resource omap3evm_smc911x_resources[] = {
 	[0] =	{
@@ -139,6 +138,7 @@ static struct twl4030_platform_data omap3evm_twldata = {
 	.keypad		= &omap3evm_kp_data,
 	.madc		= &omap3evm_madc_data,
 	.usb		= &omap3evm_usb_data,
+	.power		= &generic3430_t2scripts_data,
 	.gpio		= &omap3evm_gpio_data,
 };
 
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index 4e2781a..b0e5cec 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -27,8 +27,6 @@
 #include <linux/kernel.h>
 #include <linux/platform_device.h>
 
-#include <linux/i2c/twl4030.h>
-
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/nand.h>
 #include <linux/mtd/partitions.h>
@@ -50,6 +48,7 @@
 #include <mach/usb-musb.h>
 
 #include "sdram-micron-mt46h32m32lf-6.h"
+#include "twl4030-generic-scripts.h"
 
 #define NAND_BLOCK_SIZE SZ_128K
 #define GPMC_CS0_BASE  0x60
@@ -160,6 +159,7 @@ static struct twl4030_platform_data overo_twldata = {
 	.irq_end	= TWL4030_IRQ_END,
 	.gpio		= &overo_gpio_data,
 	.usb		= &overo_usb_data,
+	.power		= &generic3430_t2scripts_data,
 };
 
 static struct i2c_board_info __initdata overo_i2c_boardinfo[] = {
-- 
1.5.6.3


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH 0/6] Integrate the twl4030 power code into new twl4030 mfd
  2008-10-20  8:37 [PATCH 0/6] Integrate the twl4030 power code into new twl4030 mfd Peter 'p2' De Schrijver
  2008-10-20  8:37 ` [PATCH 1/6] Add defines and data types for twl4030 Peter 'p2' De Schrijver
@ 2008-10-20  9:02 ` David Brownell
  2008-10-24  9:21   ` Peter 'p2' De Schrijver
  2008-10-24 22:39 ` Kevin Hilman
  2 siblings, 1 reply; 14+ messages in thread
From: David Brownell @ 2008-10-20  9:02 UTC (permalink / raw)
  To: Peter 'p2' De Schrijver; +Cc: linux-omap

On Monday 20 October 2008, Peter 'p2' De Schrijver wrote:
> This patchset integrates the twl4030 power code into the new twl4030 mfd framework.
> The scripts will be moved to the board specific data.
> 
> Peter 'p2' De Schrijver (6):
>   Add defines and data types for twl4030.
>   Move existing TWL4030 code to drivers/mfd
>   Hook twl4030 power code into twl4030 core.
>   3430sdp and ldp use custom twl4030 power scripts.
>   Generic twl4030 power script for 3430 based boards.
>   omap3 evm, beagle and overo use the generic twl4030 script

Seems OK to me ... any reason this shouldn't go to mainline?

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 0/6] Integrate the twl4030 power code into new twl4030 mfd
  2008-10-20  9:02 ` [PATCH 0/6] Integrate the twl4030 power code into new twl4030 mfd David Brownell
@ 2008-10-24  9:21   ` Peter 'p2' De Schrijver
  2008-10-24  9:31     ` David Brownell
  0 siblings, 1 reply; 14+ messages in thread
From: Peter 'p2' De Schrijver @ 2008-10-24  9:21 UTC (permalink / raw)
  To: ext David Brownell; +Cc: linux-omap

On Mon, Oct 20, 2008 at 02:02:16AM -0700, ext David Brownell wrote:
> On Monday 20 October 2008, Peter 'p2' De Schrijver wrote:
> > This patchset integrates the twl4030 power code into the new twl4030 mfd framework.
> > The scripts will be moved to the board specific data.
> > 
> > Peter 'p2' De Schrijver (6):
> >   Add defines and data types for twl4030.
> >   Move existing TWL4030 code to drivers/mfd
> >   Hook twl4030 power code into twl4030 core.
> >   3430sdp and ldp use custom twl4030 power scripts.
> >   Generic twl4030 power script for 3430 based boards.
> >   omap3 evm, beagle and overo use the generic twl4030 script
> 
> Seems OK to me ... any reason this shouldn't go to mainline?
> 

I don't see any reason.

Cheers,

Peter.

-- 
goa is a state of mind
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 0/6] Integrate the twl4030 power code into new twl4030 mfd
  2008-10-24  9:21   ` Peter 'p2' De Schrijver
@ 2008-10-24  9:31     ` David Brownell
  0 siblings, 0 replies; 14+ messages in thread
From: David Brownell @ 2008-10-24  9:31 UTC (permalink / raw)
  To: Peter 'p2' De Schrijver; +Cc: linux-omap

On Friday 24 October 2008, Peter 'p2' De Schrijver wrote:
> On Mon, Oct 20, 2008 at 02:02:16AM -0700, ext David Brownell wrote:
> > 
> > Seems OK to me ... any reason this shouldn't go to mainline?
> 
> I don't see any reason.

Great!  Then once this merges to linux-omap, I think you're
the best person to submit this.  Just the results of the MFD
and include changes, one patch ... the arch/arm bits would
go later.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 0/6] Integrate the twl4030 power code into new twl4030 mfd
  2008-10-20  8:37 [PATCH 0/6] Integrate the twl4030 power code into new twl4030 mfd Peter 'p2' De Schrijver
  2008-10-20  8:37 ` [PATCH 1/6] Add defines and data types for twl4030 Peter 'p2' De Schrijver
  2008-10-20  9:02 ` [PATCH 0/6] Integrate the twl4030 power code into new twl4030 mfd David Brownell
@ 2008-10-24 22:39 ` Kevin Hilman
  2008-10-24 22:53   ` Tony Lindgren
  2 siblings, 1 reply; 14+ messages in thread
From: Kevin Hilman @ 2008-10-24 22:39 UTC (permalink / raw)
  To: Peter 'p2' De Schrijver; +Cc: linux-omap

"Peter 'p2' De Schrijver" <peter.de-schrijver@nokia.com> writes:

> This patchset integrates the twl4030 power code into the new twl4030 mfd framework.
> The scripts will be moved to the board specific data.
>
> Peter 'p2' De Schrijver (6):
>   Add defines and data types for twl4030.
>   Move existing TWL4030 code to drivers/mfd
>   Hook twl4030 power code into twl4030 core.
>   3430sdp and ldp use custom twl4030 power scripts.
>   Generic twl4030 power script for 3430 based boards.
>   omap3 evm, beagle and overo use the generic twl4030 script

Tony,

This looks good to me.  Rather than pull this into pm-<next>, this
could go straight into linux-omap, and then Peter should submit to
mainline.

Kevin



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 0/6] Integrate the twl4030 power code into new twl4030 mfd
  2008-10-24 22:39 ` Kevin Hilman
@ 2008-10-24 22:53   ` Tony Lindgren
  0 siblings, 0 replies; 14+ messages in thread
From: Tony Lindgren @ 2008-10-24 22:53 UTC (permalink / raw)
  To: Kevin Hilman; +Cc: Peter 'p2' De Schrijver, linux-omap

* Kevin Hilman <khilman@deeprootsystems.com> [081024 15:39]:
> "Peter 'p2' De Schrijver" <peter.de-schrijver@nokia.com> writes:
> 
> > This patchset integrates the twl4030 power code into the new twl4030 mfd framework.
> > The scripts will be moved to the board specific data.
> >
> > Peter 'p2' De Schrijver (6):
> >   Add defines and data types for twl4030.
> >   Move existing TWL4030 code to drivers/mfd
> >   Hook twl4030 power code into twl4030 core.
> >   3430sdp and ldp use custom twl4030 power scripts.
> >   Generic twl4030 power script for 3430 based boards.
> >   omap3 evm, beagle and overo use the generic twl4030 script
> 
> Tony,
> 
> This looks good to me.  Rather than pull this into pm-<next>, this
> could go straight into linux-omap, and then Peter should submit to
> mainline.

OK, sounds good to me.

Tony

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 5/6] Generic twl4030 power script for 3430 based boards.
  2008-10-20  8:37         ` [PATCH 5/6] Generic twl4030 power script for 3430 based boards Peter 'p2' De Schrijver
  2008-10-20  8:37           ` [PATCH 6/6] omap3 evm, beagle and overo use the generic twl4030 script Peter 'p2' De Schrijver
@ 2008-10-31 19:50           ` Grazvydas Ignotas
  1 sibling, 0 replies; 14+ messages in thread
From: Grazvydas Ignotas @ 2008-10-31 19:50 UTC (permalink / raw)
  To: linux-omap; +Cc: peter.de-schrijver, Grazvydas Ignotas

+struct twl4030_power_data generic3430_t2scripts_data __initdata = {
+	.scripts        = twl4030_scripts,
+	.size           = ARRAY_SIZE(twl4030_scripts),
+};
+

This structure is declared with __initdata, but other structures referencing it
are not:

@@ -157,6 +156,7 @@ static struct twl4030_platform_data beagle_twldata = {
 	/* platform_data for children goes here */
 	.usb		= &beagle_usb_data,
 	.gpio		= &beagle_gpio_data,
+	.power		= &generic3430_t2scripts_data,
 };
 
This causes warning while building the kernel:

WARNING: modpost: Found 1 section mismatch(es).

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2008-10-31 19:57 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-20  8:37 [PATCH 0/6] Integrate the twl4030 power code into new twl4030 mfd Peter 'p2' De Schrijver
2008-10-20  8:37 ` [PATCH 1/6] Add defines and data types for twl4030 Peter 'p2' De Schrijver
2008-10-20  8:37   ` [PATCH 2/6] Move existing TWL4030 code to drivers/mfd Peter 'p2' De Schrijver
2008-10-20  8:37     ` [PATCH 3/6] Hook twl4030 power code into twl4030 core Peter 'p2' De Schrijver
2008-10-20  8:37       ` [PATCH 4/6] 3430sdp and ldp use custom twl4030 power scripts Peter 'p2' De Schrijver
2008-10-20  8:37         ` [PATCH 5/6] Generic twl4030 power script for 3430 based boards Peter 'p2' De Schrijver
2008-10-20  8:37           ` [PATCH 6/6] omap3 evm, beagle and overo use the generic twl4030 script Peter 'p2' De Schrijver
2008-10-31 19:50           ` [PATCH 5/6] Generic twl4030 power script for 3430 based boards Grazvydas Ignotas
2008-10-20  9:02 ` [PATCH 0/6] Integrate the twl4030 power code into new twl4030 mfd David Brownell
2008-10-24  9:21   ` Peter 'p2' De Schrijver
2008-10-24  9:31     ` David Brownell
2008-10-24 22:39 ` Kevin Hilman
2008-10-24 22:53   ` Tony Lindgren
  -- strict thread matches above, loose matches on Subject: below --
2008-10-15 13:37 Peter 'p2' De Schrijver

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).