Fix artik audio bootup
authorbsvt <b.theogaraj@samsung.com>
Thu, 7 Sep 2017 06:46:47 +0000 (23:46 -0700)
committerShivam Garg <garg.shivam@samsung.com>
Mon, 18 Sep 2017 14:03:31 +0000 (23:03 +0900)
os/arch/arm/src/artik053/src/Makefile
os/arch/arm/src/artik053/src/artik053_alc5658.c
os/arch/arm/src/artik053/src/artik053_boot.c

index 4670ef0..aef116f 100644 (file)
@@ -66,7 +66,9 @@ CSRCS += artik053_alc5658_i2c.c
 endif
 endif
 
-ifeq ($(CONFIG_AUDIO_ALC5658CHAR),y)
+ifeq ($(CONFIG_AUDIO_ALC5658),y)
+CSRCS += artik053_alc5658.c
+else ifeq ($(CONFIG_AUDIO_ALC5658CHAR),y)
 CSRCS += artik053_alc5658char.c
 endif
 
index d84804f..2ed7b47 100644 (file)
@@ -285,17 +285,6 @@ int s5j_alc5658_initialize(int minor)
                /* Now we can use these I2C and I2S interfaces to initialize the
                 * ALC5658 which will return an audio interface.
                 */
-               /* Create a device name */
-#ifdef CONFIG_AUDIO_MULTI_CARD
-
-               /*Device name for capture interface of sound card */
-               snprintf(devname, 12, "pcmC%uD%u%c", minor, 0, 'c');
-
-
-               /* ALC5658 initiliased for capture device */
-               /* Now we can use these I2C and I2S interfaces to initialize the
-                * ALC5658 which will return an audio interface.
-                */
                alc5658 = alc5658_initialize(i2c, i2s, &g_alc5658info.lower);
                if (!alc5658) {
                        auddbg("ERROR: Failed to initialize the ALC5658\n");
@@ -315,42 +304,9 @@ int s5j_alc5658_initialize(int minor)
                        goto errout_with_alc5658;
                }
 
-               ret = audio_register(devname, pcm);
-               if (ret < 0) {
-                       auddbg("ERROR: Failed to register /dev/%s device: %d\n", devname, ret);
-                       goto errout_with_pcm;
-               }
-
-               /*Device name for playback interface of sound card */
-               snprintf(devname, 12, "pcmC%uD%u%c", minor, 0, 'p');
-
-#else
-               /*Device name for both playback and capture interfaces of sound card */
-               snprintf(devname, 12, "pcmC%u", minor);
-#endif
-               /* Now we can use these I2C and I2S interfaces to initialize the
-                * ALC5658 which will return an audio interface.
-                */
-
-               alc5658 = alc5658_initialize(i2c, i2s, &g_alc5658info.lower);
-               if (!alc5658) {
-                       auddbg("ERROR: Failed to initialize the ALC5658\n");
-                       ret = -ENODEV;
-                       goto errout_with_irq;
-               }
-
-               /* No we can embed the ALC5658/I2C/I2S conglomerate into a PCM decoder
-                * instance so that we will have a PCM front end for the the ALC5658
-                * driver.
-                */
-
-               pcm = pcm_decode_initialize(alc5658);
-               if (!pcm) {
-                       auddbg("ERROR: Failed create the PCM decoder\n");
-                       ret = -ENODEV;
-                       goto errout_with_alc5658;
-               }
+               /* Create a device name */
 
+               snprintf(devname, 12, "pcm%d", minor);
 
                /* Finally, we can register the PCM/ALC5658/I2C/I2S audio device.
                 *
index 4cf4381..802d2ad 100644 (file)
@@ -126,14 +126,29 @@ static void board_gpio_initialize(void)
  ****************************************************************************/
 static void board_i2c_initialize(void)
 {
-#ifdef CONFIG_I2C
-#ifdef CONFIG_S5J_I2C
+#if defined(CONFIG_I2C) && defined(CONFIG_S5J_I2C)
        s5j_i2c_register(0);
        s5j_i2c_register(1);
 #endif
-#endif
 }
 
+/****************************************************************************
+ * Name: board_audio_initialize
+ *
+ * Description:
+ *  Initialize all audio related
+ ****************************************************************************/
+static void board_audio_initialize(void)
+{
+#if defined(CONFIG_AUDIO_ALC5658)
+       s5j_alc5658_initialize(0);
+#elif defined(CONFIG_AUDIO_ALC5658CHAR)
+       s5j_alc5658char_initialize(0);
+#elif defined(CONFIG_AUDIO_I2SCHAR)
+       alc5658_i2c_initialize();
+       i2schar_devinit();
+#endif
+}
 
 /*****************************************************************************
  * Public Functions
@@ -229,6 +244,8 @@ void board_initialize(void)
 
        board_gpio_initialize();
        board_i2c_initialize();
+       board_audio_initialize();
+       board_sensor_initialize();
 
 }
 #endif /* CONFIG_BOARD_INITIALIZE */