ARM: tegra: harmony: I2C-related portions of audio support
authorStephen Warren <swarren@nvidia.com>
Sat, 5 Mar 2011 05:42:31 +0000 (22:42 -0700)
committerOlof Johansson <olof@lixom.net>
Mon, 7 Mar 2011 23:44:32 +0000 (15:44 -0800)
This patch is the portion of the audio-related setup that relies additionally
on the latest Tegra I2C driver being merged.

* Define platform data for WM8903 audio codec
* Register WM8903 as an I2C device

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
arch/arm/mach-tegra/board-harmony.c

index ea908cd0d550e2d17a6ec5857355d6bc958e8a59..82c780345a9f04284acc8cf47920ce44604ac8d6 100644 (file)
@@ -27,6 +27,8 @@
 #include <linux/i2c.h>
 #include <linux/i2c-tegra.h>
 
+#include <sound/wm8903.h>
+
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/time.h>
@@ -96,6 +98,25 @@ static struct tegra_i2c_platform_data harmony_dvc_platform_data = {
        .bus_clk_rate   = 400000,
 };
 
+static struct wm8903_platform_data harmony_wm8903_pdata = {
+       .irq_active_low = 0,
+       .micdet_cfg = 0,
+       .micdet_delay = 100,
+       .gpio_cfg = {
+               WM8903_GPIO_NO_CONFIG,
+               WM8903_GPIO_NO_CONFIG,
+               0,
+               WM8903_GPIO_NO_CONFIG,
+               WM8903_GPIO_NO_CONFIG,
+       },
+};
+
+static struct i2c_board_info __initdata wm8903_board_info = {
+       I2C_BOARD_INFO("wm8903", 0x1a),
+       .platform_data = &harmony_wm8903_pdata,
+       .irq = TEGRA_GPIO_TO_IRQ(TEGRA_GPIO_CDC_IRQ),
+};
+
 static void __init harmony_i2c_init(void)
 {
        tegra_i2c_device1.dev.platform_data = &harmony_i2c1_platform_data;
@@ -107,6 +128,8 @@ static void __init harmony_i2c_init(void)
        platform_device_register(&tegra_i2c_device2);
        platform_device_register(&tegra_i2c_device3);
        platform_device_register(&tegra_i2c_device4);
+
+       i2c_register_board_info(0, &wm8903_board_info, 1);
 }
 
 static struct platform_device *harmony_devices[] __initdata = {