From: Tom Rix <Tom.Rix@windriver.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 5/6] OMAP3 Move twl4030 mmc function
Date: Sun, 28 Jun 2009 12:52:31 -0500 [thread overview]
Message-ID: <1246211552-30268-6-git-send-email-Tom.Rix@windriver.com> (raw)
In-Reply-To: <1246211552-30268-5-git-send-email-Tom.Rix@windriver.com>
Because twl4030 now has its own device files, move and rename
twl4030_mmc_config.
twl4030_mmc_config initializes the twl4030 power setting to
the mmc device. Because it is in the twl4030 power domain, move
it out of drivers/mmc/omap3_mmc.c and into drivers/power/twl4030.c.
The function was renamed to twl4030_power_mmc_init because all
the functions in this file are to have the format
twl4030_power_<device>_<action>
In this case the suffix is mmc_init so
device : mmc
action : init
Signed-off-by: Tom Rix <Tom.Rix@windriver.com>
---
drivers/mmc/omap3_mmc.c | 13 ++-----------
drivers/power/twl4030.c | 15 +++++++++++++++
include/configs/omap3_evm.h | 5 +++++
include/twl4030.h | 3 +++
4 files changed, 25 insertions(+), 11 deletions(-)
diff --git a/drivers/mmc/omap3_mmc.c b/drivers/mmc/omap3_mmc.c
index e90db7e..9e09434 100644
--- a/drivers/mmc/omap3_mmc.c
+++ b/drivers/mmc/omap3_mmc.c
@@ -28,6 +28,7 @@
#include <mmc.h>
#include <part.h>
#include <i2c.h>
+#include <twl4030.h>
#include <asm/io.h>
#include <asm/arch/mmc.h>
@@ -58,21 +59,11 @@ block_dev_desc_t *mmc_get_dev(int dev)
return (block_dev_desc_t *) &mmc_blk_dev;
}
-void twl4030_mmc_config(void)
-{
- unsigned char data;
-
- data = DEV_GRP_P1;
- i2c_write(PWRMGT_ADDR_ID4, VMMC1_DEV_GRP, 1, &data, 1);
- data = VMMC1_VSEL_30;
- i2c_write(PWRMGT_ADDR_ID4, VMMC1_DEDICATED, 1, &data, 1);
-}
-
unsigned char mmc_board_init(void)
{
t2_t *t2_base = (t2_t *)T2_BASE;
- twl4030_mmc_config();
+ twl4030_power_mmc_init();
writel(readl(&t2_base->pbias_lite) | PBIASLITEPWRDNZ1 |
PBIASSPEEDCTRL0 | PBIASLITEPWRDNZ0,
diff --git a/drivers/power/twl4030.c b/drivers/power/twl4030.c
index 1454c2c..5e3d217 100644
--- a/drivers/power/twl4030.c
+++ b/drivers/power/twl4030.c
@@ -98,3 +98,18 @@ void twl4030_power_init(void)
TWL4030_PM_RECEIVER_VDAC_DEDICATED);
}
+#define VMMC1_VSEL_30 0x02
+
+void twl4030_power_mmc_init(void)
+{
+ unsigned char byte;
+
+ byte = DEV_GRP_P1;
+ twl4030_i2c_write_u8(TWL4030_CHIP_PM_RECEIVER, byte,
+ TWL4030_PM_RECEIVER_VMMC1_DEV_GRP);
+
+ /* 3 Volts */
+ byte = VMMC1_VSEL_30;
+ twl4030_i2c_write_u8(TWL4030_CHIP_PM_RECEIVER, byte,
+ TWL4030_PM_RECEIVER_VMMC1_DEDICATED);
+}
diff --git a/include/configs/omap3_evm.h b/include/configs/omap3_evm.h
index e205c01..315404a 100644
--- a/include/configs/omap3_evm.h
+++ b/include/configs/omap3_evm.h
@@ -128,6 +128,11 @@
#define CONFIG_DRIVER_OMAP34XX_I2C 1
/*
+ * TWL4030
+ */
+#define CONFIG_TWL4030_POWER 1
+
+/*
* Board NAND Info.
*/
#define CONFIG_SYS_NAND_ADDR NAND_BASE /* physical address */
diff --git a/include/twl4030.h b/include/twl4030.h
index d6b61b8..6f480d8 100644
--- a/include/twl4030.h
+++ b/include/twl4030.h
@@ -390,6 +390,9 @@ static inline int twl4030_i2c_read_u8(u8 chip_no, u8 *val, u8 reg)
void twl4030_power_reset_init(void);
/* For initializing power device */
void twl4030_power_init(void);
+/* For initializing mmc power */
+void twl4030_power_mmc_init(void);
+
/*
* LED
*/
--
1.6.0.5
next prev parent reply other threads:[~2009-06-28 17:52 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-28 17:52 [U-Boot] OMAP i2c and twl4030 Tom Rix
2009-06-28 17:52 ` [U-Boot] [PATCH 1/6] OMAP I2C Fix the sampling clock Tom Rix
2009-06-28 17:52 ` [U-Boot] [PATCH 2/6] TWL4030 Add initial support Tom Rix
2009-06-28 17:52 ` [U-Boot] [PATCH 3/6] TWL4030 Add power reset button Tom Rix
2009-06-28 17:52 ` [U-Boot] [PATCH 4/6] OMAP3 Move twl4030 power and led functions Tom Rix
2009-06-28 17:52 ` Tom Rix [this message]
2009-06-28 17:52 ` [U-Boot] [PATCH 6/6] OMAP3 Remove twl4030 defines Tom Rix
2009-06-28 19:46 ` [U-Boot] OMAP i2c and twl4030 Jean-Christophe PLAGNIOL-VILLARD
2009-06-28 20:04 ` Tom
2009-06-28 21:23 ` Jean-Christophe PLAGNIOL-VILLARD
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=1246211552-30268-6-git-send-email-Tom.Rix@windriver.com \
--to=tom.rix@windriver.com \
--cc=u-boot@lists.denx.de \
/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