Skip to contentSkip to conversation

omap: n8x0: Audio update to N810

PATCH In review Jarkko Nikula 2 participants 6 messages Aug 9, 2010 – Aug 10, 2010

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

cover omap: n8x0: Audio update to N810

Hi

With this set and a fix [1] it is possible to get ALSA SoC on N810 working.

This set is generated against mainline commit e320cea but applies also to linux-omap (board-n8x0.c has cbus patches in linux-omap).

Signature · 2 lines
Jarkko
1. http://marc.info/?l=linux-omap&m=128109830113485&w=2
#1 lore raw

PATCH 1/3 omap: n8x0: Cleanup i2c1 and menelaus registration

- Move n8x0_i2c_board_info_1 out from #ifdef CONFIG_MENELAUS block, register i2c1 in n8x0_init_machine and do a few clean-ups around these. Code looks better if board infos are grouped together
- Mark n8x0_i2c_board_info_1 and n8x0_menelaus_platform_data with __initdata

---
 arch/arm/mach-omap2/board-n8x0.c |   34 +++++++++++++++-------------------
 1 files changed, 15 insertions(+), 19 deletions(-)
arch/arm/mach-omap2/board-n8x0.c +15 -19
index a3e2b49..313ce5e 100644
@@ -614,30 +614,25 @@ static int n8x0_menelaus_late_init(struct device *dev)
 	return 0;
 }
 
-static struct i2c_board_info __initdata n8x0_i2c_board_info_1[] = {
+#else
+static int n8x0_menelaus_late_init(struct device *dev)
+{
+	return 0;
+}
+#endif
+
+static struct menelaus_platform_data n8x0_menelaus_platform_data __initdata = {
+	.late_init = n8x0_menelaus_late_init,
+};
+
+static struct i2c_board_info __initdata n8x0_i2c_board_info_1[] __initdata = {
 	{
 		I2C_BOARD_INFO("menelaus", 0x72),
 		.irq = INT_24XX_SYS_NIRQ,
+		.platform_data = &n8x0_menelaus_platform_data,
 	},
 };
 
-static struct menelaus_platform_data n8x0_menelaus_platform_data = {
-	.late_init = n8x0_menelaus_late_init,
-};
-
-static void __init n8x0_menelaus_init(void)
-{
-	n8x0_i2c_board_info_1[0].platform_data = &n8x0_menelaus_platform_data;
-	omap_register_i2c_bus(1, 400, n8x0_i2c_board_info_1,
-			      ARRAY_SIZE(n8x0_i2c_board_info_1));
-}
-
-#else
-static inline void __init n8x0_menelaus_init(void)
-{
-}
-#endif
-
 static void __init n8x0_map_io(void)
 {
 	omap2_set_globals_242x();
@@ -665,9 +660,10 @@ static void __init n8x0_init_machine(void)
 	/* FIXME: add n810 spi devices */
 	spi_register_board_info(n800_spi_board_info,
 				ARRAY_SIZE(n800_spi_board_info));
+	omap_register_i2c_bus(1, 400, n8x0_i2c_board_info_1,
+			      ARRAY_SIZE(n8x0_i2c_board_info_1));
 
 	omap_serial_init();
-	n8x0_menelaus_init();
 	n8x0_onenand_init();
 	n8x0_mmc_init();
 	n8x0_usb_init();
Signature · 1 line
1.7.1
#2 lore raw

PATCH 2/3 omap: n8x0: Register i2c2 and add board info with tlv320aic3x for N810

In reply to Jarkko Nikula

Second i2c bus on Nokia N800 and N810 shares both common and hw specific peripherals. Register now this bus and add board info with tlv320aic3x for N810. Common peripherals may be added as an additional board info to omap_register_i2c_bus(2, ...);

---
With this patch it is possible to probe tlv320aic3x audio codec and get the ASoC subsystem registered on Nokia N810.

---
 arch/arm/mach-omap2/board-n8x0.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/board-n8x0.c +16 -0
index 313ce5e..7863633 100644
@@ -20,6 +20,7 @@
 #include <linux/i2c.h>
 #include <linux/spi/spi.h>
 #include <linux/usb/musb.h>
+#include <sound/tlv320aic3x.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach-types.h>
@@ -633,6 +634,17 @@ static struct i2c_board_info __initdata n8x0_i2c_board_info_1[] __initdata = {
 	},
 };
 
+static struct aic3x_pdata n810_aic33_data __initdata = {
+	.gpio_reset = 118,
+};
+
+static struct i2c_board_info n810_i2c_board_info_2[] __initdata = {
+	{
+		I2C_BOARD_INFO("tlv320aic3x", 0x18),
+		.platform_data = &n810_aic33_data,
+	},
+};
+
 static void __init n8x0_map_io(void)
 {
 	omap2_set_globals_242x();
@@ -662,6 +674,10 @@ static void __init n8x0_init_machine(void)
 				ARRAY_SIZE(n800_spi_board_info));
 	omap_register_i2c_bus(1, 400, n8x0_i2c_board_info_1,
 			      ARRAY_SIZE(n8x0_i2c_board_info_1));
+	omap_register_i2c_bus(2, 400, NULL, 0);
+	if (machine_is_nokia_n810())
+		i2c_register_board_info(2, n810_i2c_board_info_2,
+					ARRAY_SIZE(n810_i2c_board_info_2));
 
 	omap_serial_init();
 	n8x0_onenand_init();
Signature · 1 line
1.7.1
#3 lore raw

PATCH 3/3 omap: n8x0: Mux i2s codec port pins for McBSP block

In reply to Jarkko Nikula

Bootloader on Nokia N800 and N810 muxes I2C codec port pins for EAC block. As there is no driver and use for EAC, mux those pins for McBSP instead since N810 ASoC drivers can use it.

---
With this patch it is possible to use audio on Nokia N810 by enabling the CONFIG_SND_OMAP_SOC_N810=y

---
 arch/arm/mach-omap2/board-n8x0.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/board-n8x0.c +5 -0
index 7863633..8fd2269 100644
@@ -660,6 +660,11 @@ static void __init n8x0_init_irq(void)
 
 #ifdef CONFIG_OMAP_MUX
 static struct omap_board_mux board_mux[] __initdata = {
+	/* I2S codec port pins for McBSP block */
+	OMAP2420_MUX(EAC_AC_SCLK, OMAP_MUX_MODE1 | OMAP_PIN_INPUT),
+	OMAP2420_MUX(EAC_AC_FS, OMAP_MUX_MODE1 | OMAP_PIN_INPUT),
+	OMAP2420_MUX(EAC_AC_DIN, OMAP_MUX_MODE1 | OMAP_PIN_INPUT),
+	OMAP2420_MUX(EAC_AC_DOUT, OMAP_MUX_MODE1 | OMAP_PIN_OUTPUT),
 	{ .reg_offset = OMAP_MUX_TERMINATOR },
 };
 #else
Signature · 1 line
1.7.1
maintainer
#4 lore raw
In reply to Jarkko Nikula
Quoted 6 lines · Jarkko Nikula

Hi

With this set and a fix [1] it is possible to get ALSA SoC on N810 working.

This set is generated against mainline commit e320cea but applies also to linux-omap (board-n8x0.c has cbus patches in linux-omap).

I've added these into omap for-next for 2.6.37. Let me know if these should go in along with other ASoC patches.

Regards,

Tony

Quoted 1 line

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

#5 lore raw
Quoted 8 lines · On Tue, 10 Aug 2010 15:07:34 +0300 Tony Lindgren <[email protected]> wrote:
Quoted 4 lines

With this set and a fix [1] it is possible to get ALSA SoC on N810 working.

This set is generated against mainline commit e320cea but applies also to linux-omap (board-n8x0.c has cbus patches in linux-omap).

I've added these into omap for-next for 2.6.37. Let me know if these should go in along with other ASoC patches.

Ok, good. This is independent set so no need for any special procedure :-)

Signature · 1 line
Jarkko