Skip to contentSkip to conversation

pxa/hx4700: add platform device and I2C info for AK4641 codec

PATCH Applied Axel Lin 3 participants 4 messages Dec 30, 2011 – Feb 2, 2012

Subsystems (3)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH v2 1/1 pxa/hx4700: add platform device and I2C info for AK4641 codec

The audio on hx4700 needs this to properly work.

---
v2: Avoid rename AK4641 power GPIOs.

 arch/arm/mach-pxa/hx4700.c |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)
arch/arm/mach-pxa/hx4700.c +25 -0
index fb9b62d..208eef1 100644
@@ -45,6 +45,7 @@
 #include <mach/hx4700.h>
 #include <mach/irda.h>
 
+#include <sound/ak4641.h>
 #include <video/platform_lcd.h>
 #include <video/w100fb.h>
 
@@ -765,6 +766,28 @@ static struct i2c_board_info __initdata pi2c_board_info[] = {
 };
 
 /*
+ * Asahi Kasei AK4641 on I2C
+ */
+
+static struct ak4641_platform_data ak4641_info = {
+	.gpio_power = GPIO27_HX4700_CODEC_ON,
+	.gpio_npdn  = GPIO109_HX4700_CODEC_nPDN,
+};
+
+static struct i2c_board_info i2c_board_info[] __initdata = {
+	{
+		I2C_BOARD_INFO("ak4641", 0x12),
+		.platform_data = &ak4641_info,
+	},
+};
+
+static struct platform_device audio = {
+	.name	= "hx4700-audio",
+	.id	= -1,
+};
+
+
+/*
  * PCMCIA
  */
 
@@ -790,6 +813,7 @@ static struct platform_device *devices[] __initdata = {
 	&gpio_vbus,
 	&power_supply,
 	&strataflash,
+	&audio,
 	&pcmcia,
 };
 
@@ -827,6 +851,7 @@ static void __init hx4700_init(void)
 	pxa_set_ficp_info(&ficp_info);
 	pxa27x_set_i2c_power_info(NULL);
 	pxa_set_i2c_info(NULL);
+	i2c_register_board_info(0, ARRAY_AND_SIZE(i2c_board_info));
 	i2c_register_board_info(1, ARRAY_AND_SIZE(pi2c_board_info));
 	pxa2xx_set_spi_info(2, &pxa_ssp2_master_info);
 	spi_register_board_info(ARRAY_AND_SIZE(tsc2046_board_info));
Signature · 1 line
1.7.5.4
Tested-by on v2 1/1
#1 lore raw

Works for me on linux-3.2-rc7.

Quoted 100 lines · Axel Lin

From: Axel Lin <[email protected]>
Subject: [PATCH v2] pxa/hx4700: add platform device and I2C info for AK4641 codec
To: linux-kernel at vger.kernel.org
Cc: "Philipp Zabel" <[email protected]>, "Dmitry Artamonow" <[email protected]>, "Mark Brown" <[email protected]>, "Liam Girdwood" <[email protected]>, "Haojian Zhuang" <[email protected]>, "Eric Miao" <[email protected]>, linux-arm-kernel at lists.infradead.org
Date: Friday, 30 December, 2011, 4:06
The audio on hx4700 needs this to
properly work.

---
v2: Avoid rename AK4641 power GPIOs.

arch/arm/mach-pxa/hx4700.c |???25
+++++++++++++++++++++++++

 1 files changed, 25 insertions(+), 0 deletions(-)
arch/arm/mach-pxa/hx4700.c +12 -0
index fb9b62d..208eef1 100644
@@ -45,6 +45,7 @@
 #include <mach/hx4700.h>
 #include <mach/irda.h>
 
+#include <sound/ak4641.h>
 #include <video/platform_lcd.h>
 #include <video/w100fb.h>
 
@@ -765,6 +766,28 @@ static struct i2c_board_info
 __initdata pi2c_board_info[] = {
 };
 
 /*
+ * Asahi Kasei AK4641 on I2C
+ */
+
+static struct ak4641_platform_data ak4641_info = {
+??? .gpio_power = GPIO27_HX4700_CODEC_ON,
+??? .gpio_npdn? =
 GPIO109_HX4700_CODEC_nPDN,
+};
+
+static struct i2c_board_info i2c_board_info[] __initdata =
 {
+??? {
+??? ???

I2C_BOARD_INFO("ak4641", 0x12),
+??? ??? .platform_data =
&ak4641_info,
+??? },

arch/arm/mach-pxa/hx4700.c +4 -0
+};
+
+static struct platform_device audio = {
+??? .name??? =

"hx4700-audio",
+??? .id??? = -1,

arch/arm/mach-pxa/hx4700.c +4 -0
+};
+
+
+/*

? * PCMCIA
? */

arch/arm/mach-pxa/hx4700.c +2 -0
@@ -790,6 +813,7 @@ static struct platform_device
 *devices[] __initdata = {
 ??? &gpio_vbus,
 ??? &power_supply,
 ??? &strataflash,
+??? &audio,
 ??? &pcmcia,
 };
@@ -827,6 +851,7 @@ static void __init hx4700_init(void)
 ??? pxa_set_ficp_info(&ficp_info);
 ??? pxa27x_set_i2c_power_info(NULL);
 ??? pxa_set_i2c_info(NULL);
+??? i2c_register_board_info(0,
 ARRAY_AND_SIZE(i2c_board_info));
 ??? i2c_register_board_info(1,
 ARRAY_AND_SIZE(pi2c_board_info));

??? pxa2xx_set_spi_info(2,
&pxa_ssp2_master_info);
???
spi_register_board_info(ARRAY_AND_SIZE(tsc2046_board_info));

Signature · 10 lines
1.7.5.4



--
To unsubscribe from this list: send the line "unsubscribe
linux-kernel" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at? http://vger.kernel.org/majordomo-info.html
Please read the FAQ at? http://www.tux.org/lkml/
author
#3 lore raw

2012/1/4 Haojian Zhuang <[email protected]>:

Quoted 6 lines · Paul Parsons
Quoted 4 lines

Works for me on linux-3.2-rc7.

Applied.

Hi Haojian,
This patch is not (yet) upstream.
Not in Linus' tree. and not in linux-next tree.
Could you help to check it again.

Thanks,
Axel