Skip to contentSkip to conversation

omap: rx51: Change the TWL4030 VMMC2 voltage constraints and supply name

PATCH In review Jarkko Nikula 3 participants 12 messages May 3, 2010 – May 5, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 omap: rx51: Change the TWL4030 VMMC2 voltage constraints and supply name

I believe the VMMC2 constraints must be the same than with VAUX3. Older boards are using TWL4030 VMMC2 supply for internal MMC whereas newer are using VAUX3 that has more limited constraints defined in this same file.

More over, the VMMC2 supply is used also for analog audio domain and the miminum analog voltage of the TLV320AIC34 codec is 2.7 V.

To combine these two facts, the patch changes supply name to V28_A as the newer boards register VMMC2_30 for VAUX3 and uses the same constraints than VAUX3 since those constraints are ok for the TLV320AIC34.

Cc Adrian Hunter <[email protected]>
Cc Eduardo Valentin <[email protected]>

---

I was looking these from Maemo kernel sources, earlier patch [1] from Eduardo and from commit f52eeee83d360d536cab1c0296eae0ec5f05e4dd.

I didn't find are the older boards using VMMC2 for audio but I assumed so.

1. http://marc.info/?l=linux-omap&m=125500330932605&w=2

---
 arch/arm/mach-omap2/board-rx51-peripherals.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
arch/arm/mach-omap2/board-rx51-peripherals.c +3 -3
index 4377a4c..b803f47 100644
@@ -370,9 +370,9 @@ static struct regulator_init_data rx51_vmmc1 = {
 
 static struct regulator_init_data rx51_vmmc2 = {
 	.constraints = {
-		.name			= "VMMC2_30",
-		.min_uV			= 1850000,
-		.max_uV			= 3150000,
+		.name			= "V28_A",
+		.min_uV			= 2800000,
+		.max_uV			= 3000000,
 		.apply_uV		= true,
 		.valid_modes_mask	= REGULATOR_MODE_NORMAL
 					| REGULATOR_MODE_STANDBY,
Signature · 1 line
1.7.0
#1 lore raw

PATCH 2/3 omap: rx51: Add i2c2 board_info with tlv320aic3x

This makes possible to probe the audio codec and add another i2c2 components in the future.

Fix also indentation for the first omap_register_i2c_bus.

---
 arch/arm/mach-omap2/board-rx51-peripherals.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
arch/arm/mach-omap2/board-rx51-peripherals.c +9 -2
index b803f47..3addfe6 100644
@@ -629,6 +629,12 @@ static struct i2c_board_info __initdata rx51_peripherals_i2c_board_info_1[] = {
 	},
 };
 
+static struct i2c_board_info __initdata rx51_peripherals_i2c_board_info_2[] = {
+	{
+		I2C_BOARD_INFO("tlv320aic3x", 0x18),
+	},
+};
+
 static int __init rx51_i2c_init(void)
 {
 	if ((system_rev >= SYSTEM_REV_S_USES_VAUX3 && system_rev < 0x100) ||
@@ -639,8 +645,9 @@ static int __init rx51_i2c_init(void)
 		rx51_twldata.vmmc2 = &rx51_vmmc2;
 	}
 	omap_register_i2c_bus(1, 2200, rx51_peripherals_i2c_board_info_1,
-			ARRAY_SIZE(rx51_peripherals_i2c_board_info_1));
-	omap_register_i2c_bus(2, 100, NULL, 0);
+			      ARRAY_SIZE(rx51_peripherals_i2c_board_info_1));
+	omap_register_i2c_bus(2, 100, rx51_peripherals_i2c_board_info_2,
+			      ARRAY_SIZE(rx51_peripherals_i2c_board_info_2));
 	omap_register_i2c_bus(3, 400, NULL, 0);
 	return 0;
 }
Signature · 1 line
1.7.0
maintainer
#2 lore raw

PATCH 2/3 omap: rx51: Add i2c2 board_info with tlv320aic3x

This patch has been applied to the linux-omap
by youw fwiendly patch wobot.

Branch in linux-omap: for-next

Initial commit ID (Likely to change): 4f39e921e97d2856f69f3e0ab2c0853007da06c7

PatchWorks
http://patchwork.kernel.org/patch/96506/

Git (Likely to change, and takes a while to get mirrored)
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=4f39e921e97d2856f69f3e0ab2c0853007da06c7

#3 lore raw

PATCH 3/3 omap: rx51: Add supplies for the tlv320aic3x codec driver

In reply to Jarkko Nikula

Upcoming change to tlv320aic3x codec driver require four supplies. Implement this by connecting analogic supplies to TWL4030 VMMC2 and digital supplies to TWL4030 VIO.

Cc Eduardo Valentin <[email protected]>

---

Analogic supplies were able to find from Maemo kernel sources and earlier patch from Eduardo:

http://marc.info/?l=linux-omap&m=125500331032616&w=2

I made an educated guess that digital codec supplies are connected to 1.8 V IO voltage and it is derived from TWL4030 VIO (like in BeagleBoard).

---
 arch/arm/mach-omap2/board-rx51-peripherals.c |   60 +++++++++++++++++++++++---
 1 files changed, 53 insertions(+), 7 deletions(-)
arch/arm/mach-omap2/board-rx51-peripherals.c +53 -7
index 3addfe6..8179d55 100644
@@ -277,7 +277,7 @@ static struct regulator_consumer_supply rx51_vmmc1_supply = {
 	.dev_name = "mmci-omap-hs.0",
 };
 
-static struct regulator_consumer_supply rx51_vmmc2_supply = {
+static struct regulator_consumer_supply rx51_vaux3_supply = {
 	.supply   = "vmmc",
 	.dev_name = "mmci-omap-hs.1",
 };
@@ -287,6 +287,35 @@ static struct regulator_consumer_supply rx51_vsim_supply = {
 	.dev_name = "mmci-omap-hs.1",
 };
 
+static struct regulator_consumer_supply rx51_vmmc2_supplies[] = {
+	/* tlv320aic3x analog supplies */
+	{
+		.supply		= "AVDD",
+		.dev_name	= "2-0018",
+	},
+	{
+		.supply		= "DRVDD",
+		.dev_name	= "2-0018",
+	},
+	/* Keep vmmc as last item. It is not iterated for newer boards */
+	{
+		.supply		= "vmmc",
+		.dev_name	= "mmci-omap-hs.1",
+	},
+};
+
+static struct regulator_consumer_supply rx51_vio_supplies[] = {
+	/* tlv320aic3x digital supplies */
+	{
+		.supply		= "IOVDD",
+		.dev_name	= "2-0018"
+	},
+	{
+		.supply		= "DVDD",
+		.dev_name	= "2-0018"
+	},
+};
+
 static struct regulator_init_data rx51_vaux1 = {
 	.constraints = {
 		.name			= "V28",
@@ -338,7 +367,7 @@ static struct regulator_init_data rx51_vaux3_mmc = {
 					| REGULATOR_CHANGE_STATUS,
 	},
 	.num_consumer_supplies	= 1,
-	.consumer_supplies	= &rx51_vmmc2_supply,
+	.consumer_supplies	= &rx51_vaux3_supply,
 };
 
 static struct regulator_init_data rx51_vaux4 = {
@@ -380,8 +409,8 @@ static struct regulator_init_data rx51_vmmc2 = {
 					| REGULATOR_CHANGE_MODE
 					| REGULATOR_CHANGE_STATUS,
 	},
-	.num_consumer_supplies	= 1,
-	.consumer_supplies	= &rx51_vmmc2_supply,
+	.num_consumer_supplies	= ARRAY_SIZE(rx51_vmmc2_supplies),
+	.consumer_supplies	= rx51_vmmc2_supplies,
 };
 
 static struct regulator_init_data rx51_vsim = {
@@ -411,6 +440,20 @@ static struct regulator_init_data rx51_vdac = {
 	},
 };
 
+static struct regulator_init_data rx51_vio = {
+	.constraints = {
+		.min_uV			= 1800000,
+		.max_uV			= 1800000,
+		.valid_modes_mask	= REGULATOR_MODE_NORMAL
+					| REGULATOR_MODE_STANDBY,
+		.valid_ops_mask		= REGULATOR_CHANGE_VOLTAGE
+					| REGULATOR_CHANGE_MODE
+					| REGULATOR_CHANGE_STATUS,
+	},
+	.num_consumer_supplies	= ARRAY_SIZE(rx51_vio_supplies),
+	.consumer_supplies	= rx51_vio_supplies,
+};
+
 static int rx51_twlgpio_setup(struct device *dev, unsigned gpio, unsigned n)
 {
 	/* FIXME this gpio setup is just a placeholder for now */
@@ -618,6 +661,7 @@ static struct twl4030_platform_data rx51_twldata __initdata = {
 	.vmmc1			= &rx51_vmmc1,
 	.vsim			= &rx51_vsim,
 	.vdac			= &rx51_vdac,
+	.vio			= &rx51_vio,
 };
 
 static struct i2c_board_info __initdata rx51_peripherals_i2c_board_info_1[] = {
@@ -638,12 +682,14 @@ static struct i2c_board_info __initdata rx51_peripherals_i2c_board_info_2[] = {
 static int __init rx51_i2c_init(void)
 {
 	if ((system_rev >= SYSTEM_REV_S_USES_VAUX3 && system_rev < 0x100) ||
-	    system_rev >= SYSTEM_REV_B_USES_VAUX3)
+	    system_rev >= SYSTEM_REV_B_USES_VAUX3) {
 		rx51_twldata.vaux3 = &rx51_vaux3_mmc;
-	else {
+		/* Only older boards use VMMC2 for internal MMC */
+		rx51_vmmc2.num_consumer_supplies--;
+	} else {
 		rx51_twldata.vaux3 = &rx51_vaux3_cam;
-		rx51_twldata.vmmc2 = &rx51_vmmc2;
 	}
+	rx51_twldata.vmmc2 = &rx51_vmmc2;
 	omap_register_i2c_bus(1, 2200, rx51_peripherals_i2c_board_info_1,
 			      ARRAY_SIZE(rx51_peripherals_i2c_board_info_1));
 	omap_register_i2c_bus(2, 100, rx51_peripherals_i2c_board_info_2,
Signature · 1 line
1.7.0
#4 lore raw

Re: [PATCH 3/3] omap: rx51: Add supplies for the tlv320aic3x codec driver

Quoted 12 lines · On Mon, 3 May 2010 18:56:16 +0300 Jarkko Nikula <[email protected]> wrote:

Upcoming change to tlv320aic3x codec driver require four supplies. Implement this by connecting analogic supplies to TWL4030 VMMC2 and digital supplies to TWL4030 VIO.

Cc Eduardo Valentin <[email protected]>

---

Analogic supplies were able to find from Maemo kernel sources and earlier patch from Eduardo:

Quoted 8 lines

http://marc.info/?l=linux-omap&m=125500331032616&w=2

I made an educated guess that digital codec supplies are connected to 1.8 V IO voltage and it is derived from TWL4030 VIO (like in BeagleBoard).

---
 arch/arm/mach-omap2/board-rx51-peripherals.c |   60 +++++++++++++++++++++++---
 1 files changed, 53 insertions(+), 7 deletions(-)

I have one patch more to this set but it cannot be applied before this tlv320aic3x patch hits into mainline:

http://mailman.alsa-project.org/pipermail/alsa-devel/2010-May/027408.html

Signature · 11 lines
Jarkko

==================== CUT HERE ============================
From: Jarkko Nikula <[email protected]>
Date: Wed, 5 May 2010 13:57:00 +0300
Subject: [PATCH] omap: rx51: Add platform_data for tlv320aic3x with reset gpio number

Signed-off-by: Jarkko Nikula <[email protected]>
---
 arch/arm/mach-omap2/board-rx51-peripherals.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/board-rx51-peripherals.c +7 -0
index 8179d55..0047026 100644
@@ -33,6 +33,8 @@
 #include <plat/onenand.h>
 #include <plat/gpmc-smc91x.h>
 
+#include <sound/tlv320aic3x.h>
+
 #include "mux.h"
 #include "hsmmc.h"
 
@@ -664,6 +666,10 @@ static struct twl4030_platform_data rx51_twldata __initdata = {
 	.vio			= &rx51_vio,
 };
 
+static struct aic3x_pdata rx51_aic3x_data __initdata = {
+	.gpio_reset		= 60,
+};
+
 static struct i2c_board_info __initdata rx51_peripherals_i2c_board_info_1[] = {
 	{
 		I2C_BOARD_INFO("twl5030", 0x48),
@@ -676,6 +682,7 @@ static struct i2c_board_info __initdata rx51_peripherals_i2c_board_info_1[] = {
 static struct i2c_board_info __initdata rx51_peripherals_i2c_board_info_2[] = {
 	{
 		I2C_BOARD_INFO("tlv320aic3x", 0x18),
+		.platform_data = &rx51_aic3x_data,
 	},
 };
 
Signature · 1 line
1.7.0
#5 lore raw

Re: [PATCH 3/3] omap: rx51: Add supplies for the tlv320aic3x codec driver

Quoted 4 lines · Jarkko Nikula

I have one patch more to this set but it cannot be applied before this tlv320aic3x patch hits into mainline:

http://mailman.alsa-project.org/pipermail/alsa-devel/2010-May/027408.html

Seems sensible to merge this along with the CODEC driver patch it depends on if everyone else is happy (assuming no merge issues)?

maintainer Acked-by
#6 lore raw

Re: [PATCH 3/3] omap: rx51: Add supplies for the tlv320aic3x codec driver

Quoted 9 lines · Mark Brown
Quoted 4 lines · Jarkko Nikula

I have one patch more to this set but it cannot be applied before this tlv320aic3x patch hits into mainline:

http://mailman.alsa-project.org/pipermail/alsa-devel/2010-May/027408.html

Seems sensible to merge this along with the CODEC driver patch it depends on if everyone else is happy (assuming no merge issues)?

Sounds good to me. I'll take the other ones, if there are merge issues then we can move some of the other patches into your tree too.

#7 lore raw

Re: [PATCH 3/3] omap: rx51: Add supplies for the tlv320aic3x codec driver

Quoted 4 lines · Tony Lindgren

Sounds good to me. I'll take the other ones, if there are merge issues then we can move some of the other patches into your tree too.

OK, please resubmit to ASoC (Liam will be picking this one up since it's OMAP-specific).

#8 lore raw

Re: [PATCH 3/3] omap: rx51: Add supplies for the tlv320aic3x codec driver

In reply to Tony Lindgren
Quoted 8 lines · On Wed, 5 May 2010 08:15:39 -0700 Tony Lindgren <[email protected]> wrote:
Quoted 2 lines · Mark Brown

Seems sensible to merge this along with the CODEC driver patch it depends on if everyone else is happy (assuming no merge issues)?

Sounds good to me. I'll take the other ones, if there are merge issues then we can move some of the other patches into your tree too.

I would rather keep the board-rx51-peripherals.c in linux-omap sync than get the N900 audio working as soon as possible :-)

None of these patches are build or boot critical so I can wait & repost the last one when the codec patches hit into mainline.

Only harm from some missing board-rx51-peripherals.c patch is that codec either doesn't probe or is kept in reset but system boots up fine. And trees are clean too!

Signature · 1 line
Jarkko
maintainer
#9 lore raw

Re: [PATCH 3/3] omap: rx51: Add supplies for the tlv320aic3x codec driver

Quoted 15 lines · Jarkko Nikula
Quoted 8 lines · On Wed, 5 May 2010 08:15:39 -0700 Tony Lindgren <[email protected]> wrote:
Quoted 2 lines · Mark Brown

Seems sensible to merge this along with the CODEC driver patch it depends on if everyone else is happy (assuming no merge issues)?

Sounds good to me. I'll take the other ones, if there are merge issues then we can move some of the other patches into your tree too.

I would rather keep the board-rx51-peripherals.c in linux-omap sync than get the N900 audio working as soon as possible :-)

Quoted 6 lines

None of these patches are build or boot critical so I can wait & repost the last one when the codec patches hit into mainline.

Only harm from some missing board-rx51-peripherals.c patch is that codec either doesn't probe or is kept in reset but system boots up fine. And trees are clean too!

OK, fine with me.

Tony

maintainer
#10 lore raw

PATCH 3/3 omap: rx51: Add supplies for the tlv320aic3x codec

In reply to Jarkko Nikula

This patch has been applied to the linux-omap
by youw fwiendly patch wobot.

Branch in linux-omap: for-next

Initial commit ID (Likely to change): 138eb2e88b5021b0a1ff23111e7a788323316f59

PatchWorks
http://patchwork.kernel.org/patch/96507/

Git (Likely to change, and takes a while to get mirrored)
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=138eb2e88b5021b0a1ff23111e7a788323316f59

maintainer
#11 lore raw

PATCH 1/3 omap: rx51: Change the TWL4030 VMMC2 voltage

In reply to Jarkko Nikula

This patch has been applied to the linux-omap
by youw fwiendly patch wobot.

Branch in linux-omap: for-next

Initial commit ID (Likely to change): 597e16fc7c7867087548f10413643350371e4b77

PatchWorks
http://patchwork.kernel.org/patch/96505/

Git (Likely to change, and takes a while to get mirrored)
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=597e16fc7c7867087548f10413643350371e4b77