blob: 3bd24d008e13d471eb12f12bacc871b777745af6 [file] [log] [blame]
#
# Copyright (C) 2015 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=audio
PKG_VERSION:=2015
PKG_RELEASE:=1
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
SVC_SOURCE_DIR:=$(MRVLDIR)/services/$(PKG_NAME)
PKG_SOURCE_DIR:=$(SVC_SOURCE_DIR) $(STAGING_DIR)/usr/lib
PKG_BUILD_PARALLEL:=0
include $(INCLUDE_DIR)/package.mk
define Package/asr_audio
SECTION:=libs
CATEGORY:=Sound
SUBMENU:= Marvell Audio solution
TITLE:=Audio-Libs
DEPENDS+= +lte-telephony
endef
define Package/asr_audio/description
Marvell Audio libraries .so .a, tinyalsa
and debug applications (apather_s, apather_c)
endef
define Package/asr_audio/config
##menu "Audio Configuration"
choice
prompt "Audio kernel service"
default KERNEL_ENABLE_AUDIO
help
There are 2 choices:
- ENABLE
- DISABLE
config KERNEL_ENABLE_AUDIO
bool "ENABLE"
config KERNEL_DISABLE_AUDIO
bool "DISABLE"
endchoice
choice
prompt "LINUX ALSA SSP Controller"
default KERNEL_LINUX_ALSA_SSP_CONTROLLER_DISABLE
help
There are 2 choices:
- ENABLE
- DISABLE
config KERNEL_LINUX_ALSA_SSP_CONTROLLER_ENABLE
bool "ENABLE"
config KERNEL_LINUX_ALSA_SSP_CONTROLLER_DISABLE
bool "DISABLE"
endchoice
choice
prompt "Select Audio Codec Chip"
default KERNEL_CODEC_NONE
help
There are 7 choices:
- ASR PM812
- ASR PM805
- ASR NAU8810
- MBTK ES8311
- MBTK TLV320AIC3X
- ASR ALC5616
- No Codec
config KERNEL_CODEC_PM812
bool "ASR PM812"
config KERNEL_CODEC_PM805
bool "ASR PM805"
config KERNEL_CODEC_NAU8810
bool "ASR NAU8810"
config KERNEL_CODEC_ES8311
bool "MBTK ES8311"
config KERNEL_CODEC_TLV320AIC3X
bool "MBTK TLV320AIC3X"
config KERNEL_CODEC_ALC5616
bool "ASR ALC5616"
config KERNEL_CODEC_NONE
bool "No Codec"
endchoice
choice
prompt "Select Role for Audio Codec I2S"
default KERNEL_CODEC_I2S_MASTER
help
There are 2 choices:
- Master
- Slave
config KERNEL_CODEC_I2S_MASTER
bool "Master"
config KERNEL_CODEC_I2S_SLAVE
bool "Slave"
endchoice
choice
prompt "Select Role for Audio Codec PCM"
default KERNEL_CODEC_PCM_SLAVE
help
There are 2 choices:
- Master
- Slave
config KERNEL_CODEC_PCM_MASTER
bool "Master"
config KERNEL_CODEC_PCM_SLAVE
bool "Slave"
endchoice
choice
prompt "Select Rate for Audio Codec PCM"
default KERNEL_CODEC_PCM_NB
help
There are 4 choices:
- NarrowBand
- Wideband
- 32KHz
- 48KHz
config KERNEL_CODEC_PCM_NB
bool "Narrowband"
config KERNEL_CODEC_PCM_WB
bool "Wideband"
config KERNEL_CODEC_PCM_32KHz
bool "32KHz"
config KERNEL_CODEC_PCM_48KHz
bool "48KHz"
endchoice
choice
prompt "Select Controller for Modem Audio"
default KERNEL_MODEM_AUDIO_CONTROLLER_GSSP
help
There are 3 choices:
- GSSP
- SSPA
- INTERNAL CODEC
config KERNEL_MODEM_AUDIO_CONTROLLER_GSSP
bool "GSSP"
config KERNEL_MODEM_AUDIO_CONTROLLER_SSPA
bool "SSPA"
config KERNEL_MODEM_AUDIO_INTERNAL_CODEC
bool "Internal Codec"
endchoice
##endmenu
endef
ifeq ($(CONFIG_KERNEL_CODEC_PM812),y)
TARGET_CFLAGS += -DCODEC_PM812
endif
ifeq ($(CONFIG_KERNEL_CODEC_PM805),y)
TARGET_CFLAGS += -DCODEC_PM805
endif
ifeq ($(CONFIG_KERNEL_CODEC_NAU8810),y)
TARGET_CFLAGS += -DCODEC_NAU8810
endif
ifeq ($(CONFIG_KERNEL_CODEC_ALC5616),y)
TARGET_CFLAGS += -DCODEC_ALC5616
endif
ifeq ($(CONFIG_KERNEL_CODEC_ES8311),y)
TARGET_CFLAGS += -DCODEC_ES8311
endif
ifeq ($(CONFIG_KERNEL_CODEC_TLV320AIC3X),y)
TARGET_CFLAGS += -DCODEC_TLV320AIC3X
endif
ifeq ($(CONFIG_KERNEL_CODEC_NONE),y)
TARGET_CFLAGS += -DCODEC_NONE
endif
ifeq ($(CONFIG_KERNEL_CODEC_I2S_MASTER),y)
TARGET_CFLAGS += -DCODEC_I2S_MASTER
endif
ifeq ($(CONFIG_KERNEL_CODEC_I2S_SLAVE),y)
TARGET_CFLAGS += -DCODEC_I2S_SLAVE
endif
ifeq ($(CONFIG_KERNEL_CODEC_PCM_MASTER),y)
TARGET_CFLAGS += -DCODEC_PCM_MASTER
endif
ifeq ($(CONFIG_KERNEL_CODEC_PCM_SLAVE),y)
TARGET_CFLAGS += -DCODEC_PCM_SLAVE
endif
ifeq ($(CONFIG_KERNEL_CODEC_PCM_NB),y)
TARGET_CFLAGS += -DCODEC_PCM_NB
endif
ifeq ($(CONFIG_KERNEL_CODEC_PCM_WB),y)
TARGET_CFLAGS += -DCODEC_PCM_WB
endif
ifeq ($(CONFIG_KERNEL_CODEC_PCM_32KHz),y)
TARGET_CFLAGS += -DCODEC_PCM_32KHz
endif
ifeq ($(CONFIG_KERNEL_CODEC_PCM_48KHz),y)
TARGET_CFLAGS += -DCODEC_PCM_48KHz
endif
TARGET_CFLAGS += -ffunction-sections -fdata-sections
TARGET_LDFLAGS += -Wl,--gc-sections
define Build/Compile
$(MAKE) $(PKG_JOBS) -C $(SVC_SOURCE_DIR) \
SUBTARGET="$(SUBTARGET)" \
CROSS_COMPILE="$(TARGET_CROSS)" \
EXTRA_CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include -I$(TOOLCHAIN_DIR)/include" \
LD_FLAGS="$(TARGET_LDFLAGS) -L$(TOOLCHAIN_DIR)/lib/"\
INSTALL_DIR="$(PKG_INSTALL_DIR)" \
OBJ_DIR="$(PKG_BUILD_DIR)/obj" \
PKG_BUILD_DIR="$(PKG_BUILD_DIR)" \
compile
endef
define Build/Clean
@if [ -d $(PKG_BUILD_DIR) ]; then \
$(MAKE) $(PKG_JOBS) -C $(SVC_SOURCE_DIR) \
CROSS_COMPILE="$(TARGET_CROSS)" \
EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
LD_FLAGS="$(TARGET_LDFLAGS)" \
INSTALL_DIR="$(PKG_INSTALL_DIR)" \
OBJ_DIR="$(PKG_BUILD_DIR)/obj" \
PKG_BUILD_DIR="$(PKG_BUILD_DIR)" \
clean; \
fi
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_DIR) $(1)/usr/include
$(CP) -rf $(PKG_INSTALL_DIR)/lib/libtinyalsa.so $(1)/usr/lib/
$(CP) -rf $(SVC_SOURCE_DIR)/tinyalsa/include/asoundlib.h $(1)/usr/include/
endef
define Package/asr_audio/install
$(INSTALL_DIR) $(1)/lib
$(INSTALL_DIR) $(1)/bin
$(INSTALL_DIR) $(1)/etc
$(CP) -rf $(PKG_INSTALL_DIR)/* $(1)/
mkdir -p $(BIN_DIR)/symbol/service
cp -rf $(PKG_BUILD_DIR)/obj/symbol/* $(BIN_DIR)/symbol/service/
endef
$(eval $(call BuildPackage,asr_audio))