Skip to contentSkip to conversation

ARM: SMDK64XX: Enable AC97 device

PATCH New Mark Brown 1 participant 5 messages Feb 12, 2010

Subsystems (3)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/5 ARM: SMDK64XX: Enable AC97 device

From: Jassi Brar <[email protected]>

Add AC97 controller to platform devices and initialize the AC97 gpios.

---
 arch/arm/mach-s3c6410/mach-smdk6410.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
arch/arm/mach-s3c6410/mach-smdk6410.c +8 -1
index eba345f..259ebbb 100644
@@ -55,6 +55,7 @@
 #include <plat/gpio-cfg.h>
 
 #include <plat/s3c6410.h>
+#include <plat/audio.h>
 #include <plat/clock.h>
 #include <plat/devs.h>
 #include <plat/cpu.h>
@@ -253,7 +254,9 @@ static struct platform_device *smdk6410_devices[] __initdata = {
 	&smdk6410_b_pwr_5v,
 #endif
 	&smdk6410_lcd_powerdev,
-
+#ifdef CONFIG_SND_SOC_SMDK_WM9713
+	&s3c64xx_device_ac97,
+#endif
 	&smdk6410_smsc911x,
 };
 
@@ -475,6 +478,10 @@ static void __init smdk6410_machine_init(void)
 	i2c_register_board_info(0, i2c_devs0, ARRAY_SIZE(i2c_devs0));
 	i2c_register_board_info(1, i2c_devs1, ARRAY_SIZE(i2c_devs1));
 
+#ifdef CONFIG_SND_SOC_SMDK_WM9713
+	s3c64xx_ac97_setup_gpio(S3C64XX_AC97_GPD);
+#endif
+
 	platform_add_devices(smdk6410_devices, ARRAY_SIZE(smdk6410_devices));
 }
 
Signature · 1 line
1.6.6.1
author
#1 lore raw

PATCH 2/5 ARM: SMDK2443: Enable AC97 device

From: Jassi Brar <[email protected]>

Add AC97 controller to platform devices and initialize the AC97 gpios.

---
 arch/arm/mach-s3c2443/mach-smdk2443.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
arch/arm/mach-s3c2443/mach-smdk2443.c +8 -0
index d65afde..e2e362b 100644
@@ -106,6 +106,9 @@ static struct platform_device *smdk2443_devices[] __initdata = {
 	&s3c_device_wdt,
 	&s3c_device_i2c0,
 	&s3c_device_hsmmc0,
+#ifdef CONFIG_SND_SOC_SMDK2443_WM9710
+	&s3c_device_ac97,
+#endif
 };
 
 static void __init smdk2443_map_io(void)
@@ -118,6 +121,11 @@ static void __init smdk2443_map_io(void)
 static void __init smdk2443_machine_init(void)
 {
 	s3c_i2c0_set_platdata(NULL);
+
+#ifdef CONFIG_SND_SOC_SMDK2443_WM9710
+	s3c24xx_ac97_setup_gpio(S3C24XX_AC97_GPE0);
+#endif
+
 	platform_add_devices(smdk2443_devices, ARRAY_SIZE(smdk2443_devices));
 	smdk_machine_init();
 }
Signature · 1 line
1.6.6.1
author
#2 lore raw

PATCH 3/5 ARM: S3C64XX: Add AC97 platform resources

In reply to Mark Brown

From: Jassi Brar <[email protected]>

This patch defines the platform device and the resources: IRQ, DMA and MEM, needed by the AC97 controller driver.

---
 arch/arm/plat-s3c/include/plat/audio.h |    8 +++
 arch/arm/plat-s3c/include/plat/devs.h  |    3 +
 arch/arm/plat-s3c64xx/dev-audio.c      |   78 ++++++++++++++++++++++++++++++++
 3 files changed, 89 insertions(+), 0 deletions(-)
arch/arm/plat-s3c/include/plat/audio.h +8 -0
index f22d23b..e07c941 100644
@@ -8,6 +8,14 @@
  * published by the Free Software Foundation.
  */
 
+/* The machine init code calls s3c*_ac97_setup_gpio with
+ * one of these defines in order to select appropriate bank
+ * of GPIO for AC97 pins
+ */
+#define S3C64XX_AC97_GPD  0
+#define S3C64XX_AC97_GPE  1
+extern void s3c64xx_ac97_setup_gpio(int);
+
 /**
  * struct s3c_audio_pdata - common platform data for audio device drivers
  * @cfg_gpio: Callback function to setup mux'ed pins in I2S/PCM/AC97 mode
arch/arm/plat-s3c/include/plat/devs.h +3 -0
index c6f9b73..65317eb 100644
@@ -35,7 +35,10 @@ extern struct platform_device s3c64xx_device_spi1;
 extern struct platform_device s3c64xx_device_pcm0;
 extern struct platform_device s3c64xx_device_pcm1;
 
+extern struct platform_device s3c64xx_device_ac97;
+
 extern struct platform_device s3c_device_ts;
+
 extern struct platform_device s3c_device_fb;
 extern struct platform_device s3c_device_ohci;
 extern struct platform_device s3c_device_lcd;
arch/arm/plat-s3c64xx/dev-audio.c +78 -0

87 lines not on this page · raw message

Signature · 1 line
1.6.6.1
author
#3 lore raw

PATCH 4/5 ARM: S3C2443: GPIO: Correct AC97 pin defines

In reply to Mark Brown

From: Jassi Brar <[email protected]>

GPIO_E-[5,9] pin functionality was defined incorrectly. The patch corrects and adds missing pins.

---
 arch/arm/mach-s3c2410/include/mach/regs-gpio.h |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
arch/arm/mach-s3c2410/include/mach/regs-gpio.h +5 -5
index ebc85c6..fd672f3 100644
@@ -406,31 +406,31 @@
 #define S3C2443_GPE5_SD1_CLK   (0x02 << 10)
 #define S3C2400_GPE5_EINT5     (0x02 << 10)
 #define S3C2400_GPE5_TCLK1     (0x03 << 10)
+#define S3C2443_GPE5_AC_BITCLK (0x03 << 10)
 
 #define S3C2410_GPE6_SDCMD     (0x02 << 12)
 #define S3C2443_GPE6_SD1_CMD   (0x02 << 12)
-#define S3C2443_GPE6_AC_BITCLK (0x03 << 12)
+#define S3C2443_GPE6_AC_SDI    (0x03 << 12)
 #define S3C2400_GPE6_EINT6     (0x02 << 12)
 
 #define S3C2410_GPE7_SDDAT0    (0x02 << 14)
 #define S3C2443_GPE5_SD1_DAT0  (0x02 << 14)
-#define S3C2443_GPE7_AC_SDI    (0x03 << 14)
+#define S3C2443_GPE7_AC_SDO    (0x03 << 14)
 #define S3C2400_GPE7_EINT7     (0x02 << 14)
 
 #define S3C2410_GPE8_SDDAT1    (0x02 << 16)
 #define S3C2443_GPE8_SD1_DAT1  (0x02 << 16)
-#define S3C2443_GPE8_AC_SDO    (0x03 << 16)
+#define S3C2443_GPE8_AC_SYNC   (0x03 << 16)
 #define S3C2400_GPE8_nXDACK0   (0x02 << 16)
 
 #define S3C2410_GPE9_SDDAT2    (0x02 << 18)
 #define S3C2443_GPE9_SD1_DAT2  (0x02 << 18)
-#define S3C2443_GPE9_AC_SYNC   (0x03 << 18)
+#define S3C2443_GPE9_AC_nRESET (0x03 << 18)
 #define S3C2400_GPE9_nXDACK1   (0x02 << 18)
 #define S3C2400_GPE9_nXBACK    (0x03 << 18)
 
 #define S3C2410_GPE10_SDDAT3   (0x02 << 20)
 #define S3C2443_GPE10_SD1_DAT3 (0x02 << 20)
-#define S3C2443_GPE10_AC_nRESET (0x03 << 20)
 #define S3C2400_GPE10_nXDREQ0  (0x02 << 20)
 
 #define S3C2410_GPE11_SPIMISO0 (0x02 << 22)
Signature · 1 line
1.6.6.1
author
#4 lore raw

PATCH 5/5 ARM: SMDK6410: Fix modular build of AC97 audio driver

In reply to Mark Brown

When the AC97 audio driver is built modular a _MODULE is appended to the symbol defined for the config option. Rather than write a lengthy check against multiple symbols just unconditionally register the AC97 controller device - much simpler and hardly a massive resource hit.

---
 arch/arm/mach-s3c6410/mach-smdk6410.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)
arch/arm/mach-s3c6410/mach-smdk6410.c +0 -4
index 259ebbb..f2c70ec 100644
@@ -254,9 +254,7 @@ static struct platform_device *smdk6410_devices[] __initdata = {
 	&smdk6410_b_pwr_5v,
 #endif
 	&smdk6410_lcd_powerdev,
-#ifdef CONFIG_SND_SOC_SMDK_WM9713
 	&s3c64xx_device_ac97,
-#endif
 	&smdk6410_smsc911x,
 };
 
@@ -478,9 +476,7 @@ static void __init smdk6410_machine_init(void)
 	i2c_register_board_info(0, i2c_devs0, ARRAY_SIZE(i2c_devs0));
 	i2c_register_board_info(1, i2c_devs1, ARRAY_SIZE(i2c_devs1));
 
-#ifdef CONFIG_SND_SOC_SMDK_WM9713
 	s3c64xx_ac97_setup_gpio(S3C64XX_AC97_GPD);
-#endif
 
 	platform_add_devices(smdk6410_devices, ARRAY_SIZE(smdk6410_devices));
 }
Signature · 1 line
1.6.6.1