ASoC: sam9g20: using platform device for audio part
authorBo Shen <voice.shen@atmel.com>
Thu, 11 Oct 2012 02:38:16 +0000 (10:38 +0800)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 6 Nov 2012 09:11:33 +0000 (10:11 +0100)
Signed-off-by: Bo Shen <voice.shen@atmel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
arch/arm/mach-at91/at91sam9260_devices.c
arch/arm/mach-at91/board-sam9g20ek.c

index a76b8684f52d07328fcfe2f4a08726124b643f5a..0f24cfb9e54ad9b6df19908a88bb5d36e7c6bff4 100644 (file)
@@ -768,6 +768,14 @@ static inline void configure_ssc_pins(unsigned pins)
                at91_set_A_periph(AT91_PIN_PB21, 1);
 }
 
+static struct platform_device at91sam9260_ssc_dai_device = {
+       .name   = "atmel-ssc-dai",
+       .id     = 0,
+       .dev    = {
+               .parent = &(at91sam9260_ssc_device.dev),
+       },
+};
+
 /*
  * SSC controllers are accessed through library code, instead of any
  * kind of all-singing/all-dancing driver.  For example one could be
@@ -792,6 +800,7 @@ void __init at91_add_device_ssc(unsigned id, unsigned pins)
        }
 
        platform_device_register(pdev);
+       platform_device_register(&at91sam9260_ssc_dai_device);
 }
 
 #else
index 3ab2b86a3762a67da9b808386d39c51fb8cd2544..5b6a6f9a94f49f9c6ccc6e670fffa65a9f6c2122 100644 (file)
@@ -353,6 +353,22 @@ static struct i2c_board_info __initdata ek_i2c_devices[] = {
         },
 };
 
+static struct platform_device sam9g20ek_pcm_device = {
+       .name   = "atmel-pcm-audio",
+       .id = -1,
+};
+
+static struct platform_device sam9g20ek_audio_device = {
+       .name   = "at91sam9g20ek-audio",
+       .id     = -1,
+};
+
+static void __init ek_add_device_audio(void)
+{
+       platform_device_register(&sam9g20ek_pcm_device);
+       platform_device_register(&sam9g20ek_audio_device);
+}
+
 
 static void __init ek_board_init(void)
 {
@@ -394,6 +410,7 @@ static void __init ek_board_init(void)
        at91_set_B_periph(AT91_PIN_PC1, 0);
        /* SSC (for WM8731) */
        at91_add_device_ssc(AT91SAM9260_ID_SSC, ATMEL_SSC_TX);
+       ek_add_device_audio();
 }
 
 MACHINE_START(AT91SAM9G20EK, "Atmel AT91SAM9G20-EK")