You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by gn...@apache.org on 2020/04/16 18:50:16 UTC

[incubator-nuttx] branch master updated (b432ae5 -> 7396c2d)

This is an automated email from the ASF dual-hosted git repository.

gnutt pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git.


    from b432ae5  Fix nxstyle warning
     new 502d7bb  boards: cxd56: spresense: move audio configuration
     new c35fd3b  boards: cxd56: spresense: add configuration for SDK audio driver
     new 50431e6  boards: cxd56: spresense: add configuration for the NuttX audio driver driver
     new 57e8f04  cxd56: add initial Nuttx audio driver
     new 5fb835b  boards: cxd56: enable Nuttx audio driver
     new 7396c2d  boards: arm: cxd56: drivers: audio: nxstyle fixes

The 6 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 boards/arm/cxd56xx/common/src/Make.defs            |    4 +
 boards/arm/cxd56xx/common/src/cxd56_audio.c        |   62 +-
 boards/arm/cxd56xx/drivers/audio/Kconfig           |  422 +---
 .../arm/cxd56xx/drivers/audio/cxd56_audio_ac_reg.c |   33 +-
 .../arm/cxd56xx/drivers/audio/cxd56_audio_ac_reg.h |   31 +-
 boards/arm/cxd56xx/drivers/audio/cxd56_audio_aca.c |   25 +-
 boards/arm/cxd56xx/drivers/audio/cxd56_audio_aca.h |   20 +-
 .../arm/cxd56xx/drivers/audio/cxd56_audio_analog.h |   20 +-
 .../cxd56xx/drivers/audio/cxd56_audio_bca_reg.c    |   12 +-
 .../cxd56xx/drivers/audio/cxd56_audio_bca_reg.h    |   10 +-
 .../arm/cxd56xx/drivers/audio/cxd56_audio_beep.c   |   20 +-
 .../arm/cxd56xx/drivers/audio/cxd56_audio_beep.h   |   14 +-
 .../arm/cxd56xx/drivers/audio/cxd56_audio_config.c |    2 +-
 .../arm/cxd56xx/drivers/audio/cxd56_audio_config.h |   12 +-
 .../cxd56xx/drivers/audio/cxd56_audio_digital.c    |    6 +-
 .../cxd56xx/drivers/audio/cxd56_audio_digital.h    |   14 +-
 boards/arm/cxd56xx/drivers/audio/cxd56_audio_dma.c |   24 +-
 boards/arm/cxd56xx/drivers/audio/cxd56_audio_dma.h |   16 +-
 .../arm/cxd56xx/drivers/audio/cxd56_audio_filter.c |    6 +-
 .../arm/cxd56xx/drivers/audio/cxd56_audio_filter.h |   14 +-
 boards/arm/cxd56xx/drivers/audio/cxd56_audio_irq.c |    8 +-
 boards/arm/cxd56xx/drivers/audio/cxd56_audio_irq.h |   14 +-
 boards/arm/cxd56xx/drivers/audio/cxd56_audio_mic.c |    8 +-
 boards/arm/cxd56xx/drivers/audio/cxd56_audio_mic.h |   16 +-
 boards/arm/cxd56xx/drivers/audio/cxd56_audio_pin.c |    6 +-
 boards/arm/cxd56xx/drivers/audio/cxd56_audio_pin.h |   14 +-
 .../arm/cxd56xx/drivers/audio/cxd56_audio_power.c  |    8 +-
 .../arm/cxd56xx/drivers/audio/cxd56_audio_power.h  |   14 +-
 .../arm/cxd56xx/drivers/audio/cxd56_audio_volume.h |   17 +-
 boards/arm/cxd56xx/spresense/Kconfig               |  436 +++-
 .../arm/cxd56xx/spresense/configs/audio/defconfig  |    4 +-
 .../configs/{audio => audio_sdk}/defconfig         |    0
 boards/arm/cxd56xx/spresense/include/cxd56_audio.h |   11 +
 boards/arm/cxd56xx/spresense/src/cxd56_bringup.c   |    9 +
 drivers/audio/Kconfig                              |   29 +
 drivers/audio/Make.defs                            |    4 +
 drivers/audio/cxd56.c                              | 2267 ++++++++++++++++++++
 drivers/audio/cxd56.h                              |  271 +++
 .../z80/arch.h => include/nuttx/audio/cxd56.h      |   43 +-
 39 files changed, 3320 insertions(+), 626 deletions(-)
 copy boards/arm/cxd56xx/spresense/configs/{audio => audio_sdk}/defconfig (100%)
 create mode 100644 drivers/audio/cxd56.c
 create mode 100644 drivers/audio/cxd56.h
 copy arch/z80/include/z80/arch.h => include/nuttx/audio/cxd56.h (82%)


[incubator-nuttx] 05/06: boards: cxd56: enable Nuttx audio driver

Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gnutt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 5fb835b1df38cc3151f1c6cd2245fb6b20c36db6
Author: Tobias Johansson <to...@sony.com>
AuthorDate: Tue Apr 7 07:50:38 2020 +0200

    boards: cxd56: enable Nuttx audio driver
    
    Adds an initial Nuttx audio driver supporting the Spresense CXD56.
    Being a work in progress the driver has a number of limitations:
    - Audio playback only, no recording yet.
    - Only 16 bit stereo playback is supported.
    - In practice only 48kHz playback is supported due to missing SRC.
---
 boards/arm/cxd56xx/common/src/Make.defs            |  4 ++
 boards/arm/cxd56xx/common/src/cxd56_audio.c        | 62 +++++++++++++++++++++-
 boards/arm/cxd56xx/spresense/include/cxd56_audio.h | 11 ++++
 boards/arm/cxd56xx/spresense/src/cxd56_bringup.c   |  9 ++++
 4 files changed, 85 insertions(+), 1 deletion(-)

diff --git a/boards/arm/cxd56xx/common/src/Make.defs b/boards/arm/cxd56xx/common/src/Make.defs
index ba10e21..5b427b1 100644
--- a/boards/arm/cxd56xx/common/src/Make.defs
+++ b/boards/arm/cxd56xx/common/src/Make.defs
@@ -34,6 +34,10 @@
 
 CSRCS += cxd56_boot.c
 
+ifeq ($(CONFIG_AUDIO_CXD56), y)
+CSRCS += cxd56_audio.c
+endif
+
 ifeq ($(CONFIG_CXD56_AUDIO), y)
 CSRCS += cxd56_audio.c
 endif
diff --git a/boards/arm/cxd56xx/common/src/cxd56_audio.c b/boards/arm/cxd56xx/common/src/cxd56_audio.c
index 58ccb66..0b90945 100644
--- a/boards/arm/cxd56xx/common/src/cxd56_audio.c
+++ b/boards/arm/cxd56xx/common/src/cxd56_audio.c
@@ -47,6 +47,9 @@
 #include <debug.h>
 
 #include <nuttx/arch.h>
+#include <nuttx/audio/audio.h>
+#include <nuttx/audio/cxd56.h>
+#include <nuttx/audio/pcm.h>
 #include <nuttx/signal.h>
 #include <arch/chip/audio.h>
 
@@ -216,6 +219,7 @@ int board_aca_power_control(int target, bool en)
           board_power_control(POWER_AUDIO_AVDD, true);
           avdd_on = true;
         }
+
       if (!dvdd_on && (target & CXD5247_DVDD))
         {
           board_power_control(POWER_AUDIO_DVDD, true);
@@ -242,12 +246,14 @@ int board_aca_power_control(int target, bool en)
           board_power_control(POWER_AUDIO_AVDD, false);
           avdd_on = false;
         }
+
       if (dvdd_on && (target & CXD5247_DVDD))
         {
           board_power_control(POWER_AUDIO_DVDD, false);
           dvdd_on = false;
         }
     }
+
   return ret;
 }
 
@@ -268,6 +274,7 @@ bool board_aca_power_monitor(int target)
     {
       avdd_stat = board_power_monitor(POWER_AUDIO_AVDD);
     }
+
   if (target & CXD5247_DVDD)
     {
       dvdd_stat = board_power_monitor(POWER_AUDIO_DVDD);
@@ -277,7 +284,7 @@ bool board_aca_power_monitor(int target)
 }
 
 #define MUTE_OFF_DELAY  (1250 * 1000) /* ms */
-#define MUTE_ON_DELAY   (150 * 1000) /* ms */
+#define MUTE_ON_DELAY   (150 * 1000)  /* ms */
 
 /****************************************************************************
  * Name: board_external_amp_mute_control
@@ -460,3 +467,56 @@ void board_audio_finalize(void)
 
   board_audio_i2s_disable();
 }
+
+/****************************************************************************
+ * Name: board_audio_initialize_driver
+ *
+ * Description:
+ *   Initialize and register the CXD56 audio driver.
+ *
+ ****************************************************************************/
+
+static struct cxd56_lower_s g_cxd56_lower;
+
+int board_audio_initialize_driver(int minor)
+{
+  FAR struct audio_lowerhalf_s *cxd56;
+  FAR struct audio_lowerhalf_s *pcm;
+  char devname[12];
+  int ret;
+
+  /* Initialize CXD56 device driver */
+
+  cxd56 = cxd56_initialize(&g_cxd56_lower);
+  if (!cxd56)
+    {
+      auderr("ERROR: Failed to initialize the CXD56 audio\n");
+
+      return -ENODEV;
+    }
+
+  /* Initialize a PCM decoder with the CXD56 instance. */
+
+  pcm = pcm_decode_initialize(cxd56);
+  if (!pcm)
+    {
+      auderr("ERROR: Failed create the PCM decoder\n");
+
+      return -ENODEV;
+    }
+
+  /* Create a device name */
+
+  snprintf(devname, 12, "pcm%d",  minor);
+
+  /* Finally, we can register the PCM/CXD56 audio device. */
+
+  ret = audio_register(devname, pcm);
+  if (ret < 0)
+    {
+      auderr("ERROR: Failed to register /dev/%s device: %d\n",
+             devname, ret);
+    }
+
+  return ret;
+}
diff --git a/boards/arm/cxd56xx/spresense/include/cxd56_audio.h b/boards/arm/cxd56xx/spresense/include/cxd56_audio.h
index 28ad54b..f9b082c 100644
--- a/boards/arm/cxd56xx/spresense/include/cxd56_audio.h
+++ b/boards/arm/cxd56xx/spresense/include/cxd56_audio.h
@@ -161,6 +161,17 @@ void board_audio_initialize(void);
 
 void board_audio_finalize(void);
 
+/****************************************************************************
+ * Name: board_audio_initialize_driver
+ *
+ * Description:
+ *   Initializes a CXD56 audio device driver node with the given number.
+ *   Used by the audio driver. Should not be used by users.
+ *
+ ****************************************************************************/
+
+int board_audio_initialize_driver(int minor);
+
 #undef EXTERN
 #if defined(__cplusplus)
 }
diff --git a/boards/arm/cxd56xx/spresense/src/cxd56_bringup.c b/boards/arm/cxd56xx/spresense/src/cxd56_bringup.c
index 99049d2..019d2f6 100644
--- a/boards/arm/cxd56xx/spresense/src/cxd56_bringup.c
+++ b/boards/arm/cxd56xx/spresense/src/cxd56_bringup.c
@@ -176,6 +176,7 @@ static void timer_initialize(void)
       snprintf(devname, sizeof(devname), "/dev/timer%d", i);
       cxd56_timer_initialize(devname, i);
     }
+
   return;
 }
 #endif
@@ -343,6 +344,14 @@ int cxd56_bringup(void)
     }
 #endif
 
+#ifdef CONFIG_AUDIO_CXD56
+  ret = board_audio_initialize_driver(1);
+  if (ret < 0)
+    {
+      _err("ERROR: Failed to initialize audio. %d\n", ret);
+    }
+#endif
+
 #ifdef CONFIG_VIDEO_ISX012
   ret = board_isx012_initialize(IMAGER_I2C);
   if (ret < 0)


[incubator-nuttx] 04/06: cxd56: add initial Nuttx audio driver

Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gnutt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 57e8f0451a17e7c01c6a6890b902a08c86207318
Author: Tobias Johansson <to...@sony.com>
AuthorDate: Tue Apr 7 07:50:38 2020 +0200

    cxd56: add initial Nuttx audio driver
    
    Adds an initial Nuttx audio driver supporting the Spresense CXD56.
    Being a work in progress the driver has a number of limitations:
    - Audio playback only, no recording yet.
    - Only 16 bit stereo playback is supported.
    - In practice only 48kHz playback is supported due to missing SRC.
    - Configure driver in "Device Drivers --> Audio Device Support".
---
 drivers/audio/Kconfig       |   29 +
 drivers/audio/Make.defs     |    4 +
 drivers/audio/cxd56.c       | 2267 +++++++++++++++++++++++++++++++++++++++++++
 drivers/audio/cxd56.h       |  271 ++++++
 include/nuttx/audio/cxd56.h |   85 ++
 5 files changed, 2656 insertions(+)

diff --git a/drivers/audio/Kconfig b/drivers/audio/Kconfig
index f632ff0..735718a 100644
--- a/drivers/audio/Kconfig
+++ b/drivers/audio/Kconfig
@@ -27,6 +27,35 @@ if AUDIO_TONE
 
 endif # AUDIO_TONE
 
+config AUDIO_CXD56
+	bool "CXD56 audio driver"
+	default n
+	depends on AUDIO
+	select AUDIO_DRIVER_SPECIFIC_BUFFERS
+	---help---
+		Enable support for audio playback using the CXD5247 chip on the
+		CXD56 Spresense board.
+
+if AUDIO_CXD56
+
+if AUDIO_DRIVER_SPECIFIC_BUFFERS
+
+config CXD56_AUDIO_NUM_BUFFERS
+	int "Number of audio buffers to use"
+	default 4
+
+config CXD56_AUDIO_BUFFER_SIZE
+	int "Size of each audio buffer"
+	default 4096
+
+endif # AUDIO_DRIVER_SPECIFIC_BUFFERS
+
+config CXD56_AUDIO_WORKER_STACKSIZE
+	int "Worker thread stack size"
+	default 768
+
+endif # AUDIO_CXD56
+
 config AUDIO_VS1053
 	bool "VS1053 codec chip"
 	default n
diff --git a/drivers/audio/Make.defs b/drivers/audio/Make.defs
index cd2ab4a..a3b607c 100644
--- a/drivers/audio/Make.defs
+++ b/drivers/audio/Make.defs
@@ -39,6 +39,10 @@
 
 ifeq ($(CONFIG_DRIVERS_AUDIO),y)
 
+ifeq ($(CONFIG_AUDIO_CXD56),y)
+CSRCS += cxd56.c
+endif
+
 ifeq ($(CONFIG_AUDIO_VS1053),y)
 CSRCS += vs1053.c
 endif
diff --git a/drivers/audio/cxd56.c b/drivers/audio/cxd56.c
new file mode 100644
index 0000000..fa25915
--- /dev/null
+++ b/drivers/audio/cxd56.c
@@ -0,0 +1,2267 @@
+/****************************************************************************
+ * drivers/audio/cxd56.h
+ *
+ *   Copyright 2019 Sony Semiconductor Solutions Corporation
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ *    used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <fcntl.h>
+#include <errno.h>
+#include <queue.h>
+
+#include <nuttx/arch.h>
+#include <nuttx/config.h>
+#include <nuttx/irq.h>
+#include <nuttx/kmalloc.h>
+#include <nuttx/mqueue.h>
+
+#include <arch/board/cxd56_clock.h>
+#include <arch/board/board.h>
+#include <arch/chip/audio.h>
+
+#include "cxd56.h"
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#define REG_BASE     0x0e300000
+#define REG_BASE_INT 0xe0045000
+
+#define CXD56_GEN_MASK(len, pos) (((len) == 32) ? 0xffffffff : \
+                                  ((1 << (len)) - 1) << (pos))
+
+#define CXD56_IRQ1_BIT_MIC  (1 << 6)   /* AU0 */
+#define CXD56_IRQ1_BIT_I2S1 (1 << 7)   /* AU1 */
+
+#define CXD56_VOL_MIN            -1020
+#define CXD56_VOL_MAX            120
+#define CXD56_VOL_MUTE           (CXD56_VOL_MIN - 1)
+#define CXD56_VOL_RANGE          (CXD56_VOL_MAX - CXD56_VOL_MIN)
+#define CXD56_VOL_NX_TO_CXD56(v) ((int)((float)((v) / 1000.0) * CXD56_VOL_RANGE) \
+                                 + CXD56_VOL_MIN)
+#define CXD56_VOL_WAIT_TIME      20
+#define CXD56_VOL_TO_REG(vol)    (((vol) / 5) & 0xff)
+#define CXD56_VOL_MUTE_REG       0x33
+#define CXD56_VOL_MUTE_TIME(vol, cycles) \
+                                 (((CXD56_VOL_TO_REG(vol) - CXD56_VOL_MUTE_REG) & 0xff) \
+                                 * ((cycles) + 1) * 4 / 48 * 1000)
+
+#define CXD56_IN_CHANNELS_MAX  8
+#define CXD56_OUT_CHANNELS_MAX 2
+
+/* Samplerates field is split into low and high byte */
+
+#define CXD56_SUPP_RATES_L  (AUDIO_SAMP_RATE_8K  | AUDIO_SAMP_RATE_11K | \
+                             AUDIO_SAMP_RATE_16K | AUDIO_SAMP_RATE_22K | \
+                             AUDIO_SAMP_RATE_32K | AUDIO_SAMP_RATE_44K | \
+                             AUDIO_SAMP_RATE_48K)
+#define CXD56_SUPP_RATES_H  ((AUDIO_SAMP_RATE_96K  | AUDIO_SAMP_RATE_128K | \
+                              AUDIO_SAMP_RATE_192K) >> 8)
+#define CXD56_SUPP_RATES    (CXD56_SUPP_RATES_L | CXD56_SUPP_RATES_H)
+
+/* Mic selections */
+
+#define CXD56_ACA_MIC_AMIC 1  /* Analog MIC */
+
+/* External XTAL */
+
+#define CXD56_AUD_MCLK_EXT (0u<<16)
+
+/* Oscillator modes */
+
+#define CXD56_ACA_OSC_24_576MHZ       1  /* 24.576MHz */
+#define CXD56_ACA_OSC_24_576MHZ_HIRES 2  /* 24.576MHz, Hi-Res */
+#define CXD56_ACA_OSC_49_152MHZ       3  /* 49.152MHz */
+#define CXD56_ACA_OSC_49_152MHZ_HIRES 4  /* 49.152MHz, Hi-Res */
+
+/* Control IDs for external as_aca_control */
+#define CXD56_ACA_CTL_CHECK_ID          0
+#define CXD56_ACA_CTL_POWER_ON_COMMON   1
+#define CXD56_ACA_CTL_POWER_ON_OUTPUT   3
+#define CXD56_ACA_CTL_SET_SMASTER       5
+#define CXD56_ACA_CTL_POWER_OFF_COMMON  6
+#define CXD56_ACA_CTL_POWER_OFF_OUTPUT  8
+#define CXD56_ACA_CTL_SET_OUTPUT_DEVICE 13
+
+#define CXD56_EXP_REVID    0x20
+#define CXD56_EXP_DEVICEID 0x02
+
+#define CXD56_OUT_DEV_OFF (0)
+#define CXD56_OUT_DEV_SP  (1)
+
+#define CXD56_SMSTR_MODE_FS_16         1
+#define CXD56_SMSTR_MODE_FS_32         2
+#define CXD56_SMSTR_MCK_FS_512         1
+#define CXD56_SMSTR_MCK_FS_1024        2
+#define CXD56_SMSTR_CHSEL_NORMAL       1
+#define CXD56_SMSTR_PWMMD_BOTH         2
+#define CXD56_ACA_OUT_OFF              6
+#define CXD56_ACA_PWMOUT_UNKNOWN       0
+#define CXD56_ACA_SP_DELAY_SEL_UNKNOWN 0
+#define CXD56_ACA_SP_LOOP_MODE_UNKNOWN 0
+#define CXD56_ACA_SP_DLY_FREE_UNKNOWN  0
+
+#define CXD56_AUDAT_SEL_BUSIF1 4
+#define CXD56_AUDAT_SEL_BUSIF2 4
+
+#define CXD56_DMA_MSTATE_BUF_EMPTY  3
+#define CXD56_DMA_TIMEOUT           10000
+#define CXD56_DMA_START_RETRY_CNT   10
+#define CXD56_DMA_SMP_WAIT_HIRES    10 /* usec per sample. */
+#define CXD56_DMA_SMP_WAIT_NORMALT  40 /* usec per sample. */
+#define CXD56_DMA_CMD_FIFO_NOT_FULL 1
+#define CXD56_DMA_START_ADDR_MASK   0x3fffffff
+
+/* Queue extensions */
+
+#define dq_push(q,n) (dq_addlast((dq_entry_t*)n,(q)))
+#define dq_pop(q)    (dq_remfirst(q))
+#define dq_clear(q) \
+  do \
+    { \
+      dq_remlast(q); \
+    } \
+  while (!dq_empty(q))
+
+/****************************************************************************
+ * Public Function Prototypes
+ ****************************************************************************/
+
+/* Located in arch/arm/src/cxd56xx/cxd56_clock.c */
+
+extern void cxd56_audio_clock_enable(uint32_t clk, uint32_t div);
+extern void cxd56_audio_clock_disable(void);
+extern bool cxd56_audio_clock_is_enabled(void);
+
+/* Located in arch/arm/src/cxd56xx/cxd56_farapistub.S */
+
+extern uint32_t as_aca_control(uint8_t type, uint32_t param);
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+/* CXD56 Audio register value definition */
+
+struct cxd56_aureg_s
+{
+  uint32_t addr;
+  uint8_t  pos;
+  uint8_t  len;
+};
+typedef struct cxd56_aureg_s cxd56_aureg_t;
+
+/* DMA interrupt types */
+
+enum cxd56_dma_int_e
+{
+  CXD56_DMA_INT_DONE = 0x01,
+  CXD56_DMA_INT_ERR  = 0x02,
+  CXD56_DMA_INT_SMP  = 0x10,
+  CXD56_DMA_INT_CMB  = 0x20
+};
+
+/* Volume setting IDs */
+
+enum cxd56_vol_id_e
+{
+  CXD56_VOL_ID_MIXER_IN1,  /* SDIN1_VOL */
+  CXD56_VOL_ID_MIXER_IN2,  /* SDIN2_VOL */
+  CXD56_VOL_ID_MIXER_OUT   /* DAC_VOL */
+};
+
+struct cxd56_aca_pwon_param_s
+{
+  uint8_t osc_mode;
+  uint8_t mic_dev;
+  uint8_t gpo_ds;
+  uint8_t ad_data_ds;
+  uint8_t dmic_clk_ds;
+  uint8_t mclk_ds;
+};
+
+struct cxd56_aca_smaster_param_s
+{
+  uint8_t mode;
+  uint8_t mck_fs;
+  uint8_t pwm_mode;
+  uint8_t ch_sel;
+  uint8_t out2dly;
+};
+
+struct cxd56_aca_pwoutput_param_s
+{
+  uint8_t out_dev;
+  uint8_t pwm_out[2];
+  uint8_t sp_delay;
+  uint8_t loop_mode;
+  uint8_t mode;
+  uint8_t sp_dly_free;
+  uint8_t sp_spliton;
+  uint8_t sp_drv;
+};
+
+/****************************************************************************
+ * Private Function Prototypes
+ ****************************************************************************/
+
+/* Interface functions */
+
+#ifdef CONFIG_AUDIO_MULTI_SESSION
+static int     cxd56_configure(FAR struct audio_lowerhalf_s *lower,
+                 FAR void *session, FAR const struct audio_caps_s *caps);
+static int     cxd56_start(FAR struct audio_lowerhalf_s *lower,
+                 FAR void *session);
+#ifndef CONFIG_AUDIO_EXCLUDE_STOP
+static int     cxd56_stop(FAR struct audio_lowerhalf_s *lower,
+                 FAR void *session);
+#endif  /* CONFIG_AUDIO_EXCLUDE_STOP */
+#ifndef CONFIG_AUDIO_EXCLUDE_PAUSE_RESUME
+static int     cxd56_pause(FAR struct audio_lowerhalf_s *lower,
+                 FAR void *session);
+static int     cxd56_resume(FAR struct audio_lowerhalf_s *lower,
+                 FAR void *session);
+#endif  /* CONFIG_AUDIO_EXCLUDE_PAUSE_RESUME */
+static int     cxd56_reserve(FAR struct audio_lowerhalf_s *lower,
+                 FAR void** session);
+static int     cxd56_release(FAR struct audio_lowerhalf_s *lower,
+                 FAR void *session);
+#else
+
+static int     cxd56_configure(FAR struct audio_lowerhalf_s *lower,
+                 FAR const struct audio_caps_s *caps);
+static int     cxd56_start(FAR struct audio_lowerhalf_s *lower);
+#ifndef CONFIG_AUDIO_EXCLUDE_STOP
+static int     cxd56_stop(FAR struct audio_lowerhalf_s *lower);
+#endif  /* CONFIG_AUDIO_EXCLUDE_STOP */
+#ifndef CONFIG_AUDIO_EXCLUDE_PAUSE_RESUME
+static int     cxd56_pause(FAR struct audio_lowerhalf_s *lower);
+static int     cxd56_resume(FAR struct audio_lowerhalf_s *lower);
+#endif  /* CONFIG_AUDIO_EXCLUDE_PAUSE_RESUME */
+static int     cxd56_reserve(FAR struct audio_lowerhalf_s *lower);
+static int     cxd56_release(FAR struct audio_lowerhalf_s *lower);
+#endif /* CONFIG_AUDIO_MULTI_SESSION */
+
+static int     cxd56_getcaps(FAR struct audio_lowerhalf_s *lower, int type,
+                 FAR struct audio_caps_s *caps);
+static int     cxd56_shutdown(FAR struct audio_lowerhalf_s *lower);
+static int     cxd56_enqueuebuffer(FAR struct audio_lowerhalf_s *lower,
+                 FAR struct ap_buffer_s *apb);
+static int     cxd56_cancelbuffer(FAR struct audio_lowerhalf_s *lower,
+                 FAR struct ap_buffer_s *apb);
+static int     cxd56_ioctl(FAR struct audio_lowerhalf_s *lower, int cmd,
+                 unsigned long arg);
+
+/* Non-interface functions */
+
+static void cxd56_attach_irq(bool attach);
+static void cxd56_enable_irq(bool enable);
+static uint32_t cxd56_get_i2s_rate(uint32_t samplerate);
+static int cxd56_init_dma(FAR struct cxd56_dev_s *dev);
+static void cxd56_init_i2s1_output(uint8_t bits);
+static int cxd56_init_worker(FAR struct audio_lowerhalf_s *lower);
+static uint32_t cxd56_power_off(FAR struct cxd56_dev_s *dev);
+static uint32_t cxd56_power_on(FAR struct cxd56_dev_s *dev);
+static uint32_t cxd56_power_on_aca(uint32_t samplerate);
+static uint32_t cxd56_power_on_analog_output(FAR struct cxd56_dev_s *dev);
+static void cxd56_power_on_i2s1(FAR struct cxd56_dev_s *dev);
+static int cxd56_start_dma(FAR struct cxd56_dev_s *dev);
+static int cxd56_stop_dma(FAR struct cxd56_dev_s *priv);
+static void cxd56_set_dma_int_en(bool enabled);
+static void cxd56_set_dma_running(cxd56_dmahandle_t handle, bool running);
+static void cxd56_set_volume(enum cxd56_vol_id_e id, int16_t vol, bool fade);
+static void cxd56_swap_buffer_rl(uint32_t addr, uint16_t size);
+static void *cxd56_workerthread(pthread_addr_t pvarg);
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+static struct cxd56_dev_s *g_dev[CXD56_AUDIO_DMA_COUNT] =
+{
+  NULL
+};
+
+static uint16_t g_codec_start_count = 0;
+
+static const struct audio_ops_s g_audioops =
+{
+  cxd56_getcaps,       /* getcaps        */
+  cxd56_configure,     /* configure      */
+  cxd56_shutdown,      /* shutdown       */
+  cxd56_start,         /* start          */
+#ifndef CONFIG_AUDIO_EXCLUDE_STOP
+  cxd56_stop,          /* stop           */
+#endif
+#ifndef CONFIG_AUDIO_EXCLUDE_PAUSE_RESUME
+  cxd56_pause,         /* pause          */
+  cxd56_resume,        /* resume         */
+#endif
+  NULL,                /* alloc_buffer   */
+  NULL,                /* free_buffer    */
+  cxd56_enqueuebuffer, /* enqueue_buffer */
+  cxd56_cancelbuffer,  /* cancel_buffer  */
+  cxd56_ioctl,         /* ioctl          */
+  NULL,                /* read           */
+  NULL,                /* write          */
+  cxd56_reserve,       /* reserve        */
+  cxd56_release        /* release        */
+};
+
+/* AC registers */
+
+const cxd56_aureg_t  REG_AC_REVID =
+{
+  REG_BASE + 0x0000, 16,  8
+};
+const cxd56_aureg_t  REG_AC_DEVICEID =
+{
+  REG_BASE + 0x0000, 24,  8
+};
+const cxd56_aureg_t  REG_AC_PDN_DSPB =
+{
+  REG_BASE + 0x0100, 16,  1
+};
+const cxd56_aureg_t  REG_AC_PDN_ANC =
+{
+  REG_BASE + 0x0100, 17,  1
+};
+const cxd56_aureg_t  REG_AC_PDN_DNC1 =
+{
+  REG_BASE + 0x0100, 18,  1
+};
+const cxd56_aureg_t  REG_AC_PDN_DNC2 =
+{
+  REG_BASE + 0x0100, 19,  1
+};
+const cxd56_aureg_t  REG_AC_PDN_SMSTR =
+{
+  REG_BASE + 0x0100, 20,  1
+};
+const cxd56_aureg_t  REG_AC_PDN_DSPS1 =
+{
+  REG_BASE + 0x0100, 21,  1
+};
+const cxd56_aureg_t  REG_AC_PDN_DSPS2 =
+{
+  REG_BASE + 0x0100, 22,  1
+};
+const cxd56_aureg_t  REG_AC_PDN_DSPC =
+{
+  REG_BASE + 0x0100, 23,  1
+};
+const cxd56_aureg_t  REG_AC_FS_FS =
+{
+  REG_BASE + 0x0104,  0,  1
+};
+const cxd56_aureg_t  REG_AC_DECIM0 =
+{
+  REG_BASE + 0x0104, 16,  1
+};
+const cxd56_aureg_t  REG_AC_DECIM1 =
+{
+  REG_BASE + 0x0104, 17,  1
+};
+const cxd56_aureg_t  REG_AC_SDES_EN =
+{
+  REG_BASE + 0x0104, 18,  1
+};
+const cxd56_aureg_t  REG_AC_MCK_AMBMSTR_EN =
+{
+  REG_BASE + 0x0104, 19,  1
+};
+const cxd56_aureg_t  REG_AC_AU_DAT_SEL2 =
+{
+  REG_BASE + 0x0108, 16,  3
+};
+const cxd56_aureg_t  REG_AC_AU_DAT_SEL1 =
+{
+  REG_BASE + 0x0108, 20,  3
+};
+const cxd56_aureg_t  REG_AC_AU_COD_INSEL3 =
+{
+  REG_BASE + 0x0108, 24,  2
+};
+const cxd56_aureg_t  REG_AC_AU_COD_INSEL2 =
+{
+  REG_BASE + 0x0108, 26,  2
+};
+const cxd56_aureg_t  REG_AC_DSR_RATE =
+{
+  REG_BASE + 0x0200,  0,  3
+};
+const cxd56_aureg_t  REG_AC_DIGSFT =
+{
+  REG_BASE + 0x0200, 12,  1
+};
+const cxd56_aureg_t  REG_AC_SRC1 =
+{
+  REG_BASE + 0x0200, 16,  2
+};
+const cxd56_aureg_t  REG_AC_SRC1IN_SEL =
+{
+  REG_BASE + 0x0200, 18,  2
+};
+const cxd56_aureg_t  REG_AC_SRC2IN_SEL =
+{
+  REG_BASE + 0x0200, 22,  2
+};
+const cxd56_aureg_t  REG_AC_DIF1 =
+{
+  REG_BASE + 0x0200, 27,  1
+};
+const cxd56_aureg_t  REG_AC_SD1MASTER =
+{
+  REG_BASE + 0x0200, 29,  1
+};
+const cxd56_aureg_t  REG_AC_SDCK_OUTENX =
+{
+  REG_BASE + 0x0200, 30,  1
+};
+const cxd56_aureg_t  REG_AC_SPC_EN =
+{
+  REG_BASE + 0x021c, 15,  1
+};
+const cxd56_aureg_t  REG_AC_ALC_EN =
+{
+  REG_BASE + 0x021c, 31,  1
+};
+const cxd56_aureg_t  REG_AC_CS_VOL =
+{
+  REG_BASE + 0x0228,  0,  7
+};
+const cxd56_aureg_t  REG_AC_CS_SIGN =
+{
+  REG_BASE + 0x0228,  7,  1
+};
+const cxd56_aureg_t  REG_AC_SDIN1_VOL =
+{
+  REG_BASE + 0x0228, 16,  8
+};
+const cxd56_aureg_t  REG_AC_SDIN2_VOL =
+{
+  REG_BASE + 0x0228, 24,  8
+};
+const cxd56_aureg_t  REG_AC_SDIN1_EN =
+{
+  REG_BASE + 0x022c,  0,  1
+};
+const cxd56_aureg_t  REG_AC_SDIN2_EN =
+{
+  REG_BASE + 0x022c,  1,  1
+};
+const cxd56_aureg_t  REG_AC_SDOUT1_EN =
+{
+  REG_BASE + 0x022c,  2,  1
+};
+const cxd56_aureg_t  REG_AC_SDOUT2_EN =
+{
+  REG_BASE + 0x022c,  3,  1
+};
+const cxd56_aureg_t  REG_AC_BLF_EN =
+{
+  REG_BASE + 0x022c,  5,  1
+};
+const cxd56_aureg_t  REG_AC_DAC_VOL =
+{
+  REG_BASE + 0x022c,  8,  8
+};
+const cxd56_aureg_t  REG_AC_DNC2_MUTE =
+{
+  REG_BASE + 0x0304, 22,  1
+};
+const cxd56_aureg_t  REG_AC_DNC2_START =
+{
+  REG_BASE + 0x0304, 23,  1
+};
+const cxd56_aureg_t  REG_AC_DNC1_MUTE =
+{
+  REG_BASE + 0x0304, 30,  1
+};
+const cxd56_aureg_t  REG_AC_DNC1_START =
+{
+  REG_BASE + 0x0304, 31,  1
+};
+const cxd56_aureg_t  REG_AC_NSX2 =
+{
+  REG_BASE + 0x0340, 30,  1
+};
+const cxd56_aureg_t  REG_AC_NSPMUTE =
+{
+  REG_BASE + 0x0340, 31,  1
+};
+const cxd56_aureg_t  REG_AC_NSDD =
+{
+  REG_BASE + 0x0344,  0, 20
+};
+const cxd56_aureg_t  REG_AC_TEST_OUT_SEL0 =
+{
+  REG_BASE + 0x0400,  6,  1
+};
+const cxd56_aureg_t  REG_AC_DSPRAM4_CLR =
+{
+  REG_BASE + 0x0400, 28,  1
+};
+const cxd56_aureg_t  REG_AC_DSPRAM2_CLR =
+{
+  REG_BASE + 0x0400, 29,  1
+};
+const cxd56_aureg_t  REG_AC_DSPRAM1_CLR =
+{
+  REG_BASE + 0x0400, 31,  1
+};
+const cxd56_aureg_t  REG_AC_S_RESET =
+{
+  REG_BASE + 0x0400, 16,  1
+};
+const cxd56_aureg_t  REG_AC_PDM_OUT_EN =
+{
+  REG_BASE + 0x0500, 16,  1
+};
+const cxd56_aureg_t  REG_AC_FS_CLK_EN =
+{
+  REG_BASE + 0x0500, 24,  1
+};
+const cxd56_aureg_t  REG_AC_DEQ_EN =
+{
+  REG_BASE + 0x0600, 31,  1
+};
+const cxd56_aureg_t  REG_AC_LR_SWAP1 =
+{
+  REG_BASE + 0x0678,  0,  1
+};
+
+/* BCA registers */
+
+const cxd56_aureg_t  REG_MIC_RTD_TRG =
+{
+  REG_BASE + 0x1008,  0,  3
+};
+const cxd56_aureg_t  REG_MIC_CH8_SEL =
+{
+  REG_BASE + 0x1010,  0,  4
+};
+const cxd56_aureg_t  REG_MIC_MON_START =
+{
+  REG_BASE + 0x1014,  3,  1
+};
+const cxd56_aureg_t  REG_MIC_MON_ERROR_SET =
+{
+  REG_BASE + 0x1014,  8,  8
+};
+const cxd56_aureg_t  REG_MIC_MON_MONBUF =
+{
+  REG_BASE + 0x1014, 16,  4
+};
+const cxd56_aureg_t  REG_I2S1_OUT_START_ADR =
+{
+  REG_BASE + 0x10c0,  0, 30
+};
+const cxd56_aureg_t  REG_I2S1_OUT_SAMPLE_NO =
+{
+  REG_BASE + 0x10c4,  0, 32
+};
+const cxd56_aureg_t  REG_I2S1_OUT_RTD_TRG =
+{
+  REG_BASE + 0x10c8,  0,  3
+};
+const cxd56_aureg_t  REG_I2S1_OUT_BITWT =
+{
+  REG_BASE + 0x10cc,  0,  1
+};
+const cxd56_aureg_t  REG_I2S1_OUT_SD1_R_SEL =
+{
+  REG_BASE + 0x10d0,  0,  2
+};
+const cxd56_aureg_t  REG_I2S1_OUT_SD1_L_SEL =
+{
+  REG_BASE + 0x10d0,  4,  2
+};
+const cxd56_aureg_t  REG_I2S1_OUT_MON_START =
+{
+  REG_BASE + 0x10d4,  0,  1
+};
+const cxd56_aureg_t  REG_I2S1_OUT_MON_ERRSET =
+{
+  REG_BASE + 0x10d4,  8,  8
+};
+const cxd56_aureg_t  REG_I2S1_OUT_MON_MONBUF =
+{
+  REG_BASE + 0x10d4, 16,  4
+};
+const cxd56_aureg_t  REG_I2S_ENSEL =
+{
+  REG_BASE + 0x1110,  0,  1
+};
+const cxd56_aureg_t  REG_CLK_EN_AHBMSTR_MIC =
+{
+  REG_BASE + 0x11f0,  0,  1
+};
+const cxd56_aureg_t  REG_CLK_EN_AHBMSTR_I2S1 =
+{
+  REG_BASE + 0x11f0,  1,  1
+};
+const cxd56_aureg_t  REG_MIC_INT_CTRL_DONE =
+{
+  REG_BASE + 0x1140,  0,  1
+};
+const cxd56_aureg_t  REG_MIC_INT_CTRL_ERR =
+{
+  REG_BASE + 0x1140,  1,  1
+};
+const cxd56_aureg_t  REG_MIC_INT_CTRL_CMB =
+{
+  REG_BASE + 0x1140,  3,  1
+};
+const cxd56_aureg_t  REG_I2S1_INT_CTRL_DONE =
+{
+  REG_BASE + 0x1144,  0,  1
+};
+const cxd56_aureg_t  REG_I2S1_INT_CTRL_ERR =
+{
+  REG_BASE + 0x1144,  1,  1
+};
+const cxd56_aureg_t  REG_I2S1_INT_CTRL_SMP =
+{
+  REG_BASE + 0x1144,  4,  1
+};
+const cxd56_aureg_t  REG_I2S1_INT_CTRL_CMB =
+{
+  REG_BASE + 0x1144,  5,  1
+};
+const cxd56_aureg_t  REG_MIC_INT_MASK_DONE =
+{
+  REG_BASE + 0x114c,  0,  1
+};
+const cxd56_aureg_t  REG_MIC_INT_MASK_ERR =
+{
+  REG_BASE + 0x114c,  1,  1
+};
+const cxd56_aureg_t  REG_MIC_INT_MASK_CMB =
+{
+  REG_BASE + 0x114c,  3,  1
+};
+const cxd56_aureg_t  REG_I2S1_INT_MASK_DONE =
+{
+  REG_BASE + 0x1150,  0,  1
+};
+const cxd56_aureg_t  REG_I2S1_INT_MASK_ERR =
+{
+  REG_BASE + 0x1150,  1,  1
+};
+const cxd56_aureg_t  REG_I2S1_INT_MASK_SMP =
+{
+  REG_BASE + 0x1150,  4,  1
+};
+const cxd56_aureg_t  REG_I2S1_INT_MASK_CMB =
+{
+  REG_BASE + 0x1150,  5,  1
+};
+const cxd56_aureg_t  REG_INT_M_I2S1_BCL_ERR1 =
+{
+  REG_BASE + 0x1158,  8,  1
+};
+const cxd56_aureg_t  REG_INT_M_I2S1_BCL_ERR2 =
+{
+  REG_BASE + 0x1158,  9,  1
+};
+const cxd56_aureg_t  REG_INT_M_OVF_SMASL =
+{
+  REG_BASE + 0x1158, 17,  1
+};
+const cxd56_aureg_t  REG_INT_M_OVF_SMASR =
+{
+  REG_BASE + 0x1158, 18,  1
+};
+const cxd56_aureg_t  REG_INT_HRESP_ERR =
+{
+  REG_BASE + 0x1160,  0,  1
+};
+const cxd56_aureg_t  REG_AHB_MASTER_MIC_MASK =
+{
+  REG_BASE + 0x1730,  0, 32
+};
+const cxd56_aureg_t  REG_AHB_MASTER_I2S1_MASK =
+{
+  REG_BASE + 0x1f30,  0, 32
+};
+
+/* Interrupt registers */
+
+const cxd56_aureg_t  REG_INT_IRQ1 =
+{
+  REG_BASE_INT + 0x30 + 3 * 4, 0, 32
+};
+const cxd56_aureg_t  REG_INT_EN1 =
+{
+  REG_BASE_INT + 0x10 + 3 * 4, 0, 32
+};
+const cxd56_aureg_t  REG_INT_EN1_BITS =
+{
+  REG_BASE_INT + 0x10 + 3 * 4, 6,  4
+};
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+static uint32_t read_reg_addr(const cxd56_aureg_t *reg)
+{
+  uint32_t mask;
+
+  mask = CXD56_GEN_MASK(reg->len, reg->pos);
+  return (*((volatile uint32_t *)reg->addr) & mask) >> reg->pos;
+}
+
+static void write_reg_addr(const cxd56_aureg_t *reg, uint32_t val)
+{
+  uint32_t mask;
+  uint32_t curr;
+
+  mask = CXD56_GEN_MASK(reg->len, reg->pos);
+  curr = *((volatile uint32_t *)reg->addr) & ~mask;
+  *((volatile uint32_t *)reg->addr) = curr | ((val << reg->pos) & mask);
+}
+
+#define read_reg(reg)         (read_reg_addr(&(reg)))
+#define read_reg32(reg)       (*((volatile uint32_t *)(reg).addr))
+#define write_reg(reg, val)   (write_reg_addr(&(reg), (val)))
+#define write_reg32(reg, val) (*((volatile uint32_t *)(reg).addr) = (val))
+
+/* Aquire semaphore */
+
+static void cxd56_take_sem(sem_t *sem)
+{
+  int ret;
+
+  do
+    {
+      ret = nxsem_wait(sem);
+      if (ret != 0 && ret != -EINTR)
+        {
+          auderr("cxd56_take_sem failed. (%d)\n", ret);
+        }
+    }
+  while (ret == -EINTR);
+}
+
+/* Release semaphore */
+
+static void cxd56_give_sem(sem_t *sem)
+{
+  int ret;
+
+  do
+    {
+      ret = nxsem_post(sem);
+      if (ret != 0 && ret != -EINTR)
+        {
+          auderr("cxd56_give_sem failed. (%d)\n", ret);
+        }
+    }
+  while (ret == -EINTR);
+}
+
+static void cxd56_int_clear(cxd56_dmahandle_t handle, uint8_t intbits)
+{
+  if (handle == CXD56_AUDIO_DMA_I2S0_DOWN)
+    {
+      write_reg32(REG_I2S1_INT_CTRL_DONE, intbits);
+    }
+}
+
+static void cxd56_int_mask(cxd56_dmahandle_t handle, uint8_t intbits)
+{
+  if (handle == CXD56_AUDIO_DMA_I2S0_DOWN)
+    {
+      intbits |= read_reg32(REG_I2S1_INT_MASK_DONE);
+      write_reg32(REG_I2S1_INT_MASK_DONE, intbits);
+    }
+}
+
+static void cxd56_int_unmask(cxd56_dmahandle_t handle, uint8_t intbits)
+{
+  uint32_t curr;
+
+  if (handle == CXD56_AUDIO_DMA_I2S0_DOWN)
+    {
+      curr = read_reg32(REG_I2S1_INT_MASK_DONE);
+      write_reg32(REG_I2S1_INT_MASK_DONE, curr & ~intbits);
+    }
+}
+
+static void cxd56_int_unmask_ahb(cxd56_dmahandle_t handle)
+{
+  if (handle == CXD56_AUDIO_DMA_I2S0_DOWN)
+    {
+      write_reg32(REG_AHB_MASTER_I2S1_MASK, 0x00000202);
+    }
+}
+
+static uint32_t cxd56_int_get_state(cxd56_dmahandle_t handle)
+{
+  if (handle == CXD56_AUDIO_DMA_I2S0_DOWN)
+    {
+      return (0x3f & read_reg32(REG_I2S1_INT_CTRL_DONE)
+              & ~(read_reg32(REG_I2S1_INT_MASK_DONE)));
+    }
+
+  return 0;
+}
+
+static uint8_t cxd56_get_monbuf_state(cxd56_dmahandle_t handle)
+{
+  if (handle == CXD56_AUDIO_DMA_I2S0_DOWN)
+    {
+      return read_reg(REG_I2S1_OUT_MON_MONBUF);
+    }
+
+  return 0;
+}
+
+static void cxd56_reset_channel_sel(cxd56_dmahandle_t handle)
+{
+  uint32_t sel;
+
+  if (handle == CXD56_AUDIO_DMA_I2S0_DOWN)
+    {
+      sel = read_reg32(REG_I2S1_OUT_SD1_R_SEL);
+      write_reg32(REG_I2S1_OUT_SD1_R_SEL, 0xffffffff);
+      write_reg32(REG_I2S1_OUT_SD1_R_SEL, sel);
+    }
+}
+
+static void cxd56_dma_int_handler(void)
+{
+  uint16_t          ecode = CXD56_AUDIO_ECODE_DMA_HANDLE_INV;
+  cxd56_dmahandle_t hdl;
+
+  uint32_t int_irq = read_reg32(REG_INT_IRQ1);
+  uint32_t int_i2s = cxd56_int_get_state(CXD56_AUDIO_DMA_I2S0_DOWN);
+
+  if ((int_irq & CXD56_IRQ1_BIT_I2S1) && (int_i2s != 0))
+    {
+      hdl = CXD56_AUDIO_DMA_I2S0_DOWN;
+
+      write_reg32(REG_I2S1_INT_CTRL_DONE, int_i2s);
+
+      if (int_i2s & (1 << REG_I2S1_INT_CTRL_DONE.pos))
+        {
+          ecode = CXD56_AUDIO_ECODE_DMA_CMPLT;
+        }
+
+      if (int_i2s & (1 << REG_I2S1_INT_CTRL_ERR.pos))
+        {
+          /* Mask and clear transfer error interrupt */
+
+          write_reg(REG_I2S1_INT_MASK_ERR, 1);
+          write_reg(REG_I2S1_INT_CTRL_ERR, 1);
+
+          ecode = CXD56_AUDIO_ECODE_DMA_TRANS;
+        }
+
+      if (int_i2s & (1 << REG_I2S1_INT_CTRL_CMB.pos))
+        {
+          /* Mask and clear bus error interrupt */
+
+          write_reg(REG_I2S1_INT_MASK_CMB, 1);
+          write_reg(REG_I2S1_INT_CTRL_CMB, 1);
+
+          ecode = CXD56_AUDIO_ECODE_DMA_CMB;
+        }
+    }
+  else
+    {
+      _warn("cxd56_dma_int_handler: Unhandled interrupt\n");
+      return;
+    }
+
+  if (ecode != CXD56_AUDIO_ECODE_DMA_HANDLE_INV)
+    {
+      struct audio_msg_s msg;
+      struct cxd56_dev_s *dev;
+
+      dev = g_dev[hdl];
+
+      /* Trigger new DMA job */
+
+      cxd56_take_sem(&dev->pendsem);
+      if (dq_count(&dev->runningq) > 0)
+        {
+          FAR struct ap_buffer_s *apb;
+          apb = (struct ap_buffer_s *) dq_pop(&dev->runningq);
+          dev->dev.upper(dev->dev.priv, AUDIO_CALLBACK_DEQUEUE, apb, OK);
+        }
+
+      cxd56_give_sem(&dev->pendsem);
+
+      if (dev->mq != NULL)
+        {
+          msg.msgId = AUDIO_MSG_DATA_REQUEST;
+          msg.u.data = 0;
+          (void)nxmq_send(dev->mq, (FAR const char *) &msg,
+                          sizeof(msg), CONFIG_CXD56_MSG_PRIO);
+        }
+
+      if (ecode == CXD56_AUDIO_ECODE_DMA_TRANS)
+        {
+          /* End of data */
+
+          msg.msgId = AUDIO_MSG_STOP;
+          msg.u.data = 0;
+          (void)nxmq_send(dev->mq, (FAR const char *)&msg,
+                          sizeof(msg), CONFIG_CXD56_MSG_PRIO);
+        }
+    }
+}
+
+static void cxd56_attach_irq(bool attach)
+{
+  if (attach)
+    {
+      irq_attach(CXD56_IRQ_AUDIO_0, (xcpt_t)cxd56_dma_int_handler, NULL);
+      irq_attach(CXD56_IRQ_AUDIO_1, (xcpt_t)cxd56_dma_int_handler, NULL);
+      irq_attach(CXD56_IRQ_AUDIO_2, (xcpt_t)cxd56_dma_int_handler, NULL);
+      irq_attach(CXD56_IRQ_AUDIO_3, (xcpt_t)cxd56_dma_int_handler, NULL);
+    }
+  else
+    {
+      irq_detach(CXD56_IRQ_AUDIO_0);
+      irq_detach(CXD56_IRQ_AUDIO_1);
+      irq_detach(CXD56_IRQ_AUDIO_2);
+      irq_detach(CXD56_IRQ_AUDIO_3);
+    }
+}
+
+static void cxd56_enable_irq(bool enable)
+{
+  if (enable)
+    {
+      up_enable_irq(CXD56_IRQ_AUDIO_0);
+      up_enable_irq(CXD56_IRQ_AUDIO_1);
+      up_enable_irq(CXD56_IRQ_AUDIO_2);
+    }
+  else
+    {
+      up_disable_irq(CXD56_IRQ_AUDIO_0);
+      up_disable_irq(CXD56_IRQ_AUDIO_1);
+      up_disable_irq(CXD56_IRQ_AUDIO_2);
+    }
+}
+
+static void cxd56_set_volume(enum cxd56_vol_id_e id, int16_t vol, bool fade)
+{
+  uint32_t waittime = 0;
+
+  if (vol == CXD56_VOL_MUTE)
+    {
+      vol = CXD56_VOL_MUTE_REG;
+    }
+  else
+    {
+      CXD56_AUDIO_ECODE ret;
+
+      vol = CXD56_VOL_TO_REG(vol);
+
+      /* Enable analog out */
+
+      ret = as_aca_control(CXD56_ACA_CTL_SET_OUTPUT_DEVICE,
+                           (uint32_t)CXD56_OUT_DEV_SP);
+      if (ret != CXD56_AUDIO_ECODE_OK)
+        {
+          auderr("cxd56_set_volume analog out enable failed. (%d)\n", ret);
+        }
+    }
+
+  switch (id)
+  {
+    case CXD56_VOL_ID_MIXER_IN1:
+      write_reg(REG_AC_SDIN1_VOL, vol);
+      break;
+    case CXD56_VOL_ID_MIXER_IN2:
+      write_reg(REG_AC_SDIN2_VOL, vol);
+      break;
+    case CXD56_VOL_ID_MIXER_OUT:
+      write_reg(REG_AC_DAC_VOL, vol);
+      break;
+  }
+
+  waittime = (fade ? CXD56_VOL_MUTE_TIME(vol, 1) : CXD56_VOL_WAIT_TIME);
+
+  nxsig_usleep(waittime);
+
+  if (vol == CXD56_VOL_MUTE_REG)
+  {
+    /* Disable analog out */
+
+    as_aca_control(CXD56_ACA_CTL_SET_OUTPUT_DEVICE,
+                   (uint32_t)CXD56_OUT_DEV_OFF);
+  }
+}
+
+static void cxd56_init_i2s1_output(uint8_t bits)
+{
+  write_reg(REG_I2S1_OUT_SD1_L_SEL, 1);
+  write_reg(REG_I2S1_OUT_SD1_R_SEL, 0);
+  write_reg(REG_I2S1_OUT_BITWT, (bits == 16));
+  write_reg(REG_CLK_EN_AHBMSTR_I2S1, 1);
+  write_reg(REG_I2S1_OUT_START_ADR, 0);
+  write_reg(REG_I2S1_OUT_SAMPLE_NO, 0);
+}
+
+static void cxd56_set_dma_int_en(bool enabled)
+{
+  if (enabled)
+    {
+      write_reg(REG_INT_EN1_BITS, 0xf);
+      write_reg(REG_INT_HRESP_ERR, 1);
+    }
+  else
+    {
+      write_reg32(REG_INT_EN1_BITS, 0x0);
+      write_reg32(REG_INT_HRESP_ERR, 0);
+    }
+}
+
+static void cxd56_set_dma_running(cxd56_dmahandle_t handle, bool running)
+{
+  if (handle == CXD56_AUDIO_DMA_I2S0_DOWN)
+    {
+      write_reg(REG_I2S1_OUT_RTD_TRG, (running ? 0x01 : 0x04));
+    }
+}
+
+static int cxd56_init_dma(FAR struct cxd56_dev_s *dev)
+{
+  int ret = CXD56_AUDIO_ECODE_OK;
+  FAR struct cxd56_dev_s *priv = (FAR struct cxd56_dev_s *)dev;
+  uint8_t ints = CXD56_DMA_INT_DONE | CXD56_DMA_INT_ERR | CXD56_DMA_INT_CMB;
+
+  audinfo("cxd56_init_dma: state = %d, hdl = %d.\n",
+          dev->state,
+          dev->dma_handle);
+
+  dq_clear(&dev->pendingq);
+  dq_clear(&dev->runningq);
+
+  /* Enable DMA */
+
+  write_reg(REG_AC_MCK_AMBMSTR_EN, 1);
+
+  /* Setup output, bit width etc */
+
+  cxd56_init_i2s1_output(priv->bitwidth);
+
+  /* Clear interrupt states */
+
+  cxd56_int_clear(dev->dma_handle, ints);
+
+  /* Enable interrupts */
+
+  cxd56_int_unmask(dev->dma_handle, ints);
+  cxd56_int_unmask_ahb(dev->dma_handle);
+
+  cxd56_set_dma_int_en(true);
+
+  return ret;
+}
+
+static uint32_t cxd56_get_i2s_rate(uint32_t samplerate)
+{
+  if (samplerate <= 48000)
+    {
+      return 1;   /* low */
+    }
+  else if (samplerate <= 96000)
+    {
+      return 2;   /* medium */
+    }
+
+  return 3;       /* high */
+}
+
+static void cxd56_power_on_i2s1(FAR struct cxd56_dev_s *dev)
+{
+  uint32_t rate;
+  write_reg(REG_AC_PDN_DSPS1, 0);                     /* Power on SRC1 */
+  write_reg(REG_AC_SD1MASTER, CXD56_I2S1_MODE);       /* I2S1 mode */
+  write_reg(REG_AC_DIF1, CXD56_I2S1_FORMAT);          /* I2S1 format */
+  write_reg(REG_AC_LR_SWAP1, CXD56_I2S1_FORMAT);
+  write_reg(REG_AC_TEST_OUT_SEL0, CXD56_I2S1_BYPASS); /* I2S1 bypass mode */
+
+  rate = cxd56_get_i2s_rate(CXD56_I2S1_DATA_RATE);
+  write_reg(REG_AC_SRC1, rate);                       /* I2S1 rate */
+}
+
+static uint32_t cxd56_power_on_aca(uint32_t samplerate)
+{
+  struct cxd56_aca_pwon_param_s pwon_param;
+
+  if (as_aca_control(CXD56_ACA_CTL_CHECK_ID, (uint32_t)NULL) != 0)
+    {
+      return CXD56_AUDIO_ECODE_ANA_CHKID;
+    }
+
+  if (samplerate > 48000)
+    {
+      pwon_param.osc_mode = (CXD56_AUDIO_MCLK == CXD56_XTAL_24_576MHZ ?
+                             CXD56_ACA_OSC_24_576MHZ_HIRES :
+                             CXD56_ACA_OSC_49_152MHZ_HIRES);
+    }
+  else
+    {
+      pwon_param.osc_mode = (CXD56_AUDIO_MCLK == CXD56_XTAL_24_576MHZ ?
+                             CXD56_ACA_OSC_24_576MHZ :
+                             CXD56_ACA_OSC_49_152MHZ);
+    }
+
+  pwon_param.dmic_clk_ds = CXD56_DMIC_CLK_DS;
+  pwon_param.ad_data_ds = CXD56_DA_DS;
+  pwon_param.mic_dev = CXD56_ACA_MIC_AMIC;  /* TODO: analog/digital mic select */
+  pwon_param.mclk_ds = CXD56_MCLKOUT_DS;
+  pwon_param.gpo_ds = CXD56_GPO_A_DS;
+  if (as_aca_control(CXD56_ACA_CTL_POWER_ON_COMMON,
+                    (uint32_t)&pwon_param) != 0)
+    {
+      return CXD56_AUDIO_ECODE_ANA_PWON;
+    }
+
+  return CXD56_AUDIO_ECODE_OK;
+}
+
+static uint32_t cxd56_power_on_analog_output(FAR struct cxd56_dev_s *dev)
+{
+  struct cxd56_aca_smaster_param_s smaster_param;
+  struct cxd56_aca_pwoutput_param_s pwon_param;
+
+  if (dev->samplerate > 48000)
+    {
+      smaster_param.mode   = CXD56_SMSTR_MODE_FS_32;
+      smaster_param.mck_fs = CXD56_SMSTR_MCK_FS_1024;
+      pwon_param.mode      = CXD56_SMSTR_MODE_FS_32;
+    }
+  else
+    {
+      smaster_param.mode   = CXD56_SMSTR_MODE_FS_16;
+      smaster_param.mck_fs = CXD56_SMSTR_MCK_FS_512;
+      pwon_param.mode      = CXD56_SMSTR_MODE_FS_16;
+    }
+
+  smaster_param.ch_sel   = CXD56_SMSTR_CHSEL_NORMAL;
+  smaster_param.out2dly  = 0x00;
+  smaster_param.pwm_mode = CXD56_SMSTR_PWMMD_BOTH;
+
+  pwon_param.out_dev     = CXD56_ACA_OUT_OFF;
+  pwon_param.pwm_out[0]  = CXD56_ACA_PWMOUT_UNKNOWN;
+  pwon_param.pwm_out[1]  = CXD56_ACA_PWMOUT_UNKNOWN;
+  pwon_param.sp_delay    = CXD56_ACA_SP_DELAY_SEL_UNKNOWN;
+  pwon_param.loop_mode   = CXD56_ACA_SP_LOOP_MODE_UNKNOWN;
+  pwon_param.sp_dly_free = CXD56_ACA_SP_DLY_FREE_UNKNOWN;
+  pwon_param.sp_spliton  = CXD56_SP_SPLIT_ON;
+  pwon_param.sp_drv      = CXD56_SP_DRIVER;
+
+  if (as_aca_control(CXD56_ACA_CTL_SET_SMASTER,
+                    (uint32_t)&smaster_param) != 0)
+    {
+      return CXD56_AUDIO_ECODE_ANA_SET_SMASTER;
+    }
+
+  if (as_aca_control(CXD56_ACA_CTL_POWER_ON_OUTPUT,
+                    (uint32_t)&pwon_param) != 0)
+    {
+      return CXD56_AUDIO_ECODE_ANA_PWON_OUTPUT;
+    }
+
+  /* Power on S-Mster. */
+
+  write_reg(REG_AC_PDN_SMSTR, 0);
+
+  /* Set NSDD. */
+
+  write_reg(REG_AC_NSDD, 0x07fb5);
+
+  /* Set NSX2. */
+
+  if (dev->samplerate > 48000 && CXD56_AUDIO_MCLK == CXD56_XTAL_49_152MHZ)
+    {
+      write_reg(REG_AC_NSX2, 1);
+    }
+  else
+    {
+      write_reg(REG_AC_NSX2, 0);
+    }
+
+  /* Set smaster and enable */
+
+  write_reg(REG_INT_M_OVF_SMASL, 0);
+  write_reg(REG_INT_M_OVF_SMASR, 0);
+  write_reg(REG_AC_NSPMUTE, 0);
+
+  cxd56_set_volume(CXD56_AUDIO_VOLID_MIXER_OUT, dev->volume, true);
+
+  return CXD56_AUDIO_ECODE_OK;
+}
+
+static uint32_t cxd56_power_on(FAR struct cxd56_dev_s *dev)
+{
+  if (g_codec_start_count == 0)
+    {
+      board_audio_i2s_enable();
+      board_audio_initialize();
+
+      /* Power on analog audio */
+
+      if (board_aca_power_control(CXD5247_AVDD | CXD5247_DVDD, true) != 0)
+        {
+          return CXD56_AUDIO_ECODE_ANA_PWON;
+        }
+
+      if (!board_aca_power_monitor(CXD5247_AVDD | CXD5247_DVDD))
+        {
+          return CXD56_AUDIO_ECODE_ANA_PWON;
+        }
+
+      cxd56_power_on_aca(dev->samplerate);
+
+      cxd56_audio_clock_enable(CXD56_AUD_MCLK_EXT, 0);
+
+      /* Power_on_codec */
+
+      if (read_reg(REG_AC_REVID) != CXD56_EXP_REVID)
+        {
+          auderr("cxd56_power_on REVID mismatch (%x vs. %x).\n",
+               REG_AC_REVID, CXD56_EXP_REVID);
+          return CXD56_AUDIO_ECODE_ANA_CHKID;
+        }
+
+      if (read_reg(REG_AC_DEVICEID) != CXD56_EXP_DEVICEID)
+        {
+          auderr("cxd56_power_on DEVICEID mismatch (%x vs. %x).\n",
+               REG_AC_DEVICEID, CXD56_EXP_DEVICEID);
+          return CXD56_AUDIO_ECODE_ANA_CHKID;
+        }
+
+      /* Power on serializeer */
+
+      write_reg(REG_AC_SDES_EN, 1);
+
+      /* Power on codec */
+
+      write_reg(REG_AC_PDN_DSPC, 0);
+      write_reg(REG_AC_DSR_RATE, 1);
+      write_reg(REG_AC_DIGSFT,   1);
+
+#if defined(CONFIG_CXD56_I2S0) || defined(CONFIG_CXD56_I2S1)
+      /* Clear interrupt status of bck_err */
+
+      write_reg(REG_INT_M_I2S1_BCL_ERR1, 0);
+      write_reg(REG_INT_M_I2S1_BCL_ERR2, 0);
+
+      cxd56_power_on_i2s1(dev);
+#endif /* defined(CONFIG_CXD56_I2S0) || defined(CONFIG_CXD56_I2S1) */
+
+#ifdef CONFIG_CXD56_I2S0
+      /* Enable I2S data input and output of SRC1 */
+
+      write_reg(REG_AC_SDIN1_EN, 1);
+      write_reg(REG_AC_SDOUT1_EN, 1);
+#endif /* CONFIG_CXD56_I2S0 */
+
+      /* Enable BCK, LRCK output if master (1). */
+
+      write_reg(REG_AC_SDCK_OUTENX, CXD56_I2S1_MODE);
+
+      /* Enable serial interface */
+
+      write_reg(REG_AC_FS_CLK_EN,  1);
+      write_reg(REG_AC_PDM_OUT_EN, 1);
+
+      /* Initialize data path selection */
+
+      write_reg(REG_AC_AU_DAT_SEL1, 4);
+      write_reg(REG_AC_AU_DAT_SEL2, 4);
+      write_reg(REG_AC_AU_COD_INSEL2,  2);
+      write_reg(REG_AC_AU_COD_INSEL3,  3);
+      write_reg(REG_AC_SRC1IN_SEL,  0);
+      write_reg(REG_AC_SRC2IN_SEL,  1);
+
+      /* Set BCA data rate */
+
+      write_reg(REG_I2S_ENSEL, (dev->samplerate > 48000) ? 1 : 0);
+
+      /* TODO: alc, cstereo, dnc, deq, vol & datapath (reset mic */
+
+      cxd56_attach_irq(true);
+      cxd56_enable_irq(true);
+    }
+
+  g_codec_start_count++;
+  dev->state = CXD56_DEV_STATE_STOPPED;
+
+  return CXD56_AUDIO_ECODE_OK;
+}
+
+static uint32_t cxd56_power_off(FAR struct cxd56_dev_s *dev)
+{
+  audinfo("cxd56_power_off\n");
+
+  /* Codec block. */
+
+  /* Disable AHBMASTER. */
+
+  write_reg(REG_AC_MCK_AMBMSTR_EN, 0);
+
+  /* Disable CODEC. */
+
+  write_reg(REG_AC_ALC_EN, 0);
+  write_reg(REG_AC_SPC_EN, 0);
+  write_reg(REG_AC_DEQ_EN, 0);
+
+  /* Disable DNC. */
+
+  write_reg(REG_AC_DNC1_MUTE, 1);
+  write_reg(REG_AC_DNC2_MUTE, 1);
+  write_reg(REG_AC_DNC1_START, 0);
+  write_reg(REG_AC_DNC2_START, 0);
+
+  /* Disable SRC. */
+
+  write_reg(REG_AC_SDIN1_EN, 0);
+  write_reg(REG_AC_SDIN2_EN, 0);
+  write_reg(REG_AC_SDOUT1_EN, 0);
+  write_reg(REG_AC_SDOUT2_EN, 0);
+  write_reg(REG_AC_SDCK_OUTENX, 1);
+  write_reg(REG_AC_BLF_EN, 0);
+
+  /* Disable SDES. */
+
+  write_reg(REG_AC_PDM_OUT_EN, 0);
+  write_reg(REG_AC_FS_CLK_EN, 0);
+  write_reg(REG_AC_SDES_EN, 0);
+
+  /* Power off SRC. */
+
+  write_reg(REG_AC_PDN_DSPS1, 1);
+  write_reg(REG_AC_PDN_DSPS2, 1);
+  write_reg(REG_AC_PDN_DSPB, 1);
+
+  /* Power off CODEC. */
+
+  write_reg(REG_AC_PDN_DSPC, 1);
+
+  /* Power off DNC. */
+
+  write_reg(REG_AC_PDN_DNC1, 1);
+  write_reg(REG_AC_PDN_DNC2, 1);
+  write_reg(REG_AC_PDN_ANC, 1);
+
+  /* Analog block. */
+
+  /* Disable audio clock */
+
+  cxd56_audio_clock_disable();
+  if (as_aca_control(CXD56_ACA_CTL_POWER_OFF_COMMON, (uint32_t)NULL) != 0)
+    {
+      return CXD56_AUDIO_ECODE_ANA_PWOFF;
+    }
+
+  board_aca_power_control(CXD5247_AVDD | CXD5247_DVDD, false);
+
+  /* Disable interrupts */
+
+  cxd56_attach_irq(false);
+  cxd56_enable_irq(false);
+
+  board_audio_finalize();
+
+  return CXD56_AUDIO_ECODE_OK;
+}
+
+/****************************************************************************
+ * Name: cxd56_getcaps
+ *
+ * Description: Get the audio device capabilities.
+ *
+ ****************************************************************************/
+
+static int cxd56_getcaps(FAR struct audio_lowerhalf_s *lower, int type,
+                 FAR struct audio_caps_s *caps)
+{
+  DEBUGASSERT(caps && caps->ac_len >= sizeof(struct audio_caps_s));
+
+  /* Fill in the caller's structure based on requested info */
+
+  caps->ac_format.hw  = 0;
+  caps->ac_controls.w = 0;
+
+  switch (caps->ac_type)
+    {
+      /* Query for supported types of units */
+
+      case AUDIO_TYPE_QUERY:
+
+        /* Stereo output */
+
+        caps->ac_channels = 2;
+
+        switch (caps->ac_subtype)
+          {
+            case AUDIO_TYPE_QUERY:
+
+              /* The types of audio units we implement */
+
+              caps->ac_controls.b[0] = AUDIO_TYPE_OUTPUT |
+                                       AUDIO_TYPE_INPUT |
+                                       AUDIO_TYPE_FEATURE;
+              break;
+
+            default:
+              caps->ac_controls.b[0] = AUDIO_SUBFMT_END;
+              break;
+          }
+        break;
+
+      /* Output capabilities */
+
+      case AUDIO_TYPE_OUTPUT:
+
+        caps->ac_channels = CXD56_OUT_CHANNELS_MAX;
+
+        switch (caps->ac_subtype)
+          {
+            case AUDIO_TYPE_QUERY:
+
+              /* Report supported output sample rates */
+
+              caps->ac_controls.b[0] = CXD56_SUPP_RATES_L;
+              caps->ac_controls.b[1] = CXD56_SUPP_RATES_H;
+              break;
+
+            default:
+              break;
+          }
+        break;
+
+      /* Feature capabilities */
+
+      case AUDIO_TYPE_FEATURE:
+
+        /* Report supported feature units */
+
+        if (caps->ac_subtype == AUDIO_FU_UNDEF)
+          {
+            caps->ac_controls.b[0] = AUDIO_FU_VOLUME;
+          }
+        break;
+
+      /* Others are unsupported */
+
+      default:
+
+        /* Zero out the fields to indicate no support */
+
+        caps->ac_subtype = 0;
+        caps->ac_channels = 0;
+        break;
+    }
+
+  /* Return the length of the audio_caps_s struct for validation */
+
+  return caps->ac_len;
+}
+
+/****************************************************************************
+ * Name: cxd56_shutdown
+ *
+ * Description: Shutdown the chip and puts it in the lowest power
+ *              state possible.
+ *
+ ****************************************************************************/
+
+static int cxd56_shutdown(FAR struct audio_lowerhalf_s *lower)
+{
+  FAR struct cxd56_dev_s *priv = (FAR struct cxd56_dev_s *)lower;
+  int ret = OK;
+
+  audinfo("cxd56_shutdown\n");
+
+  if (priv->state != CXD56_DEV_STATE_OFF)
+    {
+      ret = cxd56_power_off(priv);
+      if (ret != CXD56_AUDIO_ECODE_OK)
+        {
+          auderr("cxd56_audio_poweroff() failed. (%d)\n", ret);
+          goto error;
+        }
+
+      g_codec_start_count = 0;
+      priv->state = CXD56_DEV_STATE_OFF;
+    }
+
+error:
+  return ret;
+}
+
+/****************************************************************************
+ * Name: cxd56_configure
+ *
+ * Description: Configure the audio device for the specified mode.
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_AUDIO_MULTI_SESSION
+static int cxd56_configure(FAR struct audio_lowerhalf_s *lower,
+                 FAR void *session, FAR const struct audio_caps_s *caps)
+#else
+static int cxd56_configure(FAR struct audio_lowerhalf_s *lower,
+                 FAR const struct audio_caps_s *caps)
+#endif
+{
+  FAR struct cxd56_dev_s *priv = (FAR struct cxd56_dev_s *)lower;
+  int ret = OK;
+
+  switch (caps->ac_type)
+    {
+    case AUDIO_TYPE_FEATURE:
+      audinfo("  AUDIO_TYPE_FEATURE\n");
+
+      switch (caps->ac_format.hw)
+        {
+#ifndef CONFIG_AUDIO_EXCLUDE_VOLUME
+        case AUDIO_FU_VOLUME:
+          {
+            uint16_t volume = caps->ac_controls.hw[0];
+
+            if (volume >= 0 && volume <= 1000)
+              {
+                /* Scale the volume setting to the range {-1020..120} */
+
+                priv->volume = CXD56_VOL_NX_TO_CXD56(volume);
+                audinfo("Volume: %d (priv = %d)\n", volume, priv->volume);
+
+                cxd56_set_volume(CXD56_AUDIO_VOLID_MIXER_OUT,
+                                 priv->volume, false);
+                cxd56_set_volume(CXD56_AUDIO_VOLID_MIXER_IN1,
+                                 priv->volume, false);
+                cxd56_set_volume(CXD56_AUDIO_VOLID_MIXER_IN2,
+                                 priv->volume, false);
+              }
+            else
+              {
+                ret = -EDOM;
+              }
+          }
+          break;
+#endif /* CONFIG_AUDIO_EXCLUDE_VOLUME */
+
+        default:
+          auderr("Unrecognized feature unit\n");
+          ret = -ENOTTY;
+          break;
+        }
+      break;
+
+    case AUDIO_TYPE_OUTPUT:
+      {
+        if (caps->ac_controls.b[2] != 16 && caps->ac_controls.b[2] != 24)
+          {
+            auderr("Unsupported bits per sample: %d\n",
+                   caps->ac_controls.b[2]);
+            ret = -ERANGE;
+            break;
+          }
+
+        /* Save the configuration */
+
+        priv->dma_handle = CXD56_AUDIO_DMA_I2S0_DOWN;
+        priv->samplerate = caps->ac_controls.hw[0];
+        priv->channels = caps->ac_channels;
+        priv->bitwidth = caps->ac_controls.b[2];
+
+        g_dev[priv->dma_handle] = priv;
+
+        audinfo("Configured output using %d:\n", priv->dma_handle);
+        audinfo("  Channels:    %d\n", priv->channels);
+        audinfo("  Samplerate:  %d\n", priv->samplerate);
+        audinfo("  Bit width:   %d\n", priv->bitwidth);
+
+        ret = cxd56_power_on(priv);
+        if (ret != CXD56_AUDIO_ECODE_OK)
+          {
+            auderr("Power on error. (%d)\n", ret);
+            goto error;
+          }
+
+        ret = cxd56_init_dma(priv);
+        if (ret != CXD56_AUDIO_ECODE_OK)
+          {
+            auderr("DMA init failed. (%d)\n", ret);
+            goto error;
+          }
+
+        ret = cxd56_power_on_analog_output(priv);
+        if (ret != CXD56_AUDIO_ECODE_OK)
+          {
+            auderr("Power on analog output failed- (%d)\n", ret);
+            goto error;
+          }
+      }
+      break;
+    }
+
+error:
+  return ret;
+}
+
+/****************************************************************************
+ * Name: cxd56_start
+ *
+ * Description: Starts playback with the current configuration.
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_AUDIO_MULTI_SESSION
+static int cxd56_start(FAR struct audio_lowerhalf_s *lower,
+                       FAR void *session)
+#else
+static int cxd56_start(FAR struct audio_lowerhalf_s *lower)
+#endif
+{
+  int ret;
+  FAR struct cxd56_dev_s *priv = (FAR struct cxd56_dev_s *)lower;
+
+  audinfo("cxd56_start\n");
+
+  /* Select audio data path */
+
+  if (priv->dma_handle == CXD56_AUDIO_DMA_I2S0_DOWN)
+    {
+      write_reg(REG_AC_AU_DAT_SEL1, CXD56_AUDAT_SEL_BUSIF1);
+    }
+
+  ret = cxd56_init_worker(lower);
+  if (ret != CXD56_AUDIO_ECODE_OK)
+    {
+      auderr("Could not feed DMA. (%d)\n", ret);
+      goto error;
+    }
+
+  priv->state = CXD56_DEV_STATE_STARTING;
+
+error:
+  return ret;
+}
+
+/****************************************************************************
+ * Name: cxd56_stop
+ *
+ * Description: Stops playback with the current configuration.
+ *
+ ****************************************************************************/
+
+static int cxd56_stop_dma(FAR struct cxd56_dev_s *priv)
+{
+  int ret = OK;
+
+  if (priv->state != CXD56_DEV_STATE_STOPPED)
+    {
+      audinfo("Stopping DMA for handle %d.\n", priv->dma_handle);
+
+      /* Stop DMA */
+
+      cxd56_set_dma_running(priv->dma_handle, false);
+
+      if (priv->dma_handle == CXD56_AUDIO_DMA_I2S0_DOWN)
+        {
+          /* Turn off amplifier */
+
+          board_external_amp_mute_control(true);
+
+          /* Mute and disable output */
+
+          write_reg(REG_AC_NSPMUTE, 1);
+          write_reg(REG_AC_PDN_SMSTR, 1);
+          as_aca_control(CXD56_ACA_CTL_POWER_OFF_OUTPUT, (uint32_t)NULL);
+        }
+
+      priv->state = CXD56_DEV_STATE_STOPPED;
+    }
+
+  return ret;
+}
+
+#ifndef CONFIG_AUDIO_EXCLUDE_STOP
+#ifdef CONFIG_AUDIO_MULTI_SESSION
+static int cxd56_stop(FAR struct audio_lowerhalf_s *lower, FAR void *session)
+#else
+static int cxd56_stop(FAR struct audio_lowerhalf_s *lower)
+#endif
+{
+  int ret = OK;
+  FAR void *value;
+  struct audio_msg_s msg;
+  FAR struct cxd56_dev_s *priv = (FAR struct cxd56_dev_s *)lower;
+
+  audinfo("cxd56_stop\n");
+
+  if (priv->state == CXD56_DEV_STATE_STOPPED)
+    {
+      goto error;
+    }
+
+  priv->state = CXD56_DEV_STATE_STOPPING;
+
+  msg.msgId = AUDIO_MSG_STOP;
+  msg.u.data = 0;
+  (void)nxmq_send(priv->mq, (FAR const char *)&msg,
+                  sizeof(msg), CONFIG_CXD56_MSG_PRIO);
+
+  /* Join the worker thread */
+
+  pthread_join(priv->threadid, &value);
+  priv->threadid = 0;
+error:
+  return ret;
+}
+#endif /* CONFIG_AUDIO_EXCLUDE_STOP */
+
+/****************************************************************************
+ * Name: cxd56_pause
+ *
+ * Description: Pauses the playback.
+ *
+ ****************************************************************************/
+
+#ifndef CONFIG_AUDIO_EXCLUDE_PAUSE_RESUME
+#ifdef CONFIG_AUDIO_MULTI_SESSION
+static int cxd56_pause(FAR struct audio_lowerhalf_s *lower,
+                       FAR void *session)
+#else
+static int cxd56_pause(FAR struct audio_lowerhalf_s *lower)
+#endif
+{
+  audinfo("cxd56_pause\n");
+  return OK;
+}
+
+/****************************************************************************
+ * Name: cxd56_resume
+ *
+ * Description: Resumes the playback.
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_AUDIO_MULTI_SESSION
+static int cxd56_resume(FAR struct audio_lowerhalf_s *lower,
+                        FAR void *session)
+#else
+static int cxd56_resume(FAR struct audio_lowerhalf_s *lower)
+#endif
+{
+  audinfo("cxd56_resume\n");
+  return OK;
+}
+#endif /* CONFIG_AUDIO_EXCLUDE_PAUSE_RESUME */
+
+/****************************************************************************
+ * Name: cxd56_release
+ *
+ * Description: Releases the session.
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_AUDIO_MULTI_SESSION
+static int cxd56_release(FAR struct audio_lowerhalf_s *lower,
+                  FAR void *pContext)
+#else
+static int cxd56_release(FAR struct audio_lowerhalf_s *lower)
+#endif
+{
+  audinfo("cxd56_release\n");
+  return OK;
+}
+
+/****************************************************************************
+ * Name: cxd56_reserve
+ *
+ * Description: Reserves a session.
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_AUDIO_MULTI_SESSION
+static int cxd56_reserve(FAR struct audio_lowerhalf_s *lower,
+                  FAR void **ppContext)
+#else
+static int cxd56_reserve(FAR struct audio_lowerhalf_s *lower)
+#endif
+{
+  audinfo("cxd56_reserve\n");
+  return OK;
+}
+
+static void cxd56_swap_buffer_rl(uint32_t addr, uint16_t size)
+{
+  uint32_t i = 0;
+  uint16_t tmp_buffer;
+  uint16_t *p_lch = (uint16_t *)addr;
+  uint16_t *p_rch = p_lch + 1;
+
+  while (i++ < size / 4)
+    {
+      tmp_buffer = *p_lch;
+      *p_lch = *p_rch;
+      *p_rch = tmp_buffer;
+
+      p_lch += 2;
+      p_rch += 2;
+    }
+}
+
+static int cxd56_start_dma(FAR struct cxd56_dev_s *dev)
+{
+  FAR struct ap_buffer_s *apb;
+  int retry;
+  int timeout;
+  uint32_t addr;
+  uint32_t size;
+  static int bufcount = 0;
+  CXD56_AUDIO_ECODE ret = CXD56_AUDIO_ECODE_OK;
+
+  cxd56_take_sem(&dev->pendsem);
+  if (dq_count(&dev->pendingq) == 0)
+    {
+    audinfo("Pending queue empty! Played %d buffers.\n", bufcount);
+    dev->state = CXD56_DEV_STATE_STOPPING;
+    }
+  else
+    {
+      /* Fill up with as many DMA requests as we can */
+
+      while (dq_count(&dev->pendingq) > 0)
+        {
+          if (read_reg(REG_I2S1_OUT_RTD_TRG) != CXD56_DMA_CMD_FIFO_NOT_FULL)
+            {
+              /* DMA busy, will retry next time */
+
+              ret = CXD56_AUDIO_ECODE_OK;
+              goto exit;
+            }
+
+          apb = (struct ap_buffer_s *) dq_peek(&dev->pendingq);
+          addr = ((uint32_t)apb->samp) & CXD56_DMA_START_ADDR_MASK;
+          size = (apb->nbytes / ((dev->bitwidth / 8) + dev->channels)) - 1;
+
+          if (dev->bitwidth == 16 && CXD56_DMA_FORMAT == CXD56_DMA_FORMAT_RL)
+            {
+              cxd56_swap_buffer_rl((uint32_t)apb->samp, apb->nbytes);
+            }
+
+          write_reg(REG_I2S1_OUT_START_ADR, addr);
+          write_reg(REG_I2S1_OUT_SAMPLE_NO, size);
+
+          /* Start DMA, use workaround with first buffer */
+
+          if (dev->state != CXD56_DEV_STATE_STARTED)
+            {
+              /* Turn on amplifier */
+
+              board_external_amp_mute_control(false);
+
+              /* Mask interrupts */
+
+              cxd56_int_mask(dev->dma_handle, CXD56_DMA_INT_ERR);
+              cxd56_int_mask(dev->dma_handle, CXD56_DMA_INT_DONE);
+
+              /* Sync workaround loop */
+
+              for (retry = 0; retry < CXD56_DMA_START_RETRY_CNT; retry++)
+                {
+                  /* Clear interrupt status */
+
+                  cxd56_int_clear(dev->dma_handle, CXD56_DMA_INT_ERR);
+                  cxd56_int_clear(dev->dma_handle, CXD56_DMA_INT_SMP);
+
+                  /* Lock interrupt */
+
+                  up_irq_disable();
+                  sched_lock();
+
+                  for (timeout = 0; timeout < CXD56_DMA_TIMEOUT; timeout++)
+                    {
+                      if (read_reg(REG_I2S1_INT_CTRL_SMP))
+                        {
+                          break;
+                        }
+                    }
+
+                  if (timeout == CXD56_DMA_TIMEOUT)
+                    {
+                      ret = CXD56_AUDIO_ECODE_DMA_SMP_TIMEOUT;
+                      goto exit;
+                    }
+
+                  /* Reset channel select */
+
+                  cxd56_reset_channel_sel(dev->dma_handle);
+
+                  /* Start DMA */
+
+                  cxd56_set_dma_running(CXD56_AUDIO_DMA_I2S0_DOWN, true);
+
+                  /* Unlock interrupt */
+
+                  sched_unlock();
+                  up_irq_enable();
+
+                  /* Wait for 1sample tramsfer */
+
+                  if (dev->samplerate > 48000)
+                    {
+                      up_udelay(CXD56_DMA_SMP_WAIT_HIRES);
+                    }
+                  else
+                    {
+                      up_udelay(CXD56_DMA_SMP_WAIT_NORMALT);
+                    }
+
+                  /* Check whether an error interrupt has occurred */
+
+                  if (read_reg(REG_I2S1_INT_CTRL_ERR))
+                    {
+                      cxd56_set_dma_running(CXD56_AUDIO_DMA_I2S0_DOWN,
+                                            false);
+                      cxd56_int_clear(dev->dma_handle,
+                                      CXD56_DMA_INT_ERR);
+
+                      for (timeout = 0;
+                           timeout < CXD56_DMA_TIMEOUT;
+                           timeout++)
+                        {
+                          if (CXD56_DMA_MSTATE_BUF_EMPTY ==
+                              cxd56_get_monbuf_state(dev->dma_handle))
+                            {
+                              if (read_reg(REG_I2S1_INT_CTRL_DONE))
+                                {
+                                  cxd56_int_clear(dev->dma_handle,
+                                                  CXD56_DMA_INT_DONE);
+                                  break;
+                                }
+                            }
+                        }
+                    }
+                      else
+                    {
+                      break;
+                    }
+                }
+
+              cxd56_int_unmask(dev->dma_handle, CXD56_DMA_INT_DONE);
+              cxd56_int_clear(dev->dma_handle, CXD56_DMA_INT_ERR);
+              cxd56_int_unmask(dev->dma_handle, CXD56_DMA_INT_ERR);
+            }
+          else
+            {
+              /* start DMA */
+
+              cxd56_set_dma_running(CXD56_AUDIO_DMA_I2S0_DOWN, true);
+            }
+
+          dq_pop(&dev->pendingq);
+          dq_push(&dev->runningq, &apb->dq_entry);
+          dev->state = CXD56_DEV_STATE_STARTED;
+          bufcount++;
+        }
+    }
+
+exit:
+  cxd56_give_sem(&dev->pendsem);
+  return ret;
+}
+
+/****************************************************************************
+ * Name: cxd56_enqueuebuffer
+ *
+ * Description: Enqueue an audio buffer for playback.
+ *
+ ****************************************************************************/
+
+static int cxd56_enqueuebuffer(FAR struct audio_lowerhalf_s *lower,
+                 FAR struct ap_buffer_s *apb)
+{
+  FAR struct cxd56_dev_s *priv = (FAR struct cxd56_dev_s *)lower;
+  struct audio_msg_s msg;
+  int                ret = OK;
+
+  cxd56_take_sem(&priv->pendsem);
+  dq_push(&priv->pendingq, &apb->dq_entry);
+  cxd56_give_sem(&priv->pendsem);
+
+  if (priv->mq != NULL)
+    {
+      msg.msgId = AUDIO_MSG_ENQUEUE;
+      msg.u.data = 0;
+      (void)nxmq_send(priv->mq, (FAR const char *) &msg,
+                      sizeof(msg), CONFIG_CXD56_MSG_PRIO);
+    }
+
+  return ret;
+}
+
+/****************************************************************************
+ * Name: cxd56_cancelbuffer
+ *
+ * Description: Called when an enqueued buffer is being cancelled.
+ *
+ ****************************************************************************/
+
+static int cxd56_cancelbuffer(FAR struct audio_lowerhalf_s *lower,
+                 FAR struct ap_buffer_s *apb)
+{
+  audinfo("cxd56_cancelbuffer\n");
+  return OK;
+}
+
+/****************************************************************************
+ * Name: cxd56_ioctl
+ *
+ * Description: Perform a device ioctl
+ *
+ ****************************************************************************/
+
+static int cxd56_ioctl(FAR struct audio_lowerhalf_s *lower, int cmd,
+                 unsigned long arg)
+{
+#ifdef CONFIG_AUDIO_DRIVER_SPECIFIC_BUFFERS
+  FAR struct ap_buffer_info_s *bufinfo;
+#endif
+
+  audinfo("cxd56_ioctl\n");
+
+  /* Handle ioctl commands from the upper-half driver */
+
+  switch (cmd)
+    {
+       /* Return our preferred buffer size and count */
+
+#ifdef CONFIG_AUDIO_DRIVER_SPECIFIC_BUFFERS
+      case AUDIOIOC_GETBUFFERINFO:
+        {
+          audinfo("AUDIOIOC_GETBUFFERINFO:\n");
+          bufinfo              = (FAR struct ap_buffer_info_s *) arg;
+          bufinfo->buffer_size = CONFIG_CXD56_AUDIO_BUFFER_SIZE;
+          bufinfo->nbuffers    = CONFIG_CXD56_AUDIO_NUM_BUFFERS;
+        }
+        break;
+#endif
+
+      default:
+        audinfo("Unhandled ioctl: %d\n", cmd);
+        break;
+    }
+
+  return OK;
+}
+
+/****************************************************************************
+ * Name: cxd56_workerthread
+ *
+ *  This is the thread that feeds data to the chip and keeps the audio
+ *  stream going.
+ *
+ ****************************************************************************/
+
+static void *cxd56_workerthread(pthread_addr_t pvarg)
+{
+  FAR struct cxd56_dev_s *priv = (struct cxd56_dev_s *)pvarg;
+  struct audio_msg_s     msg;
+  unsigned int           prio;
+  int                    ret;
+  int                    size;
+
+  audinfo("Workerthread started.\n");
+
+#ifndef CONFIG_AUDIO_EXCLUDE_STOP
+  priv->terminating = false;
+#endif
+
+  /* Mark ourself as running */
+
+  priv->running = true;
+
+  /* Initial buffering */
+
+  ret = cxd56_start_dma(priv);
+  if (ret != CXD56_AUDIO_ECODE_OK)
+    {
+      auderr("Could not start DMA transfer. (%d)\n", ret);
+      priv->running = false;
+    }
+
+  while (priv->running)
+    {
+      size = nxmq_receive(priv->mq, (FAR char *)&msg, sizeof(msg), &prio);
+
+      /* Handle the case when we return with no message */
+
+      if (size == 0)
+        {
+          priv->running = false;
+          break;
+        }
+
+      /* Process the message */
+
+      switch (msg.msgId)
+        {
+          case AUDIO_MSG_STOP:
+            cxd56_stop_dma(priv);
+            priv->running = false;
+            audinfo("Workerthread stopped.\n");
+            break;
+
+          case AUDIO_MSG_DATA_REQUEST:
+            cxd56_start_dma(priv);
+            break;
+
+          case AUDIO_MSG_ENQUEUE:
+          default:
+            break;
+        }
+    }
+
+  mq_close(priv->mq);
+  mq_unlink(priv->mqname);
+  priv->mq = NULL;
+
+  /* Send AUDIO_MSG_COMPLETE to the client */
+
+#ifdef CONFIG_AUDIO_MULTI_SESSION
+  priv->dev.upper(priv->dev.priv, AUDIO_CALLBACK_COMPLETE, NULL, OK, NULL);
+#else
+  priv->dev.upper(priv->dev.priv, AUDIO_CALLBACK_COMPLETE, NULL, OK);
+#endif
+
+  return NULL;
+}
+
+/* Setup worker thread and message queue */
+
+static int cxd56_init_worker(FAR struct audio_lowerhalf_s *dev)
+{
+  FAR struct cxd56_dev_s *priv = (FAR struct cxd56_dev_s *)dev;
+  struct sched_param sparam;
+  struct mq_attr     m_attr;
+  pthread_attr_t     t_attr;
+  void               *value;
+  int                ret = CXD56_AUDIO_ECODE_OK;
+
+  snprintf(priv->mqname, sizeof(priv->mqname), "/tmp/%X", priv);
+
+  m_attr.mq_maxmsg  = 16;
+  m_attr.mq_msgsize = sizeof(struct audio_msg_s);
+  m_attr.mq_curmsgs = 0;
+  m_attr.mq_flags   = 0;
+
+  priv->mq = mq_open(priv->mqname, O_RDWR | O_CREAT, 0644, &m_attr);
+  if (priv->mq == NULL)
+    {
+      auderr("Could not allocate message queue.\n");
+      ret = -ENOMEM;
+      goto error;
+    }
+
+  /* Join any old worker thread we had created to prevent a memory leak */
+
+  if (priv->threadid != 0)
+    {
+      pthread_join(priv->threadid, &value);
+    }
+
+  pthread_attr_init(&t_attr);
+  sparam.sched_priority = sched_get_priority_max(SCHED_FIFO) - 3;
+  (void)pthread_attr_setschedparam(&t_attr, &sparam);
+  (void)pthread_attr_setstacksize(&t_attr,
+                                  CONFIG_CXD56_AUDIO_WORKER_STACKSIZE);
+
+  ret = pthread_create(&priv->threadid, &t_attr, cxd56_workerthread,
+                       (pthread_addr_t)priv);
+  if (ret != OK)
+    {
+      auderr("pthread_create failed. (%d)\n", ret);
+      goto error;
+    }
+  else
+    {
+      pthread_setname_np(priv->threadid, "cxd56");
+    }
+
+error:
+  return ret;
+}
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: cxd56_initialize
+ *
+ * Description:
+ *   Initialize audio on the CXD56 device
+ *
+ * Input Parameters:
+ *
+ ****************************************************************************/
+
+struct audio_lowerhalf_s *cxd56_initialize(
+                         FAR const struct cxd56_lower_s *lower)
+{
+  FAR struct cxd56_dev_s *priv;
+
+  audinfo("cxd56_initialize\n");
+  priv = (FAR struct cxd56_dev_s *)kmm_zalloc(sizeof(struct cxd56_dev_s));
+  if (priv)
+    {
+      priv->dev.ops = &g_audioops;
+      priv->lower   = lower;
+      priv->state   = CXD56_DEV_STATE_OFF;
+
+      nxsem_init(&priv->pendsem, 0, 1);
+      dq_init(&priv->pendingq);
+      dq_init(&priv->runningq);
+    }
+
+  return &priv->dev;
+}
diff --git a/drivers/audio/cxd56.h b/drivers/audio/cxd56.h
new file mode 100644
index 0000000..1012df6
--- /dev/null
+++ b/drivers/audio/cxd56.h
@@ -0,0 +1,271 @@
+/****************************************************************************
+ * drivers/audio/cxd56.h
+ *
+ *   Copyright 2019 Sony Semiconductor Solutions Corporation
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ *    used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+#ifndef __DRIVERS_AUDIO_CXD56_H
+#define __DRIVERS_AUDIO_CXD56_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <pthread.h>
+#include <mqueue.h>
+
+#include <nuttx/audio/audio.h>
+#include <nuttx/config.h>
+#include <nuttx/compiler.h>
+#include <nuttx/fs/ioctl.h>
+
+#ifdef CONFIG_AUDIO
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#ifndef CONFIG_CXD56_AUDIO_WORKER_STACKSIZE
+#  define CONFIG_CXD56_AUDIO_WORKER_STACKSIZE  768
+#endif
+
+#ifndef CONFIG_CXD56_MSG_PRIO
+#  define CONFIG_CXD56_MSG_PRIO  1
+#endif
+
+#ifdef CONFIG_CXD56_AUDIO_I2S_DEVICE_1_MASTER
+#  define CXD56_I2S1_MODE    0    /* Master */
+#else
+#  define CXD56_I2S1_MODE    1    /* Slave */
+#endif
+
+#ifdef CONFIG_CXD56_AUDIO_I2S_FORMAT_1_LEFT
+#  define CXD56_I2S1_FORMAT  1    /* Left */
+#else
+#  define CXD56_I2S1_FORMAT  0    /* Normal */
+#endif
+
+#ifdef CONFIG_CXD56_AUDIO_I2S_BYPASS_MODE_1_ENABLE
+#  define CXD56_I2S1_BYPASS  0    /* Disable */
+#else
+#  define CXD56_I2S1_BYPASS  1    /* Enable */
+#endif
+
+/* I2S data rate of I2S1 */
+
+#if defined(CONFIG_CXD56_I2S0)
+#  define CXD56_I2S1_DATA_RATE   CONFIG_CXD56_AUDIO_I2S_RATE_1
+#else
+#  define CXD56_I2S1_DATA_RATE   0
+#endif
+
+#define CXD56_XTAL_24_576MHZ  0
+#define CXD56_XTAL_49_152MHZ  1
+
+#ifdef CONFIG_CXD56_AUDIO_XTAL_SEL_49_152MHZ
+#  define CXD56_AUDIO_MCLK   CXD56_XTAL_49_152MHZ
+#else
+#  define CXD56_AUDIO_MCLK   CXD56_XTAL_24_576MHZ
+#endif
+
+/* Drive strength levels */
+#define CXD56_DS_WEAKEST    1
+#define CXD56_DS_WEAKER     2
+#define CXD56_DS_STRONGER   3
+#define CXD56_DS_STRONGEST  4
+
+/* Drive strength of global pin output-A */
+#if defined(CONFIG_CXD56_AUDIO_GPO_A_WEAKEST)
+#  define CXD56_GPO_A_DS    CXD56_DS_WEAKEST
+#elif defined(CONFIG_CXD56_AUDIO_GPO_A_WEAKER)
+#  define CXD56_GPO_A_DS    CXD56_DS_WEAKER
+#elif defined(CONFIG_CXD56_AUDIO_GPO_A_STRONGER)
+#  define CXD56_GPO_A_DS    CXD56_DS_STRONGER
+#else
+#  define CXD56_GPO_A_DS    CXD56_DS_STRONGEST
+#endif
+
+/* Drive strength of D/A converted data */
+#if defined(CONFIG_CXD56_AUDIO_DA_DATA_WEAKEST)
+#  define CXD56_DA_DS    CXD56_DS_WEAKEST
+#elif defined(CONFIG_CXD56_AUDIO_DA_DATA_WEAKER)
+#  define CXD56_DA_DS    CXD56_DS_WEAKER
+#elif defined(CONFIG_CXD56_AUDIO_DA_DATA_STRONGER)
+#  define CXD56_DA_DS    CXD56_DS_STRONGER
+#else
+#  define CXD56_DA_DS    CXD56_DS_STRONGEST
+#endif
+
+/* Drive strength of digital mic clock */
+#if defined(CONFIG_CXD56_AUDIO_CLKOUT_DMIC_WEAKEST)
+#  define CXD56_DMIC_CLK_DS    CXD56_DS_WEAKEST
+#elif defined(CONFIG_CXD56_AUDIO_CLKOUT_DMIC_WEAKER)
+#  define CXD56_DMIC_CLK_DS    CXD56_DS_WEAKER
+#elif defined(CONFIG_CXD56_AUDIO_CLKOUT_DMIC_STRONGER)
+#  define CXD56_DMIC_CLK_DS    CXD56_DS_STRONGER
+#else
+#  define CXD56_DMIC_CLK_DS    CXD56_DS_STRONGEST
+#endif
+
+/* Drive strength of master clock */
+#if defined(CONFIG_CXD56_AUDIO_MCLKOUT_WEAKEST)
+#  define CXD56_MCLKOUT_DS    CXD56_DS_WEAKEST
+#elif defined(CONFIG_CXD56_AUDIO_MCLKOUT_WEAKER)
+#  define CXD56_MCLKOUT_DS    CXD56_DS_WEAKER
+#elif defined(CONFIG_CXD56_AUDIO_MCLKOUT_STRONGER)
+#  define CXD56_MCLKOUT_DS    CXD56_DS_STRONGER
+#else
+#  define CXD56_MCLKOUT_DS    CXD56_DS_STRONGEST
+#endif
+
+/* Speaker time split on drive */
+#if defined(CONFIG_CXD56_AUDIO_SP_SPLIT_LONGEST)
+#  define CXD56_SP_SPLIT_ON    4
+#elif defined(CONFIG_CXD56_AUDIO_SP_SPLIT_LONG)
+#  define CXD56_SP_SPLIT_ON    3
+#elif defined(CONFIG_CXD56_AUDIO_SP_SPLIT_SHORT)
+#  define CXD56_SP_SPLIT_ON    2
+#else
+#  define CXD56_SP_SPLIT_ON    1
+#endif
+
+/* Speaker drive mode */
+
+#if defined(CONFIG_CXD56_AUDIO_SP_DRV_LINEOUT)
+#  define CXD56_SP_DRIVER   0
+#elif defined(CONFIG_CXD56_AUDIO_SP_DRV_1DRIVERT)
+#  define CXD56_SP_DRIVER   1
+#elif defined(CONFIG_CXD56_AUDIO_SP_DRV_2DRIVERT)
+#  define CXD56_SP_DRIVER   2
+#else
+#  define CXD56_SP_DRIVER   3
+#endif
+
+/* DMA format */
+
+#define CXD56_DMA_FORMAT_LR 0
+#define CXD56_DMA_FORMAT_RL 1
+
+#if defined(CONFIG_CXD56_AUDIO_DMA_DATA_FORMAT_LR)
+#  define CXD56_DMA_FORMAT  CXD56_DMA_FORMAT_LR
+#else
+#  define CXD56_DMA_FORMAT  CXD56_DMA_FORMAT_RL
+#endif
+
+/* Audio buffer configuration */
+
+#ifndef CONFIG_CXD56_AUDIO_BUFFER_SIZE
+#  define CONFIG_CXD56_AUDIO_BUFFER_SIZE  4096
+#endif
+
+#ifndef CONFIG_CXD56_AUDIO_NUM_BUFFERS
+#  define CONFIG_CXD56_AUDIO_NUM_BUFFERS  4
+#endif
+
+/****************************************************************************
+ * Public Types
+ ****************************************************************************/
+
+enum cxd56_dmahandle_e
+{
+  CXD56_AUDIO_DMA_MIC,
+  CXD56_AUDIO_DMA_I2S0_DOWN,
+  CXD56_AUDIO_DMA_COUNT
+};
+typedef enum cxd56_dmahandle_e cxd56_dmahandle_t;
+
+enum cxd56_devstate_e
+{
+  CXD56_DEV_STATE_OFF,
+  CXD56_DEV_STATE_STOPPED,
+  CXD56_DEV_STATE_STARTING,
+  CXD56_DEV_STATE_STARTED,
+  CXD56_DEV_STATE_STOPPING,
+};
+
+struct cxd56_dev_s
+{
+  /* We are an audio lower half driver (We are also the upper "half" of
+   * the CS43L22 driver with respect to the board lower half driver).
+   *
+   * Terminology:
+   * Our "lower" half audio instances will be called dev for the publicly
+   * visible version and "priv" for the version that only this driver
+   * knows.  From the point of view of this driver, it is the board lower
+   * "half" that is referred to as "lower".
+   */
+
+  struct audio_lowerhalf_s dev;             /* CXD56 audio lower half (this device) */
+
+  /* Our specific driver data goes here */
+
+  const FAR struct cxd56_lower_s *lower;    /* Pointer to the board lower functions */
+  enum cxd56_devstate_e   state;            /* Driver state */
+  enum cxd56_dmahandle_e  dma_handle;       /* DMA handle */
+  mqd_t                   mq;               /* Message queue for receiving messages */
+  char                    mqname[16];       /* Our message queue name */
+  pthread_t               threadid;         /* ID of our thread */
+  sem_t                   pendsem;          /* Protect pendq */
+
+  struct dq_queue_s       pendingq;         /* Queue of pending buffers to be sent */
+  struct dq_queue_s       runningq;         /* Queue of buffers being played */
+
+  uint16_t                samplerate;       /* Sample rate */
+#ifndef CONFIG_AUDIO_EXCLUDE_VOLUME
+  int16_t                 volume;           /* Output volume {0..63} */
+#endif  /* CONFIG_AUDIO_EXCLUDE_VOLUME */
+  uint8_t                 channels;         /* Number of channels (1..8) */
+
+  /* enum cxd56_audio_samp_fmt_e  format; */ /* Output bits per sample (16 or 24) */
+
+  uint8_t                 bitwidth;         /* Bits per sample (16 or 24) */
+  bool                    muted;            /* True: Output is muted */
+
+  bool                    running;          /* True: Worker thread is running */
+  bool                    paused;           /* True: Playing is paused */
+#ifndef CONFIG_AUDIO_EXCLUDE_STOP
+  bool                    terminating;      /* True: Stop requested */
+#endif
+  bool                    reserved;         /* True: Device is reserved */
+  volatile int            result;           /* The result of the last transfer */
+};
+
+/****************************************************************************
+ * Public Data
+ ****************************************************************************/
+
+/****************************************************************************
+ * Public Function Prototypes
+ ****************************************************************************/
+
+#endif /* CONFIG_AUDIO */
+
+#endif /* __DRIVERS_AUDIO_CXD56_H */
diff --git a/include/nuttx/audio/cxd56.h b/include/nuttx/audio/cxd56.h
new file mode 100644
index 0000000..7a0c872
--- /dev/null
+++ b/include/nuttx/audio/cxd56.h
@@ -0,0 +1,85 @@
+/****************************************************************************
+ * include/nuttx/audio/cxd56.h
+ *
+ *   Copyright 2019 Sony Semiconductor Solutions Corporation
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ *    used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************/
+
+#ifndef __INCLUDE_NUTTX_AUDIO_CXD56_H
+#define __INCLUDE_NUTTX_AUDIO_CXD56_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <stdint.h>
+#include <stdbool.h>
+
+#include <nuttx/irq.h>
+
+#if defined(CONFIG_AUDIO_CXD56) || defined(CONFIG_CXD56_AUDIO)
+
+/****************************************************************************
+ * Public Types
+ ****************************************************************************/
+
+struct cxd56_lower_s
+{
+  int dma_handle;
+};
+
+/****************************************************************************
+ * Public Data
+ ****************************************************************************/
+
+#ifdef __cplusplus
+#define EXTERN extern "C"
+extern "C"
+{
+#else
+#define EXTERN extern
+#endif
+
+/****************************************************************************
+ * Public Function Prototypes
+ ****************************************************************************/
+
+struct audio_lowerhalf_s;
+
+FAR struct audio_lowerhalf_s *
+  cxd56_initialize(FAR const struct cxd56_lower_s *lower);
+
+#undef EXTERN
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* CONFIG_CXD56_AUDIO */
+#endif /* __INCLUDE_NUTTX_AUDIO_CXD56_H */


[incubator-nuttx] 03/06: boards: cxd56: spresense: add configuration for the NuttX audio driver driver

Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gnutt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 50431e66943d6c0342fd07fdef1fd9cb60f3164b
Author: Alin Jerpelea <al...@sony.com>
AuthorDate: Wed Apr 15 09:21:56 2020 +0200

    boards: cxd56: spresense: add configuration for the NuttX audio driver driver
    
    This configuration uses the NuttX audio driver
    
    Signed-off-by: Alin Jerpelea <al...@sony.com>
---
 boards/arm/cxd56xx/spresense/configs/audio/defconfig | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/boards/arm/cxd56xx/spresense/configs/audio/defconfig b/boards/arm/cxd56xx/spresense/configs/audio/defconfig
index 01e508d..0e79ec5 100644
--- a/boards/arm/cxd56xx/spresense/configs/audio/defconfig
+++ b/boards/arm/cxd56xx/spresense/configs/audio/defconfig
@@ -17,11 +17,12 @@ CONFIG_ARCH_CHIP="cxd56xx"
 CONFIG_ARCH_CHIP_CXD56XX=y
 CONFIG_ARCH_STACKDUMP=y
 CONFIG_ARMV7M_USEBASEPRI=y
+CONFIG_AUDIO=y
+CONFIG_AUDIO_CXD56=y
 CONFIG_BOARD_LOOPSPERMSEC=5434
 CONFIG_BOOT_RUNFROMISRAM=y
 CONFIG_BUILTIN=y
 CONFIG_CLOCK_MONOTONIC=y
-CONFIG_CXD56_AUDIO=y
 CONFIG_CXD56_BINARY=y
 CONFIG_CXD56_I2C0=y
 CONFIG_CXD56_I2C=y
@@ -32,6 +33,7 @@ CONFIG_CXD56_SPI=y
 CONFIG_CXD56_USBDEV=y
 CONFIG_DEBUG_FULLOPT=y
 CONFIG_DEBUG_SYMBOLS=y
+CONFIG_DRIVERS_AUDIO=y
 CONFIG_FAT_LCNAMES=y
 CONFIG_FAT_LFN=y
 CONFIG_FAT_MAXFNAME=255


[incubator-nuttx] 02/06: boards: cxd56: spresense: add configuration for SDK audio driver

Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gnutt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit c35fd3bb25a724290929bc755298bf14a5ed0412
Author: Alin Jerpelea <al...@sony.com>
AuthorDate: Wed Apr 15 09:21:56 2020 +0200

    boards: cxd56: spresense: add configuration for SDK audio driver
    
    This configuration uses the driver audio from SDK
    
    Signed-off-by: Alin Jerpelea <al...@sony.com>
---
 .../cxd56xx/spresense/configs/audio_sdk/defconfig  | 92 ++++++++++++++++++++++
 1 file changed, 92 insertions(+)

diff --git a/boards/arm/cxd56xx/spresense/configs/audio_sdk/defconfig b/boards/arm/cxd56xx/spresense/configs/audio_sdk/defconfig
new file mode 100644
index 0000000..01e508d
--- /dev/null
+++ b/boards/arm/cxd56xx/spresense/configs/audio_sdk/defconfig
@@ -0,0 +1,92 @@
+#
+# This file is autogenerated: PLEASE DO NOT EDIT IT.
+#
+# You can use "make menuconfig" to make any modifications to the installed .config file.
+# You can then do "make savedefconfig" to generate a new defconfig file that includes your
+# modifications.
+#
+# CONFIG_CXD56_I2C0_SCUSEQ is not set
+# CONFIG_MMCSD_HAVE_WRITEPROTECT is not set
+# CONFIG_MMCSD_SPI is not set
+# CONFIG_MTD_SMART_WEAR_LEVEL is not set
+# CONFIG_STANDARD_SERIAL is not set
+CONFIG_ARCH="arm"
+CONFIG_ARCH_BOARD="spresense"
+CONFIG_ARCH_BOARD_SPRESENSE=y
+CONFIG_ARCH_CHIP="cxd56xx"
+CONFIG_ARCH_CHIP_CXD56XX=y
+CONFIG_ARCH_STACKDUMP=y
+CONFIG_ARMV7M_USEBASEPRI=y
+CONFIG_BOARD_LOOPSPERMSEC=5434
+CONFIG_BOOT_RUNFROMISRAM=y
+CONFIG_BUILTIN=y
+CONFIG_CLOCK_MONOTONIC=y
+CONFIG_CXD56_AUDIO=y
+CONFIG_CXD56_BINARY=y
+CONFIG_CXD56_I2C0=y
+CONFIG_CXD56_I2C=y
+CONFIG_CXD56_SDIO=y
+CONFIG_CXD56_SPI4=y
+CONFIG_CXD56_SPI5=y
+CONFIG_CXD56_SPI=y
+CONFIG_CXD56_USBDEV=y
+CONFIG_DEBUG_FULLOPT=y
+CONFIG_DEBUG_SYMBOLS=y
+CONFIG_FAT_LCNAMES=y
+CONFIG_FAT_LFN=y
+CONFIG_FAT_MAXFNAME=255
+CONFIG_FS_FAT=y
+CONFIG_FS_PROCFS=y
+CONFIG_FS_PROCFS_REGISTER=y
+CONFIG_FS_SMARTFS=y
+CONFIG_HAVE_CXX=y
+CONFIG_HAVE_CXXINITIALIZE=y
+CONFIG_I2C=y
+CONFIG_LIBM=y
+CONFIG_MAX_TASKS=16
+CONFIG_MAX_WDOGPARMS=2
+CONFIG_MMCSD=y
+CONFIG_MMCSD_SDIO=y
+CONFIG_MTD_BYTE_WRITE=y
+CONFIG_MTD_PARTITION=y
+CONFIG_MTD_SMART=y
+CONFIG_MTD_SMART_ENABLE_CRC=y
+CONFIG_MTD_SMART_SECTOR_SIZE=4096
+CONFIG_NAME_MAX=765
+CONFIG_NFILE_DESCRIPTORS=8
+CONFIG_NFILE_STREAMS=8
+CONFIG_NSH_ARCHINIT=y
+CONFIG_NSH_BUILTIN_APPS=y
+CONFIG_NSH_READLINE=y
+CONFIG_PREALLOC_MQ_MSGS=4
+CONFIG_PREALLOC_TIMERS=4
+CONFIG_PREALLOC_WDOGS=16
+CONFIG_RAM_SIZE=1572864
+CONFIG_RAM_START=0x0d000000
+CONFIG_READLINE_CMD_HISTORY=y
+CONFIG_RR_INTERVAL=200
+CONFIG_RTC=y
+CONFIG_RTC_DRIVER=y
+CONFIG_SCHED_WAITPID=y
+CONFIG_SDCLONE_DISABLE=y
+CONFIG_SMARTFS_ALIGNED_ACCESS=y
+CONFIG_SMARTFS_MAXNAMLEN=30
+CONFIG_SMARTFS_MULTI_ROOT_DIRS=y
+CONFIG_SPECIFIC_DRIVERS=y
+CONFIG_SPI=y
+CONFIG_SPRESENSE_EXTENSION=y
+CONFIG_START_DAY=6
+CONFIG_START_MONTH=12
+CONFIG_START_YEAR=2011
+CONFIG_SYSTEM_CLE=y
+CONFIG_SYSTEM_NSH=y
+CONFIG_SYSTEM_NSH_CXXINITIALIZE=y
+CONFIG_SYSTEM_USBMSC=y
+CONFIG_UART1_SERIAL_CONSOLE=y
+CONFIG_USBDEV=y
+CONFIG_USBDEV_DMA=y
+CONFIG_USBDEV_DUALSPEED=y
+CONFIG_USBMSC=y
+CONFIG_USBMSC_EPBULKIN=1
+CONFIG_USBMSC_REMOVABLE=y
+CONFIG_USER_ENTRYPOINT="spresense_main"


[incubator-nuttx] 01/06: boards: cxd56: spresense: move audio configuration

Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gnutt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 502d7bb5012ff44df647ab91076457a8c635081b
Author: Alin Jerpelea <al...@sony.com>
AuthorDate: Wed Apr 15 09:17:44 2020 +0200

    boards: cxd56: spresense: move audio configuration
    
    The audio configuration is board specific and shared by both audio drivers.
    
    Signed-off-by: Alin Jerpelea <al...@sony.com>
---
 boards/arm/cxd56xx/drivers/audio/Kconfig | 422 +-----------------------------
 boards/arm/cxd56xx/spresense/Kconfig     | 436 ++++++++++++++++++++++++++++++-
 2 files changed, 430 insertions(+), 428 deletions(-)

diff --git a/boards/arm/cxd56xx/drivers/audio/Kconfig b/boards/arm/cxd56xx/drivers/audio/Kconfig
index 89f568a..64b075e 100644
--- a/boards/arm/cxd56xx/drivers/audio/Kconfig
+++ b/boards/arm/cxd56xx/drivers/audio/Kconfig
@@ -5,425 +5,7 @@
 
 comment "Audio Options"
 
-menuconfig CXD56_AUDIO
-	bool "CXD56 Audio Driver"
+config CXD56_AUDIO
+	bool "CXD56 SDK Audio Driver"
 	default n
 
-if CXD56_AUDIO
-
-config CXD56_I2S0
-	bool "I2S0"
-	default y
-	---help---
-		Enable I2S channel 0
-
-config CXD56_I2S1
-	bool "I2S1"
-	default n
-	---help---
-		Enable I2S channel 1
-
-menu "Audio baseband config settings"
-
-choice
-	prompt "Audio analog block selection"
-	default CXD56_AUDIO_ANALOG_CXD5247
-
-config CXD56_AUDIO_ANALOG_CXD5247
-	bool "CXD5247"
-
-config CXD56_AUDIO_ANALOG_NONE
-	bool "System does not use audio analog block"
-endchoice
-
-if CXD56_AUDIO_ANALOG_CXD5247
-menu "CXD5247 settings"
-choice
-	prompt "X'tal frequency of the CXD5247"
-	default CXD56_AUDIO_XTAL_SEL_49_152MHZ
-
-config CXD56_AUDIO_XTAL_SEL_24_576MHZ
-	bool "24.576MHz"
-
-config CXD56_AUDIO_XTAL_SEL_49_152MHZ
-	bool "49.152MHz"
-endchoice
-
-choice
-	prompt "MICBIAS voltage of the CXD5247"
-	default CXD56_AUDIO_MICBIAS_20V
-
-config CXD56_AUDIO_MICBIAS_20V
-	bool "2.0V"
-
-config CXD56_AUDIO_MICBIAS_28V
-	bool "2.8V"
-endchoice
-
-config CXD56_AUDIO_MIC_CHANNEL_SEL
-	hex "MIC channel select map"
-	default 0xFFFF4321
-	range 0 0xFFFFFFFF
-	---help---
-		This designates microphone input of the CXD5247 in matrix format.
-		One microphone can be assigned to multiple channels (CHs.)
-		(Example: When DMA transfer is performed in monaural mode,
-		AMIC1 is assigned to CH1 and CH2 and the same audio data is
-		transferred to the each channel)
-
-choice
-	prompt "Output drive strength of MCLKOUT selection"
-	default CXD56_AUDIO_MCLKOUT_WEAKEST
-
-config CXD56_AUDIO_MCLKOUT_WEAKEST
-	bool "2mA"
-
-config CXD56_AUDIO_MCLKOUT_WEAKER
-	bool "4mA"
-
-config CXD56_AUDIO_MCLKOUT_STRONGER
-	bool "6mA"
-
-config CXD56_AUDIO_MCLKOUT_STRONGEST
-	bool "8mA"
-endchoice
-
-choice
-	prompt "Output drive strength of CLKOUT_DMIC selection"
-	default CXD56_AUDIO_CLKOUT_DMIC_WEAKEST
-
-config CXD56_AUDIO_CLKOUT_DMIC_WEAKEST
-	bool "2mA"
-
-config CXD56_AUDIO_CLKOUT_DMIC_WEAKER
-	bool "4mA"
-
-config CXD56_AUDIO_CLKOUT_DMIC_STRONGER
-	bool "6mA"
-
-config CXD56_AUDIO_CLKOUT_DMIC_STRONGEST
-	bool "8mA"
-endchoice
-
-choice
-	prompt "Output drive strength of DA_DATA selection"
-	default CXD56_AUDIO_DA_DATA_WEAKEST
-
-config CXD56_AUDIO_DA_DATA_WEAKEST
-	bool "2mA"
-
-config CXD56_AUDIO_DA_DATA_WEAKER
-	bool "4mA"
-
-config CXD56_AUDIO_DA_DATA_STRONGER
-	bool "6mA"
-
-config CXD56_AUDIO_DA_DATA_STRONGEST
-	bool "8mA"
-endchoice
-
-choice
-	prompt "Output drive strength of GPO_A selection"
-	default CXD56_AUDIO_GPO_A_WEAKEST
-
-config CXD56_AUDIO_GPO_A_WEAKEST
-	bool "2mA"
-
-config CXD56_AUDIO_GPO_A_WEAKER
-	bool "4mA"
-
-config CXD56_AUDIO_GPO_A_STRONGER
-	bool "6mA"
-
-config CXD56_AUDIO_GPO_A_STRONGEST
-	bool "8mA"
-endchoice
-
-choice
-	prompt "Input source of Cascaded Integrator-Comb filter selection"
-	default CXD56_AUDIO_CIC_IN_SEL_CXD
-
-config CXD56_AUDIO_CIC_IN_SEL_CXD
-	bool "from CXD5247"
-
-config CXD56_AUDIO_CIC_IN_SEL_DMIC
-	bool "from DMIC"
-
-config CXD56_AUDIO_CIC_IN_SEL_NONE
-	bool "No Cascaded Integrator-Comb filter input"
-endchoice
-
-choice
-	prompt "Drive currents of PDM signals"
-	default CXD56_AUDIO_PDM_LOWEMI_2MA
-
-config CXD56_AUDIO_PDM_LOWEMI_2MA
-	bool "2mA"
-
-config CXD56_AUDIO_PDM_LOWEMI_4MA
-	bool "4mA"
-endchoice
-
-choice
-	prompt "HPADC mic bias selection"
-	default CXD56_AUDIO_HPADC_MIC_BIAS_OFF
-	---help---
-		This setting depends on a circuit board configuration.
-		Set "Microphone bias is enabled" when a microphone connected to
-		HPADC should be applied with voltage from the CXD5247.
-		Otherwise, set "Microphone bias is disabled".
-
-config CXD56_AUDIO_HPADC_MIC_BIAS_ON
-	bool "Microphone bias is enabled"
-
-config CXD56_AUDIO_HPADC_MIC_BIAS_OFF
-	bool "Microphone bias is disabled"
-endchoice
-
-choice
-	prompt "Version of the CXD5247"
-	default CXD56_CXD5247_VER_ES4
-
-config CXD56_CXD5247_VER_ES2
-	bool "ES Version 2.0"
-
-config CXD56_CXD5247_VER_ES3
-	bool "ES Version 3.0"
-
-config CXD56_CXD5247_VER_ES4
-	bool "ES Version 4.0"
-endchoice
-
-if CXD56_CXD5247_VER_ES4
-choice
-	prompt "Speaker time split on drive selection"
-	default CXD56_AUDIO_SP_SPLIT_SHORTEST
-
-config CXD56_AUDIO_SP_SPLIT_SHORTEST
-	bool "shortest"
-
-config CXD56_AUDIO_SP_SPLIT_SHORT
-	bool "short"
-
-config CXD56_AUDIO_SP_SPLIT_LONG
-	bool "long"
-
-config CXD56_AUDIO_SP_SPLIT_LONGEST
-	bool "longest"
-endchoice
-
-choice
-	prompt "Speaker drive mode selection"
-	default CXD56_AUDIO_SP_DRV_LINEOUT
-
-config CXD56_AUDIO_SP_DRV_4DRIVERT
-	bool "4Driver(SPK)"
-
-config CXD56_AUDIO_SP_DRV_2DRIVERT
-	bool "2Driver"
-
-config CXD56_AUDIO_SP_DRV_1DRIVERT
-	bool "1Driver(HP)"
-
-config CXD56_AUDIO_SP_DRV_LINEOUT
-	bool "Lineout"
-endchoice
-endif # CXD56_CXD5247_VER_ES4
-endmenu
-endif # CXD56_AUDIO_ANALOG_CXD5247
-
-menu "I2S settings"
-
-if CXD56_I2S0
-choice
-	prompt "I2S0 device mode selection"
-	default CXD56_AUDIO_I2S_DEVICE_1_SLAVE
-	---help---
-		This designates ports and clock modes that are connected
-		as interfaces for PCM signal input and output.
-
-config CXD56_AUDIO_I2S_DEVICE_1_SLAVE
-	bool "I2S0 Slave mode"
-
-config CXD56_AUDIO_I2S_DEVICE_1_MASTER
-	bool "I2S0 Master mode"
-endchoice
-
-choice
-	prompt "I2S0 format type selection"
-	default CXD56_AUDIO_I2S_FORMAT_1_I2S
-	---help---
-		This designates the format of PCM signals on I2S.
-
-config CXD56_AUDIO_I2S_FORMAT_1_I2S
-	bool "I2S format"
-
-config CXD56_AUDIO_I2S_FORMAT_1_LEFT
-	bool "Left Justified format"
-endchoice
-
-choice
-	prompt "I2S0 bypass mode selection"
-	default CXD56_AUDIO_I2S_BYPASS_MODE_1_DISABLE
-	---help---
-		This designates the bypass mode of the sampling rate converter.
-		To improve sound quality, set it to "Enable".
-		The bypass mode can be enable when audio clk_mode is Hi-Res mode,
-		and I2S device mode is master mode and rate is 192kHz(192000).
-
-config CXD56_AUDIO_I2S_BYPASS_MODE_1_ENABLE
-	bool "Enable bypass"
-
-config CXD56_AUDIO_I2S_BYPASS_MODE_1_DISABLE
-	bool "Disable bypass"
-endchoice
-
-config CXD56_AUDIO_I2S_RATE_1
-	int "I2S0 data rate"
-	default  48000
-	range 48000 192000
-	---help---
-		This designates input and output data rate of I2S.
-		The maximum rate is 192000.
-
-endif # CXD56_I2S0
-
-if CXD56_I2S1
-choice
-	prompt "I2S1 device mode selection"
-	default CXD56_AUDIO_I2S_DEVICE_2_SLAVE
-	---help---
-		This designates ports and clock modes that are connected
-		as interfaces for PCM signal input and output.
-
-config CXD56_AUDIO_I2S_DEVICE_2_SLAVE
-	bool "I2S1 Slave mode"
-
-config CXD56_AUDIO_I2S_DEVICE_2_MASTER
-	bool "I2S1 Master mode"
-endchoice
-
-choice
-	prompt "I2S1 format type selection"
-	default CXD56_AUDIO_I2S_FORMAT_2_I2S
-	---help---
-		This designates the format of PCM signals on I2S0.
-
-config CXD56_AUDIO_I2S_FORMAT_2_I2S
-	bool "I2S format"
-
-config CXD56_AUDIO_I2S_FORMAT_2_LEFT
-	bool "Left Justified format"
-endchoice
-
-choice
-	prompt "I2S1 bypass mode selection"
-	default CXD56_AUDIO_I2S_BYPASS_MODE_2_DISABLE
-	---help---
-		This designates the bypass mode of the sampling rate converter.
-		To improve sound quality, set it to "Enable".
-		The bypass mode can be enable when audio clk_mode is Hi-Res mode,
-		and I2S device mode is master mode and rate is 192kHz(192000).
-
-config CXD56_AUDIO_I2S_BYPASS_MODE_2_ENABLE
-	bool "Enable bypass"
-
-config CXD56_AUDIO_I2S_BYPASS_MODE_2_DISABLE
-	bool "Disable bypass"
-endchoice
-
-config CXD56_AUDIO_I2S_RATE_2
-	int "I2S1 data rate"
-	default  48000
-	range 48000 192000
-	---help---
-		This designates input and output data rate of I2S1.
-		The maximum rate is 192000.
-
-endif # CXD56_I2S1
-
-choice
-	prompt "Drive currents of I2S signals"
-	default CXD56_AUDIO_I2S_LOWEMI_2MA
-
-config CXD56_AUDIO_I2S_LOWEMI_2MA
-	bool "2mA"
-
-config CXD56_AUDIO_I2S_LOWEMI_4MA
-	bool "4mA"
-endchoice
-endmenu
-
-choice
-	prompt "ON/OFF of Automatic Level Control/Sound Pressure Counter selection"
-	default CXD56_AUDIO_ALC_SPC_SEL_OFF
-
-config CXD56_AUDIO_ALC_SPC_SEL_OFF
-	bool "All OFF"
-
-config CXD56_AUDIO_ALC_SPC_SEL_ALC
-	bool "Automatic Level Control ON"
-
-config CXD56_AUDIO_ALC_SPC_SEL_SPC
-	bool "Sound Pressure Counter ON"
-endchoice
-
-if CXD56_AUDIO_ALC_SPC_SEL_ALC
-menu "Automatic Level Control setting"
-config CXD56_AUDIO_ALC_KNEE
-	int "Knee levels of Automatic Level Control.[(1/10)dB]"
-	default -40
-	range -635 0
-	---help---
-		This command sets integer values 10 times larger than knee levels of
-		Automatic Level Control. (step width: 0.5 dB) When a value within the
-		range in the table below with a number other than 0 or 5 in one's
-		place is designated, it will be regarded as a integer value round up
-		to zero or five in the one's place. For example, when "-24" is
-		designated, the value will be regarded as "-20".
-
-config CXD56_AUDIO_ALC_TARGET
-	int "Target level of Automatic Level Control.[dB]"
-	default 0
-	range -63 0
-endmenu
-endif # CXD56_AUDIO_ALC_SPC_SEL_ALC
-
-if CXD56_AUDIO_ALC_SPC_SEL_SPC
-menu "Sound Pressure Conter setting"
-config CXD56_AUDIO_SPC_LIMIT
-	int "Limit levels of Sound Pressure Counter.[(1/10)dB]"
-	default 0
-	range -250 0
-	---help---
-		This command sets integer values 10 times larger than limit levels of
-		Sound Pressure Counter. (step width: 0.5 dB) When a value within the
-		range in the table below with a number other than 0 or 5 in one's
-		place is designated, it will be regarded as a integer value round up
-		to zero or five in the one's place. For example, when "-24" is
-		designated, the value will be regarded as "-20".
-endmenu
-endif # CXD56_AUDIO_ALC_SPC_SEL_SPC
-
-choice
-	prompt "LR data format during DMA transfer"
-	default CXD56_AUDIO_DMA_DATA_FORMAT_RL
-	---help---
-		This sets the data arrangement of left channel and right channel in
-		the data format for 16 bit DMA transfer.
-
-config CXD56_AUDIO_DMA_DATA_FORMAT_LR
-	bool "allocate left channel data in most significant bit"
-
-config CXD56_AUDIO_DMA_DATA_FORMAT_RL
-	bool "allocate right channel data in most significant bit"
-endchoice
-
-config CXD56_AUDIO_MIC_BOOT_WAIT
-	int "Wait time for mic booting.[msec]"
-	default 1100
-	range 0 65535
-
-endmenu
-
-endif # CXD56_AUDIO
diff --git a/boards/arm/cxd56xx/spresense/Kconfig b/boards/arm/cxd56xx/spresense/Kconfig
index 2f4486a..380bf85 100644
--- a/boards/arm/cxd56xx/spresense/Kconfig
+++ b/boards/arm/cxd56xx/spresense/Kconfig
@@ -13,6 +13,434 @@ config CXD56_SPIFLASHSIZE
 		Specify the SPI flash total available size for the application.
 		This value is generally set half of SPI flash device capacity.
 
+comment "Audio Options"
+
+if AUDIO_CXD56 || CXD56_AUDIO
+
+choice
+	prompt "Audio I2S settings"
+	default CXD56_I2S0
+
+config CXD56_I2S0
+	bool "I2S0"
+
+config CXD56_I2S1
+	bool "I2S1"
+endchoice
+
+menu "Audio baseband config settings"
+
+choice
+	prompt "Audio analog block selection"
+	default CXD56_AUDIO_ANALOG_CXD5247
+
+config CXD56_AUDIO_ANALOG_CXD5247
+	bool "CXD5247"
+
+config CXD56_AUDIO_ANALOG_NONE
+	bool "System does not use audio analog block"
+endchoice
+
+if CXD56_AUDIO_ANALOG_CXD5247
+
+menu "CXD5247 settings"
+choice
+	prompt "X'tal frequency of the CXD5247"
+	default CXD56_AUDIO_XTAL_SEL_49_152MHZ
+
+config CXD56_AUDIO_XTAL_SEL_24_576MHZ
+	bool "24.576MHz"
+
+config CXD56_AUDIO_XTAL_SEL_49_152MHZ
+	bool "49.152MHz"
+endchoice
+
+choice
+	prompt "MICBIAS voltage of the CXD5247"
+	default CXD56_AUDIO_MICBIAS_20V
+
+config CXD56_AUDIO_MICBIAS_20V
+	bool "2.0V"
+
+config CXD56_AUDIO_MICBIAS_28V
+	bool "2.8V"
+endchoice
+
+config CXD56_AUDIO_MIC_CHANNEL_SEL
+	hex "MIC channel select map"
+	default 0xFFFF4321
+	range 0 0xFFFFFFFF
+	---help---
+		This designates microphone input of the CXD5247 in matrix format.
+		One microphone can be assigned to multiple channels (CHs.)
+		(Example: When DMA transfer is performed in monaural mode,
+		AMIC1 is assigned to CH1 and CH2 and the same audio data is
+		transferred to the each channel)
+
+choice
+	prompt "Output drive strength of MCLKOUT selection"
+	default CXD56_AUDIO_MCLKOUT_WEAKEST
+
+config CXD56_AUDIO_MCLKOUT_WEAKEST
+	bool "2mA"
+
+config CXD56_AUDIO_MCLKOUT_WEAKER
+	bool "4mA"
+
+config CXD56_AUDIO_MCLKOUT_STRONGER
+	bool "6mA"
+
+config CXD56_AUDIO_MCLKOUT_STRONGEST
+	bool "8mA"
+endchoice
+
+choice
+	prompt "Output drive strength of CLKOUT_DMIC selection"
+	default CXD56_AUDIO_CLKOUT_DMIC_WEAKEST
+
+config CXD56_AUDIO_CLKOUT_DMIC_WEAKEST
+	bool "2mA"
+
+config CXD56_AUDIO_CLKOUT_DMIC_WEAKER
+	bool "4mA"
+
+config CXD56_AUDIO_CLKOUT_DMIC_STRONGER
+	bool "6mA"
+
+config CXD56_AUDIO_CLKOUT_DMIC_STRONGEST
+	bool "8mA"
+endchoice
+
+choice
+	prompt "Output drive strength of DA_DATA selection"
+	default CXD56_AUDIO_DA_DATA_WEAKEST
+
+config CXD56_AUDIO_DA_DATA_WEAKEST
+	bool "2mA"
+
+config CXD56_AUDIO_DA_DATA_WEAKER
+	bool "4mA"
+
+config CXD56_AUDIO_DA_DATA_STRONGER
+	bool "6mA"
+
+config CXD56_AUDIO_DA_DATA_STRONGEST
+	bool "8mA"
+endchoice
+
+choice
+	prompt "Output drive strength of GPO_A selection"
+	default CXD56_AUDIO_GPO_A_WEAKEST
+
+config CXD56_AUDIO_GPO_A_WEAKEST
+	bool "2mA"
+
+config CXD56_AUDIO_GPO_A_WEAKER
+	bool "4mA"
+
+config CXD56_AUDIO_GPO_A_STRONGER
+	bool "6mA"
+
+config CXD56_AUDIO_GPO_A_STRONGEST
+	bool "8mA"
+endchoice
+
+choice
+	prompt "Input source of Cascaded Integrator-Comb filter selection"
+	default CXD56_AUDIO_CIC_IN_SEL_CXD
+
+config CXD56_AUDIO_CIC_IN_SEL_CXD
+	bool "from CXD5247"
+
+config CXD56_AUDIO_CIC_IN_SEL_DMIC
+	bool "from DMIC"
+
+config CXD56_AUDIO_CIC_IN_SEL_NONE
+	bool "No Cascaded Integrator-Comb filter input"
+endchoice
+
+choice
+	prompt "Drive currents of PDM signals"
+	default CXD56_AUDIO_PDM_LOWEMI_2MA
+
+config CXD56_AUDIO_PDM_LOWEMI_2MA
+	bool "2mA"
+
+config CXD56_AUDIO_PDM_LOWEMI_4MA
+	bool "4mA"
+endchoice
+
+choice
+	prompt "HPADC mic bias selection"
+	default CXD56_AUDIO_HPADC_MIC_BIAS_OFF
+	---help---
+		This setting depends on a circuit board configuration.
+		Set "Microphone bias is enabled" when a microphone connected to
+		HPADC should be applied with voltage from the CXD5247.
+		Otherwise, set "Microphone bias is disabled".
+
+config CXD56_AUDIO_HPADC_MIC_BIAS_ON
+	bool "Microphone bias is enabled"
+
+config CXD56_AUDIO_HPADC_MIC_BIAS_OFF
+	bool "Microphone bias is disabled"
+endchoice
+
+choice
+	prompt "Version of the CXD5247"
+	default CXD56_CXD5247_VER_ES4
+
+config CXD56_CXD5247_VER_ES2
+	bool "ES Version 2.0"
+
+config CXD56_CXD5247_VER_ES3
+	bool "ES Version 3.0"
+
+config CXD56_CXD5247_VER_ES4
+	bool "ES Version 4.0"
+endchoice
+
+if CXD56_CXD5247_VER_ES4
+choice
+	prompt "Speaker time split on drive selection"
+	default CXD56_AUDIO_SP_SPLIT_SHORTEST
+
+config CXD56_AUDIO_SP_SPLIT_SHORTEST
+	bool "shortest"
+
+config CXD56_AUDIO_SP_SPLIT_SHORT
+	bool "short"
+
+config CXD56_AUDIO_SP_SPLIT_LONG
+	bool "long"
+
+config CXD56_AUDIO_SP_SPLIT_LONGEST
+	bool "longest"
+endchoice
+
+choice
+	prompt "Speaker drive mode selection"
+	default CXD56_AUDIO_SP_DRV_LINEOUT
+
+config CXD56_AUDIO_SP_DRV_4DRIVERT
+	bool "4Driver(SPK)"
+
+config CXD56_AUDIO_SP_DRV_2DRIVERT
+	bool "2Driver"
+
+config CXD56_AUDIO_SP_DRV_1DRIVERT
+	bool "1Driver(HP)"
+
+config CXD56_AUDIO_SP_DRV_LINEOUT
+	bool "Lineout"
+endchoice
+endif # CXD56_CXD5247_VER_ES4
+endmenu
+endif # CXD56_AUDIO_ANALOG_CXD5247
+
+menu "I2S settings"
+
+if CXD56_I2S0
+choice
+	prompt "I2S0 device mode selection"
+	default CXD56_AUDIO_I2S_DEVICE_1_SLAVE
+	---help---
+		This designates ports and clock modes that are connected
+		as interfaces for PCM signal input and output.
+
+config CXD56_AUDIO_I2S_DEVICE_1_SLAVE
+	bool "I2S0 Slave mode"
+
+config CXD56_AUDIO_I2S_DEVICE_1_MASTER
+	bool "I2S0 Master mode"
+endchoice
+
+choice
+	prompt "I2S0 format type selection"
+	default CXD56_AUDIO_I2S_FORMAT_1_I2S
+	---help---
+		This designates the format of PCM signals on I2S.
+
+config CXD56_AUDIO_I2S_FORMAT_1_I2S
+	bool "I2S format"
+
+config CXD56_AUDIO_I2S_FORMAT_1_LEFT
+	bool "Left Justified format"
+endchoice
+
+choice
+	prompt "I2S0 bypass mode selection"
+	default CXD56_AUDIO_I2S_BYPASS_MODE_1_DISABLE
+	---help---
+		This designates the bypass mode of the sampling rate converter.
+		To improve sound quality, set it to "Enable".
+		The bypass mode can be enable when audio clk_mode is Hi-Res mode,
+		and I2S device mode is master mode and rate is 192kHz(192000).
+
+config CXD56_AUDIO_I2S_BYPASS_MODE_1_ENABLE
+	bool "Enable bypass"
+
+config CXD56_AUDIO_I2S_BYPASS_MODE_1_DISABLE
+	bool "Disable bypass"
+endchoice
+
+config CXD56_AUDIO_I2S_RATE_1
+	int "I2S0 data rate"
+	default  48000
+	range 48000 192000
+	---help---
+		This designates input and output data rate of I2S.
+		The maximum rate is 192000.
+
+endif # CXD56_I2S0
+
+if CXD56_I2S1
+choice
+	prompt "I2S1 device mode selection"
+	default CXD56_AUDIO_I2S_DEVICE_2_SLAVE
+	---help---
+		This designates ports and clock modes that are connected
+		as interfaces for PCM signal input and output.
+
+config CXD56_AUDIO_I2S_DEVICE_2_SLAVE
+	bool "I2S1 Slave mode"
+
+config CXD56_AUDIO_I2S_DEVICE_2_MASTER
+	bool "I2S1 Master mode"
+endchoice
+
+choice
+	prompt "I2S1 format type selection"
+	default CXD56_AUDIO_I2S_FORMAT_2_I2S
+	---help---
+		This designates the format of PCM signals on I2S0.
+
+config CXD56_AUDIO_I2S_FORMAT_2_I2S
+	bool "I2S format"
+
+config CXD56_AUDIO_I2S_FORMAT_2_LEFT
+	bool "Left Justified format"
+endchoice
+
+choice
+	prompt "I2S1 bypass mode selection"
+	default CXD56_AUDIO_I2S_BYPASS_MODE_2_DISABLE
+	---help---
+		This designates the bypass mode of the sampling rate converter.
+		To improve sound quality, set it to "Enable".
+		The bypass mode can be enable when audio clk_mode is Hi-Res mode,
+		and I2S device mode is master mode and rate is 192kHz(192000).
+
+config CXD56_AUDIO_I2S_BYPASS_MODE_2_ENABLE
+	bool "Enable bypass"
+
+config CXD56_AUDIO_I2S_BYPASS_MODE_2_DISABLE
+	bool "Disable bypass"
+endchoice
+
+config CXD56_AUDIO_I2S_RATE_2
+	int "I2S1 data rate"
+	default  48000
+	range 48000 192000
+	---help---
+		This designates input and output data rate of I2S1.
+		The maximum rate is 192000.
+
+endif # CXD56_I2S1
+
+choice
+	prompt "Drive currents of I2S signals"
+	default CXD56_AUDIO_I2S_LOWEMI_2MA
+
+config CXD56_AUDIO_I2S_LOWEMI_2MA
+	bool "2mA"
+
+config CXD56_AUDIO_I2S_LOWEMI_4MA
+	bool "4mA"
+endchoice
+endmenu
+
+choice
+	prompt "ON/OFF of Automatic Level Control/Sound Pressure Counter selection"
+	default CXD56_AUDIO_ALC_SPC_SEL_OFF
+
+config CXD56_AUDIO_ALC_SPC_SEL_OFF
+	bool "All OFF"
+
+config CXD56_AUDIO_ALC_SPC_SEL_ALC
+	bool "Automatic Level Control ON"
+
+config CXD56_AUDIO_ALC_SPC_SEL_SPC
+	bool "Sound Pressure Counter ON"
+endchoice
+
+if CXD56_AUDIO_ALC_SPC_SEL_ALC
+menu "Automatic Level Control setting"
+config CXD56_AUDIO_ALC_KNEE
+	int "Knee levels of Automatic Level Control.[(1/10)dB]"
+	default -40
+	range -635 0
+	---help---
+		This command sets integer values 10 times larger than knee levels of
+		Automatic Level Control. (step width: 0.5 dB) When a value within the
+		range in the table below with a number other than 0 or 5 in one's
+		place is designated, it will be regarded as a integer value round up
+		to zero or five in the one's place. For example, when "-24" is
+		designated, the value will be regarded as "-20".
+
+config CXD56_AUDIO_ALC_TARGET
+	int "Target level of Automatic Level Control.[dB]"
+	default 0
+	range -63 0
+endmenu
+endif # CXD56_AUDIO_ALC_SPC_SEL_ALC
+
+if CXD56_AUDIO_ALC_SPC_SEL_SPC
+menu "Sound Pressure Conter setting"
+config CXD56_AUDIO_SPC_LIMIT
+	int "Limit levels of Sound Pressure Counter.[(1/10)dB]"
+	default 0
+	range -250 0
+	---help---
+		This command sets integer values 10 times larger than limit levels of
+		Sound Pressure Counter. (step width: 0.5 dB) When a value within the
+		range in the table below with a number other than 0 or 5 in one's
+		place is designated, it will be regarded as a integer value round up
+		to zero or five in the one's place. For example, when "-24" is
+		designated, the value will be regarded as "-20".
+endmenu
+endif # CXD56_AUDIO_ALC_SPC_SEL_SPC
+
+choice
+	prompt "LR data format during DMA transfer"
+	default CXD56_AUDIO_DMA_DATA_FORMAT_RL
+	---help---
+		This sets the data arrangement of left channel and right channel in
+		the data format for 16 bit DMA transfer.
+
+config CXD56_AUDIO_DMA_DATA_FORMAT_LR
+	bool "allocate left channel data in most significant bit"
+
+config CXD56_AUDIO_DMA_DATA_FORMAT_RL
+	bool "allocate right channel data in most significant bit"
+endchoice
+
+config CXD56_AUDIO_MIC_BOOT_WAIT
+	int "Wait time for mic booting.[msec]"
+	default 1100
+	range 0 65535
+
+endmenu
+endif # Spresense Audio
+
+config CXD56_IMAGEPROC
+	bool "Spresense Image Processor"
+	default n
+	select CXD56_GE2D
+	---help---
+		Enable support for accelerated format converter, rotation and so on.
+		using the CXD5602 image processing accelerator.
+
 config SPRESENSE_EXTENSION
 	bool "Extension board"
 	default n
@@ -74,14 +502,6 @@ config LCD_ON_MAIN_BOARD
 
 endchoice
 endif
-config CXD56_IMAGEPROC
-	bool "Spresense Image Processor"
-	default n
-	select CXD56_GE2D
-	---help---
-		Enable support for accelerated format converter, rotation and so on.
-		using the CXD5602 image processing accelerator.
-
 comment "LTE Options"
 
 menuconfig CXD56_LTE


[incubator-nuttx] 06/06: boards: arm: cxd56: drivers: audio: nxstyle fixes

Posted by gn...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

gnutt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 7396c2d47a2804d432cddf95ae2950a6e358f1c4
Author: Alin Jerpelea <al...@sony.com>
AuthorDate: Thu Apr 16 18:17:46 2020 +0200

    boards: arm: cxd56: drivers: audio: nxstyle fixes
    
    nxstyle fixes for cxd56 audio driver
    
    Signed-off-by: Alin Jerpelea <al...@sony.com>
---
 .../arm/cxd56xx/drivers/audio/cxd56_audio_ac_reg.c | 33 ++++++++++++++--------
 .../arm/cxd56xx/drivers/audio/cxd56_audio_ac_reg.h | 31 +++++++++++---------
 boards/arm/cxd56xx/drivers/audio/cxd56_audio_aca.c | 25 ++++++++++------
 boards/arm/cxd56xx/drivers/audio/cxd56_audio_aca.h | 20 +++++++------
 .../arm/cxd56xx/drivers/audio/cxd56_audio_analog.h | 20 +++++++------
 .../cxd56xx/drivers/audio/cxd56_audio_bca_reg.c    | 12 ++++----
 .../cxd56xx/drivers/audio/cxd56_audio_bca_reg.h    | 10 +++----
 .../arm/cxd56xx/drivers/audio/cxd56_audio_beep.c   | 20 ++++++-------
 .../arm/cxd56xx/drivers/audio/cxd56_audio_beep.h   | 14 ++++-----
 .../arm/cxd56xx/drivers/audio/cxd56_audio_config.c |  2 +-
 .../arm/cxd56xx/drivers/audio/cxd56_audio_config.h | 12 ++++----
 .../cxd56xx/drivers/audio/cxd56_audio_digital.c    |  6 ++--
 .../cxd56xx/drivers/audio/cxd56_audio_digital.h    | 14 ++++-----
 boards/arm/cxd56xx/drivers/audio/cxd56_audio_dma.c | 24 ++++++++--------
 boards/arm/cxd56xx/drivers/audio/cxd56_audio_dma.h | 16 +++++------
 .../arm/cxd56xx/drivers/audio/cxd56_audio_filter.c |  6 ++--
 .../arm/cxd56xx/drivers/audio/cxd56_audio_filter.h | 14 ++++-----
 boards/arm/cxd56xx/drivers/audio/cxd56_audio_irq.c |  8 +++---
 boards/arm/cxd56xx/drivers/audio/cxd56_audio_irq.h | 14 ++++-----
 boards/arm/cxd56xx/drivers/audio/cxd56_audio_mic.c |  8 +++---
 boards/arm/cxd56xx/drivers/audio/cxd56_audio_mic.h | 16 +++++------
 boards/arm/cxd56xx/drivers/audio/cxd56_audio_pin.c |  6 ++--
 boards/arm/cxd56xx/drivers/audio/cxd56_audio_pin.h | 14 ++++-----
 .../arm/cxd56xx/drivers/audio/cxd56_audio_power.c  |  8 +++---
 .../arm/cxd56xx/drivers/audio/cxd56_audio_power.h  | 14 ++++-----
 .../arm/cxd56xx/drivers/audio/cxd56_audio_volume.h | 17 +++++------
 26 files changed, 205 insertions(+), 179 deletions(-)

diff --git a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_ac_reg.c b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_ac_reg.c
index 1bd9bbf..0b25f22 100644
--- a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_ac_reg.c
+++ b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_ac_reg.c
@@ -626,27 +626,31 @@ static void poweron_i2s0(void)
   /* Set I2S mode of SRC1. */
 
   uint32_t is_master =
-    (CXD56_AUDIO_CFG_I2S1_MODE == CXD56_AUDIO_CFG_I2S_MODE_MASTER) ? 1 : 0;
+    (CXD56_AUDIO_CFG_I2S1_MODE ==
+     CXD56_AUDIO_CFG_I2S_MODE_MASTER) ? 1 : 0;
 
   write_ac_reg(RI_SD1MASTER, is_master);
 
   /* Set I2S format of SRC1. */
 
   uint32_t is_left =
-    (CXD56_AUDIO_CFG_I2S1_FORMAT == CXD56_AUDIO_CFG_I2S_FORMAT_LEFT) ? 1 : 0;
+    (CXD56_AUDIO_CFG_I2S1_FORMAT ==
+     CXD56_AUDIO_CFG_I2S_FORMAT_LEFT) ? 1 : 0;
 
   write_ac_reg(RI_DIF1, is_left);
   write_ac_reg(RI_LR_SWAP1, is_left);
 
   /* Set data rate of SRC1. */
 
-  uint32_t data_rate = get_data_rate(CXD56_AUDIO_CFG_I2S1_DATA_RATE);
+  uint32_t data_rate =
+    get_data_rate(CXD56_AUDIO_CFG_I2S1_DATA_RATE);
   write_ac_reg(RI_SRC1, data_rate);
 
   /* Set bypass mode of SRC1. */
 
   uint32_t is_bypass =
-    (CXD56_AUDIO_CFG_I2S1_BYPASS == CXD56_AUDIO_CFG_I2S_BYPASS_ENABLE) ? 1 : 0;
+    (CXD56_AUDIO_CFG_I2S1_BYPASS ==
+     CXD56_AUDIO_CFG_I2S_BYPASS_ENABLE) ? 1 : 0;
 
   write_ac_reg(RI_TEST_OUT_SEL0, is_bypass);
 }
@@ -662,13 +666,15 @@ static void poweron_i2s1(void)
   /* Set I2S mode of SRC2. */
 
   uint32_t is_master =
-    (CXD56_AUDIO_CFG_I2S2_MODE == CXD56_AUDIO_CFG_I2S_MODE_MASTER) ? 1 : 0;
+    (CXD56_AUDIO_CFG_I2S2_MODE ==
+     CXD56_AUDIO_CFG_I2S_MODE_MASTER) ? 1 : 0;
   write_ac_reg(RI_SD2MASTER, is_master);
 
   /* Set I2S format of SRC2. */
 
   uint32_t is_left =
-    (CXD56_AUDIO_CFG_I2S2_FORMAT == CXD56_AUDIO_CFG_I2S_FORMAT_LEFT) ? 1 : 0;
+    (CXD56_AUDIO_CFG_I2S2_FORMAT ==
+     CXD56_AUDIO_CFG_I2S_FORMAT_LEFT) ? 1 : 0;
   write_ac_reg(RI_DIF2, is_left);
   write_ac_reg(RI_LR_SWAP2, is_left);
 
@@ -680,7 +686,8 @@ static void poweron_i2s1(void)
   /* Set bypass mode of SRC2. */
 
   uint32_t is_bypass =
-    (CXD56_AUDIO_CFG_I2S2_BYPASS == CXD56_AUDIO_CFG_I2S_BYPASS_ENABLE) ? 1 : 0;
+    (CXD56_AUDIO_CFG_I2S2_BYPASS ==
+     CXD56_AUDIO_CFG_I2S_BYPASS_ENABLE) ? 1 : 0;
   write_ac_reg(RI_TEST_OUT_SEL0, is_bypass);
 }
 #endif /* #ifdef CONFIG_CXD56_I2S1 */
@@ -1177,10 +1184,11 @@ void cxd56_audio_ac_reg_set_deq_param(FAR cxd56_audio_deq_coef_t *deq)
   set_deq_coef(RI_DEQ_COEF_6B0, &deq->coef[5]);
 }
 
-CXD56_AUDIO_ECODE cxd56_audio_ac_reg_poweron_cic(uint8_t mic_in,
-                                                 uint8_t mic_mode,
-                                                 uint8_t cic_num,
-                                                 FAR cxd56_audio_mic_gain_t *gain)
+CXD56_AUDIO_ECODE cxd56_audio_ac_reg_poweron_cic(
+                                     uint8_t mic_in,
+                                     uint8_t mic_mode,
+                                     uint8_t cic_num,
+                                     FAR cxd56_audio_mic_gain_t *gain)
 {
   /* Power on CIC. */
 
@@ -1439,7 +1447,8 @@ void cxd56_audio_ac_reg_set_dsrrate(uint32_t rate)
   write_ac_reg(RI_DSR_RATE, rate);
 }
 
-void cxd56_audio_ac_reg_set_seloutch(FAR cxd56_audio_ac_reg_seloutch_t *seloutch)
+void cxd56_audio_ac_reg_set_seloutch(
+                        FAR cxd56_audio_ac_reg_seloutch_t *seloutch)
 {
   write_ac_reg(RI_SEL_OUT1_L, seloutch->ch[0]);
   write_ac_reg(RI_SEL_OUT1_R, seloutch->ch[1]);
diff --git a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_ac_reg.h b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_ac_reg.h
index def7073..436f280 100644
--- a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_ac_reg.h
+++ b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_ac_reg.h
@@ -1,4 +1,4 @@
-/***************************************************************************
+/****************************************************************************
  * boards/arm/cxd56xx/drivers/audio/cxd56_audio_ac_reg.h
  *
  *   Copyright 2018 Sony Semiconductor Solutions Corporation
@@ -36,13 +36,13 @@
 #ifndef __BOARDS_ARM_CXD56XX_DRIVERS_AUDIO_CXD56_AUDIO_AC_REG_H
 #define __BOARDS_ARM_CXD56XX_DRIVERS_AUDIO_CXD56_AUDIO_AC_REG_H
 
-/***************************************************************************
+/****************************************************************************
  * Included Files
  ****************************************************************************/
 
 #include <arch/chip/audio.h>
 
-/***************************************************************************
+/****************************************************************************
  * Pre-processor Definitions
  ****************************************************************************/
 
@@ -368,7 +368,7 @@ enum audio_codec_register_id_e
 
 typedef enum audio_codec_register_id_e AC_REG_ID;
 
-/***************************************************************************
+/****************************************************************************
  * Public Types
  ****************************************************************************/
 
@@ -379,15 +379,15 @@ struct cxd56_audio_ac_reg_seloutch_s
 
 typedef struct cxd56_audio_ac_reg_seloutch_s cxd56_audio_ac_reg_seloutch_t;
 
-/***************************************************************************
+/****************************************************************************
  * Public Data
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Inline Functions
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Public Function Prototypes
  ****************************************************************************/
 
@@ -412,10 +412,11 @@ void cxd56_audio_ac_reg_set_dncram(cxd56_audio_dnc_id_t id,
 void cxd56_audio_ac_reg_enable_deq(void);
 void cxd56_audio_ac_reg_disable_deq(void);
 void cxd56_audio_ac_reg_set_deq_param(FAR cxd56_audio_deq_coef_t *deq);
-CXD56_AUDIO_ECODE cxd56_audio_ac_reg_poweron_cic(uint8_t mic_in,
-                                                 uint8_t mic_mode,
-                                                 uint8_t cic_num,
-                                                 FAR cxd56_audio_mic_gain_t *gain);
+CXD56_AUDIO_ECODE cxd56_audio_ac_reg_poweron_cic(
+                                uint8_t mic_in,
+                                uint8_t mic_mode,
+                                uint8_t cic_num,
+                                FAR cxd56_audio_mic_gain_t *gain);
 void cxd56_audio_ac_reg_poweroff_cic(void);
 CXD56_AUDIO_ECODE cxd56_audio_ac_reg_poweron_decim(uint8_t mic_mode,
                                                    uint8_t clk_mode);
@@ -433,7 +434,8 @@ void cxd56_audio_ac_reg_set_cicgain(uint8_t cic_num,
 void cxd56_audio_ac_reg_enable_digsft(void);
 void cxd56_audio_ac_reg_disable_digsft(void);
 void cxd56_audio_ac_reg_set_dsrrate(uint32_t rate);
-void cxd56_audio_ac_reg_set_seloutch(FAR cxd56_audio_ac_reg_seloutch_t *seloutch);
+void cxd56_audio_ac_reg_set_seloutch(
+                    FAR cxd56_audio_ac_reg_seloutch_t *seloutch);
 void cxd56_audio_ac_reg_enable_dma(void);
 
 void cxd56_audio_ac_reg_poweron_i2s(uint8_t clk_mode);
@@ -442,8 +444,9 @@ void cxd56_audio_ac_reg_enable_i2s_src2(void);
 void cxd56_audio_ac_reg_enable_i2s_bcklrckout(void);
 void cxd56_audio_ac_reg_disable_i2s_bcklrckout(void);
 
-CXD56_AUDIO_ECODE cxd56_audio_ac_reg_set_selector(cxd56_audio_signal_t sig,
-                                                  cxd56_audio_sel_t sel);
+CXD56_AUDIO_ECODE cxd56_audio_ac_reg_set_selector(
+                                     cxd56_audio_signal_t sig,
+                                     cxd56_audio_sel_t sel);
 
 CXD56_AUDIO_ECODE cxd56_audio_ac_reg_enable_cstereo(bool sign_inv,
                                                     int16_t vol);
diff --git a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_aca.c b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_aca.c
index 30816ce..b430c9c 100644
--- a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_aca.c
+++ b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_aca.c
@@ -1,4 +1,4 @@
-/***************************************************************************
+/****************************************************************************
  * boards/arm/cxd56xx/drivers/audio/cxd56_audio_aca.c
  *
  *   Copyright 2018 Sony Semiconductor Solutions Corporation
@@ -493,7 +493,8 @@ static void get_sp_split_on(uint8_t cf_sp_spliton,
     }
 }
 
-static void get_sp_driver(uint8_t cfg_sp_drv, FAR as_aca_sp_drv_sel_id_t *sp_drv)
+static void get_sp_driver(uint8_t cfg_sp_drv,
+                          FAR as_aca_sp_drv_sel_id_t *sp_drv)
 {
   switch (cfg_sp_drv)
     {
@@ -574,7 +575,8 @@ void get_input_param(as_aca_pulco_in_param_t *param,
         {
           mic_id = mic_sel - 1;
           param->mic_gain[mic_id] = (gain->gain[i] >= MIC_GAIN_MAX) ?
-                                     MIC_GAIN_MAX : (gain->gain[i] / 30) * 30;
+                                     MIC_GAIN_MAX :
+                                    (gain->gain[i] / 30) * 30;
 
           pga_gain = gain->gain[i] - param->mic_gain[mic_id];
           param->pga_gain[mic_id] = (pga_gain >= PGA_GAIN_MAX) ?
@@ -628,7 +630,7 @@ void get_pwon_out_param(as_aca_pulco_out_param_t *param)
   get_sp_driver((uint8_t)cxd56_audio_config_get_spdriver(), &param->sp_drv);
 }
 
-/***************************************************************************
+/****************************************************************************
  * Public Functions
  ****************************************************************************/
 
@@ -678,13 +680,15 @@ CXD56_AUDIO_ECODE cxd56_audio_aca_poweron_micbias(void)
   return CXD56_AUDIO_ECODE_OK;
 }
 
-CXD56_AUDIO_ECODE cxd56_audio_aca_poweron_input(FAR cxd56_audio_mic_gain_t *gain)
+CXD56_AUDIO_ECODE cxd56_audio_aca_poweron_input(
+                                 FAR cxd56_audio_mic_gain_t *gain)
 {
   as_aca_pulco_in_param_t pwon_input_param;
 
   get_input_param(&pwon_input_param, gain);
 
-  if (as_aca_control(AS_ACA_POWER_ON_INPUT, (uint32_t)&pwon_input_param) != 0)
+  if (as_aca_control(AS_ACA_POWER_ON_INPUT,
+     (uint32_t)&pwon_input_param) != 0)
     {
       return CXD56_AUDIO_ECODE_ANA_PWON_INPUT;
     }
@@ -712,7 +716,8 @@ CXD56_AUDIO_ECODE cxd56_audio_aca_poweron_output(void)
 
   get_pwon_out_param(&pwon_output_param);
 
-  if (as_aca_control(AS_ACA_POWER_ON_OUTPUT, (uint32_t)&pwon_output_param) != 0)
+  if (as_aca_control(AS_ACA_POWER_ON_OUTPUT,
+     (uint32_t)&pwon_output_param) != 0)
     {
       return CXD56_AUDIO_ECODE_ANA_PWON_OUTPUT;
     }
@@ -752,7 +757,8 @@ CXD56_AUDIO_ECODE cxd56_audio_aca_enable_output(void)
 
 CXD56_AUDIO_ECODE cxd56_audio_aca_disable_output(void)
 {
-  if (as_aca_control(AS_ACA_SET_OUTPUT_DEVICE, (uint32_t)AS_OUT_DEV_OFF) != 0)
+  if (as_aca_control(AS_ACA_SET_OUTPUT_DEVICE,
+     (uint32_t)AS_OUT_DEV_OFF) != 0)
     {
       return CXD56_AUDIO_ECODE_ANA_DISABLE_OUTPUT;
     }
@@ -760,7 +766,8 @@ CXD56_AUDIO_ECODE cxd56_audio_aca_disable_output(void)
   return CXD56_AUDIO_ECODE_OK;
 }
 
-CXD56_AUDIO_ECODE cxd56_audio_aca_set_micgain(FAR cxd56_audio_mic_gain_t *gain)
+CXD56_AUDIO_ECODE cxd56_audio_aca_set_micgain(
+                             FAR cxd56_audio_mic_gain_t *gain)
 {
   as_aca_pulco_in_param_t mic_gain_param;
 
diff --git a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_aca.h b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_aca.h
index ac9e2e7..98cbc1d 100644
--- a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_aca.h
+++ b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_aca.h
@@ -1,4 +1,4 @@
-/***************************************************************************
+/****************************************************************************
  * boards/arm/cxd56xx/drivers/audio/cxd56_audio_aca.h
  *
  *   Copyright 2018 Sony Semiconductor Solutions Corporation
@@ -36,13 +36,13 @@
 #ifndef __BOARDS_ARM_CXD56XX_DRIVERS_AUDIO_CXD56_AUDIO_ACA_H
 #define __BOARDS_ARM_CXD56XX_DRIVERS_AUDIO_CXD56_AUDIO_ACA_H
 
-/***************************************************************************
+/****************************************************************************
  * Included Files
  ****************************************************************************/
 
 #include <arch/chip/audio.h>
 
-/***************************************************************************
+/****************************************************************************
  * Pre-processor Definitions
  ****************************************************************************/
 
@@ -51,33 +51,35 @@
 #define DNC2_IRAM_BASE  0x3c00
 #define DNC2_CRAM_BASE  0x4400
 
-/***************************************************************************
+/****************************************************************************
  * Public Types
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Public Data
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Inline Functions
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Public Function Prototypes
  ****************************************************************************/
 
 CXD56_AUDIO_ECODE cxd56_audio_aca_poweron(void);
 CXD56_AUDIO_ECODE cxd56_audio_aca_poweroff(void);
 CXD56_AUDIO_ECODE cxd56_audio_aca_poweron_micbias(void);
-CXD56_AUDIO_ECODE cxd56_audio_aca_poweron_input(FAR cxd56_audio_mic_gain_t *gain);
+CXD56_AUDIO_ECODE cxd56_audio_aca_poweron_input(
+                                  FAR cxd56_audio_mic_gain_t *gain);
 CXD56_AUDIO_ECODE cxd56_audio_aca_set_smaster(void);
 CXD56_AUDIO_ECODE cxd56_audio_aca_poweron_output(void);
 CXD56_AUDIO_ECODE cxd56_audio_aca_poweroff_input(void);
 CXD56_AUDIO_ECODE cxd56_audio_aca_poweroff_output(void);
 CXD56_AUDIO_ECODE cxd56_audio_aca_enable_output(void);
 CXD56_AUDIO_ECODE cxd56_audio_aca_disable_output(void);
-CXD56_AUDIO_ECODE cxd56_audio_aca_set_micgain(FAR cxd56_audio_mic_gain_t *gain);
+CXD56_AUDIO_ECODE cxd56_audio_aca_set_micgain(
+                                  FAR cxd56_audio_mic_gain_t *gain);
 CXD56_AUDIO_ECODE cxd56_audio_aca_notify_micbootdone(void);
 
 #endif /* __BOARDS_ARM_CXD56XX_DRIVERS_AUDIO_CXD56_AUDIO_ACA_H */
diff --git a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_analog.h b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_analog.h
index e5c19f2..a6ce9e1 100644
--- a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_analog.h
+++ b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_analog.h
@@ -1,4 +1,4 @@
-/***************************************************************************
+/****************************************************************************
  * boards/arm/cxd56xx/drivers/audio/cxd56_audio_analog.h
  *
  *   Copyright 2018 Sony Semiconductor Solutions Corporation
@@ -36,41 +36,43 @@
 #ifndef __BOARDS_ARM_CXD56XX_DRIVERS_AUDIO_CXD56_AUDIO_ANALOG_H
 #define __BOARDS_ARM_CXD56XX_DRIVERS_AUDIO_CXD56_AUDIO_ANALOG_H
 
-/***************************************************************************
+/****************************************************************************
  * Included Files
  ****************************************************************************/
 
 #include <arch/chip/audio.h>
 
-/***************************************************************************
+/****************************************************************************
  * Pre-processor Definitions
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Public Types
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Public Data
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Inline Functions
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Public Function Prototypes
  ****************************************************************************/
 
 CXD56_AUDIO_ECODE cxd56_audio_analog_poweron(void);
 CXD56_AUDIO_ECODE cxd56_audio_analog_poweroff(void);
-CXD56_AUDIO_ECODE cxd56_audio_analog_poweron_input(FAR cxd56_audio_mic_gain_t *gain);
+CXD56_AUDIO_ECODE cxd56_audio_analog_poweron_input(
+                                     FAR cxd56_audio_mic_gain_t *gain);
 CXD56_AUDIO_ECODE cxd56_audio_analog_poweron_output(void);
 CXD56_AUDIO_ECODE cxd56_audio_analog_poweroff_input(void);
 CXD56_AUDIO_ECODE cxd56_audio_analog_poweroff_output(void);
 CXD56_AUDIO_ECODE cxd56_audio_analog_enable_output(void);
 CXD56_AUDIO_ECODE cxd56_audio_analog_disable_output(void);
-CXD56_AUDIO_ECODE cxd56_audio_analog_set_micgain(FAR cxd56_audio_mic_gain_t *gain);
+CXD56_AUDIO_ECODE cxd56_audio_analog_set_micgain(
+                                     FAR cxd56_audio_mic_gain_t *gain);
 CXD56_AUDIO_ECODE cxd56_audio_analog_wait_input_standby(void);
 
 #endif /* __BOARDS_ARM_CXD56XX_DRIVERS_AUDIO_CXD56_AUDIO_ANALOG_H */
diff --git a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_bca_reg.c b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_bca_reg.c
index 4b98536..93945d3 100644
--- a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_bca_reg.c
+++ b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_bca_reg.c
@@ -1,4 +1,4 @@
-/***************************************************************************
+/****************************************************************************
  * boards/arm/cxd56xx/drivers/audio/cxd56_audio_bca_reg.c
  *
  *   Copyright 2018 Sony Semiconductor Solutions Corporation
@@ -33,7 +33,7 @@
  *
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Included Files
  ****************************************************************************/
 
@@ -43,7 +43,7 @@
 #include "cxd56_audio_config.h"
 #include "cxd56_audio_bca_reg.h"
 
-/***************************************************************************
+/****************************************************************************
  * Pre-processor Definitions
  ****************************************************************************/
 
@@ -70,7 +70,7 @@ enum dma_i2s_out_sel_e
 
 #define BCA_REG_MAX_BIT 32
 
-/***************************************************************************
+/****************************************************************************
  * Public Data
  ****************************************************************************/
 
@@ -244,7 +244,7 @@ const struct audio_bca_reg_s g_bca_reg[BCA_REG_MAX_ENTRY] =
   {0x2730,  0, 32, 0x00000000},  /* AHB MASTER I2S2 MASK (0x00)       */
 };
 
-/***************************************************************************
+/****************************************************************************
  * Private Functions
  ****************************************************************************/
 
@@ -420,7 +420,7 @@ void enable_i2s2_out_fmt16(void)
   write_bca_reg(BCA_I2S2_OUT_SAMPLE_NO,     0);
 }
 
-/***************************************************************************
+/****************************************************************************
  * Public Functions
  ****************************************************************************/
 
diff --git a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_bca_reg.h b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_bca_reg.h
index 03ba387..6eb26c1 100644
--- a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_bca_reg.h
+++ b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_bca_reg.h
@@ -1,4 +1,4 @@
-/***************************************************************************
+/****************************************************************************
  * boards/arm/cxd56xx/drivers/audio/cxd56_audio_bca_reg.h
  *
  *   Copyright 2018 Sony Semiconductor Solutions Corporation
@@ -36,13 +36,13 @@
 #ifndef __BOARDS_ARM_CXD56XX_DRIVERS_AUDIO_CXD56_AUDIO_BCA_REG_H
 #define __BOARDS_ARM_CXD56XX_DRIVERS_AUDIO_CXD56_AUDIO_BCA_REG_H
 
-/***************************************************************************
+/****************************************************************************
  * Included Files
  ****************************************************************************/
 
 #include <arch/chip/audio.h>
 
-/***************************************************************************
+/****************************************************************************
  * Pre-processor Definitions
  ****************************************************************************/
 
@@ -67,7 +67,7 @@
 
 #define DMA_CMD_FIFO_NOT_FULL        1
 
-/***************************************************************************
+/****************************************************************************
  * Public Types
  ****************************************************************************/
 
@@ -234,7 +234,7 @@ typedef enum
   BCA_REG_MAX_ENTRY
 } BCA_REG_ID;
 
-/***************************************************************************
+/****************************************************************************
  * Public Function Prototypes
  ****************************************************************************/
 
diff --git a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_beep.c b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_beep.c
index cba8773..bf30152 100644
--- a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_beep.c
+++ b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_beep.c
@@ -1,4 +1,4 @@
-/***************************************************************************
+/****************************************************************************
  * boards/arm/cxd56xx/drivers/audio/cxd56_audio_beep.c
  *
  *   Copyright 2018 Sony Semiconductor Solutions Corporation
@@ -33,7 +33,7 @@
  *
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Included Files
  ****************************************************************************/
 
@@ -43,7 +43,7 @@
 #include "cxd56_audio_ac_reg.h"
 #include "cxd56_audio_beep.h"
 
-/***************************************************************************
+/****************************************************************************
  * Pre-processor Definitions
  ****************************************************************************/
 
@@ -63,7 +63,7 @@
 
 #define VOL_MIN         -90
 
-/***************************************************************************
+/****************************************************************************
  * Private Data
  ****************************************************************************/
 
@@ -71,15 +71,15 @@ static bool g_beep = false;
 
 static const uint16_t g_beepfreqtable[] =
 {
-   120,  127,  134,  142,  151,  160,  169,  180,  190,  201,  214,  226,
-   240,  254,  269,  285,  302,  320,  339,  360,  381,  403,  428,  453,
-   480,  509,  539,  571,  606,  642,  681,  719,  762,  810,  857,  910,
-   965, 1021, 1079, 1143, 1215, 1289, 1362, 1444, 1536, 1627, 1714, 1829,
+  120,  127,  134,  142,  151,  160,  169,  180,  190,  201,  214,  226,
+  240,  254,  269,  285,  302,  320,  339,  360,  381,  403,  428,  453,
+  480,  509,  539,  571,  606,  642,  681,  719,  762,  810,  857,  910,
+  965,  1021, 1079, 1143, 1215, 1289, 1362, 1444, 1536, 1627, 1714, 1829,
   1939, 2043, 2182, 2313, 2400, 2560, 2704, 2866, 3048, 3200, 3429, 3623,
   3840, 4085,   94
 };
 
-/***************************************************************************
+/****************************************************************************
  * Private Functions
  ****************************************************************************/
 
@@ -107,7 +107,7 @@ uint32_t convert_freq(uint32_t freq)
   return prev;
 }
 
-/***************************************************************************
+/****************************************************************************
  * Public Functions
  ****************************************************************************/
 
diff --git a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_beep.h b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_beep.h
index 72335ad..82d0246 100644
--- a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_beep.h
+++ b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_beep.h
@@ -1,4 +1,4 @@
-/***************************************************************************
+/****************************************************************************
  * boards/arm/cxd56xx/drivers/audio/cxd56_audio_beep.h
  *
  *   Copyright 2018 Sony Semiconductor Solutions Corporation
@@ -36,29 +36,29 @@
 #ifndef __BOARDS_ARM_CXD56XX_DRIVERS_AUDIO_CXD56_AUDIO_BEEP_H
 #define __BOARDS_ARM_CXD56XX_DRIVERS_AUDIO_CXD56_AUDIO_BEEP_H
 
-/***************************************************************************
+/****************************************************************************
  * Included Files
  ****************************************************************************/
 
 #include <arch/chip/audio.h>
 
-/***************************************************************************
+/****************************************************************************
  * Pre-processor Definitions
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Public Types
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Public Data
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Inline Functions
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Public Function Prototypes
  ****************************************************************************/
 
diff --git a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_config.c b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_config.c
index 8270bee..1da7028 100644
--- a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_config.c
+++ b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_config.c
@@ -1,4 +1,4 @@
-/***************************************************************************
+/****************************************************************************
  * boards/arm/cxd56xx/drivers/audio/cxd56_audio_config.c
  *
  *   Copyright 2018 Sony Semiconductor Solutions Corporation
diff --git a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_config.h b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_config.h
index 179e886..152c485 100644
--- a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_config.h
+++ b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_config.h
@@ -1,4 +1,4 @@
-/***************************************************************************
+/****************************************************************************
  * boards/arm/cxd56xx/drivers/audio/cxd56_audio_config.h
  *
  *   Copyright 2018 Sony Semiconductor Solutions Corporation
@@ -36,14 +36,14 @@
 #ifndef __BOARDS_ARM_CXD56XX_DRIVERS_AUDIO_CXD56_AUDIO_CONFIG_H
 #define __BOARDS_ARM_CXD56XX_DRIVERS_AUDIO_CXD56_AUDIO_CONFIG_H
 
-/***************************************************************************
+/****************************************************************************
  * Included Files
  ****************************************************************************/
 
 #include <nuttx/config.h>
 #include <arch/chip/audio.h>
 
-/***************************************************************************
+/****************************************************************************
  * Pre-processor Definitions
  ****************************************************************************/
 
@@ -357,15 +357,15 @@ enum cxd56_audio_cfg_sp_spliton_e
 #  define CXD56_AUDIO_CFG_SP_DRIVER   CXD56_AUDIO_SP_DRV_4DRIVER
 #endif
 
-/***************************************************************************
+/****************************************************************************
  * Public Types
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Public Data
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Public Function Prototypes
  ****************************************************************************/
 
diff --git a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_digital.c b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_digital.c
index e96f0bd..01dc95d 100644
--- a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_digital.c
+++ b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_digital.c
@@ -1,4 +1,4 @@
-/***************************************************************************
+/****************************************************************************
  * boards/arm/cxd56xx/drivers/audio/cxd56_audio_digital.c
  *
  *   Copyright 2018 Sony Semiconductor Solutions Corporation
@@ -33,7 +33,7 @@
  *
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Included Files
  ****************************************************************************/
 
@@ -45,7 +45,7 @@
 #include "cxd56_audio_bca_reg.h"
 #include "cxd56_audio_digital.h"
 
-/***************************************************************************
+/****************************************************************************
  * Public Functions
  ****************************************************************************/
 
diff --git a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_digital.h b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_digital.h
index c14a4a8..9b2b27a 100644
--- a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_digital.h
+++ b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_digital.h
@@ -1,4 +1,4 @@
-/***************************************************************************
+/****************************************************************************
  * boards/arm/cxd56xx/drivers/audio/cxd56_audio_digital.h
  *
  *   Copyright 2018 Sony Semiconductor Solutions Corporation
@@ -36,29 +36,29 @@
 #ifndef __BOARDS_ARM_CXD56XX_DRIVERS_AUDIO_CXD56_AUDIO_DIGITAL_H
 #define __BOARDS_ARM_CXD56XX_DRIVERS_AUDIO_CXD56_AUDIO_DIGITAL_H
 
-/***************************************************************************
+/****************************************************************************
  * Included Files
  ****************************************************************************/
 
 #include <arch/chip/audio.h>
 
-/***************************************************************************
+/****************************************************************************
  * Pre-processor Definitions
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Public Types
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Public Data
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Inline Functions
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Public Function Prototypes
  ****************************************************************************/
 
diff --git a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_dma.c b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_dma.c
index b2f2f6c..228999a 100644
--- a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_dma.c
+++ b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_dma.c
@@ -1,4 +1,4 @@
-/***************************************************************************
+/****************************************************************************
  * boards/arm/cxd56xx/drivers/audio/cxd56_audio_dma.c
  *
  *   Copyright 2018 Sony Semiconductor Solutions Corporation
@@ -33,7 +33,7 @@
  *
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Included Files
  ****************************************************************************/
 
@@ -47,7 +47,7 @@
 #include "cxd56_audio_ac_reg.h"
 #include "cxd56_audio_bca_reg.h"
 
-/***************************************************************************
+/****************************************************************************
  * Pre-processor Definitions
  ****************************************************************************/
 
@@ -98,7 +98,7 @@ enum audio_irq_reg_type_e
 #define CLR_DMA_ACT(_path_)  g_dma_act_status &= ~(1 << _path_)
 #define IS_DMA_ACT(_path_)   ((g_dma_act_status & (1 << _path_)) != 0)
 
-/***************************************************************************
+/****************************************************************************
  * Private Data
  ****************************************************************************/
 
@@ -112,7 +112,7 @@ static bool s_work_arroud_dmac[DMA_HANDLE_MAX_NUM] =
   true
 };
 
-/***************************************************************************
+/****************************************************************************
  * Private Functions
  ****************************************************************************/
 
@@ -345,7 +345,7 @@ static CXD56_AUDIO_ECODE start_dma_workaround(cxd56_audio_dma_t handle)
   return ret;
 }
 
-/***************************************************************************
+/****************************************************************************
  * Public Functions
  ****************************************************************************/
 
@@ -476,7 +476,7 @@ CXD56_AUDIO_ECODE cxd56_audio_dma_set_cb(cxd56_audio_dma_t handle,
 }
 
 CXD56_AUDIO_ECODE cxd56_audio_dma_get_mstate(cxd56_audio_dma_t handle,
-                                             FAR cxd56_audio_dma_mstate_t *state)
+                                    FAR cxd56_audio_dma_mstate_t *state)
 {
   cxd56_audio_bca_reg_get_dma_mstate(handle, state);
 
@@ -659,8 +659,9 @@ void cxd56_audio_dma_int_handler(void)
 
       if (int_i2s2 & DMA_STATE_BIT_I2S_OUT_DONE)
         {
-          (*g_dma_cb[CXD56_AUDIO_DMAC_I2S1_DOWN])(CXD56_AUDIO_DMAC_I2S1_DOWN,
-                                                 CXD56_AUDIO_ECODE_DMA_CMPLT);
+          (*g_dma_cb[CXD56_AUDIO_DMAC_I2S1_DOWN])
+          (CXD56_AUDIO_DMAC_I2S1_DOWN,
+           CXD56_AUDIO_ECODE_DMA_CMPLT);
         }
 
       /* Check transfer err state. */
@@ -671,8 +672,9 @@ void cxd56_audio_dma_int_handler(void)
 
           cxd56_audio_bca_reg_clear_err_int(CXD56_AUDIO_DMAC_I2S1_DOWN);
 
-          (*g_dma_cb[CXD56_AUDIO_DMAC_I2S1_DOWN])(CXD56_AUDIO_DMAC_I2S1_DOWN,
-                                                 CXD56_AUDIO_ECODE_DMA_TRANS);
+          (*g_dma_cb[CXD56_AUDIO_DMAC_I2S1_DOWN])
+          (CXD56_AUDIO_DMAC_I2S1_DOWN,
+           CXD56_AUDIO_ECODE_DMA_TRANS);
         }
 
       /* Check bus err state. */
diff --git a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_dma.h b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_dma.h
index 091142a..258b8f1 100644
--- a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_dma.h
+++ b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_dma.h
@@ -1,4 +1,4 @@
-/***************************************************************************
+/****************************************************************************
  * boards/arm/cxd56xx/drivers/audio/cxd56_audio_dma.h
  *
  *   Copyright 2018 Sony Semiconductor Solutions Corporation
@@ -36,29 +36,29 @@
 #ifndef __BOARDS_ARM_CXD56XX_DRIVERS_AUDIO_CXD56_AUDIO_DMA_H
 #define __BOARDS_ARM_CXD56XX_DRIVERS_AUDIO_CXD56_AUDIO_DMA_H
 
-/***************************************************************************
+/****************************************************************************
  * Included Files
  ****************************************************************************/
 
 #include <arch/chip/audio.h>
 
-/***************************************************************************
+/****************************************************************************
  * Pre-processor Definitions
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Public Types
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Public Data
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Inline Functions
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Public Function Prototypes
  ****************************************************************************/
 
@@ -71,7 +71,7 @@ CXD56_AUDIO_ECODE cxd56_audio_dma_init(cxd56_audio_dma_t handle,
 CXD56_AUDIO_ECODE cxd56_audio_dma_set_cb(cxd56_audio_dma_t handle,
                                          FAR cxd56_audio_dma_cb_t cb);
 CXD56_AUDIO_ECODE cxd56_audio_dma_get_mstate(cxd56_audio_dma_t handle,
-                                             FAR cxd56_audio_dma_mstate_t *state);
+                                      FAR cxd56_audio_dma_mstate_t *state);
 CXD56_AUDIO_ECODE cxd56_audio_dma_en_dmaint(void);
 CXD56_AUDIO_ECODE cxd56_audio_dma_dis_dmaint(void);
 CXD56_AUDIO_ECODE cxd56_audio_dma_start(cxd56_audio_dma_t handle,
diff --git a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_filter.c b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_filter.c
index cb26439..44dcee3 100644
--- a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_filter.c
+++ b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_filter.c
@@ -1,4 +1,4 @@
-/***************************************************************************
+/****************************************************************************
  * boards/arm/cxd56xx/drivers/audio/cxd56_audio_filter.c
  *
  *   Copyright 2018 Sony Semiconductor Solutions Corporation
@@ -33,7 +33,7 @@
  *
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Included Files
  ****************************************************************************/
 
@@ -43,7 +43,7 @@
 #include "cxd56_audio_filter.h"
 #include "cxd56_audio_ac_reg.h"
 
-/***************************************************************************
+/****************************************************************************
  * Public Functions
  ****************************************************************************/
 
diff --git a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_filter.h b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_filter.h
index 6205427..15ddda8 100644
--- a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_filter.h
+++ b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_filter.h
@@ -1,4 +1,4 @@
-/***************************************************************************
+/****************************************************************************
  * boards/arm/cxd56xx/drivers/audio/cxd56_audio_filter.h
  *
  *   Copyright 2018 Sony Semiconductor Solutions Corporation
@@ -36,29 +36,29 @@
 #ifndef __BOARDS_ARM_CXD56XX_DRIVERS_AUDIO_CXD56_AUDIO_FILTER_H
 #define __BOARDS_ARM_CXD56XX_DRIVERS_AUDIO_CXD56_AUDIO_FILTER_H
 
-/***************************************************************************
+/****************************************************************************
  * Included Files
  ****************************************************************************/
 
 #include <arch/chip/audio.h>
 
-/***************************************************************************
+/****************************************************************************
  * Pre-processor Definitions
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Public Types
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Public Data
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Inline Functions
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Public Function Prototypes
  ****************************************************************************/
 
diff --git a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_irq.c b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_irq.c
index 10390a7..0e424f5 100644
--- a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_irq.c
+++ b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_irq.c
@@ -1,4 +1,4 @@
-/***************************************************************************
+/****************************************************************************
  * boards/arm/cxd56xx/drivers/audio/cxd56_audio_irq.c
  *
  *   Copyright 2018 Sony Semiconductor Solutions Corporation
@@ -33,7 +33,7 @@
  *
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Included Files
  ****************************************************************************/
 
@@ -43,13 +43,13 @@
 
 #include "cxd56_audio_irq.h"
 
-/***************************************************************************
+/****************************************************************************
  * Public Function Prototypes
  ****************************************************************************/
 
 extern void cxd56_audio_dma_int_handler(void);
 
-/***************************************************************************
+/****************************************************************************
  * Public Functions
  ****************************************************************************/
 
diff --git a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_irq.h b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_irq.h
index a65f9ba..d288b4a 100644
--- a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_irq.h
+++ b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_irq.h
@@ -1,4 +1,4 @@
-/***************************************************************************
+/****************************************************************************
  * boards/arm/cxd56xx/drivers/audio/cxd56_audio_irq.h
  *
  *   Copyright 2018 Sony Semiconductor Solutions Corporation
@@ -36,29 +36,29 @@
 #ifndef __BOARDS_ARM_CXD56XX_DRIVERS_AUDIO_CXD56_AUDIO_IRQ_H
 #define __BOARDS_ARM_CXD56XX_DRIVERS_AUDIO_CXD56_AUDIO_IRQ_H
 
-/***************************************************************************
+/****************************************************************************
  * Included Files
  ****************************************************************************/
 
 #include <arch/chip/audio.h>
 
-/***************************************************************************
+/****************************************************************************
  * Pre-processor Definitions
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Public Types
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Public Data
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Inline Functions
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Public Function Prototypes
  ****************************************************************************/
 
diff --git a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_mic.c b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_mic.c
index 68d4e4e..f8ac10b 100644
--- a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_mic.c
+++ b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_mic.c
@@ -1,4 +1,4 @@
-/***************************************************************************
+/****************************************************************************
  * boards/arm/cxd56xx/drivers/audio/cxd56_audio_mic.c
  *
  *   Copyright 2018 Sony Semiconductor Solutions Corporation
@@ -33,7 +33,7 @@
  *
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Included Files
  ****************************************************************************/
 
@@ -44,7 +44,7 @@
 #include "cxd56_audio_mic.h"
 #include "cxd56_audio_ac_reg.h"
 
-/***************************************************************************
+/****************************************************************************
  * Pre-processor Definitions
  ****************************************************************************/
 
@@ -54,7 +54,7 @@
 #define MIC_CH_BITNUM  4
 #define MIC_CH_BITMAP  0xf
 
-/***************************************************************************
+/****************************************************************************
  * Public Functions
  ****************************************************************************/
 
diff --git a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_mic.h b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_mic.h
index 2ae23e3..41415f8 100644
--- a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_mic.h
+++ b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_mic.h
@@ -1,4 +1,4 @@
-/***************************************************************************
+/****************************************************************************
  * boards/arm/cxd56xx/drivers/audio/cxd56_audio_mic.h
  *
  *   Copyright 2018 Sony Semiconductor Solutions Corporation
@@ -36,29 +36,29 @@
 #ifndef __BOARDS_ARM_CXD56XX_DRIVERS_AUDIO_CXD56_AUDIO_MIC_H
 #define __BOARDS_ARM_CXD56XX_DRIVERS_AUDIO_CXD56_AUDIO_MIC_H
 
-/***************************************************************************
+/****************************************************************************
  * Included Files
  ****************************************************************************/
 
 #include <arch/chip/audio.h>
 
-/***************************************************************************
+/****************************************************************************
  * Pre-processor Definitions
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Public Types
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Public Data
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Inline Functions
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Public Function Prototypes
  ****************************************************************************/
 
@@ -66,6 +66,6 @@ CXD56_AUDIO_ECODE cxd56_audio_mic_enable(FAR cxd56_audio_mic_gain_t *gain);
 CXD56_AUDIO_ECODE cxd56_audio_mic_disable(void);
 CXD56_AUDIO_ECODE cxd56_audio_mic_set_gain(FAR cxd56_audio_mic_gain_t *gain);
 CXD56_AUDIO_ECODE cxd56_audio_mic_set_seloutch(uint8_t mic_num,
-                                               cxd56_audio_samp_fmt_t format);
+                                              cxd56_audio_samp_fmt_t format);
 
 #endif /* __BOARDS_ARM_CXD56XX_DRIVERS_AUDIO_CXD56_AUDIO_MIC_H */
diff --git a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_pin.c b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_pin.c
index 2e15125..7d92d58 100644
--- a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_pin.c
+++ b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_pin.c
@@ -1,4 +1,4 @@
-/***************************************************************************
+/****************************************************************************
  * boards/arm/cxd56xx/drivers/audio/cxd56_audio_pin.c
  *
  *   Copyright 2018 Sony Semiconductor Solutions Corporation
@@ -33,7 +33,7 @@
  *
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Included Files
  ****************************************************************************/
 
@@ -41,7 +41,7 @@
 
 #include "cxd56_audio_pin.h"
 
-/***************************************************************************
+/****************************************************************************
  * Public Functions
  ****************************************************************************/
 
diff --git a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_pin.h b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_pin.h
index 163ec5c..e2cc467 100644
--- a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_pin.h
+++ b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_pin.h
@@ -1,4 +1,4 @@
-/***************************************************************************
+/****************************************************************************
  * boards/arm/cxd56xx/drivers/audio/cxd56_audio_pin.h
  *
  *   Copyright 2018 Sony Semiconductor Solutions Corporation
@@ -36,29 +36,29 @@
 #ifndef __BOARDS_ARM_CXD56XX_DRIVERS_AUDIO_CXD56_AUDIO_PIN_H
 #define __BOARDS_ARM_CXD56XX_DRIVERS_AUDIO_CXD56_AUDIO_PIN_H
 
-/***************************************************************************
+/****************************************************************************
  * Included Files
  ****************************************************************************/
 
 #include <arch/board/board.h>
 
-/***************************************************************************
+/****************************************************************************
  * Pre-processor Definitions
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Public Types
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Public Data
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Inline Functions
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Public Function Prototypes
  ****************************************************************************/
 
diff --git a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_power.c b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_power.c
index a6092a0..2989765 100644
--- a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_power.c
+++ b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_power.c
@@ -1,4 +1,4 @@
-/***************************************************************************
+/****************************************************************************
  * boards/arm/cxd56xx/drivers/audio/cxd56_audio_power.c
  *
  *   Copyright 2018 Sony Semiconductor Solutions Corporation
@@ -33,7 +33,7 @@
  *
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Included Files
  ****************************************************************************/
 
@@ -50,7 +50,7 @@
 #include "cxd56_audio_ac_reg.h"
 #include "cxd56_audio_bca_reg.h"
 
-/***************************************************************************
+/****************************************************************************
  * Private Functions
  ****************************************************************************/
 
@@ -93,7 +93,7 @@ static CXD56_AUDIO_ECODE power_on_codec(void)
   return ret;
 }
 
-/***************************************************************************
+/****************************************************************************
  * Public Functions
  ****************************************************************************/
 
diff --git a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_power.h b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_power.h
index 369e3e5..4693956 100644
--- a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_power.h
+++ b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_power.h
@@ -1,4 +1,4 @@
-/***************************************************************************
+/****************************************************************************
  * boards/arm/cxd56xx/drivers/audio/cxd56_audio_power.h
  *
  *   Copyright 2018 Sony Semiconductor Solutions Corporation
@@ -36,29 +36,29 @@
 #ifndef __BOARDS_ARM_CXD56XX_DRIVERS_AUDIO_CXD56_AUDIO_POWER_H
 #define __BOARDS_ARM_CXD56XX_DRIVERS_AUDIO_CXD56_AUDIO_POWER_H
 
-/***************************************************************************
+/****************************************************************************
  * Included Files
  ****************************************************************************/
 
 #include <arch/chip/audio.h>
 
-/***************************************************************************
+/****************************************************************************
  * Pre-processor Definitions
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Public Types
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Public Data
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Inline Functions
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Public Function Prototypes
  ****************************************************************************/
 
diff --git a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_volume.h b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_volume.h
index 21d351b..821da63 100644
--- a/boards/arm/cxd56xx/drivers/audio/cxd56_audio_volume.h
+++ b/boards/arm/cxd56xx/drivers/audio/cxd56_audio_volume.h
@@ -1,4 +1,4 @@
-/***************************************************************************
+/****************************************************************************
  * boards/arm/cxd56xx/drivers/audio/cxd56_audio_volume.h
  *
  *   Copyright 2018 Sony Semiconductor Solutions Corporation
@@ -36,33 +36,34 @@
 #ifndef __BOARDS_ARM_CXD56XX_DRIVERS_AUDIO_CXD56_AUDIO_VOLUME_H
 #define __BOARDS_ARM_CXD56XX_DRIVERS_AUDIO_CXD56_AUDIO_VOLUME_H
 
-/***************************************************************************
+/****************************************************************************
  * Included Files
  ****************************************************************************/
 
 #include <arch/chip/audio.h>
 
-/***************************************************************************
+/****************************************************************************
  * Pre-processor Definitions
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Public Types
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Public Data
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Inline Functions
  ****************************************************************************/
 
-/***************************************************************************
+/****************************************************************************
  * Public Function Prototypes
  ****************************************************************************/
 
-CXD56_AUDIO_ECODE cxd56_audio_volume_set(cxd56_audio_volid_t id, int16_t vol);
+CXD56_AUDIO_ECODE cxd56_audio_volume_set(cxd56_audio_volid_t id,
+                                         int16_t vol);
 CXD56_AUDIO_ECODE cxd56_audio_volume_mute(cxd56_audio_volid_t id);
 CXD56_AUDIO_ECODE cxd56_audio_volume_unmute(cxd56_audio_volid_t id);
 CXD56_AUDIO_ECODE cxd56_audio_volume_mute_fade(cxd56_audio_volid_t id,