WM8904 w/NxPlayer: Fix some compile errors and warnings with debug enabled
This commit is contained in:
parent
70de1267b6
commit
f4bcb730d2
6 changed files with 195 additions and 144 deletions
198
Kconfig
198
Kconfig
|
|
@ -379,31 +379,19 @@ config DEBUG_VERBOSE
|
||||||
|
|
||||||
comment "Subsystem Debug Options"
|
comment "Subsystem Debug Options"
|
||||||
|
|
||||||
config DEBUG_MM
|
config DEBUG_AUDIO
|
||||||
bool "Memory Manager Debug Output"
|
bool "Audio Device Debug Output"
|
||||||
default n
|
default n
|
||||||
---help---
|
---help---
|
||||||
Enable memory management debug SYSLOG output (disabled by default)
|
Enable low level debug SYSLOG output from the audio subsystem and
|
||||||
|
device drivers. (disabled by default). Support for this debug option
|
||||||
|
is architecture-specific and may not be available for some MCUs.
|
||||||
|
|
||||||
config DEBUG_SCHED
|
config DEBUG_BINFMT
|
||||||
bool "Scheduler Debug Output"
|
bool "Binary Loader Debug Output"
|
||||||
default n
|
default n
|
||||||
---help---
|
---help---
|
||||||
Enable OS debug SYSLOG output (disabled by default)
|
Enable binary loader debug SYSLOG output (disabled by default)
|
||||||
|
|
||||||
config DEBUG_PAGING
|
|
||||||
bool "Demand Paging Debug Output"
|
|
||||||
default n
|
|
||||||
depends on PAGING
|
|
||||||
---help---
|
|
||||||
Enable demand paging debug SYSLOG output (disabled by default)
|
|
||||||
|
|
||||||
config DEBUG_NET
|
|
||||||
bool "Network Debug Output"
|
|
||||||
default n
|
|
||||||
depends on ARCH_HAVE_NET
|
|
||||||
---help---
|
|
||||||
Enable network debug SYSLOG output (disabled by default)
|
|
||||||
|
|
||||||
config DEBUG_CRYPTO
|
config DEBUG_CRYPTO
|
||||||
bool "Crypto Debug Output"
|
bool "Crypto Debug Output"
|
||||||
|
|
@ -412,36 +400,68 @@ config DEBUG_CRYPTO
|
||||||
---help---
|
---help---
|
||||||
Enable Crypto debug SYSLOG output (disabled by default)
|
Enable Crypto debug SYSLOG output (disabled by default)
|
||||||
|
|
||||||
config DEBUG_USB
|
|
||||||
bool "USB Debug Output"
|
|
||||||
default n
|
|
||||||
depends on USBDEV || USBHOST
|
|
||||||
---help---
|
|
||||||
Enable usb debug SYSLOG output (disabled by default)
|
|
||||||
|
|
||||||
config DEBUG_FS
|
config DEBUG_FS
|
||||||
bool "File System Debug Output"
|
bool "File System Debug Output"
|
||||||
default n
|
default n
|
||||||
---help---
|
---help---
|
||||||
Enable file system debug SYSLOG output (disabled by default)
|
Enable file system debug SYSLOG output (disabled by default)
|
||||||
|
|
||||||
|
config DEBUG_GRAPHICS
|
||||||
|
bool "Graphics Debug Output"
|
||||||
|
default n
|
||||||
|
---help---
|
||||||
|
Enable NX graphics debug SYSLOG output (disabled by default)
|
||||||
|
|
||||||
config DEBUG_LIB
|
config DEBUG_LIB
|
||||||
bool "C Library Debug Output"
|
bool "C Library Debug Output"
|
||||||
default n
|
default n
|
||||||
---help---
|
---help---
|
||||||
Enable C library debug SYSLOG output (disabled by default)
|
Enable C library debug SYSLOG output (disabled by default)
|
||||||
|
|
||||||
config DEBUG_BINFMT
|
config DEBUG_MM
|
||||||
bool "Binary Loader Debug Output"
|
bool "Memory Manager Debug Output"
|
||||||
default n
|
default n
|
||||||
---help---
|
---help---
|
||||||
Enable binary loader debug SYSLOG output (disabled by default)
|
Enable memory management debug SYSLOG output (disabled by default)
|
||||||
|
|
||||||
config DEBUG_GRAPHICS
|
config DEBUG_NET
|
||||||
bool "Graphics Debug Output"
|
bool "Network Debug Output"
|
||||||
|
default n
|
||||||
|
depends on ARCH_HAVE_NET
|
||||||
|
---help---
|
||||||
|
Enable network debug SYSLOG output (disabled by default)
|
||||||
|
|
||||||
|
config DEBUG_SCHED
|
||||||
|
bool "Scheduler Debug Output"
|
||||||
default n
|
default n
|
||||||
---help---
|
---help---
|
||||||
Enable NX graphics debug SYSLOG output (disabled by default)
|
Enable OS debug SYSLOG output (disabled by default)
|
||||||
|
|
||||||
|
config DEBUG_SYSCALL
|
||||||
|
bool "SYSCALL Debug Output"
|
||||||
|
default n
|
||||||
|
depends on NUTTX_KERNEL
|
||||||
|
---help---
|
||||||
|
Enable very low level output related to system calls. This gives
|
||||||
|
you basically a poor man's version of strace.
|
||||||
|
|
||||||
|
comment "OS Function Debug Options"
|
||||||
|
|
||||||
|
config DEBUG_DMA
|
||||||
|
bool "DMA Debug Output"
|
||||||
|
default n
|
||||||
|
depends on ARCH_DMA
|
||||||
|
---help---
|
||||||
|
Enable DMA-releated debug SYSLOG output (disabled by default).
|
||||||
|
Support for this debug option is architecture-specific and may not
|
||||||
|
be available for some MCUs.
|
||||||
|
|
||||||
|
config DEBUG_HEAP
|
||||||
|
bool "Heap usage debug hooks"
|
||||||
|
default n
|
||||||
|
depends on ARCH_HAVE_HEAPCHECK
|
||||||
|
---help---
|
||||||
|
Enable hooks to check heap usage. Only supported by a few architectures.
|
||||||
|
|
||||||
config DEBUG_IRQ
|
config DEBUG_IRQ
|
||||||
bool "Interrupt Controller Debug Output"
|
bool "Interrupt Controller Debug Output"
|
||||||
|
|
@ -454,13 +474,12 @@ config DEBUG_IRQ
|
||||||
that here is a problem with that logic. On some platforms, this
|
that here is a problem with that logic. On some platforms, this
|
||||||
option may even cause crashes! Use with care!
|
option may even cause crashes! Use with care!
|
||||||
|
|
||||||
config DEBUG_SYSCALL
|
config DEBUG_PAGING
|
||||||
bool "SYSCALL Debug Output"
|
bool "Demand Paging Debug Output"
|
||||||
default n
|
default n
|
||||||
depends on NUTTX_KERNEL
|
depends on PAGING
|
||||||
---help---
|
---help---
|
||||||
Enable very low level output related to system calls. This gives
|
Enable demand paging debug SYSLOG output (disabled by default)
|
||||||
you basically a poor man's version of strace.
|
|
||||||
|
|
||||||
config DEBUG_STACK
|
config DEBUG_STACK
|
||||||
bool "Stack usage debug hooks"
|
bool "Stack usage debug hooks"
|
||||||
|
|
@ -469,13 +488,6 @@ config DEBUG_STACK
|
||||||
---help---
|
---help---
|
||||||
Enable hooks to check stack usage. Only supported by a few architectures.
|
Enable hooks to check stack usage. Only supported by a few architectures.
|
||||||
|
|
||||||
config DEBUG_HEAP
|
|
||||||
bool "Heap usage debug hooks"
|
|
||||||
default n
|
|
||||||
depends on ARCH_HAVE_HEAPCHECK
|
|
||||||
---help---
|
|
||||||
Enable hooks to check heap usage. Only supported by a few architectures.
|
|
||||||
|
|
||||||
comment "Driver Debug Options"
|
comment "Driver Debug Options"
|
||||||
|
|
||||||
config DEBUG_LCD
|
config DEBUG_LCD
|
||||||
|
|
@ -515,6 +527,23 @@ config DEBUG_ANALOG
|
||||||
this debug option is architecture-specific and may not be available
|
this debug option is architecture-specific and may not be available
|
||||||
for some MCUs.
|
for some MCUs.
|
||||||
|
|
||||||
|
config DEBUG_CAN
|
||||||
|
bool "CAN Debug Output"
|
||||||
|
default n
|
||||||
|
depends on CAN
|
||||||
|
---help---
|
||||||
|
Enable CAN driver debug SYSLOG output (disabled by default).
|
||||||
|
Support for this debug option is architecture-specific and may not
|
||||||
|
be available for some MCUs.
|
||||||
|
|
||||||
|
config DEBUG_GPIO
|
||||||
|
bool "GPIO Debug Output"
|
||||||
|
default n
|
||||||
|
---help---
|
||||||
|
Enable GPIO-releated debug SYSLOG output (disabled by default).
|
||||||
|
Support for this debug option is architecture-specific and may not
|
||||||
|
be available for some MCUs.
|
||||||
|
|
||||||
config DEBUG_I2C
|
config DEBUG_I2C
|
||||||
bool "I2C Debug Output"
|
bool "I2C Debug Output"
|
||||||
default n
|
default n
|
||||||
|
|
@ -524,15 +553,6 @@ config DEBUG_I2C
|
||||||
Support for this debug option is architecture-specific and may not
|
Support for this debug option is architecture-specific and may not
|
||||||
be available for some MCUs.
|
be available for some MCUs.
|
||||||
|
|
||||||
config DEBUG_SPI
|
|
||||||
bool "SPI Debug Output"
|
|
||||||
default n
|
|
||||||
depends on SPI
|
|
||||||
---help---
|
|
||||||
Enable I2C driver debug SYSLOG output (disabled by default).
|
|
||||||
Support for this debug option is architecture-specific and may not
|
|
||||||
be available for some MCUs.
|
|
||||||
|
|
||||||
config DEBUG_I2S
|
config DEBUG_I2S
|
||||||
bool "I2S Debug Output"
|
bool "I2S Debug Output"
|
||||||
default n
|
default n
|
||||||
|
|
@ -542,15 +562,6 @@ config DEBUG_I2S
|
||||||
Support for this debug option is architecture-specific and may not
|
Support for this debug option is architecture-specific and may not
|
||||||
be available for some MCUs.
|
be available for some MCUs.
|
||||||
|
|
||||||
config DEBUG_CAN
|
|
||||||
bool "CAN Debug Output"
|
|
||||||
default n
|
|
||||||
depends on CAN
|
|
||||||
---help---
|
|
||||||
Enable CAN driver debug SYSLOG output (disabled by default).
|
|
||||||
Support for this debug option is architecture-specific and may not
|
|
||||||
be available for some MCUs.
|
|
||||||
|
|
||||||
config DEBUG_PWM
|
config DEBUG_PWM
|
||||||
bool "PWM Debug Output"
|
bool "PWM Debug Output"
|
||||||
default n
|
default n
|
||||||
|
|
@ -560,32 +571,6 @@ config DEBUG_PWM
|
||||||
Support for this debug option is architecture-specific and may not
|
Support for this debug option is architecture-specific and may not
|
||||||
be available for some MCUs.
|
be available for some MCUs.
|
||||||
|
|
||||||
config DEBUG_SDIO
|
|
||||||
bool "SDIO Debug Output"
|
|
||||||
default n
|
|
||||||
depends on MMCSD_SDIO
|
|
||||||
---help---
|
|
||||||
Enable SDIO driver debug SYSLOG output (disabled by default).
|
|
||||||
Support for this debug option is architecture-specific and may not
|
|
||||||
be available for some MCUs.
|
|
||||||
|
|
||||||
config DEBUG_GPIO
|
|
||||||
bool "GPIO Debug Output"
|
|
||||||
default n
|
|
||||||
---help---
|
|
||||||
Enable GPIO-releated debug SYSLOG output (disabled by default).
|
|
||||||
Support for this debug option is architecture-specific and may not
|
|
||||||
be available for some MCUs.
|
|
||||||
|
|
||||||
config DEBUG_DMA
|
|
||||||
bool "DMA Debug Output"
|
|
||||||
default n
|
|
||||||
depends on ARCH_DMA
|
|
||||||
---help---
|
|
||||||
Enable DMA-releated debug SYSLOG output (disabled by default).
|
|
||||||
Support for this debug option is architecture-specific and may not
|
|
||||||
be available for some MCUs.
|
|
||||||
|
|
||||||
config DEBUG_RTC
|
config DEBUG_RTC
|
||||||
bool "RTC Debug Output"
|
bool "RTC Debug Output"
|
||||||
default n
|
default n
|
||||||
|
|
@ -595,12 +580,21 @@ config DEBUG_RTC
|
||||||
Support for this debug option is architecture-specific and may not
|
Support for this debug option is architecture-specific and may not
|
||||||
be available for some MCUs.
|
be available for some MCUs.
|
||||||
|
|
||||||
config DEBUG_WATCHDOG
|
config DEBUG_SDIO
|
||||||
bool "Watchdog Timer Debug Output"
|
bool "SDIO Debug Output"
|
||||||
default n
|
default n
|
||||||
depends on WATCHDOG
|
depends on MMCSD_SDIO
|
||||||
---help---
|
---help---
|
||||||
Enable watchdog timer debug SYSLOG output (disabled by default).
|
Enable SDIO driver debug SYSLOG output (disabled by default).
|
||||||
|
Support for this debug option is architecture-specific and may not
|
||||||
|
be available for some MCUs.
|
||||||
|
|
||||||
|
config DEBUG_SPI
|
||||||
|
bool "SPI Debug Output"
|
||||||
|
default n
|
||||||
|
depends on SPI
|
||||||
|
---help---
|
||||||
|
Enable I2C driver debug SYSLOG output (disabled by default).
|
||||||
Support for this debug option is architecture-specific and may not
|
Support for this debug option is architecture-specific and may not
|
||||||
be available for some MCUs.
|
be available for some MCUs.
|
||||||
|
|
||||||
|
|
@ -613,13 +607,21 @@ config DEBUG_TIMER
|
||||||
Support for this debug option is architecture-specific and may not
|
Support for this debug option is architecture-specific and may not
|
||||||
be available for some MCUs.
|
be available for some MCUs.
|
||||||
|
|
||||||
config DEBUG_AUDIO
|
config DEBUG_USB
|
||||||
bool "Audio Device Debug Output"
|
bool "USB Debug Output"
|
||||||
default n
|
default n
|
||||||
|
depends on USBDEV || USBHOST
|
||||||
---help---
|
---help---
|
||||||
Enable low level debug SYSLOG output from the audio subsystem and
|
Enable usb debug SYSLOG output (disabled by default)
|
||||||
device drivers. (disabled by default). Support for this debug option
|
|
||||||
is architecture-specific and may not be available for some MCUs.
|
config DEBUG_WATCHDOG
|
||||||
|
bool "Watchdog Timer Debug Output"
|
||||||
|
default n
|
||||||
|
depends on WATCHDOG
|
||||||
|
---help---
|
||||||
|
Enable watchdog timer debug SYSLOG output (disabled by default).
|
||||||
|
Support for this debug option is architecture-specific and may not
|
||||||
|
be available for some MCUs.
|
||||||
|
|
||||||
endif # DEBUG
|
endif # DEBUG
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -54,12 +54,12 @@
|
||||||
*
|
*
|
||||||
* Alternative pin selections are provided with a numeric suffix like _1, _2, etc. Drivers, however, will
|
* Alternative pin selections are provided with a numeric suffix like _1, _2, etc. Drivers, however, will
|
||||||
* use the pin selection without the numeric suffix. Additional definitions are required in the board.h
|
* use the pin selection without the numeric suffix. Additional definitions are required in the board.h
|
||||||
* file. For example, if we wanted the PCK0on PB26, then the following definition should appear in the
|
* file. For example, if we wanted the PCK0 on PB26, then the following definition should appear in the
|
||||||
* board.h header file for that board:
|
* board.h header file for that board:
|
||||||
*
|
*
|
||||||
* #define PIO_PMC_PCK0 PIO_PMC_PCK0_1
|
* #define PIO_PMC_PCK0 PIO_PMC_PCK0_1
|
||||||
*
|
*
|
||||||
* The LCD driver will then automatically configure PA16 as the DAT16 pin.
|
* The PCK logic will then automatically configure PB26 as the PCK0 pin.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* WARNING!!! WARNING!!! WARNING!!! WARNING!!! WARNING!!! WARNING!!! WARNING!!!
|
/* WARNING!!! WARNING!!! WARNING!!! WARNING!!! WARNING!!! WARNING!!! WARNING!!!
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,7 @@
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
#include <arch/board/board.h>
|
#include <arch/board/board.h>
|
||||||
|
|
||||||
#include <nuttx/arch.h>
|
#include <nuttx/arch.h>
|
||||||
#include <nuttx/kmalloc.h>
|
#include <nuttx/kmalloc.h>
|
||||||
#include <nuttx/wqueue.h>
|
#include <nuttx/wqueue.h>
|
||||||
|
|
@ -200,29 +201,51 @@
|
||||||
#define SSC_CLKOUT_CONT 1 /* Continuous */
|
#define SSC_CLKOUT_CONT 1 /* Continuous */
|
||||||
#define SSC_CLKOUT_XFER 2 /* Only output clock during transfers */
|
#define SSC_CLKOUT_XFER 2 /* Only output clock during transfers */
|
||||||
|
|
||||||
|
/* Bus configuration differ with chip */
|
||||||
|
|
||||||
|
#if defined(ATSAMA5D3)
|
||||||
|
/* System bus interfaces */
|
||||||
|
|
||||||
|
# define DMACH_FLAG_PERIPH_IF DMACH_FLAG_PERIPHAHB_AHB_IF2
|
||||||
|
# define DMACH_FLAG_MEM_IF DMACH_FLAG_MEMAHB_AHB_IF0
|
||||||
|
|
||||||
|
#elif defined(ATSAMA5D4)
|
||||||
|
/* System Bus Interfaces
|
||||||
|
*
|
||||||
|
* Both SSC0 and SSC1 are APB1; HSMCI1 is on H32MX. Both are accessible
|
||||||
|
* on MATRIX IF1.
|
||||||
|
*
|
||||||
|
* Memory is available on either port 5 (IF0 for both XDMAC0 and 1) or
|
||||||
|
* port 6 (IF1 for both XDMAC0 and 1).
|
||||||
|
*/
|
||||||
|
|
||||||
|
# define DMACH_FLAG_PERIPH_IF DMACH_FLAG_PERIPHAHB_AHB_IF1
|
||||||
|
# define DMACH_FLAG_MEM_IF DMACH_FLAG_MEMAHB_AHB_IF0
|
||||||
|
#endif
|
||||||
|
|
||||||
/* DMA configuration */
|
/* DMA configuration */
|
||||||
|
|
||||||
#define DMA8_FLAGS \
|
#define DMA8_FLAGS \
|
||||||
(DMACH_FLAG_PERIPHAHB_AHB_IF2 | DMACH_FLAG_PERIPHH2SEL | \
|
(DMACH_FLAG_PERIPH_IF | DMACH_FLAG_PERIPHH2SEL | \
|
||||||
DMACH_FLAG_PERIPHISPERIPH | DMACH_FLAG_PERIPHWIDTH_8BITS | \
|
DMACH_FLAG_PERIPHISPERIPH | DMACH_FLAG_PERIPHWIDTH_8BITS | \
|
||||||
DMACH_FLAG_PERIPHCHUNKSIZE_1 | DMACH_FLAG_MEMPID_MAX | \
|
DMACH_FLAG_PERIPHCHUNKSIZE_1 | DMACH_FLAG_MEMPID_MAX | \
|
||||||
DMACH_FLAG_MEMAHB_AHB_IF0 | DMACH_FLAG_MEMWIDTH_16BITS | \
|
DMACH_FLAG_MEM_IF | DMACH_FLAG_MEMWIDTH_16BITS | \
|
||||||
DMACH_FLAG_MEMINCREMENT | DMACH_FLAG_MEMCHUNKSIZE_4| \
|
DMACH_FLAG_MEMINCREMENT | DMACH_FLAG_MEMCHUNKSIZE_4| \
|
||||||
DMACH_FLAG_MEMBURST_4)
|
DMACH_FLAG_MEMBURST_4)
|
||||||
|
|
||||||
#define DMA16_FLAGS \
|
#define DMA16_FLAGS \
|
||||||
(DMACH_FLAG_PERIPHAHB_AHB_IF2 | DMACH_FLAG_PERIPHH2SEL | \
|
(DMACH_FLAG_PERIPH_IF | DMACH_FLAG_PERIPHH2SEL | \
|
||||||
DMACH_FLAG_PERIPHISPERIPH | DMACH_FLAG_PERIPHWIDTH_16BITS | \
|
DMACH_FLAG_PERIPHISPERIPH | DMACH_FLAG_PERIPHWIDTH_16BITS | \
|
||||||
DMACH_FLAG_PERIPHCHUNKSIZE_1 | DMACH_FLAG_MEMPID_MAX | \
|
DMACH_FLAG_PERIPHCHUNKSIZE_1 | DMACH_FLAG_MEMPID_MAX | \
|
||||||
DMACH_FLAG_MEMAHB_AHB_IF0 | DMACH_FLAG_MEMWIDTH_16BITS | \
|
DMACH_FLAG_MEM_IF | DMACH_FLAG_MEMWIDTH_16BITS | \
|
||||||
DMACH_FLAG_MEMINCREMENT | DMACH_FLAG_MEMCHUNKSIZE_4 | \
|
DMACH_FLAG_MEMINCREMENT | DMACH_FLAG_MEMCHUNKSIZE_4 | \
|
||||||
DMACH_FLAG_MEMBURST_4)
|
DMACH_FLAG_MEMBURST_4)
|
||||||
|
|
||||||
#define DMA32_FLAGS \
|
#define DMA32_FLAGS \
|
||||||
(DMACH_FLAG_PERIPHAHB_AHB_IF2 | DMACH_FLAG_PERIPHH2SEL | \
|
(DMACH_FLAG_PERIPH_IF | DMACH_FLAG_PERIPHH2SEL | \
|
||||||
DMACH_FLAG_PERIPHISPERIPH | DMACH_FLAG_PERIPHWIDTH_32BITS | \
|
DMACH_FLAG_PERIPHISPERIPH | DMACH_FLAG_PERIPHWIDTH_32BITS | \
|
||||||
DMACH_FLAG_PERIPHCHUNKSIZE_1 | DMACH_FLAG_MEMPID_MAX | \
|
DMACH_FLAG_PERIPHCHUNKSIZE_1 | DMACH_FLAG_MEMPID_MAX | \
|
||||||
DMACH_FLAG_MEMAHB_AHB_IF0 | DMACH_FLAG_MEMWIDTH_32BITS | \
|
DMACH_FLAG_MEM_IF | DMACH_FLAG_MEMWIDTH_32BITS | \
|
||||||
DMACH_FLAG_MEMINCREMENT | DMACH_FLAG_MEMCHUNKSIZE_4 | \
|
DMACH_FLAG_MEMINCREMENT | DMACH_FLAG_MEMCHUNKSIZE_4 | \
|
||||||
DMACH_FLAG_MEMBURST_4)
|
DMACH_FLAG_MEMBURST_4)
|
||||||
|
|
||||||
|
|
@ -2610,6 +2633,7 @@ static void ssc_clocking(struct sam_ssc_s *priv)
|
||||||
/* Determine the maximum SSC peripheral clock frequency */
|
/* Determine the maximum SSC peripheral clock frequency */
|
||||||
|
|
||||||
mck = BOARD_MCK_FREQUENCY;
|
mck = BOARD_MCK_FREQUENCY;
|
||||||
|
#ifdef SAMA5_HAVE_PMC_PCR_DIV
|
||||||
DEBUGASSERT((mck >> 3) <= SAM_SSC_MAXPERCLK);
|
DEBUGASSERT((mck >> 3) <= SAM_SSC_MAXPERCLK);
|
||||||
|
|
||||||
if (mck <= SAM_SSC_MAXPERCLK)
|
if (mck <= SAM_SSC_MAXPERCLK)
|
||||||
|
|
@ -2633,6 +2657,13 @@ static void ssc_clocking(struct sam_ssc_s *priv)
|
||||||
regval = PMC_PCR_DIV8;
|
regval = PMC_PCR_DIV8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
/* No PCR_DIV field */
|
||||||
|
|
||||||
|
priv->frequency = mck;
|
||||||
|
regval = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Set the maximum SSC peripheral clock frequency */
|
/* Set the maximum SSC peripheral clock frequency */
|
||||||
|
|
||||||
regval |= PMC_PCR_PID(priv->pid) | PMC_PCR_CMD | PMC_PCR_EN;
|
regval |= PMC_PCR_PID(priv->pid) | PMC_PCR_CMD | PMC_PCR_EN;
|
||||||
|
|
|
||||||
|
|
@ -2761,12 +2761,12 @@ Audio Support
|
||||||
Audio
|
Audio
|
||||||
CONFIG_AUDIO=y : Audio support needed
|
CONFIG_AUDIO=y : Audio support needed
|
||||||
CONFIG_AUDIO_FORMAT_PCM=y : Only PCM files are supported
|
CONFIG_AUDIO_FORMAT_PCM=y : Only PCM files are supported
|
||||||
|
CONFIG_AUDIO_NUM_BUFFERS=8 : Number of audio buffers
|
||||||
|
CONFIG_AUDIO_BUFFER_NUMBYTES=8192 : Audio buffer size
|
||||||
|
|
||||||
Drivers -> Audio
|
Drivers -> Audio
|
||||||
CONFIG_I2S=y : General I2S support
|
CONFIG_I2S=y : General I2S support
|
||||||
CONFIG_AUDIO_DEVICES=y : Audio device support
|
CONFIG_AUDIO_DEVICES=y : Audio device support
|
||||||
CONFIG_AUDIO_NUM_BUFFERS=8 : Number of audio buffers
|
|
||||||
CONFIG_AUDIO_BUFFER_NUMBYTES=8192 : Audio buffer size
|
|
||||||
CONFIG_AUDIO_WM8904=y : Build WM8904 driver character driver
|
CONFIG_AUDIO_WM8904=y : Build WM8904 driver character driver
|
||||||
|
|
||||||
Board Selection
|
Board Selection
|
||||||
|
|
@ -2785,6 +2785,33 @@ Audio Support
|
||||||
file at SAMA5D4-EK for information about how you might implement this test
|
file at SAMA5D4-EK for information about how you might implement this test
|
||||||
for the SAMA5D4-EK.
|
for the SAMA5D4-EK.
|
||||||
|
|
||||||
|
The NxPlayer
|
||||||
|
------------
|
||||||
|
|
||||||
|
The NxPlayer is a audio library and command line application for playing
|
||||||
|
audio file. The NxPlayer can be found at apps/system/nxplayer. If you
|
||||||
|
would like to add the NxPlayer, here are some recommended configuration
|
||||||
|
settings:
|
||||||
|
|
||||||
|
System Libraries and NSH Add-Ons -> NxPlayer media player / command line ->
|
||||||
|
CONFIG_NXPLAYER_PLAYTHREAD_STACKSIZE=1500 : Size of the audio player stack
|
||||||
|
CONFIG_SYSTEM_NXPLAYER=y : Build the NxPlayer library
|
||||||
|
CONFIG_NXPLAYER_COMMAND_LINE=y : Build command line application
|
||||||
|
CONFIG_NXPLAYER_INCLUDE_HELP=y : Includes a help command
|
||||||
|
CONFIG_NXPLAYER_INCLUDE_DEVICE_SEARCH=n : (Since there is only one audio device)
|
||||||
|
CONFIG_NXPLAYER_INCLUDE_PREFERRED_DEVICE=y : Only one audio device is supported
|
||||||
|
CONFIG_NXPLAYER_FMT_FROM_EXT=n : (Since only PCM is supported)
|
||||||
|
NXPLAYER_FMT_FROM_HEADER=n : (Since only PCM is supported)
|
||||||
|
CONFIG_NXPLAYER_INCLUDE_MEDIADIR=y : Specify a media directory
|
||||||
|
CONFIG_NXPLAYER_DEFAULT_MEDIADIR="/mnt/sdcard" : See below
|
||||||
|
CONFIG_NXPLAYER_RECURSIVE_MEDIA_SEARCH=y : Search all sub-directories
|
||||||
|
CONFIG_NXPLAYER_INCLUDE_SYSTEM_RESET=y : Add support for reset command
|
||||||
|
|
||||||
|
You must include the full path to the location where NxPlayer can find the
|
||||||
|
media files. That path is given by CONFIG_NXPLAYER_DEFAULT_MEDIADIR.
|
||||||
|
Here I use the example "/mnt/scard". That is a location where you could,
|
||||||
|
for example, mount an MMC/SD card driver.
|
||||||
|
|
||||||
TM7000 LCD/Touchscreen
|
TM7000 LCD/Touchscreen
|
||||||
======================
|
======================
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -228,11 +228,25 @@
|
||||||
#define BOARD_EBICS3_NAND_DATAADDR 0x60000000
|
#define BOARD_EBICS3_NAND_DATAADDR 0x60000000
|
||||||
|
|
||||||
/* Pin disambiguation ***************************************************************/
|
/* Pin disambiguation ***************************************************************/
|
||||||
|
/* Alternative pin selections are provided with a numeric suffix like _1, _2, etc.
|
||||||
|
* Drivers, however, will use the pin selection without the numeric suffix.
|
||||||
|
* Additional definitions are required in this board.h file. For example, if we
|
||||||
|
* wanted the PCK0on PB26, then the following definition should appear in the
|
||||||
|
* board.h header file for that board:
|
||||||
|
*
|
||||||
|
* #define PIO_PMC_PCK0 PIO_PMC_PCK0_1
|
||||||
|
*
|
||||||
|
* The PCK logic will then automatically configure PB26 as the PCK0 pin.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* SSC0 TD is provided on PB28 */
|
||||||
|
|
||||||
|
#define PIO_SSC0_TD PIO_SSC0_TD_2
|
||||||
|
|
||||||
/* PCK0 is provided to the WM8904 audio CODEC via PB26 */
|
/* PCK0 is provided to the WM8904 audio CODEC via PB26 */
|
||||||
|
|
||||||
#ifdef CONFIG_AUDIO_WM8904
|
#ifdef CONFIG_AUDIO_WM8904
|
||||||
# define PIO_PMC_PCK0 PIO_PMC_PCK0_1
|
# define PIO_PMC_PCK0 PIO_PMC_PCK0_1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
|
|
|
||||||
|
|
@ -153,8 +153,7 @@ static int wm8904_configure(FAR struct audio_lowerhalf_s *dev,
|
||||||
static int wm8904_configure(FAR struct audio_lowerhalf_s *dev,
|
static int wm8904_configure(FAR struct audio_lowerhalf_s *dev,
|
||||||
FAR const struct audio_caps_s *caps);
|
FAR const struct audio_caps_s *caps);
|
||||||
#endif
|
#endif
|
||||||
static int wm8904_softreset(FAR struct wm8904_dev_s *priv);
|
static int wm8904_reset(FAR struct wm8904_dev_s *priv);
|
||||||
static int wm8904_hardreset(FAR struct wm8904_dev_s *priv);
|
|
||||||
static int wm8904_shutdown(FAR struct audio_lowerhalf_s *dev);
|
static int wm8904_shutdown(FAR struct audio_lowerhalf_s *dev);
|
||||||
static void wm8904_senddone(FAR struct i2s_dev_s *i2s,
|
static void wm8904_senddone(FAR struct i2s_dev_s *i2s,
|
||||||
FAR struct ap_buffer_s *apb, FAR void *arg, int result);
|
FAR struct ap_buffer_s *apb, FAR void *arg, int result);
|
||||||
|
|
@ -315,7 +314,7 @@ static uint16_t wm8904_readreg(FAR struct wm8904_dev_s *priv, uint8_t regaddr)
|
||||||
* return the value read.
|
* return the value read.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
regval = ((uint16_t)data[0] << 8) | (uint16_t)data[1]
|
regval = ((uint16_t)data[0] << 8) | (uint16_t)data[1];
|
||||||
audvdbg("READ: %02x -> %04x\n", regaddr, regval);
|
audvdbg("READ: %02x -> %04x\n", regaddr, regval);
|
||||||
return regval;
|
return regval;
|
||||||
}
|
}
|
||||||
|
|
@ -859,41 +858,23 @@ static int wm8904_configure(FAR struct audio_lowerhalf_s *dev,
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: wm8904_softreset
|
* Name: wm8904_reset
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Performs a soft reset on the WM8904 chip by setting the RESET bit of
|
* Performs a soft reset on the WM8904 chip by writing to the SWRST
|
||||||
* the MODE register.
|
* register.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static int wm8904_softreset(FAR struct wm8904_dev_s *priv)
|
static int wm8904_reset(FAR struct wm8904_dev_s *priv)
|
||||||
{
|
{
|
||||||
/* First disable interrupts */
|
/* First disable interrupts */
|
||||||
|
|
||||||
WM8904_DISABLE(priv->lower);
|
WM8904_DISABLE(priv->lower);
|
||||||
|
|
||||||
/* Now issue a reset command */
|
/* Now issue a reset command */
|
||||||
#warning Missing logic
|
|
||||||
|
|
||||||
/* Select the lowest power consumption mode of operation */
|
wm8904_writereg(priv, WM8904_SWRST, 0);
|
||||||
/* REVISIT */
|
|
||||||
|
|
||||||
return OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Name: wm8904_hardreset
|
|
||||||
*
|
|
||||||
* Description:
|
|
||||||
* Performs a hardware reset on the WM8904 chip by toggling the RST line,
|
|
||||||
* disabling interrupts, and setting the default operating frequency.
|
|
||||||
*
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
static int wm8904_hardreset(FAR struct wm8904_dev_s *priv)
|
|
||||||
{
|
|
||||||
WM8904_DISABLE(priv->lower);
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -909,7 +890,7 @@ static int wm8904_shutdown(FAR struct audio_lowerhalf_s *dev)
|
||||||
{
|
{
|
||||||
FAR struct wm8904_dev_s *priv = (FAR struct wm8904_dev_s *)dev;
|
FAR struct wm8904_dev_s *priv = (FAR struct wm8904_dev_s *)dev;
|
||||||
|
|
||||||
#warning Missing logic
|
wm8904_reset(priv);
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -950,7 +931,7 @@ static void wm8904_senddone(FAR struct i2s_dev_s *i2s,
|
||||||
|
|
||||||
/* And decrement the number of buffers in-flight */
|
/* And decrement the number of buffers in-flight */
|
||||||
|
|
||||||
DEBUGASSERT(inflight > 0);
|
DEBUGASSERT(priv->inflight > 0);
|
||||||
priv->inflight--;
|
priv->inflight--;
|
||||||
|
|
||||||
/* Save the result of the transfer */
|
/* Save the result of the transfer */
|
||||||
|
|
@ -963,10 +944,6 @@ static void wm8904_senddone(FAR struct i2s_dev_s *i2s,
|
||||||
* buffers in the done queue that need to be cleaned up.
|
* buffers in the done queue that need to be cleaned up.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
DEBUGASSERT(lower && priv);
|
|
||||||
|
|
||||||
/* Create an (empty) message and send it to the worker thread */
|
|
||||||
|
|
||||||
msg.msgId = AUDIO_MSG_COMPLETE;
|
msg.msgId = AUDIO_MSG_COMPLETE;
|
||||||
ret = mq_send(priv->mq, &msg, sizeof(msg), CONFIG_WM8904_MSG_PRIO);
|
ret = mq_send(priv->mq, &msg, sizeof(msg), CONFIG_WM8904_MSG_PRIO);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
|
|
@ -1207,7 +1184,7 @@ static void *wm8904_workerthread(pthread_addr_t pvarg)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
auddbg("ERROR: Ignoring message ID %d\n", msg.msgID);
|
auddbg("ERROR: Ignoring message ID %d\n", msg.msgId);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1275,7 +1252,7 @@ static int wm8904_start(FAR struct audio_lowerhalf_s *dev)
|
||||||
|
|
||||||
/* Do a soft reset, just in case */
|
/* Do a soft reset, just in case */
|
||||||
|
|
||||||
wm8904_softreset(priv);
|
wm8904_reset(priv);
|
||||||
|
|
||||||
/* Exit reduced power modes of operation */
|
/* Exit reduced power modes of operation */
|
||||||
/* REVISIT */
|
/* REVISIT */
|
||||||
|
|
@ -1508,7 +1485,7 @@ static int wm8904_ioctl(FAR struct audio_lowerhalf_s *dev, int cmd,
|
||||||
*/
|
*/
|
||||||
|
|
||||||
case AUDIOIOC_HWRESET:
|
case AUDIOIOC_HWRESET:
|
||||||
wm8904_hardreset((FAR struct wm8904_dev_s *)dev);
|
wm8904_reset((FAR struct wm8904_dev_s *)dev);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* Report our preferred buffer size and quantity */
|
/* Report our preferred buffer size and quantity */
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue