summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorJonas Aaberg <jonas.aberg@stericsson.com>2011-10-04 11:18:22 +0200
committerPhilippe Langlais <philippe.langlais@stericsson.com>2011-12-06 10:59:47 +0100
commit59dc1f1a3f7a14addec7a242a0f8fea77f12eca5 (patch)
tree43abc997183beadfcaaf82b67c607a2e1a780281 /sound
parentb5497d7edb43e94d3161ec0ef3d318460520b7d3 (diff)
misc: audio_io: Remove obsolete and unused driver
audio_io is superseded by alsa. ST-Ericsson Linux next: - ST-Ericsson ID: - ST-Ericsson FOSS-OUT ID: Trivial Change-Id: I4641468e1d67e8596b1fcd9af69b0b81b686a0a0 Signed-off-by: Jonas Aaberg <jonas.aberg@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/32904 Reviewed-by: Ola LILJA2 <ola.o.lilja@stericsson.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/Kconfig60
-rw-r--r--sound/Makefile7
-rw-r--r--sound/ab8500_codec.c6697
-rw-r--r--sound/ab8500_codec_v1_0.c6405
-rw-r--r--sound/u8500_acodec_ab8500.c2523
5 files changed, 0 insertions, 15692 deletions
diff --git a/sound/Kconfig b/sound/Kconfig
index 35bb190ed54..1fef141ef8e 100644
--- a/sound/Kconfig
+++ b/sound/Kconfig
@@ -23,66 +23,6 @@ menuconfig SOUND
and read <file:Documentation/sound/oss/README.modules>; the module
will be called soundcore.
-# added for U8500 audio codec device
-config U8500_ACODEC
- tristate "U8500 audio codec generic module (used both by SAA and ALSA)"
- depends on STM_MSP_I2S
- default Y
- help
- Say Y here if you have a U8500 based device
- and want to use its audio codec chip.
-
- To compile this driver as a module, choose M here: the module
- will be called u8500mod_acodec.
-
-choice
- prompt "Audio codec type"
- depends on U8500_ACODEC
- default U8500_AB8500_ED
-
- config U8500_AB8500_ED
- bool "U8500 ab8500 v0 audio codec"
-
- config U8500_AB8500_CUT10
- bool "U8500 ab8500 v1.x audio codec"
-
-endchoice
-
-menu "Debug level for ux500 audio drivers"
-config STM_ACODEC_DEBUG
- int "STM ACODEC Debug Level"
- depends on U8500_ACODEC
- default 0
- help
- Sets the ACODEC debug ON/OFF for U8500 SoC
- * 0 OFF
- * 1 ON
-
-config STM_ALSA_DEBUG
- int "STM ALSA Debug Level"
- depends on SND_U8500_ALSA || SND_U8500_ALSA_AB8500
- default 0
- help
- Sets the ALSA debug ON/OFF for U8500 SoC
- * 0 OFF
- * 1 ON
-endmenu
-
-choice
- prompt "Driver mode"
- depends on U8500_ACODEC
- default U8500_ACODEC_DMA
-
- config U8500_ACODEC_DMA
- bool "DMA mode"
-
- config U8500_ACODEC_POLL
- bool "Polling mode"
-
- config U8500_ACODEC_INTR
- bool "Interrupt mode"
-endchoice
-
if SOUND
config SOUND_OSS_CORE
diff --git a/sound/Makefile b/sound/Makefile
index b5963c8b70d..ce9132b1c39 100644
--- a/sound/Makefile
+++ b/sound/Makefile
@@ -16,11 +16,4 @@ ifeq ($(CONFIG_SND),y)
obj-y += last.o
endif
-obj-$(CONFIG_U8500_ACODEC) += u8500mod_acodec.o
-ifeq ($(CONFIG_U8500_AB8500_CUT10),y)
- u8500mod_acodec-objs := u8500_acodec_ab8500.o ab8500_codec_v1_0.o
-else
- u8500mod_acodec-objs := u8500_acodec_ab8500.o ab8500_codec.o
-endif
-
soundcore-objs := sound_core.o
diff --git a/sound/ab8500_codec.c b/sound/ab8500_codec.c
deleted file mode 100644
index fd4975bbdce..00000000000
--- a/sound/ab8500_codec.c
+++ /dev/null
@@ -1,6697 +0,0 @@
-/*
- * Copyright (C) ST-Ericsson SA 2010
- *
- * Author: ST-Ericsson
- *
- * License terms:
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as published
- * by the Free Software Foundation.
- */
-
- /*----------------------------------------------------------------------------
- * Includes
- *---------------------------------------------------------------------------*/
-#include <mach/ab8500_codec.h>
-#include <mach/ab8500_codec_p.h>
-
-/*--------------------------------------------------------------------------*
- * debug stuff *
- *--------------------------------------------------------------------------*/
-#ifdef __DEBUG
-#define MY_DEBUG_LEVEL_VAR_NAME myDebugLevel_AB8500_CODEC
-#define MY_DEBUG_ID myDebugID_AB8500_CODEC
-PRIVATE t_dbg_level MY_DEBUG_LEVEL_VAR_NAME = DEBUG_LEVEL0;
-PRIVATE t_dbg_id MY_DEBUG_ID = AB8500_CODEC_HCL_DBG_ID;
-#endif
-
-/*--------------------------------------------------------------------------*
- * Global data for interrupt mode management *
- *--------------------------------------------------------------------------*/
-PRIVATE t_ab8500_codec_system_context g_ab8500_codec_system_context;
-
-/*--------------------------------------------------------------------------*
- * Default Values *
- *--------------------------------------------------------------------------*/
-#define AB8500_CODEC_DEFAULT_SLAVE_ADDRESS_OF_CODEC 0xD
-#define AB8500_CODEC_DEFAULT_DIRECTION AB8500_CODEC_DIRECTION_OUT
-
-#define AB8500_CODEC_DEFAULT_MODE_IN AB8500_CODEC_MODE_VOICE
-#define AB8500_CODEC_DEFAULT_MODE_OUT AB8500_CODEC_MODE_VOICE
-
-#define AB8500_CODEC_DEFAULT_INPUT_SRC AB8500_CODEC_SRC_MICROPHONE_1A
-#define AB8500_CODEC_DEFAULT_OUTPUT_DEST AB8500_CODEC_DEST_HEADSET
-
-#define AB8500_CODEC_DEFAULT_VOLUME_LEFT_IN 75
-#define AB8500_CODEC_DEFAULT_VOLUME_RIGHT_IN 75
-#define AB8500_CODEC_DEFAULT_VOLUME_LEFT_OUT 75
-#define AB8500_CODEC_DEFAULT_VOLUME_RIGHT_OUT 75
-
-/*---------------------------------------------------------------------
- * PRIVATE APIs
- *--------------------------------------------------------------------*/
-PRIVATE t_ab8500_codec_error ab8500_codec_ADSlotAllocationSwitch1(IN
- t_ab8500_codec_slot
- ad_slot,
- IN
- t_ab8500_codec_cr31_to_cr46_ad_data_allocation
- value);
-PRIVATE t_ab8500_codec_error ab8500_codec_ADSlotAllocationSwitch2(IN
- t_ab8500_codec_slot
- ad_slot,
- IN
- t_ab8500_codec_cr31_to_cr46_ad_data_allocation
- value);
-PRIVATE t_ab8500_codec_error ab8500_codec_ADSlotAllocationSwitch3(IN
- t_ab8500_codec_slot
- ad_slot,
- IN
- t_ab8500_codec_cr31_to_cr46_ad_data_allocation
- value);
-PRIVATE t_ab8500_codec_error ab8500_codec_ADSlotAllocationSwitch4(IN
- t_ab8500_codec_slot
- ad_slot,
- IN
- t_ab8500_codec_cr31_to_cr46_ad_data_allocation
- value);
-PRIVATE t_ab8500_codec_error ab8500_codec_SrcPowerControlSwitch1(IN
- t_ab8500_codec_src
- src_device,
- t_ab8500_codec_src_state
- state);
-PRIVATE t_ab8500_codec_error ab8500_codec_SrcPowerControlSwitch2(IN
- t_ab8500_codec_src
- src_device,
- t_ab8500_codec_src_state
- state);
-PRIVATE t_ab8500_codec_error ab8500_codec_SetModeAndDirectionUpdateCR(void);
-PRIVATE t_ab8500_codec_error ab8500_codec_SetSrcVolumeUpdateCR(void);
-PRIVATE t_ab8500_codec_error ab8500_codec_SetDestVolumeUpdateCR(void);
-PRIVATE t_ab8500_codec_error ab8500_codec_ProgramDirectionIN(void);
-PRIVATE t_ab8500_codec_error ab8500_codec_ProgramDirectionOUT(void);
-PRIVATE t_ab8500_codec_error ab8500_codec_DestPowerControlUpdateCR(void);
-
-/********************************************************************************************/
-/* Name: ab8500_codec_SingleWrite */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_SingleWrite(t_uint8 register_offset,
- t_uint8 data)
-{
- return (t_ab8500_codec_error) (AB8500_CODEC_Write
- (register_offset, 0x01, &data));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_SingleRead */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_SingleRead(t_uint8 register_offset,
- t_uint8 data)
-{
- t_uint8 dummy_data = 0xAA;
-
- return (t_ab8500_codec_error) (AB8500_CODEC_Read
- (register_offset, 0x01, &dummy_data,
- &data));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR0 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR0(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr0_powerup,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR0_POWERUP);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr0_enaana,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR0_ENAANA);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR0, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR1 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR1(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr1_swreset,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR1_SWRESET);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR1, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR2 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR2(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr2_enad1,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR2_ENAD1);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr2_enad2,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR2_ENAD2);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr2_enad3,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR2_ENAD3);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr2_enad4,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR2_ENAD4);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr2_enad5,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR2_ENAD5);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr2_enad6,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR2_ENAD6);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR2, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR3 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR3(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr3_enda1,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR3_ENDA1);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr3_enda2,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR3_ENDA2);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr3_enda3,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR3_ENDA3);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr3_enda4,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR3_ENDA4);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr3_enda5,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR3_ENDA5);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr3_enda6,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR3_ENDA6);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR3, value));
-}
-
-#if 0
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR4 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR4(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr4_lowpowhs,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR4_LOWPOWHS);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr4_lowpowdachs,
- AB8500_CODEC_MASK_TWO_BITS, AB8500_CODEC_CR4_LOWPOWDACHS);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr4_lowpowear,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR4_LOWPOWEAR);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr4_ear_sel_cm,
- AB8500_CODEC_MASK_TWO_BITS, AB8500_CODEC_CR4_EAR_SEL_CM);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr4_hs_hp_dis,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR4_HS_HP_DIS);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr4_ear_hp_dis,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR4_EAR_HP_DIS);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR4, value));
-}
-#endif
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR5 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR5(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr5_enmic1,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR5_ENMIC1);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr5_enmic2,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR5_ENMIC2);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr5_enlinl,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR5_ENLINL);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr5_enlinr,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR5_ENLINR);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr5_mutmic1,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR5_MUTMIC1);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr5_mutmic2,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR5_MUTMIC2);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr5_mutlinl,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR5_MUTELINL);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr5_mutlinr,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR5_MUTELINR);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR5, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR6 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR6(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr6_endmic1,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR6_ENDMIC1);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr6_endmic2,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR6_ENDMIC2);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr6_endmic3,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR6_ENDMIC3);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr6_endmic4,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR6_ENDMIC4);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr6_endmic5,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR6_ENDMIC5);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr6_endmic6,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR6_ENDMIC6);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR6, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR7 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR7(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr7_mic1sel,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR7_MIC1SEL);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr7_linrsel,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR7_LINRSEL);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr7_endrvhsl,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR7_ENDRVHSL);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr7_endrvhsr,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR7_ENDRVHSR);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr7_enadcmic,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR7_ENADCMIC);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr7_enadclinl,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR7_ENADCLINL);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr7_enadclinr,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR7_ENADCLINR);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR7, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR8 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR8(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr8_cp_dis_pldwn,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR8_CP_DIS_PLDWN);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr8_enear,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR8_ENEAR);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr8_enhsl,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR8_ENHSL);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr8_enhsr,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR8_ENHSR);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr8_enhfl,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR8_ENHFL);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr8_enhfr,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR8_ENHFR);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr8_envibl,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR8_ENVIBL);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr8_envibr,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR8_ENVIBR);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR8, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR9 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR9(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr9_endacear,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR9_ENADACEAR);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr9_endachsl,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR9_ENADACHSL);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr9_endachsr,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR9_ENADACHSR);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr9_endachfl,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR9_ENADACHFL);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr9_endachfr,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR9_ENADACHFR);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr9_endacvibl,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR9_ENADACVIBL);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr9_endacvibr,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR9_ENADACVIBR);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR9, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR10 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR10(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr10_muteear,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR10_MUTEEAR);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr10_mutehsl,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR10_MUTEHSL);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr10_mutehsr,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR10_MUTEHSR);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr10_mutehfl,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR10_MUTEHFL);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr10_mutehfr,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR10_MUTEHFR);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr10_mutevibl,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR10_MUTEVIBL);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr10_mutevibr,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR10_MUTEVIBR);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR10, value));
-}
-
-#if 0
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR11 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR11(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr11_earshortpwd,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR11_ENSHORTPWD);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr11_earshortdis,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR11_EARSHORTDIS);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr11_hslshortdis,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR11_HSLSHORTDIS);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr11_hsrshortdis,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR11_HSRSHORTDIS);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr11_hflshortdis,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR11_HFLSHORTDIS);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr11_hfrshortdis,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR11_HFRSHORTDIS);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr11_viblshortdis,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR11_VIBLSHORTDIS);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr11_vibrshortdis,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR11_VIBRSHORTDIS);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR11, value));
-}
-
-#endif
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR12 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR12(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr12_encphs,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR12_ENCPHS);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr12_hsautotime,
- AB8500_CODEC_MASK_THREE_BITS, AB8500_CODEC_CR12_HSAUTOTIME);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr12_hsautoensel,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR12_HSAUTOENSEL);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr12_hsautoen,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR12_HSAUTOEN);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR12, value));
-}
-
-#if 0
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR13 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR13(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr13_envdet_hthresh,
- AB8500_CODEC_MASK_FOUR_BITS, AB8500_CODEC_CR13_ENVDET_HTHRESH);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr13_envdet_lthresh,
- AB8500_CODEC_MASK_FOUR_BITS, AB8500_CODEC_CR13_ENVDET_LTHRESH);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR13, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR14 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR14(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr14_smpslven,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR14_SMPSLVEN);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr14_envdetsmpsen,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR14_ENVDETSMPSEN);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr14_cplven,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR14_CPLVEN);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr14_envdetcpen,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR14_ENVDETCPEN);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr14_envet_time,
- AB8500_CODEC_MASK_FOUR_BITS, AB8500_CODEC_CR14_ENVDET_TIME);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR14, value));
-}
-#endif
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR15 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR15(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr15_pwmtovibl,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR15_PWMTOVIBL);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr15_pwmtovibr,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR15_PWMTOVIBR);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr15_pwmlctrl,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR15_PWMLCTRL);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr15_pwmrctrl,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR15_PWMRCTRL);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr15_pwmnlctrl,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR15_PWMNLCTRL);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr15_pwmplctrl,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR15_PWMPLCTRL);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr15_pwmnrctrl,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR15_PWMNRCTRL);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr15_pwmprctrl,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR15_PWMPRCTRL);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR15, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR16 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR16(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr16_pwmnlpol,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR16_PWMNLPOL);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr16_pwmnldutycycle,
- AB8500_CODEC_MASK_SEVEN_BITS, AB8500_CODEC_CR16_PWMNLDUTYCYCLE);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR16, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR17 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR17(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr17_pwmplpol,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR17_PWMPLPOL);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr17_pwmpldutycycle,
- AB8500_CODEC_MASK_SEVEN_BITS, AB8500_CODEC_CR17_PWMLPDUTYCYCLE);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR17, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR18 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR18(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr18_pwmnrpol,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR18_PWMNRPOL);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr18_pwmnrdutycycle,
- AB8500_CODEC_MASK_SEVEN_BITS, AB8500_CODEC_CR18_PWMNRDUTYCYCLE);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR18, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR19 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR19(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr19_pwmprpol,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR19_PWMPRPOL);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr19_pwmprdutycycle,
- AB8500_CODEC_MASK_SEVEN_BITS, AB8500_CODEC_CR19_PWMRPDUTYCYCLE);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR19, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR20 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR20(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr20_en_se_mic1,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR20_EN_SE_MIC1);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr20_mic1_gain,
- AB8500_CODEC_MASK_FIVE_BITS, AB8500_CODEC_CR20_MIC1_GAIN);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR20, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR21 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR21(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr21_en_se_mic2,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR21_EN_SE_MIC2);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr21_mic2_gain,
- AB8500_CODEC_MASK_FIVE_BITS, AB8500_CODEC_CR21_MIC2_GAIN);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR21, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR22 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR22(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr22_hsl_gain,
- AB8500_CODEC_MASK_THREE_BITS, AB8500_CODEC_CR22_HSL_GAIN);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr22_linl_gain,
- AB8500_CODEC_MASK_FIVE_BITS, AB8500_CODEC_CR22_LINL_GAIN);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR22, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR23 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR23(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr23_hsr_gain,
- AB8500_CODEC_MASK_THREE_BITS, AB8500_CODEC_CR23_HSR_GAIN);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr23_linr_gain,
- AB8500_CODEC_MASK_FIVE_BITS, AB8500_CODEC_CR23_LINR_GAIN);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR23, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR24 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR24(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr24_lintohsl_gain,
- AB8500_CODEC_MASK_FIVE_BITS, AB8500_CODEC_CR24_LINTOHSL_GAIN);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR24, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR25 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR25(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr25_lintohsr_gain,
- AB8500_CODEC_MASK_FIVE_BITS, AB8500_CODEC_CR25_LINTOHSR_GAIN);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR25, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR26 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR26(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr26_ad1nh,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR26_AD1NH);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr26_ad2nh,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR26_AD2NH);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr26_ad3nh,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR26_AD3NH);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr26_ad4nh,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR26_AD4NH);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr26_ad1_voice,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR26_AD1_VOICE);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr26_ad2_voice,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR26_AD2_VOICE);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr26_ad3_voice,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR26_AD3_VOICE);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr26_ad4_voice,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR26_AD4_VOICE);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR26, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR27 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR27(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr27_en_mastgen,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR27_EN_MASTGEN);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr27_if1_bitclk_osr,
- AB8500_CODEC_MASK_TWO_BITS, AB8500_CODEC_CR27_IF1_BITCLK_OSR);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr27_enfs_bitclk1,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR27_ENFS_BITCLK1);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr27_if0_bitclk_osr,
- AB8500_CODEC_MASK_TWO_BITS, AB8500_CODEC_CR27_IF0_BITCLK_OSR);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr27_enfs_bitclk0,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR27_ENFS_BITCLK0);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR27, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR28 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR28(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr28_fsync0p,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR28_FSYNC0P);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr28_bitclk0p,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR28_BITCLK0P);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr28_if0del,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR28_IF0DEL);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr28_if0format,
- AB8500_CODEC_MASK_TWO_BITS, AB8500_CODEC_CR28_IF0FORMAT);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr28_if0wl,
- AB8500_CODEC_MASK_TWO_BITS, AB8500_CODEC_CR28_IF0WL);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR28, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR29 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR29(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr29_if0datoif1ad,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR29_IF0DATOIF1AD);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr29_if0cktoif1ck,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR29_IF0CKTOIF1CK);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr29_if1master,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR29_IF1MASTER);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr29_if1datoif0ad,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR29_IF1DATOIF0AD);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr29_if1cktoif0ck,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR29_IF1CKTOIF0CK);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr29_if0master,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR29_IF0MASTER);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr29_if0bfifoen,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR29_IF0BFIFOEN);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR29, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR30 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR30(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr30_fsync1p,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR30_FSYNC1P);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr30_bitclk1p,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR30_BITCLK1P);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr30_if1del,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR30_IF1DEL);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr30_if1format,
- AB8500_CODEC_MASK_TWO_BITS, AB8500_CODEC_CR30_IF1FORMAT);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr30_if1wl,
- AB8500_CODEC_MASK_TWO_BITS, AB8500_CODEC_CR30_IF1WL);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR30, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR31 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR31(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr31_adotoslot1,
- AB8500_CODEC_MASK_FOUR_BITS, AB8500_CODEC_CR31_ADOTOSLOT1);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr31_adotoslot0,
- AB8500_CODEC_MASK_FOUR_BITS, AB8500_CODEC_CR31_ADOTOSLOT0);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR31, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR32 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR32(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr32_adotoslot3,
- AB8500_CODEC_MASK_FOUR_BITS, AB8500_CODEC_CR32_ADOTOSLOT3);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr32_adotoslot2,
- AB8500_CODEC_MASK_FOUR_BITS, AB8500_CODEC_CR32_ADOTOSLOT2);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR32, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR33 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR33(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr33_adotoslot5,
- AB8500_CODEC_MASK_FOUR_BITS, AB8500_CODEC_CR33_ADOTOSLOT5);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr33_adotoslot4,
- AB8500_CODEC_MASK_FOUR_BITS, AB8500_CODEC_CR33_ADOTOSLOT4);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR33, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR34 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR34(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr34_adotoslot7,
- AB8500_CODEC_MASK_FOUR_BITS, AB8500_CODEC_CR34_ADOTOSLOT7);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr34_adotoslot6,
- AB8500_CODEC_MASK_FOUR_BITS, AB8500_CODEC_CR34_ADOTOSLOT6);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR34, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR35 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR35(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr35_adotoslot9,
- AB8500_CODEC_MASK_FOUR_BITS, AB8500_CODEC_CR35_ADOTOSLOT9);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr35_adotoslot8,
- AB8500_CODEC_MASK_FOUR_BITS, AB8500_CODEC_CR35_ADOTOSLOT8);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR35, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR36 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR36(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr36_adotoslot11,
- AB8500_CODEC_MASK_FOUR_BITS, AB8500_CODEC_CR36_ADOTOSLOT11);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr36_adotoslot10,
- AB8500_CODEC_MASK_FOUR_BITS, AB8500_CODEC_CR36_ADOTOSLOT10);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR36, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR37 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR37(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr37_adotoslot13,
- AB8500_CODEC_MASK_FOUR_BITS, AB8500_CODEC_CR37_ADOTOSLOT13);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr37_adotoslot12,
- AB8500_CODEC_MASK_FOUR_BITS, AB8500_CODEC_CR37_ADOTOSLOT12);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR37, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR38 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR38(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr38_adotoslot15,
- AB8500_CODEC_MASK_FOUR_BITS, AB8500_CODEC_CR38_ADOTOSLOT15);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr38_adotoslot14,
- AB8500_CODEC_MASK_FOUR_BITS, AB8500_CODEC_CR38_ADOTOSLOT14);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR38, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR39 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR39(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr39_adotoslot17,
- AB8500_CODEC_MASK_FOUR_BITS, AB8500_CODEC_CR39_ADOTOSLOT17);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr39_adotoslot16,
- AB8500_CODEC_MASK_FOUR_BITS, AB8500_CODEC_CR39_ADOTOSLOT16);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR39, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR40 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR40(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr40_adotoslot19,
- AB8500_CODEC_MASK_FOUR_BITS, AB8500_CODEC_CR40_ADOTOSLOT19);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr40_adotoslot18,
- AB8500_CODEC_MASK_FOUR_BITS, AB8500_CODEC_CR40_ADOTOSLOT18);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR40, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR41 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR41(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr41_adotoslot21,
- AB8500_CODEC_MASK_FOUR_BITS, AB8500_CODEC_CR41_ADOTOSLOT21);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr41_adotoslot20,
- AB8500_CODEC_MASK_FOUR_BITS, AB8500_CODEC_CR41_ADOTOSLOT20);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR41, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR42 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR42(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr42_adotoslot23,
- AB8500_CODEC_MASK_FOUR_BITS, AB8500_CODEC_CR42_ADOTOSLOT23);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr42_adotoslot22,
- AB8500_CODEC_MASK_FOUR_BITS, AB8500_CODEC_CR42_ADOTOSLOT22);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR42, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR43 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR43(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr43_adotoslot25,
- AB8500_CODEC_MASK_FOUR_BITS, AB8500_CODEC_CR43_ADOTOSLOT25);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr43_adotoslot24,
- AB8500_CODEC_MASK_FOUR_BITS, AB8500_CODEC_CR43_ADOTOSLOT24);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR43, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR44 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR44(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr44_adotoslot27,
- AB8500_CODEC_MASK_FOUR_BITS, AB8500_CODEC_CR44_ADOTOSLOT27);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr44_adotoslot26,
- AB8500_CODEC_MASK_FOUR_BITS, AB8500_CODEC_CR44_ADOTOSLOT26);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR44, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR45 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR45(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr45_adotoslot29,
- AB8500_CODEC_MASK_FOUR_BITS, AB8500_CODEC_CR45_ADOTOSLOT29);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr45_adotoslot28,
- AB8500_CODEC_MASK_FOUR_BITS, AB8500_CODEC_CR45_ADOTOSLOT28);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR45, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR46 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR46(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr46_adotoslot31,
- AB8500_CODEC_MASK_FOUR_BITS, AB8500_CODEC_CR46_ADOTOSLOT31);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr46_adotoslot30,
- AB8500_CODEC_MASK_FOUR_BITS, AB8500_CODEC_CR46_ADOTOSLOT30);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR46, value));
-}
-
-#if 0
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR47 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR47(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr47_hiz_sl7,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR47_HIZ_SL7);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr47_hiz_sl6,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR47_HIZ_SL6);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr47_hiz_sl5,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR47_HIZ_SL5);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr47_hiz_sl4,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR47_HIZ_SL4);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr47_hiz_sl3,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR47_HIZ_SL3);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr47_hiz_sl2,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR47_HIZ_SL2);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr47_hiz_sl1,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR47_HIZ_SL1);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr47_hiz_sl0,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR47_HIZ_SL0);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR47, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR48 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR48(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr48_hiz_sl15,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR48_HIZ_SL15);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr48_hiz_sl14,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR48_HIZ_SL14);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr48_hiz_sl13,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR48_HIZ_SL13);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr48_hiz_sl12,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR48_HIZ_SL12);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr48_hiz_sl11,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR48_HIZ_SL11);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr48_hiz_sl10,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR48_HIZ_SL10);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr48_hiz_sl9,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR48_HIZ_SL9);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr48_hiz_sl8,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR48_HIZ_SL8);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR48, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR49 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR49(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr49_hiz_sl23,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR49_HIZ_SL23);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr49_hiz_sl22,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR49_HIZ_SL22);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr49_hiz_sl21,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR49_HIZ_SL21);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr49_hiz_sl20,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR49_HIZ_SL20);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr49_hiz_sl19,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR49_HIZ_SL19);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr49_hiz_sl18,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR49_HIZ_SL18);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr49_hiz_sl17,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR49_HIZ_SL17);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr49_hiz_sl16,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR49_HIZ_SL16);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR49, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR50 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR50(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr50_hiz_sl31,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR50_HIZ_SL31);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr50_hiz_sl30,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR50_HIZ_SL30);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr50_hiz_sl29,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR50_HIZ_SL29);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr50_hiz_sl28,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR50_HIZ_SL28);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr50_hiz_sl27,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR50_HIZ_SL27);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr50_hiz_sl26,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR50_HIZ_SL26);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr50_hiz_sl25,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR50_HIZ_SL25);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr50_hiz_sl24,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR50_HIZ_SL24);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR50, value));
-}
-
-#endif
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR51 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR51(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr51_da12_voice,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR51_DA12_VOICE);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr51_sldai1toslado1,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR51_SLDAI1TOSLADO1);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr51_sltoda1,
- AB8500_CODEC_MASK_FIVE_BITS, AB8500_CODEC_CR51_SLTODA1);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR51, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR52 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR52(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr52_sldai2toslado2,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR52_SLDAI1TOSLADO2);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr52_sltoda2,
- AB8500_CODEC_MASK_FIVE_BITS, AB8500_CODEC_CR52_SLTODA2);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR52, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR53 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR53(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr53_da34_voice,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR53_DA34_VOICE);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr53_sldai3toslado3,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR53_SLDAI1TOSLADO3);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr53_sltoda3,
- AB8500_CODEC_MASK_FIVE_BITS, AB8500_CODEC_CR53_SLTODA3);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR53, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR54 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR54(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr54_sldai4toslado4,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR54_SLDAI1TOSLADO4);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr54_sltoda4,
- AB8500_CODEC_MASK_FIVE_BITS, AB8500_CODEC_CR54_SLTODA4);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR54, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR55 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR55(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr55_da56_voice,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR55_DA56_VOICE);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr55_sldai5toslado5,
- AB8500_CODEC_MASK_TWO_BITS, AB8500_CODEC_CR55_SLDAI1TOSLADO5);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr55_sltoda5,
- AB8500_CODEC_MASK_FIVE_BITS, AB8500_CODEC_CR55_SLTODA5);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR55, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR56 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR56(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr56_sldai6toslado7,
- AB8500_CODEC_MASK_TWO_BITS, AB8500_CODEC_CR56_SLDAI1TOSLADO6);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr56_sltoda6,
- AB8500_CODEC_MASK_FIVE_BITS, AB8500_CODEC_CR56_SLTODA6);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR56, value));
-}
-
-#if 0
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR57 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR57(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr57_bfifull_msk,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR57_BFIFULL_MSK);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr57_bfiempt_msk,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR57_BFIEMPT_MSK);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr57_dachan_msk,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR57_DACHAN_MSK);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr57_gain_msk,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR57_GAIN_MSK);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr57_dspad_msk,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR57_DSPAD_MSK);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr57_dspda_msk,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR57_DSPDA_MSK);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr57_stfir_msk,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR57_STFIR_MSK);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR57, value));
-}
-
-/* CR58 is Read Only */
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR59 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR59(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr59_vssready_msk,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR59_VSSREADY_MSK);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr59_shrtvibl_msk,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR59_SHRTVIBL_MSK);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr59_shrtvibr_msk,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR59_SHRTVIBR_MSK);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr59_shrthfl_msk,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR59_SHRTHFL_MSK);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr59_shrthfr_msk,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR59_SHRTHFR_MSK);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr59_shrthsl_msk,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR59_SHRTHSL_MSK);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr59_shrthsr_msk,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR59_SHRTHSR_MSK);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr59_shrtear_msk,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR59_SHRTEAR_MSK);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR59, value));
-}
-
-/* CR60 is Read Only */
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR61 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR61(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- /* 5 bits are Read Only */
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr61_fade_speed,
- AB8500_CODEC_MASK_TWO_BITS, AB8500_CODEC_CR61_FADE_SPEED);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR61, value));
-}
-#endif
-/* CR62 is Read Only */
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR63 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR63(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr63_datohslen,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR63_DATOHSLEN);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr63_datohsren,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR63_DATOHSREN);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr63_ad1sel,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR63_AD1SEL);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr63_ad2sel,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR63_AD2SEL);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr63_ad3sel,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR63_AD3SEL);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr63_ad5sel,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR63_AD5SEL);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr63_ad6sel,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR63_AD6SEL);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr63_ancsel,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR63_ANCSEL);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR63, value));
-}
-
-#if 0
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR64 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR64(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr64_datohfren,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR64_DATOHFREN);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr64_datohflen,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR64_DATOHFLEN);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr64_hfrsel,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR64_HFRSEL);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr64_hflsel,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR64_HFLSEL);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr64_stfir1sel,
- AB8500_CODEC_MASK_TWO_BITS, AB8500_CODEC_CR64_STFIR1SEL);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr64_stfir2sel,
- AB8500_CODEC_MASK_TWO_BITS, AB8500_CODEC_CR64_STFIR2SEL);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR64, value));
-}
-
-#endif
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR65 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR65(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr65_fadedis_ad1,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR65_FADEDIS_AD1);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr65_ad1gain,
- AB8500_CODEC_MASK_SIX_BITS, AB8500_CODEC_CR65_AD1GAIN);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR65, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR66 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR66(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr66_fadedis_ad2,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR66_FADEDIS_AD2);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr66_ad2gain,
- AB8500_CODEC_MASK_SIX_BITS, AB8500_CODEC_CR66_AD2GAIN);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR66, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR67 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR67(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr67_fadedis_ad3,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR67_FADEDIS_AD3);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr67_ad3gain,
- AB8500_CODEC_MASK_SIX_BITS, AB8500_CODEC_CR67_AD3GAIN);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR67, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR68 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR68(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr68_fadedis_ad4,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR68_FADEDIS_AD4);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr68_ad4gain,
- AB8500_CODEC_MASK_SIX_BITS, AB8500_CODEC_CR68_AD4GAIN);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR68, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR69 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR69(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr69_fadedis_ad5,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR69_FADEDIS_AD5);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr69_ad5gain,
- AB8500_CODEC_MASK_SIX_BITS, AB8500_CODEC_CR69_AD5GAIN);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR69, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR70 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR70(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr70_fadedis_ad6,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR70_FADEDIS_AD6);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr70_ad6gain,
- AB8500_CODEC_MASK_SIX_BITS, AB8500_CODEC_CR70_AD6GAIN);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR70, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR71 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR71(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr71_fadedis_da1,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR71_FADEDIS_DA1);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr71_da1gain,
- AB8500_CODEC_MASK_SIX_BITS, AB8500_CODEC_CR71_DA1GAIN);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR71, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR72 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR72(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr72_fadedis_da2,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR72_FADEDIS_DA2);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr72_da2gain,
- AB8500_CODEC_MASK_SIX_BITS, AB8500_CODEC_CR72_DA2GAIN);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR72, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR73 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR73(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr73_fadedis_da3,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR73_FADEDIS_DA3);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr73_da3gain,
- AB8500_CODEC_MASK_SIX_BITS, AB8500_CODEC_CR73_DA3GAIN);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR73, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR74 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR74(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr74_fadedis_da4,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR74_FADEDIS_DA4);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr74_da4gain,
- AB8500_CODEC_MASK_SIX_BITS, AB8500_CODEC_CR74_DA4GAIN);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR74, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR75 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR75(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr75_fadedis_da5,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR75_FADEDIS_DA5);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr75_da5gain,
- AB8500_CODEC_MASK_SIX_BITS, AB8500_CODEC_CR75_DA5GAIN);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR75, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR76 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR76(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr76_fadedis_da6,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR76_FADEDIS_DA6);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr76_da6gain,
- AB8500_CODEC_MASK_SIX_BITS, AB8500_CODEC_CR76_DA6GAIN);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR76, value));
-}
-
-#if 0
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR77 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR77(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr77_fadedis_ad1l,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR77_FADEDIS_AD1L);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr77_ad1lbgain_to_hfl,
- AB8500_CODEC_MASK_SIX_BITS, AB8500_CODEC_CR77_AD1LBGAIN);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR77, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR78 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR78(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr78_fadedis_ad2l,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR78_FADEDIS_AD2L);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr78_ad2lbgain_to_hfr,
- AB8500_CODEC_MASK_SIX_BITS, AB8500_CODEC_CR78_AD2LBGAIN);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR78, value));
-}
-#endif
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR79 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR79(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr79_hssinc1,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR79_HSSINC1);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr79_fadedis_hsl,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR79_FADEDIS_HSL);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr79_hsldgain,
- AB8500_CODEC_MASK_FOUR_BITS, AB8500_CODEC_CR79_HSLDGAIN);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR79, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR80 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR80(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr80_fadedis_hsr,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR80_FADEDIS_HSR);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr80_hsrdgain,
- AB8500_CODEC_MASK_FOUR_BITS, AB8500_CODEC_CR80_HSRDGAIN);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR80, value));
-}
-
-#if 0
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR81 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR81(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr81_stfir1gain,
- AB8500_CODEC_MASK_FIVE_BITS, AB8500_CODEC_CR81_STFIR1GAIN);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR81, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR82 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR82(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr82_stfir2gain,
- AB8500_CODEC_MASK_FIVE_BITS, AB8500_CODEC_CR82_STFIR2GAIN);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR82, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR83 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR83(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr83_enanc,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR83_ENANC);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr83_anciirinit,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR83_ANCIIRINIT);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr83_ancfirupdate,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR83_ANCFIRUPDATE);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR83, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR84 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR84(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr84_ancinshift,
- AB8500_CODEC_MASK_FIVE_BITS, AB8500_CODEC_CR84_ANCINSHIFT);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR84, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR85 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR85(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr85_ancfiroutshift,
- AB8500_CODEC_MASK_FIVE_BITS, AB8500_CODEC_CR85_ANCFIROUTSHIFT);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR85, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR86 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR86(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr86_ancshiftout,
- AB8500_CODEC_MASK_FIVE_BITS, AB8500_CODEC_CR86_ANCSHIFTOUT);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR86, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR87 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR87(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr87_ancfircoeff_msb,
- AB8500_CODEC_MASK_EIGHT_BITS, AB8500_CODEC_CR87_ANCFIRCOEFF_MSB);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR87, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR88 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR88(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr88_ancfircoeff_lsb,
- AB8500_CODEC_MASK_EIGHT_BITS, AB8500_CODEC_CR88_ANCFIRCOEFF_LSB);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR88, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR89 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR89(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr89_anciircoeff_msb,
- AB8500_CODEC_MASK_EIGHT_BITS, AB8500_CODEC_CR89_ANCIIRCOEFF_MSB);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR89, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR90 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR90(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr90_anciircoeff_lsb,
- AB8500_CODEC_MASK_EIGHT_BITS, AB8500_CODEC_CR90_ANCIIRCOEFF_LSB);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR90, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR91 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR91(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr91_ancwarpdel_msb,
- AB8500_CODEC_MASK_EIGHT_BITS, AB8500_CODEC_CR91_ANCWARPDEL_MSB);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR91, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR92 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR92(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr92_ancwarpdel_lsb,
- AB8500_CODEC_MASK_EIGHT_BITS, AB8500_CODEC_CR92_ANCWARPDEL_LSB);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR92, value));
-}
-
-/* CR93 is Read Only */
-/* CR94 is Read Only */
-/* CR95 is Read Only */
-/* CR96 is Read Only */
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR97 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR97(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr97_stfir_set,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR97_STFIR_SET);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr97_stfir_addr,
- AB8500_CODEC_MASK_SEVEN_BITS, AB8500_CODEC_CR97_STFIR_ADDR);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR97, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR98 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR98(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr98_stfir_coeff_msb,
- AB8500_CODEC_MASK_EIGHT_BITS, AB8500_CODEC_CR98_STFIR_COEFF_MSB);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR98, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR99 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR99(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr99_stfir_coeff_lsb,
- AB8500_CODEC_MASK_EIGHT_BITS, AB8500_CODEC_CR99_STFIR_COEFF_LSB);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR99, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR100 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR100(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr100_enstfirs,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR100_ENSTFIRS);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr100_stfirstoif1,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR100_STFIRSTOIF1);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr100_stfir_busy,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR100_STFIR_BUSY);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR100, value));
-}
-
-#endif
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR101 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR101(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr101_parlhf,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR101_PARLHF);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr101_parlvib,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR101_PARLVIB);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr101_classd_viblswapen,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR101_CLASSDVIBLSWAPEN);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr101_classd_vibrswapen,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR101_CLASSDVIBRSWAPEN);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr101_classd_hflswapen,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR101_CLASSDHFLSWAPEN);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr101_classd_hfrswapen,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR101_CLASSDHFRSWAPEN);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR101, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR102 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR102(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr102_classd_firbyp,
- AB8500_CODEC_MASK_FOUR_BITS, AB8500_CODEC_CR102_CLASSD_FIRBYP);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr102_classd_highvolen,
- AB8500_CODEC_MASK_FOUR_BITS, AB8500_CODEC_CR102_CLASSD_HIGHVOLEN);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR102, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR103 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR103(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr103_classd_ditherhpgain,
- AB8500_CODEC_MASK_FOUR_BITS,
- AB8500_CODEC_CR103_CLASSD_DITHERHPGAIN);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr103_classd_ditherwgain,
- AB8500_CODEC_MASK_FOUR_BITS,
- AB8500_CODEC_CR103_CLASSD_DITHERWGAIN);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR103, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR104 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR104(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr104_bfifoint,
- AB8500_CODEC_MASK_SIX_BITS, AB8500_CODEC_CR104_BFIFOINT);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR104, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR105 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR105(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr105_bfifotx,
- AB8500_CODEC_MASK_EIGHT_BITS, AB8500_CODEC_CR105_BFIFOTX);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR105, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR106 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR106(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr106_bfifofsext,
- AB8500_CODEC_MASK_THREE_BITS, AB8500_CODEC_CR106_BFIFOFSEXT);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr106_bfifomsk,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR106_BFIFOMSK);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr106_bfifomstr,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR106_BFIFOMSTR);
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr106_bfifostrt,
- AB8500_CODEC_MASK_ONE_BIT, AB8500_CODEC_CR106_BFIFOSTRT);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR106, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR107 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR107(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr107_bfifosampnr,
- AB8500_CODEC_MASK_EIGHT_BITS, AB8500_CODEC_CR107_BFIFOSAMPNR);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR107, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR108 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR108(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr108_bfifowakeup,
- AB8500_CODEC_MASK_EIGHT_BITS, AB8500_CODEC_CR108_BFIFOWAKEUP);
-
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR108, value));
-}
-
-/* CR109 is Read Only */
-/********************************************************************************************/
-/* Name: ab8500_codec_Reset() */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_Reset(void)
-{
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- p_ab8500_codec_configuration->cr1_swreset =
- AB8500_CODEC_CR1_SWRESET_ENABLED;
-
- ab8500_codec_error = ab8500_codec_UpdateCR1();
- if (AB8500_CODEC_OK != ab8500_codec_error) {
- return (ab8500_codec_error);
- }
-
- return (ab8500_codec_error);
-}
-
-PRIVATE t_ab8500_codec_error ab8500_codec_ProgramDirection(IN
- t_ab8500_codec_direction
- ab8500_codec_direction)
-{ /*only IN or OUT must be passed (not INOUT) */
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
-
- if (AB8500_CODEC_DIRECTION_IN == ab8500_codec_direction) {
- ab8500_codec_error = ab8500_codec_ProgramDirectionIN();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- }
-
- if (AB8500_CODEC_DIRECTION_OUT == ab8500_codec_direction) {
- ab8500_codec_error = ab8500_codec_ProgramDirectionOUT();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- }
-
- return (ab8500_codec_error);
-}
-
-PRIVATE t_ab8500_codec_error ab8500_codec_SetDirection(IN
- t_ab8500_codec_direction
- ab8500_codec_direction)
-{
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
- switch (ab8500_codec_direction) {
- case AB8500_CODEC_DIRECTION_IN:
- ab8500_codec_error =
- ab8500_codec_ProgramDirection(AB8500_CODEC_DIRECTION_IN);
- break;
-
- case AB8500_CODEC_DIRECTION_OUT:
- ab8500_codec_error =
- ab8500_codec_ProgramDirection(AB8500_CODEC_DIRECTION_OUT);
- break;
-
- case AB8500_CODEC_DIRECTION_INOUT:
- ab8500_codec_error =
- ab8500_codec_ProgramDirection(AB8500_CODEC_DIRECTION_IN);
- if (AB8500_CODEC_OK == ab8500_codec_error) {
- ab8500_codec_error =
- ab8500_codec_ProgramDirection
- (AB8500_CODEC_DIRECTION_OUT);
- }
- break;
- }
-
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR5();
- if (AB8500_CODEC_OK != ab8500_codec_error) {
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR6();
- if (AB8500_CODEC_OK != ab8500_codec_error) {
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR7();
- if (AB8500_CODEC_OK != ab8500_codec_error) {
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR8();
- if (AB8500_CODEC_OK != ab8500_codec_error) {
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR9();
- if (AB8500_CODEC_OK != ab8500_codec_error) {
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR10();
- if (AB8500_CODEC_OK != ab8500_codec_error) {
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR12();
- if (AB8500_CODEC_OK != ab8500_codec_error) {
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR15();
- if (AB8500_CODEC_OK != ab8500_codec_error) {
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR63();
- if (AB8500_CODEC_OK != ab8500_codec_error) {
- return (ab8500_codec_error);
- }
-
- return (ab8500_codec_error);
-}
-
-/****************************************************************************/
-/* NAME: AB8500_CODEC_Init */
-/*--------------------------------------------------------------------------*/
-/* DESCRIPTION: */
-/* Initialize the global variables & stores the slave address of codec. */
-/* */
-/* ARGUMENTS */
-/* IN: */
-/* slave_address_of_ab8500_codec: Audio codec slave address */
-/* OUT: */
-/* None */
-/* */
-/* RETURN: */
-/* Returns AB8500_CODEC_OK */
-/* COMMENTS: */
-/* 1) Saves the supplied slave_address_of_codec in global variable */
-/*--------------------------------------------------------------------------*/
-/* REENTRANCY: Non Re-Entrant */
-
-/****************************************************************************/
-PUBLIC t_ab8500_codec_error AB8500_CODEC_Init(IN t_uint8
- slave_address_of_ab8500_codec)
-{
- DBGENTER1(" (%lx)", slave_address_of_ab8500_codec);
-
- g_ab8500_codec_system_context.slave_address_of_ab8500_codec =
- slave_address_of_ab8500_codec;
-
- DBGEXIT(AB8500_CODEC_OK);
- return (AB8500_CODEC_OK);
-}
-
-/****************************************************************************/
-/* NAME: AB8500_CODEC_Reset */
-/*--------------------------------------------------------------------------*/
-/* DESCRIPTION: */
-/* Reset the global variables and clear audiocodec settings to default. */
-/* */
-/* ARGUMENTS */
-/* IN: */
-/* None */
-/* OUT: */
-/* None */
-/* */
-/* RETURN: */
-/* AB8500_CODEC_TRANSACTION_FAILED: If transaction fails. */
-/* AB8500_CODEC_OK: if successful. */
-/*--------------------------------------------------------------------------*/
-/* REENTRANCY: Non Re-Entrant */
-
-/****************************************************************************/
-PUBLIC t_ab8500_codec_error AB8500_CODEC_Reset(void)
-{
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
-
- DBGENTER();
-
- g_ab8500_codec_system_context.ab8500_codec_direction =
- AB8500_CODEC_DEFAULT_DIRECTION;
- g_ab8500_codec_system_context.ab8500_codec_mode_in =
- AB8500_CODEC_DEFAULT_MODE_IN;
- g_ab8500_codec_system_context.ab8500_codec_mode_out =
- AB8500_CODEC_DEFAULT_MODE_OUT;
-
- g_ab8500_codec_system_context.ab8500_codec_src =
- AB8500_CODEC_DEFAULT_INPUT_SRC;
- g_ab8500_codec_system_context.ab8500_codec_dest =
- AB8500_CODEC_DEFAULT_OUTPUT_DEST;
-
- g_ab8500_codec_system_context.in_left_volume =
- AB8500_CODEC_DEFAULT_VOLUME_LEFT_IN;
- g_ab8500_codec_system_context.in_right_volume =
- AB8500_CODEC_DEFAULT_VOLUME_RIGHT_IN;
- g_ab8500_codec_system_context.out_left_volume =
- AB8500_CODEC_DEFAULT_VOLUME_LEFT_OUT;
- g_ab8500_codec_system_context.out_right_volume =
- AB8500_CODEC_DEFAULT_VOLUME_RIGHT_OUT;
-
- ab8500_codec_error = ab8500_codec_Reset();
-
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-/****************************************************************************/
-/* NAME: AB8500_CODEC_SetModeAndDirection */
-/*--------------------------------------------------------------------------*/
-/* DESCRIPTION: */
-/* Configures the whole audio codec to work in audio mode */
-/* (using I2S protocol). */
-/* */
-/* ARGUMENTS */
-/* IN: */
-/* direction: select the direction (IN, OUT or INOUT) */
-/* in_mode: codec mode for recording. If direction is OUT only, */
-/* this parameter is ignored. */
-/* out_mode: codec mode for playing. If direction is IN only, */
-/* this parameter is ignored. */
-/* p_tdm_config: TDM configuration required to be configured by user */
-/* OUT: */
-/* None */
-/* */
-/* RETURN: */
-/* AB8500_CODEC_UNSUPPORTED_FEATURE: The API may not allow setting */
-/* 2 different modes, in which case it should return this value. */
-/* AB8500_CODEC_TRANSACTION_FAILED: If transaction fails. */
-/* AB8500_CODEC_OK: if successful. */
-/*--------------------------------------------------------------------------*/
-/* REENTRANCY: Non Re-Entrant */
-
-/****************************************************************************/
-PUBLIC t_ab8500_codec_error AB8500_CODEC_SetModeAndDirection
- (IN t_ab8500_codec_direction ab8500_codec_direction,
- IN t_ab8500_codec_mode ab8500_codec_mode_in,
- IN t_ab8500_codec_mode ab8500_codec_mode_out,
- IN t_ab8500_codec_tdm_config const *const p_tdm_config) {
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- DBGENTER3(" (%lx %lx %lx)", ab8500_codec_direction,
- ab8500_codec_mode_in, ab8500_codec_mode_out);
-
- if (AB8500_CODEC_AUDIO_INTERFACE_1 ==
- g_ab8500_codec_system_context.audio_interface) {
- if (AB8500_CODEC_DIRECTION_OUT == ab8500_codec_direction
- || AB8500_CODEC_DIRECTION_INOUT == ab8500_codec_direction) {
- p_ab8500_codec_configuration->cr3_enda1 =
- AB8500_CODEC_CR3_ENDA1_ENABLED;
- p_ab8500_codec_configuration->cr3_enda2 =
- AB8500_CODEC_CR3_ENDA2_ENABLED;
- p_ab8500_codec_configuration->cr3_enda3 =
- AB8500_CODEC_CR3_ENDA3_ENABLED;
- p_ab8500_codec_configuration->cr3_enda4 =
- AB8500_CODEC_CR3_ENDA4_ENABLED;
- p_ab8500_codec_configuration->cr3_enda5 =
- AB8500_CODEC_CR3_ENDA5_ENABLED;
- p_ab8500_codec_configuration->cr3_enda6 =
- AB8500_CODEC_CR3_ENDA6_ENABLED;
-
- p_ab8500_codec_configuration->cr27_if1_bitclk_osr =
- p_tdm_config->cr27_if1_bitclk_osr;
-
- if (AB8500_CODEC_MODE_HIFI == ab8500_codec_mode_out) {
- p_ab8500_codec_configuration->cr30_fsync1p =
- AB8500_CODEC_CR30_FSYNC1P_FALLING_EDGE;
- p_ab8500_codec_configuration->cr30_bitclk1p =
- AB8500_CODEC_CR30_BITCLK1P_FALLING_EDGE;
- p_ab8500_codec_configuration->cr30_if1del =
- AB8500_CODEC_CR30_IF1DEL_DELAYED;
- p_ab8500_codec_configuration->cr30_if1format =
- AB8500_CODEC_CR30_IF1FORMAT_I2S_LEFTALIGNED;
- p_ab8500_codec_configuration->cr30_if1wl =
- p_tdm_config->cr30_if1wl;
- } else {
- p_ab8500_codec_configuration->cr30_fsync1p =
- AB8500_CODEC_CR30_FSYNC1P_FALLING_EDGE;
- p_ab8500_codec_configuration->cr30_bitclk1p =
- AB8500_CODEC_CR30_BITCLK1P_FALLING_EDGE;
- p_ab8500_codec_configuration->cr30_if1del =
- AB8500_CODEC_CR30_IF1DEL_DELAYED;
- p_ab8500_codec_configuration->cr30_if1format =
- AB8500_CODEC_CR30_IF1FORMAT_TDM;
- p_ab8500_codec_configuration->cr30_if1wl =
- p_tdm_config->cr30_if1wl;
- }
- }
-
- if (AB8500_CODEC_DIRECTION_IN == ab8500_codec_direction
- || AB8500_CODEC_DIRECTION_INOUT == ab8500_codec_direction) {
- p_ab8500_codec_configuration->cr2_enad1 =
- AB8500_CODEC_CR2_ENAD1_ENABLED;
- p_ab8500_codec_configuration->cr2_enad2 =
- AB8500_CODEC_CR2_ENAD2_ENABLED;
- p_ab8500_codec_configuration->cr2_enad3 =
- AB8500_CODEC_CR2_ENAD3_ENABLED;
- p_ab8500_codec_configuration->cr2_enad4 =
- AB8500_CODEC_CR2_ENAD4_ENABLED;
- p_ab8500_codec_configuration->cr2_enad5 =
- AB8500_CODEC_CR2_ENAD5_ENABLED;
- p_ab8500_codec_configuration->cr2_enad6 =
- AB8500_CODEC_CR2_ENAD6_ENABLED;
-
- p_ab8500_codec_configuration->cr27_if1_bitclk_osr =
- p_tdm_config->cr27_if1_bitclk_osr;
-
- if (AB8500_CODEC_MODE_HIFI == ab8500_codec_mode_in) {
- p_ab8500_codec_configuration->cr30_fsync1p =
- AB8500_CODEC_CR30_FSYNC1P_FALLING_EDGE;
- p_ab8500_codec_configuration->cr30_bitclk1p =
- AB8500_CODEC_CR30_BITCLK1P_FALLING_EDGE;
- p_ab8500_codec_configuration->cr30_if1del =
- AB8500_CODEC_CR30_IF1DEL_DELAYED;
- p_ab8500_codec_configuration->cr30_if1format =
- AB8500_CODEC_CR30_IF1FORMAT_I2S_LEFTALIGNED;
- p_ab8500_codec_configuration->cr30_if1wl =
- p_tdm_config->cr30_if1wl;
- } else {
- p_ab8500_codec_configuration->cr30_fsync1p =
- AB8500_CODEC_CR30_FSYNC1P_RISING_EDGE;
- p_ab8500_codec_configuration->cr30_bitclk1p =
- AB8500_CODEC_CR30_BITCLK1P_FALLING_EDGE;
- p_ab8500_codec_configuration->cr30_if1del =
- AB8500_CODEC_CR30_IF1DEL_NOT_DELAYED;
- p_ab8500_codec_configuration->cr30_if1format =
- AB8500_CODEC_CR30_IF1FORMAT_TDM;
- p_ab8500_codec_configuration->cr30_if1wl =
- p_tdm_config->cr30_if1wl;
- }
- }
- } else {
- if (AB8500_CODEC_DIRECTION_OUT == ab8500_codec_direction
- || AB8500_CODEC_DIRECTION_INOUT == ab8500_codec_direction) {
- p_ab8500_codec_configuration->cr3_enda1 =
- AB8500_CODEC_CR3_ENDA1_ENABLED;
- p_ab8500_codec_configuration->cr3_enda2 =
- AB8500_CODEC_CR3_ENDA2_ENABLED;
- p_ab8500_codec_configuration->cr3_enda3 =
- AB8500_CODEC_CR3_ENDA3_ENABLED;
- p_ab8500_codec_configuration->cr3_enda4 =
- AB8500_CODEC_CR3_ENDA4_ENABLED;
- p_ab8500_codec_configuration->cr3_enda5 =
- AB8500_CODEC_CR3_ENDA5_ENABLED;
- p_ab8500_codec_configuration->cr3_enda6 =
- AB8500_CODEC_CR3_ENDA6_ENABLED;
-
- p_ab8500_codec_configuration->cr27_if0_bitclk_osr =
- p_tdm_config->cr27_if0_bitclk_osr;
-
- p_ab8500_codec_configuration->cr63_datohslen =
- AB8500_CODEC_CR63_DATOHSLEN_ENABLED;
- p_ab8500_codec_configuration->cr63_datohsren =
- AB8500_CODEC_CR63_DATOHSREN_ENABLED;
-
- if (AB8500_CODEC_MODE_HIFI == ab8500_codec_mode_out) {
- p_ab8500_codec_configuration->cr28_fsync0p =
- AB8500_CODEC_CR28_FSYNC0P_FALLING_EDGE;
- p_ab8500_codec_configuration->cr28_bitclk0p = p_tdm_config->cr28_bitclk0p; /*AB8500_CODEC_CR28_BITCLK0P_FALLING_EDGE; */
- p_ab8500_codec_configuration->cr28_if0del = p_tdm_config->cr28_if0del; /*AB8500_CODEC_CR28_IF0DEL_DELAYED; */
- p_ab8500_codec_configuration->cr28_if0format =
- AB8500_CODEC_CR28_IF0FORMAT_I2S_LEFTALIGNED;
- p_ab8500_codec_configuration->cr28_if0wl =
- p_tdm_config->cr28_if0wl;
- } else {
- p_ab8500_codec_configuration->cr28_fsync0p =
- AB8500_CODEC_CR28_FSYNC0P_FALLING_EDGE;
- p_ab8500_codec_configuration->cr28_bitclk0p = p_tdm_config->cr28_bitclk0p; /*AB8500_CODEC_CR28_BITCLK0P_FALLING_EDGE; */
- p_ab8500_codec_configuration->cr28_if0del = p_tdm_config->cr28_if0del; /*AB8500_CODEC_CR28_IF0DEL_DELAYED; */
- p_ab8500_codec_configuration->cr28_if0format =
- AB8500_CODEC_CR28_IF0FORMAT_TDM;
- p_ab8500_codec_configuration->cr28_if0wl =
- p_tdm_config->cr28_if0wl;
- }
- }
-
- if (AB8500_CODEC_DIRECTION_IN == ab8500_codec_direction
- || AB8500_CODEC_DIRECTION_INOUT == ab8500_codec_direction) {
- p_ab8500_codec_configuration->cr2_enad1 =
- AB8500_CODEC_CR2_ENAD1_ENABLED;
- p_ab8500_codec_configuration->cr2_enad2 =
- AB8500_CODEC_CR2_ENAD2_ENABLED;
- p_ab8500_codec_configuration->cr2_enad3 =
- AB8500_CODEC_CR2_ENAD3_ENABLED;
- p_ab8500_codec_configuration->cr2_enad4 =
- AB8500_CODEC_CR2_ENAD4_ENABLED;
- p_ab8500_codec_configuration->cr2_enad5 =
- AB8500_CODEC_CR2_ENAD5_ENABLED;
- p_ab8500_codec_configuration->cr2_enad6 =
- AB8500_CODEC_CR2_ENAD6_ENABLED;
-
- p_ab8500_codec_configuration->cr26_ad1_voice =
- AB8500_CODEC_CR26_AD1_VOICE_LOWLATENCYFILTER;
- p_ab8500_codec_configuration->cr26_ad2_voice =
- AB8500_CODEC_CR26_AD2_VOICE_LOWLATENCYFILTER;
- p_ab8500_codec_configuration->cr26_ad3_voice =
- AB8500_CODEC_CR26_AD3_VOICE_LOWLATENCYFILTER;
- p_ab8500_codec_configuration->cr26_ad4_voice =
- AB8500_CODEC_CR26_AD4_VOICE_LOWLATENCYFILTER;
-
- p_ab8500_codec_configuration->cr27_if0_bitclk_osr =
- p_tdm_config->cr27_if0_bitclk_osr;
-
- if (AB8500_CODEC_MODE_HIFI == ab8500_codec_mode_in) {
- p_ab8500_codec_configuration->cr28_fsync0p =
- AB8500_CODEC_CR28_FSYNC0P_RISING_EDGE;
- p_ab8500_codec_configuration->cr28_bitclk0p = p_tdm_config->cr28_bitclk0p; /*AB8500_CODEC_CR28_BITCLK0P_RISING_EDGE; */
- p_ab8500_codec_configuration->cr28_if0del = p_tdm_config->cr28_if0del; /*AB8500_CODEC_CR28_IF0DEL_NOT_DELAYED; */
- p_ab8500_codec_configuration->cr28_if0format =
- AB8500_CODEC_CR28_IF0FORMAT_I2S_LEFTALIGNED;
- p_ab8500_codec_configuration->cr28_if0wl =
- p_tdm_config->cr28_if0wl;
- } else {
- p_ab8500_codec_configuration->cr28_fsync0p =
- AB8500_CODEC_CR28_FSYNC0P_RISING_EDGE;
- p_ab8500_codec_configuration->cr28_bitclk0p = p_tdm_config->cr28_bitclk0p; /*AB8500_CODEC_CR28_BITCLK0P_FALLING_EDGE; */
- p_ab8500_codec_configuration->cr28_if0del = p_tdm_config->cr28_if0del; /*AB8500_CODEC_CR28_IF0DEL_NOT_DELAYED; */
- p_ab8500_codec_configuration->cr28_if0format =
- AB8500_CODEC_CR28_IF0FORMAT_TDM;
- p_ab8500_codec_configuration->cr28_if0wl =
- p_tdm_config->cr28_if0wl;
- }
- }
- }
-
- ab8500_codec_error = ab8500_codec_SetModeAndDirectionUpdateCR();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- g_ab8500_codec_system_context.ab8500_codec_direction =
- ab8500_codec_direction;
- g_ab8500_codec_system_context.ab8500_codec_mode_in =
- ab8500_codec_mode_in;
- g_ab8500_codec_system_context.ab8500_codec_mode_out =
- ab8500_codec_mode_out;
-
- ab8500_codec_error = ab8500_codec_SetDirection(ab8500_codec_direction);
-
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-/****************************************************************************/
-/* NAME: AB8500_CODEC_SetSrcVolume */
-/*--------------------------------------------------------------------------*/
-/* DESCRIPTION: */
-/* Sets the record volumes. */
-/* */
-/* ARGUMENTS */
-/* IN: */
-/* t_ab8500_codec_src: select source device for recording. */
-/* in_left_volume: record volume for left channel. */
-/* in_right_volume: record volume for right channel. */
-/* OUT: */
-/* None */
-/* */
-/* RETURN: */
-/* AB8500_CODEC_TRANSACTION_FAILED: If transaction fails. */
-/* AB8500_CODEC_OK: if successful. */
-/*--------------------------------------------------------------------------*/
-/* REENTRANCY: Non Re-Entrant */
-
-/****************************************************************************/
-PUBLIC t_ab8500_codec_error AB8500_CODEC_SetSrcVolume
- (IN t_ab8500_codec_src src_device,
- IN t_uint8 in_left_volume, IN t_uint8 in_right_volume) {
- t_ab8500_codec_error ab8500_codec_error;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
- DBGENTER3(" (%lx %lx %lx)", src_device, in_left_volume,
- in_right_volume);
-
- if (in_left_volume > AB8500_CODEC_MAX_VOLUME) {
- in_left_volume = AB8500_CODEC_MAX_VOLUME;
- }
-
- if (in_right_volume > AB8500_CODEC_MAX_VOLUME) {
- in_right_volume = AB8500_CODEC_MAX_VOLUME;
- }
-
- g_ab8500_codec_system_context.in_left_volume = in_left_volume;
- g_ab8500_codec_system_context.in_right_volume = in_right_volume;
-
- p_ab8500_codec_configuration->cr65_ad1gain =
- AB8500_CODEC_AD_D_VOLUME_MIN +
- (in_left_volume *
- (AB8500_CODEC_AD_D_VOLUME_MAX -
- AB8500_CODEC_AD_D_VOLUME_MIN)) / 100;
- p_ab8500_codec_configuration->cr66_ad2gain =
- AB8500_CODEC_AD_D_VOLUME_MIN +
- (in_left_volume *
- (AB8500_CODEC_AD_D_VOLUME_MAX -
- AB8500_CODEC_AD_D_VOLUME_MIN)) / 100;
- p_ab8500_codec_configuration->cr67_ad3gain =
- AB8500_CODEC_AD_D_VOLUME_MIN +
- (in_left_volume *
- (AB8500_CODEC_AD_D_VOLUME_MAX -
- AB8500_CODEC_AD_D_VOLUME_MIN)) / 100;
- p_ab8500_codec_configuration->cr68_ad4gain =
- AB8500_CODEC_AD_D_VOLUME_MIN +
- (in_left_volume *
- (AB8500_CODEC_AD_D_VOLUME_MAX -
- AB8500_CODEC_AD_D_VOLUME_MIN)) / 100;
- p_ab8500_codec_configuration->cr69_ad5gain =
- AB8500_CODEC_AD_D_VOLUME_MIN +
- (in_left_volume *
- (AB8500_CODEC_AD_D_VOLUME_MAX -
- AB8500_CODEC_AD_D_VOLUME_MIN)) / 100;
- p_ab8500_codec_configuration->cr70_ad6gain =
- AB8500_CODEC_AD_D_VOLUME_MIN +
- (in_left_volume *
- (AB8500_CODEC_AD_D_VOLUME_MAX -
- AB8500_CODEC_AD_D_VOLUME_MIN)) / 100;
-
- /* Set mininimum volume if volume is zero */
- switch (src_device) {
- case AB8500_CODEC_SRC_LINEIN:
- p_ab8500_codec_configuration->cr22_linl_gain =
- AB8500_CODEC_LINEIN_VOLUME_MIN +
- (in_left_volume *
- (AB8500_CODEC_LINEIN_VOLUME_MAX -
- AB8500_CODEC_LINEIN_VOLUME_MIN)) / 100;
- p_ab8500_codec_configuration->cr23_linr_gain =
- AB8500_CODEC_LINEIN_VOLUME_MIN +
- (in_right_volume *
- (AB8500_CODEC_LINEIN_VOLUME_MAX -
- AB8500_CODEC_LINEIN_VOLUME_MIN)) / 100;
- break;
-
- case AB8500_CODEC_SRC_MICROPHONE_1A:
- case AB8500_CODEC_SRC_MICROPHONE_1B:
- p_ab8500_codec_configuration->cr20_mic1_gain =
- AB8500_CODEC_MIC_VOLUME_MIN +
- (in_left_volume *
- (AB8500_CODEC_MIC_VOLUME_MAX -
- AB8500_CODEC_MIC_VOLUME_MIN)) / 100;
- break;
-
- case AB8500_CODEC_SRC_MICROPHONE_2:
- p_ab8500_codec_configuration->cr21_mic2_gain =
- AB8500_CODEC_MIC_VOLUME_MIN +
- (in_left_volume *
- (AB8500_CODEC_MIC_VOLUME_MAX -
- AB8500_CODEC_MIC_VOLUME_MIN)) / 100;
- break;
-
- case AB8500_CODEC_SRC_D_MICROPHONE_1:
- break;
-
- case AB8500_CODEC_SRC_D_MICROPHONE_2:
- break;
-
- case AB8500_CODEC_SRC_D_MICROPHONE_3:
- break;
-
- case AB8500_CODEC_SRC_D_MICROPHONE_4:
- break;
-
- case AB8500_CODEC_SRC_D_MICROPHONE_5:
- break;
-
- case AB8500_CODEC_SRC_D_MICROPHONE_6:
- break;
-
- case AB8500_CODEC_SRC_ALL:
- p_ab8500_codec_configuration->cr22_linl_gain =
- AB8500_CODEC_LINEIN_VOLUME_MIN +
- (in_left_volume *
- (AB8500_CODEC_LINEIN_VOLUME_MAX -
- AB8500_CODEC_LINEIN_VOLUME_MIN)) / 100;
- p_ab8500_codec_configuration->cr23_linr_gain =
- AB8500_CODEC_LINEIN_VOLUME_MIN +
- (in_right_volume *
- (AB8500_CODEC_LINEIN_VOLUME_MAX -
- AB8500_CODEC_LINEIN_VOLUME_MIN)) / 100;
-
- p_ab8500_codec_configuration->cr20_mic1_gain =
- AB8500_CODEC_MIC_VOLUME_MIN +
- (in_left_volume *
- (AB8500_CODEC_MIC_VOLUME_MAX -
- AB8500_CODEC_MIC_VOLUME_MIN)) / 100;
-
- p_ab8500_codec_configuration->cr21_mic2_gain =
- AB8500_CODEC_MIC_VOLUME_MIN +
- (in_left_volume *
- (AB8500_CODEC_MIC_VOLUME_MAX -
- AB8500_CODEC_MIC_VOLUME_MIN)) / 100;
- break;
-
- default:
- ab8500_codec_error = AB8500_CODEC_INVALID_PARAMETER;
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_SetSrcVolumeUpdateCR();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-/****************************************************************************/
-/* NAME: AB8500_CODEC_SetDestVolume */
-/*--------------------------------------------------------------------------*/
-/* DESCRIPTION: */
-/* Sets the play volumes. */
-/* */
-/* ARGUMENTS */
-/* IN: */
-/* out_left_volume: play volume for left channel. */
-/* out_right_volume: play volume for right channel. */
-/* OUT: */
-/* None */
-/* */
-/* RETURN: */
-/* AB8500_CODEC_TRANSACTION_FAILED: If transaction fails. */
-/* AB8500_CODEC_OK: if successful. */
-/*--------------------------------------------------------------------------*/
-/* REENTRANCY: Non Re-Entrant */
-
-/****************************************************************************/
-PUBLIC t_ab8500_codec_error AB8500_CODEC_SetDestVolume
- (IN t_ab8500_codec_dest dest_device,
- IN t_uint8 out_left_volume, IN t_uint8 out_right_volume) {
- t_ab8500_codec_error ab8500_codec_error;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
- DBGENTER3(" (%lx %lx %lx)", dest_device, out_left_volume,
- out_right_volume);
-
- if (out_left_volume > AB8500_CODEC_MAX_VOLUME) {
- out_left_volume = AB8500_CODEC_MAX_VOLUME;
- }
-
- if (out_right_volume > AB8500_CODEC_MAX_VOLUME) {
- out_right_volume = AB8500_CODEC_MAX_VOLUME;
- }
-
- g_ab8500_codec_system_context.out_left_volume = out_left_volume;
- g_ab8500_codec_system_context.out_right_volume = out_right_volume;
-
- p_ab8500_codec_configuration->cr71_da1gain =
- AB8500_CODEC_DA_D_VOLUME_MIN +
- (out_left_volume *
- (AB8500_CODEC_DA_D_VOLUME_MAX -
- AB8500_CODEC_DA_D_VOLUME_MIN)) / 100;
- p_ab8500_codec_configuration->cr72_da2gain =
- AB8500_CODEC_DA_D_VOLUME_MIN +
- (out_left_volume *
- (AB8500_CODEC_DA_D_VOLUME_MAX -
- AB8500_CODEC_DA_D_VOLUME_MIN)) / 100;
- p_ab8500_codec_configuration->cr73_da3gain =
- AB8500_CODEC_DA_D_VOLUME_MIN +
- (out_left_volume *
- (AB8500_CODEC_DA_D_VOLUME_MAX -
- AB8500_CODEC_DA_D_VOLUME_MIN)) / 100;
- p_ab8500_codec_configuration->cr74_da4gain =
- AB8500_CODEC_DA_D_VOLUME_MIN +
- (out_left_volume *
- (AB8500_CODEC_DA_D_VOLUME_MAX -
- AB8500_CODEC_DA_D_VOLUME_MIN)) / 100;
- p_ab8500_codec_configuration->cr75_da5gain =
- AB8500_CODEC_DA_D_VOLUME_MIN +
- (out_left_volume *
- (AB8500_CODEC_DA_D_VOLUME_MAX -
- AB8500_CODEC_DA_D_VOLUME_MIN)) / 100;
- p_ab8500_codec_configuration->cr76_da6gain =
- AB8500_CODEC_DA_D_VOLUME_MIN +
- (out_left_volume *
- (AB8500_CODEC_DA_D_VOLUME_MAX -
- AB8500_CODEC_DA_D_VOLUME_MIN)) / 100;
-
- /* Set mininimum volume if volume is zero */
- switch (dest_device) {
- case AB8500_CODEC_DEST_HEADSET:
- p_ab8500_codec_configuration->cr22_hsl_gain =
- AB8500_CODEC_HEADSET_VOLUME_MIN +
- (out_left_volume *
- (AB8500_CODEC_HEADSET_VOLUME_MAX -
- AB8500_CODEC_HEADSET_VOLUME_MIN)) / 100;
- p_ab8500_codec_configuration->cr23_hsr_gain =
- AB8500_CODEC_HEADSET_VOLUME_MIN +
- (out_right_volume *
- (AB8500_CODEC_HEADSET_VOLUME_MAX -
- AB8500_CODEC_HEADSET_VOLUME_MIN)) / 100;
-
- p_ab8500_codec_configuration->cr79_hsldgain =
- AB8500_CODEC_HEADSET_D_VOLUME_0DB;
- p_ab8500_codec_configuration->cr80_hsrdgain =
- AB8500_CODEC_HEADSET_D_VOLUME_0DB;
- break;
-
- case AB8500_CODEC_DEST_EARPIECE:
- p_ab8500_codec_configuration->cr79_hsldgain =
- AB8500_CODEC_HEADSET_D_VOLUME_0DB;
- break;
-
- case AB8500_CODEC_DEST_HANDSFREE:
-
- p_ab8500_codec_configuration->cr101_parlhf =
- AB8500_CODEC_CR101_PARLHF_INDEPENDENT;
- p_ab8500_codec_configuration->cr101_parlvib =
- AB8500_CODEC_CR101_PARLVIB_INDEPENDENT;
- p_ab8500_codec_configuration->cr101_classd_viblswapen =
- AB8500_CODEC_CR101_CLASSD_VIBLSWAPEN_DISABLED;
- p_ab8500_codec_configuration->cr101_classd_vibrswapen =
- AB8500_CODEC_CR101_CLASSD_VIBRSWAPEN_DISABLED;
- p_ab8500_codec_configuration->cr101_classd_hflswapen =
- AB8500_CODEC_CR101_CLASSD_HFLSWAPEN_DISABLED;
- p_ab8500_codec_configuration->cr101_classd_hfrswapen =
- AB8500_CODEC_CR101_CLASSD_HFRSWAPEN_DISABLED;
-
- p_ab8500_codec_configuration->cr102_classd_firbyp =
- AB8500_CODEC_CR102_CLASSD_FIRBYP_ALL_ENABLED;
- p_ab8500_codec_configuration->cr102_classd_highvolen =
- AB8500_CODEC_CR102_CLASSD_HIGHVOLEN_DISABLED;
-
- p_ab8500_codec_configuration->cr103_classd_ditherhpgain = 0x8;
- p_ab8500_codec_configuration->cr103_classd_ditherwgain = 0x4;
-
- break;
-
- case AB8500_CODEC_DEST_VIBRATOR_L:
- p_ab8500_codec_configuration->cr16_pwmnldutycycle =
- AB8500_CODEC_VIBRATOR_VOLUME_MIN;
- p_ab8500_codec_configuration->cr17_pwmpldutycycle =
- AB8500_CODEC_VIBRATOR_VOLUME_MIN +
- (out_right_volume *
- (AB8500_CODEC_VIBRATOR_VOLUME_MAX -
- AB8500_CODEC_VIBRATOR_VOLUME_MIN)) / 100;
- break;
-
- case AB8500_CODEC_DEST_VIBRATOR_R:
- p_ab8500_codec_configuration->cr18_pwmnrdutycycle =
- AB8500_CODEC_VIBRATOR_VOLUME_MIN;
- p_ab8500_codec_configuration->cr19_pwmprdutycycle =
- AB8500_CODEC_VIBRATOR_VOLUME_MIN +
- (out_right_volume *
- (AB8500_CODEC_VIBRATOR_VOLUME_MAX -
- AB8500_CODEC_VIBRATOR_VOLUME_MIN)) / 100;
- break;
-
- case AB8500_CODEC_DEST_ALL:
- p_ab8500_codec_configuration->cr22_hsl_gain =
- AB8500_CODEC_HEADSET_VOLUME_MIN +
- (out_left_volume *
- (AB8500_CODEC_HEADSET_VOLUME_MAX -
- AB8500_CODEC_HEADSET_VOLUME_MIN)) / 100;
- p_ab8500_codec_configuration->cr23_hsr_gain =
- AB8500_CODEC_HEADSET_VOLUME_MIN +
- (out_right_volume *
- (AB8500_CODEC_HEADSET_VOLUME_MAX -
- AB8500_CODEC_HEADSET_VOLUME_MIN)) / 100;
-
- p_ab8500_codec_configuration->cr79_hsldgain =
- AB8500_CODEC_HEADSET_D_VOLUME_0DB;
- break;
-
- default:
- ab8500_codec_error = AB8500_CODEC_INVALID_PARAMETER;
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_SetDestVolumeUpdateCR();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-/****************************************************************************/
-/* NAME: AB8500_CODEC_SetMasterMode */
-/*--------------------------------------------------------------------------*/
-/* DESCRIPTION: */
-/* Set the Audio Codec in Master mode. */
-/* */
-/* ARGUMENTS */
-/* IN: t_codec_master_mode: Enable/disable master mode */
-/* OUT: */
-/* None */
-/* RETURN: */
-/* AB8500_CODEC_TRANSACTION_FAILED: If transaction fails. */
-/* AB8500_CODEC_OK: if successful. */
-/* REMARK: Call this API after calling AB8500_CODEC_SetModeAndDirection() API*/
-/*--------------------------------------------------------------------------*/
-/* REENTRANCY: Non Re-Entrant */
-
-/****************************************************************************/
-PUBLIC t_ab8500_codec_error AB8500_CODEC_SetMasterMode(IN
- t_ab8500_codec_master_mode
- mode)
-{
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
- DBGENTER0();
-
- if (AB8500_CODEC_AUDIO_INTERFACE_1 ==
- g_ab8500_codec_system_context.audio_interface) {
-
- p_ab8500_codec_configuration->cr27_en_mastgen =
- AB8500_CODEC_CR27_EN_MASTGEN_ENABLED;
- p_ab8500_codec_configuration->cr27_enfs_bitclk1 =
- AB8500_CODEC_CR27_ENFS_BITCLK1_ENABLED;
-
- if (AB8500_CODEC_MASTER_MODE_ENABLE == mode) {
- p_ab8500_codec_configuration->cr29_if1master =
- AB8500_CODEC_CR29_IF1MASTER_FS1CK1_OUTPUT;
- } else {
- p_ab8500_codec_configuration->cr29_if1master =
- AB8500_CODEC_CR29_IF1MASTER_FS1CK1_INPUT;
- }
-
- } else {
-
- p_ab8500_codec_configuration->cr27_en_mastgen =
- AB8500_CODEC_CR27_EN_MASTGEN_ENABLED;
- p_ab8500_codec_configuration->cr27_enfs_bitclk0 =
- AB8500_CODEC_CR27_ENFS_BITCLK0_ENABLED;
-
- if (AB8500_CODEC_MASTER_MODE_ENABLE == mode) {
- p_ab8500_codec_configuration->cr29_if0master =
- AB8500_CODEC_CR29_IF0MASTER_FS0CK0_OUTPUT;
- } else {
- p_ab8500_codec_configuration->cr29_if0master =
- AB8500_CODEC_CR29_IF0MASTER_FS0CK0_INPUT;
- }
-
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR27();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR29();
-
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-/****************************************************************************/
-/* NAME: AB8500_CODEC_SelectInput */
-/*--------------------------------------------------------------------------*/
-/* DESCRIPTION: */
-/* Select input source for recording. */
-/* */
-/* ARGUMENTS */
-/* IN: */
-/* input_src: select input source for recording when several sources */
-/* are supported in codec. */
-/* OUT: */
-/* None */
-/* */
-/* RETURN: */
-/* AB8500_CODEC_INVALID_PARAMETER: If input_src provided is invalid */
-/* by the codec hardware in use. */
-/* AB8500_CODEC_TRANSACTION_FAILED: If transaction fails. */
-/* AB8500_CODEC_OK: if successful. */
-/*--------------------------------------------------------------------------*/
-/* REENTRANCY: Non Re-Entrant */
-
-/****************************************************************************/
-PUBLIC t_ab8500_codec_error AB8500_CODEC_SelectInput(IN t_ab8500_codec_src
- ab8500_codec_src)
-{
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
- DBGENTER1(" (%lx)", ab8500_codec_src);
-
- g_ab8500_codec_system_context.ab8500_codec_src = ab8500_codec_src;
-
- ab8500_codec_error =
- ab8500_codec_SetDirection(AB8500_CODEC_DIRECTION_IN);
-
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-/****************************************************************************/
-/* NAME: AB8500_CODEC_SelectOutput */
-/*--------------------------------------------------------------------------*/
-/* DESCRIPTION: */
-/* Select output desination for playing. */
-/* */
-/* ARGUMENTS */
-/* IN: */
-/* output_dest: select output destination for playing when several are */
-/* supported by codec hardware. */
-/* OUT: */
-/* None */
-/* */
-/* RETURN: */
-/* AB8500_CODEC_INVALID_PARAMETER: If output_src provided is invalid */
-/* AB8500_CODEC_TRANSACTION_FAILED: If transaction fails. */
-/* AB8500_CODEC_OK: if successful. */
-/*--------------------------------------------------------------------------*/
-/* REENTRANCY: Non Re-Entrant */
-
-/****************************************************************************/
-PUBLIC t_ab8500_codec_error AB8500_CODEC_SelectOutput(IN t_ab8500_codec_dest
- ab8500_codec_dest)
-{
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
- g_ab8500_codec_system_context.ab8500_codec_dest = ab8500_codec_dest;
- DBGENTER1(" (%lx)", ab8500_codec_dest);
-
- ab8500_codec_error =
- ab8500_codec_SetDirection(AB8500_CODEC_DIRECTION_OUT);
-
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-/****************************************************************************/
-/* NAME: AB8500_CODEC_PowerDown */
-/*--------------------------------------------------------------------------*/
-/* DESCRIPTION: */
-/* Shuts the audio codec down completely. */
-/* */
-/* ARGUMENTS */
-/* IN: */
-/* OUT: */
-/* */
-/* RETURN: */
-/* AB8500_CODEC_TRANSACTION_FAILED: If transaction fails. */
-/* AB8500_CODEC_OK: if successful. */
-/*--------------------------------------------------------------------------*/
-/* REENTRANCY: Non Re-Entrant */
-
-/****************************************************************************/
-PUBLIC t_ab8500_codec_error AB8500_CODEC_PowerDown(void)
-{
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
-
- g_ab8500_codec_system_context.ab8500_codec_configuration.cr0_powerup =
- AB8500_CODEC_CR0_POWERUP_OFF;
-
- ab8500_codec_error = ab8500_codec_UpdateCR0();
-
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-/****************************************************************************/
-/* NAME: AB8500_CODEC_PowerUp */
-/*--------------------------------------------------------------------------*/
-/* DESCRIPTION: */
-/* Switch on the audio codec. */
-/* */
-/* ARGUMENTS */
-/* IN: */
-/* None */
-/* OUT: */
-/* None */
-/* RETURN: */
-/* AB8500_CODEC_TRANSACTION_FAILED: If transaction fails. */
-/* CODEC_OK: if successful. */
-/*--------------------------------------------------------------------------*/
-/* REENTRANCY: Non Re-Entrant */
-
-/****************************************************************************/
-PUBLIC t_ab8500_codec_error AB8500_CODEC_PowerUp(void)
-{
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
-
- DBGENTER();
-
- /*g_ab8500_codec_system_context.ab8500_codec_configuration.cr1_swreset = AB8500_CODEC_CR1_SWRESET_ENABLED; Removed by kardad
- ab8500_codec_error = ab8500_codec_UpdateCR1();
- if (AB8500_CODEC_OK != ab8500_codec_error)
- {
- return(ab8500_codec_error);
- } */
-
- g_ab8500_codec_system_context.ab8500_codec_configuration.cr0_powerup =
- AB8500_CODEC_CR0_POWERUP_ON;
- g_ab8500_codec_system_context.ab8500_codec_configuration.cr0_enaana =
- AB8500_CODEC_CR0_ENAANA_ON;
-
- ab8500_codec_error = ab8500_codec_UpdateCR0();
-
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-/****************************************************************************/
-/* NAME: AB8500_CODEC_SelectInterface */
-/*--------------------------------------------------------------------------*/
-/* DESCRIPTION: */
-/* Select the Audio Interface 0 or 1. */
-/* */
-/* ARGUMENTS */
-/* IN: t_ab8500_codec_audio_interface: The selected interface */
-/* */
-/* OUT: */
-/* None */
-/* RETURN: */
-/* AB8500_CODEC_OK: Always. */
-/* REMARK: Call this API before using a function of the low level drivers */
-/* to select the interface that you want to configure */
-/*--------------------------------------------------------------------------*/
-/* REENTRANCY: Non Re-Entrant */
-
-/****************************************************************************/
-PUBLIC t_ab8500_codec_error AB8500_CODEC_SelectInterface(IN
- t_ab8500_codec_audio_interface
- audio_interface)
-{
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
- DBGENTER0();
-
- g_ab8500_codec_system_context.audio_interface = audio_interface;
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-/****************************************************************************/
-/* NAME: AB8500_CODEC_GetInterface */
-/*--------------------------------------------------------------------------*/
-/* DESCRIPTION: */
-/* Get the Audio Interface 0 or 1. */
-/* */
-/* ARGUMENTS */
-/* IN: */
-/* None */
-/* OUT: p_audio_interface: Store the selected interface */
-/* RETURN: */
-/* AB8500_CODEC_OK: Always */
-/*--------------------------------------------------------------------------*/
-/* REENTRANCY: Re-Entrant */
-/* REENTRANCY ISSUES: No Issues */
-
-/****************************************************************************/
-PUBLIC t_ab8500_codec_error AB8500_CODEC_GetInterface(OUT
- t_ab8500_codec_audio_interface
- * p_audio_interface)
-{
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
- DBGENTER0();
-
- *p_audio_interface = g_ab8500_codec_system_context.audio_interface;
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-/****************************************************************************/
-/* NAME: AB8500_CODEC_SetAnalogLoopback */
-/*--------------------------------------------------------------------------*/
-/* DESCRIPTION: */
-/* Sets Line-In to HeadSet loopback with the required gain. */
-/* */
-/* ARGUMENTS */
-/* IN: */
-/* out_left_volume: play volume for left channel. */
-/* out_right_volume: play volume for right channel. */
-/* OUT: */
-/* None */
-/* */
-/* RETURN: */
-/* AB8500_CODEC_TRANSACTION_FAILED: If transaction fails. */
-/* AB8500_CODEC_OK: if successful. */
-/*--------------------------------------------------------------------------*/
-/* REENTRANCY: Non Re-Entrant */
-
-/****************************************************************************/
-PUBLIC t_ab8500_codec_error AB8500_CODEC_SetAnalogLoopback(IN t_uint8
- out_left_volume,
- IN t_uint8
- out_right_volume)
-{
- t_ab8500_codec_error ab8500_codec_error;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
- DBGENTER2(" (%lx %lx)", out_left_volume, out_right_volume);
-
- if (out_left_volume > AB8500_CODEC_MAX_VOLUME) {
- out_left_volume = AB8500_CODEC_MAX_VOLUME;
- }
-
- if (out_right_volume > AB8500_CODEC_MAX_VOLUME) {
- out_right_volume = AB8500_CODEC_MAX_VOLUME;
- }
-
- g_ab8500_codec_system_context.out_left_volume = out_left_volume;
- g_ab8500_codec_system_context.out_right_volume = out_right_volume;
-
- p_ab8500_codec_configuration->cr24_lintohsl_gain =
- AB8500_CODEC_LINEIN_TO_HS_L_R_VOLUME_MIN +
- (out_left_volume *
- (AB8500_CODEC_LINEIN_TO_HS_L_R_VOLUME_MAX -
- AB8500_CODEC_LINEIN_TO_HS_L_R_VOLUME_MIN)) / 100;
- p_ab8500_codec_configuration->cr25_lintohsr_gain =
- AB8500_CODEC_LINEIN_TO_HS_L_R_VOLUME_MIN +
- (out_right_volume *
- (AB8500_CODEC_LINEIN_TO_HS_L_R_VOLUME_MAX -
- AB8500_CODEC_LINEIN_TO_HS_L_R_VOLUME_MIN)) / 100;
-
- ab8500_codec_error = ab8500_codec_UpdateCR24();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR25();
-
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-/****************************************************************************/
-/* NAME: AB8500_CODEC_RemoveAnalogLoopback */
-/*--------------------------------------------------------------------------*/
-/* DESCRIPTION: */
-/* Remove Line-In to HeadSet loopback. */
-/* */
-/* ARGUMENTS */
-/* IN: */
-/* None */
-/* OUT: */
-/* None */
-/* */
-/* RETURN: */
-/* AB8500_CODEC_TRANSACTION_FAILED: If transaction fails. */
-/* AB8500_CODEC_OK: if successful. */
-/*--------------------------------------------------------------------------*/
-/* REENTRANCY: Non Re-Entrant */
-
-/****************************************************************************/
-PUBLIC t_ab8500_codec_error AB8500_CODEC_RemoveAnalogLoopback(void)
-{
- t_ab8500_codec_error ab8500_codec_error;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
- DBGENTER0();
-
- p_ab8500_codec_configuration->cr24_lintohsl_gain =
- AB8500_CODEC_LINEIN_TO_HS_L_R_LOOP_OPEN;
- p_ab8500_codec_configuration->cr25_lintohsr_gain =
- AB8500_CODEC_LINEIN_TO_HS_L_R_LOOP_OPEN;
-
- ab8500_codec_error = ab8500_codec_UpdateCR24();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR25();
-
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-/****************************************************************************/
-/* NAME: AB8500_CODEC_EnableBypassMode */
-/*--------------------------------------------------------------------------*/
-/* DESCRIPTION: */
-/* Enables IF0 to IF1 path or vice versa */
-/* */
-/* ARGUMENTS */
-/* IN: */
-/* None */
-/* OUT: */
-/* None */
-/* */
-/* RETURN: */
-/* AB8500_CODEC_TRANSACTION_FAILED: If transaction fails. */
-/* AB8500_CODEC_OK: if successful. */
-/*--------------------------------------------------------------------------*/
-/* REENTRANCY: Non Re-Entrant */
-
-/****************************************************************************/
-PUBLIC t_ab8500_codec_error AB8500_CODEC_EnableBypassMode(void)
-{
- t_ab8500_codec_error ab8500_codec_error;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
- DBGENTER0();
-
- if (AB8500_CODEC_AUDIO_INTERFACE_1 ==
- g_ab8500_codec_system_context.audio_interface) {
- p_ab8500_codec_configuration->cr29_if1datoif0ad =
- AB8500_CODEC_CR29_IF1DATOIF0AD_SENT;
- p_ab8500_codec_configuration->cr29_if1cktoif0ck =
- AB8500_CODEC_CR29_IF1CKTOIF0CK_SENT;
- } else {
- p_ab8500_codec_configuration->cr29_if0datoif1ad =
- AB8500_CODEC_CR29_IF0DATOIF1AD_SENT;
- p_ab8500_codec_configuration->cr29_if0cktoif1ck =
- AB8500_CODEC_CR29_IF0CKTOIF1CK_SENT;
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR29();
-
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-/****************************************************************************/
-/* NAME: AB8500_CODEC_DisableBypassMode */
-/*--------------------------------------------------------------------------*/
-/* DESCRIPTION: */
-/* Disables IF0 to IF1 path or vice versa */
-/* */
-/* ARGUMENTS */
-/* IN: */
-/* None */
-/* OUT: */
-/* None */
-/* */
-/* RETURN: */
-/* AB8500_CODEC_TRANSACTION_FAILED: If transaction fails. */
-/* AB8500_CODEC_OK: if successful. */
-/*--------------------------------------------------------------------------*/
-/* REENTRANCY: Non Re-Entrant */
-
-/****************************************************************************/
-PUBLIC t_ab8500_codec_error AB8500_CODEC_DisableBypassMode(void)
-{
- t_ab8500_codec_error ab8500_codec_error;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
- DBGENTER0();
-
- if (AB8500_CODEC_AUDIO_INTERFACE_1 ==
- g_ab8500_codec_system_context.audio_interface) {
- p_ab8500_codec_configuration->cr29_if1datoif0ad =
- AB8500_CODEC_CR29_IF1DATOIF0AD_NOTSENT;
- p_ab8500_codec_configuration->cr29_if1cktoif0ck =
- AB8500_CODEC_CR29_IF1CKTOIF0CK_NOTSENT;
- } else {
- p_ab8500_codec_configuration->cr29_if0datoif1ad =
- AB8500_CODEC_CR29_IF0DATOIF1AD_NOTSENT;
- p_ab8500_codec_configuration->cr29_if0cktoif1ck =
- AB8500_CODEC_CR29_IF0CKTOIF1CK_NOTSENT;
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR29();
-
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-/****************************************************************************/
-/* NAME: AB8500_CODEC_SrcPowerControl */
-/*--------------------------------------------------------------------------*/
-/* DESCRIPTION: */
-/* Enables/Disables & UnMute/Mute the desired source */
-/* */
-/* ARGUMENTS */
-/* IN: */
-/* t_ab8500_codec_src: select source device for enabling/disabling. */
-/* t_ab8500_codec_src_state: Enable/Disable */
-/* OUT: */
-/* None */
-/* */
-/* RETURN: */
-/* AB8500_CODEC_TRANSACTION_FAILED: If transaction fails. */
-/* AB8500_CODEC_OK: if successful. */
-/*--------------------------------------------------------------------------*/
-/* REENTRANCY: Non Re-Entrant */
-
-/****************************************************************************/
-PUBLIC t_ab8500_codec_error AB8500_CODEC_SrcPowerControl(IN t_ab8500_codec_src
- src_device,
- t_ab8500_codec_src_state
- state)
-{
- t_ab8500_codec_error ab8500_codec_error;
-
- DBGENTER2(" (%lx %lx)", src_device, state);
-
- if (src_device <= AB8500_CODEC_SRC_D_MICROPHONE_2) {
- ab8500_codec_error =
- ab8500_codec_SrcPowerControlSwitch1(src_device, state);
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- } else if (src_device <= AB8500_CODEC_SRC_ALL) {
- ab8500_codec_error =
- ab8500_codec_SrcPowerControlSwitch2(src_device, state);
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- } else {
- ab8500_codec_error = AB8500_CODEC_INVALID_PARAMETER;
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR5();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR6();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR7();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR63();
-
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-/****************************************************************************/
-/* NAME: AB8500_CODEC_DestPowerControl */
-/*--------------------------------------------------------------------------*/
-/* DESCRIPTION: */
-/* Enables/Disables & UnMute/Mute the desired destination */
-/* */
-/* ARGUMENTS */
-/* IN: */
-/* t_ab8500_codec_dest: select destination device for enabling/disabling. */
-/* t_ab8500_codec_dest_state: Enable/Disable */
-/* OUT: */
-/* None */
-/* */
-/* RETURN: */
-/* AB8500_CODEC_TRANSACTION_FAILED: If transaction fails. */
-/* AB8500_CODEC_OK: if successful. */
-/*--------------------------------------------------------------------------*/
-/* REENTRANCY: Non Re-Entrant */
-
-/****************************************************************************/
-PUBLIC t_ab8500_codec_error AB8500_CODEC_DestPowerControl(IN t_ab8500_codec_dest
- dest_device,
- t_ab8500_codec_dest_state
- state)
-{
- t_ab8500_codec_error ab8500_codec_error;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
- DBGENTER2(" (%lx %lx)", dest_device, state);
-
- switch (dest_device) {
- case AB8500_CODEC_DEST_HEADSET:
-
- if (AB8500_CODEC_DEST_STATE_ENABLE == state) {
- p_ab8500_codec_configuration->cr8_enhsl =
- AB8500_CODEC_CR8_ENHSL_ENABLED;
- p_ab8500_codec_configuration->cr8_enhsr =
- AB8500_CODEC_CR8_ENHSR_ENABLED;
- p_ab8500_codec_configuration->cr10_mutehsl =
- AB8500_CODEC_CR10_MUTEHSL_DISABLED;
- p_ab8500_codec_configuration->cr10_mutehsr =
- AB8500_CODEC_CR10_MUTEHSR_DISABLED;
- } else {
- p_ab8500_codec_configuration->cr8_enhsl =
- AB8500_CODEC_CR8_ENHSL_DISABLED;
- p_ab8500_codec_configuration->cr8_enhsr =
- AB8500_CODEC_CR8_ENHSR_DISABLED;
- p_ab8500_codec_configuration->cr10_mutehsl =
- AB8500_CODEC_CR10_MUTEHSL_ENABLED;
- p_ab8500_codec_configuration->cr10_mutehsr =
- AB8500_CODEC_CR10_MUTEHSR_ENABLED;
- }
- break;
-
- case AB8500_CODEC_DEST_EARPIECE:
-
- if (AB8500_CODEC_DEST_STATE_ENABLE == state) {
- p_ab8500_codec_configuration->cr8_enear =
- AB8500_CODEC_CR8_ENEAR_ENABLED;
- p_ab8500_codec_configuration->cr9_endacear =
- AB8500_CODEC_CR9_ENDACEAR_ENABLED;
- p_ab8500_codec_configuration->cr10_muteear =
- AB8500_CODEC_CR10_MUTEEAR_DISABLED;
- } else {
- p_ab8500_codec_configuration->cr8_enear =
- AB8500_CODEC_CR8_ENEAR_DISABLED;
- p_ab8500_codec_configuration->cr9_endacear =
- AB8500_CODEC_CR9_ENDACEAR_DISABLED;
- p_ab8500_codec_configuration->cr10_muteear =
- AB8500_CODEC_CR10_MUTEEAR_ENABLED;
- }
- break;
-
- case AB8500_CODEC_DEST_HANDSFREE:
-
- if (AB8500_CODEC_DEST_STATE_ENABLE == state) {
- p_ab8500_codec_configuration->cr8_enhfl =
- AB8500_CODEC_CR8_ENHFL_ENABLED;
- p_ab8500_codec_configuration->cr8_enhfr =
- AB8500_CODEC_CR8_ENHFR_ENABLED;
- p_ab8500_codec_configuration->cr9_endachfl =
- AB8500_CODEC_CR9_ENDACHFL_ENABLED;
- p_ab8500_codec_configuration->cr9_endachfr =
- AB8500_CODEC_CR9_ENDACHFR_ENABLED;
- p_ab8500_codec_configuration->cr10_mutehfl =
- AB8500_CODEC_CR10_MUTEHFL_DISABLED;
- p_ab8500_codec_configuration->cr10_mutehfr =
- AB8500_CODEC_CR10_MUTEHFR_DISABLED;
- } else {
- p_ab8500_codec_configuration->cr8_enhfl =
- AB8500_CODEC_CR8_ENHFL_DISABLED;
- p_ab8500_codec_configuration->cr8_enhfr =
- AB8500_CODEC_CR8_ENHFR_DISABLED;
- p_ab8500_codec_configuration->cr9_endachfl =
- AB8500_CODEC_CR9_ENDACHFL_DISABLED;
- p_ab8500_codec_configuration->cr9_endachfr =
- AB8500_CODEC_CR9_ENDACHFR_DISABLED;
- p_ab8500_codec_configuration->cr10_mutehfl =
- AB8500_CODEC_CR10_MUTEHFL_ENABLED;
- p_ab8500_codec_configuration->cr10_mutehfr =
- AB8500_CODEC_CR10_MUTEHFR_ENABLED;
- }
- break;
-
- case AB8500_CODEC_DEST_VIBRATOR_L:
-
- if (AB8500_CODEC_DEST_STATE_ENABLE == state) {
- p_ab8500_codec_configuration->cr8_envibl =
- AB8500_CODEC_CR8_ENVIBL_ENABLED;
- p_ab8500_codec_configuration->cr9_endacvibl =
- AB8500_CODEC_CR9_ENDACVIBL_ENABLED;
- p_ab8500_codec_configuration->cr10_mutevibl =
- AB8500_CODEC_CR10_MUTEVIBL_DISABLED;
- p_ab8500_codec_configuration->cr15_pwmtovibl =
- AB8500_CODEC_CR15_PWMTOVIBL_PWM;
- p_ab8500_codec_configuration->cr15_pwmlctrl =
- AB8500_CODEC_CR15_PWMLCTRL_PWMNPLDUTYCYCLE;
- p_ab8500_codec_configuration->cr15_pwmnlctrl =
- AB8500_CODEC_CR15_PWMNLCTRL_PWMNLDUTYCYCLE;
- p_ab8500_codec_configuration->cr15_pwmplctrl =
- AB8500_CODEC_CR15_PWMPLCTRL_PWMPLDUTYCYCLE;
- } else {
- p_ab8500_codec_configuration->cr8_envibl =
- AB8500_CODEC_CR8_ENVIBL_DISABLED;
- p_ab8500_codec_configuration->cr9_endacvibl =
- AB8500_CODEC_CR9_ENDACVIBL_DISABLED;
- p_ab8500_codec_configuration->cr10_mutevibl =
- AB8500_CODEC_CR10_MUTEVIBL_ENABLED;
- p_ab8500_codec_configuration->cr15_pwmtovibl =
- AB8500_CODEC_CR15_PWMTOVIBL_DA_PATH;
- p_ab8500_codec_configuration->cr15_pwmlctrl =
- AB8500_CODEC_CR15_PWMLCTRL_PWMNPLGPOL;
- p_ab8500_codec_configuration->cr15_pwmnlctrl =
- AB8500_CODEC_CR15_PWMNLCTRL_PWMNLGPOL;
- p_ab8500_codec_configuration->cr15_pwmplctrl =
- AB8500_CODEC_CR15_PWMPLCTRL_PWMPLGPOL;
- }
- break;
-
- case AB8500_CODEC_DEST_VIBRATOR_R:
-
- if (AB8500_CODEC_DEST_STATE_ENABLE == state) {
- p_ab8500_codec_configuration->cr8_envibr =
- AB8500_CODEC_CR8_ENVIBR_ENABLED;
- p_ab8500_codec_configuration->cr9_endacvibr =
- AB8500_CODEC_CR9_ENDACVIBR_ENABLED;
- p_ab8500_codec_configuration->cr10_mutevibr =
- AB8500_CODEC_CR10_MUTEVIBR_DISABLED;
- p_ab8500_codec_configuration->cr15_pwmtovibr =
- AB8500_CODEC_CR15_PWMTOVIBR_PWM;
- p_ab8500_codec_configuration->cr15_pwmrctrl =
- AB8500_CODEC_CR15_PWMRCTRL_PWMNPRDUTYCYCLE;
- p_ab8500_codec_configuration->cr15_pwmnrctrl =
- AB8500_CODEC_CR15_PWMNRCTRL_PWMNRDUTYCYCLE;
- p_ab8500_codec_configuration->cr15_pwmprctrl =
- AB8500_CODEC_CR15_PWMPRCTRL_PWMPRDUTYCYCLE;
- } else {
- p_ab8500_codec_configuration->cr8_envibr =
- AB8500_CODEC_CR8_ENVIBR_DISABLED;
- p_ab8500_codec_configuration->cr9_endacvibr =
- AB8500_CODEC_CR9_ENDACVIBR_DISABLED;
- p_ab8500_codec_configuration->cr10_mutevibr =
- AB8500_CODEC_CR10_MUTEVIBR_ENABLED;
- p_ab8500_codec_configuration->cr15_pwmtovibr =
- AB8500_CODEC_CR15_PWMTOVIBR_DA_PATH;
- p_ab8500_codec_configuration->cr15_pwmrctrl =
- AB8500_CODEC_CR15_PWMRCTRL_PWMNPRGPOL;
- p_ab8500_codec_configuration->cr15_pwmnrctrl =
- AB8500_CODEC_CR15_PWMNRCTRL_PWMNRGPOL;
- p_ab8500_codec_configuration->cr15_pwmprctrl =
- AB8500_CODEC_CR15_PWMPRCTRL_PWMPRGPOL;
- }
- break;
-
- case AB8500_CODEC_DEST_ALL:
-
- if (AB8500_CODEC_DEST_STATE_ENABLE == state) {
- p_ab8500_codec_configuration->cr8_enhsl =
- AB8500_CODEC_CR8_ENHSL_ENABLED;
- p_ab8500_codec_configuration->cr8_enhsr =
- AB8500_CODEC_CR8_ENHSR_ENABLED;
- p_ab8500_codec_configuration->cr8_enear =
- AB8500_CODEC_CR8_ENEAR_ENABLED;
- p_ab8500_codec_configuration->cr8_enhfl =
- AB8500_CODEC_CR8_ENHFL_ENABLED;
- p_ab8500_codec_configuration->cr8_enhfr =
- AB8500_CODEC_CR8_ENHFR_ENABLED;
- p_ab8500_codec_configuration->cr8_envibl =
- AB8500_CODEC_CR8_ENVIBL_ENABLED;
- p_ab8500_codec_configuration->cr8_envibr =
- AB8500_CODEC_CR8_ENVIBR_ENABLED;
-
- p_ab8500_codec_configuration->cr9_endacear =
- AB8500_CODEC_CR9_ENDACEAR_ENABLED;
- p_ab8500_codec_configuration->cr9_endachfl =
- AB8500_CODEC_CR9_ENDACHFL_ENABLED;
- p_ab8500_codec_configuration->cr9_endachfr =
- AB8500_CODEC_CR9_ENDACHFR_ENABLED;
- p_ab8500_codec_configuration->cr9_endacvibl =
- AB8500_CODEC_CR9_ENDACVIBL_ENABLED;
- p_ab8500_codec_configuration->cr9_endacvibr =
- AB8500_CODEC_CR9_ENDACVIBR_ENABLED;
-
- p_ab8500_codec_configuration->cr10_mutehsl =
- AB8500_CODEC_CR10_MUTEHSL_DISABLED;
- p_ab8500_codec_configuration->cr10_mutehsr =
- AB8500_CODEC_CR10_MUTEHSR_DISABLED;
- p_ab8500_codec_configuration->cr10_muteear =
- AB8500_CODEC_CR10_MUTEEAR_DISABLED;
- p_ab8500_codec_configuration->cr10_mutehfl =
- AB8500_CODEC_CR10_MUTEHFL_DISABLED;
- p_ab8500_codec_configuration->cr10_mutehfr =
- AB8500_CODEC_CR10_MUTEHFR_DISABLED;
- p_ab8500_codec_configuration->cr10_mutevibl =
- AB8500_CODEC_CR10_MUTEVIBL_DISABLED;
- p_ab8500_codec_configuration->cr10_mutevibr =
- AB8500_CODEC_CR10_MUTEVIBR_DISABLED;
-
- p_ab8500_codec_configuration->cr15_pwmtovibl =
- AB8500_CODEC_CR15_PWMTOVIBL_PWM;
- p_ab8500_codec_configuration->cr15_pwmlctrl =
- AB8500_CODEC_CR15_PWMLCTRL_PWMNPLDUTYCYCLE;
- p_ab8500_codec_configuration->cr15_pwmnlctrl =
- AB8500_CODEC_CR15_PWMNLCTRL_PWMNLDUTYCYCLE;
- p_ab8500_codec_configuration->cr15_pwmplctrl =
- AB8500_CODEC_CR15_PWMPLCTRL_PWMPLDUTYCYCLE;
- p_ab8500_codec_configuration->cr15_pwmtovibr =
- AB8500_CODEC_CR15_PWMTOVIBR_PWM;
- p_ab8500_codec_configuration->cr15_pwmrctrl =
- AB8500_CODEC_CR15_PWMRCTRL_PWMNPRDUTYCYCLE;
- p_ab8500_codec_configuration->cr15_pwmnrctrl =
- AB8500_CODEC_CR15_PWMNRCTRL_PWMNRDUTYCYCLE;
- p_ab8500_codec_configuration->cr15_pwmprctrl =
- AB8500_CODEC_CR15_PWMPRCTRL_PWMPRDUTYCYCLE;
- } else {
- p_ab8500_codec_configuration->cr8_enhsl =
- AB8500_CODEC_CR8_ENHSL_DISABLED;
- p_ab8500_codec_configuration->cr8_enhsr =
- AB8500_CODEC_CR8_ENHSR_DISABLED;
- p_ab8500_codec_configuration->cr8_enear =
- AB8500_CODEC_CR8_ENEAR_DISABLED;
- p_ab8500_codec_configuration->cr8_enhfl =
- AB8500_CODEC_CR8_ENHFL_DISABLED;
- p_ab8500_codec_configuration->cr8_enhfr =
- AB8500_CODEC_CR8_ENHFR_DISABLED;
- p_ab8500_codec_configuration->cr8_envibl =
- AB8500_CODEC_CR8_ENVIBL_DISABLED;
- p_ab8500_codec_configuration->cr8_envibr =
- AB8500_CODEC_CR8_ENVIBR_DISABLED;
-
- p_ab8500_codec_configuration->cr9_endacear =
- AB8500_CODEC_CR9_ENDACEAR_DISABLED;
- p_ab8500_codec_configuration->cr9_endachfl =
- AB8500_CODEC_CR9_ENDACHFL_DISABLED;
- p_ab8500_codec_configuration->cr9_endachfr =
- AB8500_CODEC_CR9_ENDACHFR_DISABLED;
- p_ab8500_codec_configuration->cr9_endacvibl =
- AB8500_CODEC_CR9_ENDACVIBL_DISABLED;
- p_ab8500_codec_configuration->cr9_endacvibr =
- AB8500_CODEC_CR9_ENDACVIBR_DISABLED;
-
- p_ab8500_codec_configuration->cr10_mutehsl =
- AB8500_CODEC_CR10_MUTEHSL_ENABLED;
- p_ab8500_codec_configuration->cr10_mutehsr =
- AB8500_CODEC_CR10_MUTEHSR_ENABLED;
- p_ab8500_codec_configuration->cr10_muteear =
- AB8500_CODEC_CR10_MUTEEAR_ENABLED;
- p_ab8500_codec_configuration->cr10_mutehfl =
- AB8500_CODEC_CR10_MUTEHFL_ENABLED;
- p_ab8500_codec_configuration->cr10_mutehfr =
- AB8500_CODEC_CR10_MUTEHFR_ENABLED;
- p_ab8500_codec_configuration->cr10_mutevibl =
- AB8500_CODEC_CR10_MUTEVIBL_ENABLED;
- p_ab8500_codec_configuration->cr10_mutevibr =
- AB8500_CODEC_CR10_MUTEVIBR_ENABLED;
-
- p_ab8500_codec_configuration->cr15_pwmtovibl =
- AB8500_CODEC_CR15_PWMTOVIBL_DA_PATH;
- p_ab8500_codec_configuration->cr15_pwmlctrl =
- AB8500_CODEC_CR15_PWMLCTRL_PWMNPLGPOL;
- p_ab8500_codec_configuration->cr15_pwmnlctrl =
- AB8500_CODEC_CR15_PWMNLCTRL_PWMNLGPOL;
- p_ab8500_codec_configuration->cr15_pwmplctrl =
- AB8500_CODEC_CR15_PWMPLCTRL_PWMPLGPOL;
- p_ab8500_codec_configuration->cr15_pwmtovibr =
- AB8500_CODEC_CR15_PWMTOVIBR_DA_PATH;
- p_ab8500_codec_configuration->cr15_pwmrctrl =
- AB8500_CODEC_CR15_PWMRCTRL_PWMNPRGPOL;
- p_ab8500_codec_configuration->cr15_pwmnrctrl =
- AB8500_CODEC_CR15_PWMNRCTRL_PWMNRGPOL;
- p_ab8500_codec_configuration->cr15_pwmprctrl =
- AB8500_CODEC_CR15_PWMPRCTRL_PWMPRGPOL;
-
- }
- break;
-
- default:
- ab8500_codec_error = AB8500_CODEC_INVALID_PARAMETER;
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_DestPowerControlUpdateCR();
-
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-
-}
-
-/****************************************************************************/
-/* NAME: AB8500_CODEC_GetVersion */
-/*--------------------------------------------------------------------------*/
-/* DESCRIPTION: */
-/* This routine populates the pVersion structure with */
-/* the current version of HCL. */
-/* */
-/* ARGUMENTS */
-/* IN: */
-/* None */
-/* OUT: */
-/* p_version: this parameter is used to return current HCL version. */
-/* */
-/* RETURN: */
-/* AB8500_CODEC_ERROR: if p_version is NULL. */
-/* AB8500_CODEC_OK: if successful */
-/*--------------------------------------------------------------------------*/
-/* REENTRANCY: Re-Entrant */
-/* REENTRANCY ISSUES: No Issues */
-
-/****************************************************************************/
-PUBLIC t_ab8500_codec_error AB8500_CODEC_GetVersion(OUT t_version * p_version)
-{
- DBGENTER1(" (%lx)", p_version);
- if (p_version != NULL) {
- p_version->minor = AB8500_CODEC_HCL_MINOR_ID;
- p_version->major = AB8500_CODEC_HCL_MAJOR_ID;
- p_version->version = AB8500_CODEC_HCL_VERSION_ID;
- DBGEXIT0(AB8500_CODEC_OK);
- return (AB8500_CODEC_OK);
- } else {
- DBGEXIT0(AB8500_CODEC_INVALID_PARAMETER);
- return (AB8500_CODEC_INVALID_PARAMETER);
- }
-}
-
-/****************************************************************************/
-/* NAME: AB8500_CODEC_SetDbgLevel */
-/*--------------------------------------------------------------------------*/
-/* DESCRIPTION: */
-/* Set the debug level used by the debug module (mask-like value). */
-/* */
-/* ARGUMENTS */
-/* IN: */
-/* debug_level: debug level to be set */
-/* OUT: */
-/* None */
-/* */
-/* RETURN: */
-/* AB8500_CODEC_OK: always */
-/*--------------------------------------------------------------------------*/
-/* REENTRANCY: Re-Entrant */
-/* REENTRANCY ISSUES: No Issues */
-
-/****************************************************************************/
-/*
-PUBLIC t_ab8500_codec_error AB8500_CODEC_SetDbgLevel(IN t_dbg_level dbg_level)
-{
- DBGENTER1(" (%d)", dbg_level);
- dbg_level = dbg_level;
-#ifdef __DEBUG
- MY_DEBUG_LEVEL_VAR_NAME = dbg_level;
-#endif
- DBGEXIT(AB8500_CODEC_OK);
- return(AB8500_CODEC_OK);
-}*/
-
-/****************************************************************************/
-/* NAME: AB8500_CODEC_GetDbgLevel */
-/*--------------------------------------------------------------------------*/
-/* DESCRIPTION: */
-/* Set the debug level used by the debug module (mask-like value). */
-/* */
-/* ARGUMENTS */
-/* IN: */
-/* None */
-/* OUT: */
-/* p_dbg_level: this parameter is used to return debug level. */
-/* */
-/* RETURN: */
-/* AB8500_CODEC_ERROR: if p_version is NULL. */
-/* AB8500_CODEC_OK: if successful */
-/*--------------------------------------------------------------------------*/
-/* REENTRANCY: Re-Entrant */
-/* REENTRANCY ISSUES: No Issues */
-
-/****************************************************************************/
-/*
-PUBLIC t_ab8500_codec_error AB8500_CODEC_GetDbgLevel(OUT t_dbg_level *p_dbg_level)
-{
- if (NULL == p_dbg_level)
- {
- DBGEXIT(AB8500_CODEC_INVALID_PARAMETER);
- return(AB8500_CODEC_INVALID_PARAMETER);
- }
-
-#ifdef __DEBUG
- * p_dbg_level = MY_DEBUG_LEVEL_VAR_NAME;
-#endif
- DBGEXIT(AB8500_CODEC_OK);
- return(AB8500_CODEC_OK);
-}
-*/
-/****************************************************************************/
-/* NAME: AB8500_CODEC_ADSlotAllocation */
-/*--------------------------------------------------------------------------*/
-/* DESCRIPTION: */
-/* AD Data Allocation in slots. */
-/* */
-/* ARGUMENTS */
-/* IN: t_ab8500_codec_slot: The slot to be allocated. */
-/* IN: t_ab8500_codec_cr31_to_cr46_ad_data_allocation: The value */
-/* to be allocated. */
-/* OUT: */
-/* None */
-/* RETURN: */
-/* AB8500_CODEC_INVALID_PARAMETER: If invalid slot number */
-/* AB8500_CODEC_OK: if successful. */
-/* REMARK: */
-/*--------------------------------------------------------------------------*/
-/* REENTRANCY: Non Re-Entrant */
-
-/****************************************************************************/
-PUBLIC t_ab8500_codec_error AB8500_CODEC_ADSlotAllocation
- (IN t_ab8500_codec_slot ad_slot,
- IN t_ab8500_codec_cr31_to_cr46_ad_data_allocation value) {
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
-
- DBGENTER2(" (%lx %lx)", ad_slot, value);
-
- if (ad_slot <= AB8500_CODEC_SLOT7) {
- ab8500_codec_error =
- ab8500_codec_ADSlotAllocationSwitch1(ad_slot, value);
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- } else if (ad_slot <= AB8500_CODEC_SLOT15) {
- ab8500_codec_error =
- ab8500_codec_ADSlotAllocationSwitch2(ad_slot, value);
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- } else if (ad_slot <= AB8500_CODEC_SLOT23) {
- ab8500_codec_error =
- ab8500_codec_ADSlotAllocationSwitch3(ad_slot, value);
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- } else if (ad_slot <= AB8500_CODEC_SLOT31) {
- ab8500_codec_error =
- ab8500_codec_ADSlotAllocationSwitch4(ad_slot, value);
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- } else {
- ab8500_codec_error = AB8500_CODEC_INVALID_PARAMETER;
- }
-
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-/****************************************************************************/
-/* NAME: AB8500_CODEC_DASlotAllocation */
-/*--------------------------------------------------------------------------*/
-/* DESCRIPTION: */
-/* Allocate the Audio Interface slot for DA paths. */
-/* */
-/* ARGUMENTS */
-/* IN: t_ab8500_codec_da_channel_number: Channel number 1/2/3/4/5/6 */
-/* IN: t_ab8500_codec_cr51_to_cr56_sltoda: Slot number */
-/* */
-/* OUT: */
-/* None */
-/* RETURN: */
-/* AB8500_CODEC_INVALID_PARAMETER: If invalid channel number */
-/* AB8500_CODEC_OK: if successful. */
-/* REMARK: */
-/*--------------------------------------------------------------------------*/
-/* REENTRANCY: Non Re-Entrant */
-
-/****************************************************************************/
-PUBLIC t_ab8500_codec_error AB8500_CODEC_DASlotAllocation
- (IN t_ab8500_codec_da_channel_number channel_number,
- IN t_ab8500_codec_cr51_to_cr56_sltoda slot) {
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
- t_ab8500_codec_cr0_powerup ab8500_codec_cr0_powerup;
-
- DBGENTER2(" (%lx %lx)", channel_number, slot);
-
- p_ab8500_codec_configuration->cr51_da12_voice =
- AB8500_CODEC_CR51_DA12_VOICE_LOWLATENCYFILTER;
-
- switch (channel_number) {
- case AB8500_CODEC_DA_CHANNEL_NUMBER_1:
- p_ab8500_codec_configuration->cr51_sltoda1 = slot;
- break;
-
- case AB8500_CODEC_DA_CHANNEL_NUMBER_2:
- p_ab8500_codec_configuration->cr52_sltoda2 = slot;
- break;
-
- case AB8500_CODEC_DA_CHANNEL_NUMBER_3:
- p_ab8500_codec_configuration->cr53_sltoda3 = slot;
- break;
-
- case AB8500_CODEC_DA_CHANNEL_NUMBER_4:
- p_ab8500_codec_configuration->cr54_sltoda4 = slot;
- break;
-
- case AB8500_CODEC_DA_CHANNEL_NUMBER_5:
- p_ab8500_codec_configuration->cr55_sltoda5 = slot;
- break;
-
- case AB8500_CODEC_DA_CHANNEL_NUMBER_6:
- p_ab8500_codec_configuration->cr56_sltoda6 = slot;
- break;
-
- default:
- ab8500_codec_error = AB8500_CODEC_INVALID_PARAMETER;
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- ab8500_codec_cr0_powerup = p_ab8500_codec_configuration->cr0_powerup;
-
- p_ab8500_codec_configuration->cr0_powerup =
- AB8500_CODEC_CR0_POWERUP_OFF;
-
- ab8500_codec_error = ab8500_codec_UpdateCR0();
- if (AB8500_CODEC_OK != ab8500_codec_error) {
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR51();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR52();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR53();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR54();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR55();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR56();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- p_ab8500_codec_configuration->cr0_powerup = ab8500_codec_cr0_powerup;
-
- ab8500_codec_error = ab8500_codec_UpdateCR0();
-
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-/****************************************************************************/
-/* NAME: AB8500_CODEC_ConfigureBurstFifo */
-/*--------------------------------------------------------------------------*/
-/* DESCRIPTION: */
-/* Configuration for Burst FIFO control */
-/* */
-/* ARGUMENTS */
-/* IN: t_ab8500_codec_burst_fifo_config: structure for configuration of */
-/* burst FIFO */
-/* OUT: */
-/* None */
-/* RETURN: */
-/* AB8500_CODEC_INVALID_PARAMETER: If invalid parameter */
-/* AB8500_CODEC_UNSUPPORTED_FEATURE: If interface 1 selected */
-/* AB8500_CODEC_OK: if successful. */
-/* REMARK: */
-/*--------------------------------------------------------------------------*/
-/* REENTRANCY: Non Re-Entrant */
-
-/****************************************************************************/
-t_ab8500_codec_error AB8500_CODEC_ConfigureBurstFifo(IN
- t_ab8500_codec_burst_fifo_config
- const *const
- p_burst_fifo_config)
-{
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
- DBGENTER1(" (%lx)", p_burst_fifo_config);
-
- if (AB8500_CODEC_AUDIO_INTERFACE_0 ==
- g_ab8500_codec_system_context.audio_interface) {
- if (AB8500_CODEC_CR27_EN_MASTGEN_ENABLED ==
- p_ab8500_codec_configuration->cr27_en_mastgen) {
- p_ab8500_codec_configuration->cr104_bfifoint =
- p_burst_fifo_config->cr104_bfifoint;
-
- p_ab8500_codec_configuration->cr105_bfifotx =
- p_burst_fifo_config->cr105_bfifotx;
-
- p_ab8500_codec_configuration->cr106_bfifofsext =
- p_burst_fifo_config->cr106_bfifofsext;
- p_ab8500_codec_configuration->cr106_bfifomsk =
- p_burst_fifo_config->cr106_bfifomsk;
- p_ab8500_codec_configuration->cr106_bfifomstr =
- p_burst_fifo_config->cr106_bfifomstr;
- p_ab8500_codec_configuration->cr106_bfifostrt =
- p_burst_fifo_config->cr106_bfifostrt;
-
- p_ab8500_codec_configuration->cr107_bfifosampnr =
- p_burst_fifo_config->cr107_bfifosampnr;
-
- p_ab8500_codec_configuration->cr108_bfifowakeup =
- p_burst_fifo_config->cr108_bfifowakeup;
-
- ab8500_codec_error = ab8500_codec_UpdateCR104();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR105();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR106();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR107();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR108();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- } else {
- ab8500_codec_error = AB8500_CODEC_INVALID_PARAMETER;
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- } else {
- ab8500_codec_error = AB8500_CODEC_UNSUPPORTED_FEATURE;
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-/****************************************************************************/
-/* NAME: AB8500_CODEC_EnableBurstFifo */
-/*--------------------------------------------------------------------------*/
-/* DESCRIPTION: */
-/* Enable the Burst FIFO for Interface 0 */
-/* */
-/* ARGUMENTS */
-/* IN: */
-/* None */
-/* OUT: */
-/* None */
-/* RETURN: */
-/* AB8500_CODEC_UNSUPPORTED_FEATURE: If Interface 1 is selected */
-/* AB8500_CODEC_OK: if successful. */
-/* REMARK: */
-/*--------------------------------------------------------------------------*/
-/* REENTRANCY: Non Re-Entrant */
-
-/****************************************************************************/
-PUBLIC t_ab8500_codec_error AB8500_CODEC_EnableBurstFifo(void)
-{
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
- DBGENTER0();
-
- if (AB8500_CODEC_AUDIO_INTERFACE_0 ==
- g_ab8500_codec_system_context.audio_interface) {
- p_ab8500_codec_configuration->cr29_if0bfifoen =
- AB8500_CODEC_CR29_IF0BFIFOEN_BURST_MODE;
-
- ab8500_codec_error = ab8500_codec_UpdateCR29();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- } else {
- ab8500_codec_error = AB8500_CODEC_UNSUPPORTED_FEATURE;
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-/****************************************************************************/
-/* NAME: AB8500_CODEC_DisableBurstFifo */
-/*--------------------------------------------------------------------------*/
-/* DESCRIPTION: */
-/* Disable the Burst FIFO for Interface 0 */
-/* */
-/* ARGUMENTS */
-/* IN: */
-/* None */
-/* OUT: */
-/* None */
-/* RETURN: */
-/* AB8500_CODEC_UNSUPPORTED_FEATURE: If Interface 1 is selected */
-/* AB8500_CODEC_OK: if successful. */
-/* REMARK: */
-/*--------------------------------------------------------------------------*/
-/* REENTRANCY: Non Re-Entrant */
-
-/****************************************************************************/
-PUBLIC t_ab8500_codec_error AB8500_CODEC_DisableBurstFifo(void)
-{
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
- DBGENTER0();
-
- if (AB8500_CODEC_AUDIO_INTERFACE_0 ==
- g_ab8500_codec_system_context.audio_interface) {
- p_ab8500_codec_configuration->cr29_if0bfifoen =
- AB8500_CODEC_CR29_IF0BFIFOEN_NORMAL_MODE;
-
- ab8500_codec_error = ab8500_codec_UpdateCR29();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- } else {
- ab8500_codec_error = AB8500_CODEC_UNSUPPORTED_FEATURE;
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-PRIVATE t_ab8500_codec_error ab8500_codec_ADSlotAllocationSwitch1
- (IN t_ab8500_codec_slot ad_slot,
- IN t_ab8500_codec_cr31_to_cr46_ad_data_allocation value) {
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- switch (ad_slot) {
- case AB8500_CODEC_SLOT0:
- p_ab8500_codec_configuration->cr31_adotoslot0 = value;
-
- ab8500_codec_error = ab8500_codec_UpdateCR31();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
-
- case AB8500_CODEC_SLOT1:
- p_ab8500_codec_configuration->cr31_adotoslot1 = value;
-
- ab8500_codec_error = ab8500_codec_UpdateCR31();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
-
- case AB8500_CODEC_SLOT2:
- p_ab8500_codec_configuration->cr32_adotoslot2 = value;
-
- ab8500_codec_error = ab8500_codec_UpdateCR32();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
-
- case AB8500_CODEC_SLOT3:
- p_ab8500_codec_configuration->cr32_adotoslot3 = value;
-
- ab8500_codec_error = ab8500_codec_UpdateCR32();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
-
- case AB8500_CODEC_SLOT4:
- p_ab8500_codec_configuration->cr33_adotoslot4 = value;
-
- ab8500_codec_error = ab8500_codec_UpdateCR33();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
-
- case AB8500_CODEC_SLOT5:
- p_ab8500_codec_configuration->cr33_adotoslot5 = value;
-
- ab8500_codec_error = ab8500_codec_UpdateCR33();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
-
- case AB8500_CODEC_SLOT6:
- p_ab8500_codec_configuration->cr34_adotoslot6 = value;
-
- ab8500_codec_error = ab8500_codec_UpdateCR34();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
-
- case AB8500_CODEC_SLOT7:
- p_ab8500_codec_configuration->cr34_adotoslot7 = value;
-
- ab8500_codec_error = ab8500_codec_UpdateCR34();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
-
- default:
- ab8500_codec_error = AB8500_CODEC_INVALID_PARAMETER;
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-PRIVATE t_ab8500_codec_error ab8500_codec_ADSlotAllocationSwitch2
- (IN t_ab8500_codec_slot ad_slot,
- IN t_ab8500_codec_cr31_to_cr46_ad_data_allocation value) {
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- switch (ad_slot) {
- case AB8500_CODEC_SLOT8:
- p_ab8500_codec_configuration->cr35_adotoslot8 = value;
-
- ab8500_codec_error = ab8500_codec_UpdateCR35();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
-
- case AB8500_CODEC_SLOT9:
- p_ab8500_codec_configuration->cr35_adotoslot9 = value;
-
- ab8500_codec_error = ab8500_codec_UpdateCR35();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
-
- case AB8500_CODEC_SLOT10:
- p_ab8500_codec_configuration->cr36_adotoslot10 = value;
-
- ab8500_codec_error = ab8500_codec_UpdateCR36();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
-
- case AB8500_CODEC_SLOT11:
- p_ab8500_codec_configuration->cr36_adotoslot11 = value;
-
- ab8500_codec_error = ab8500_codec_UpdateCR36();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
-
- case AB8500_CODEC_SLOT12:
- p_ab8500_codec_configuration->cr37_adotoslot12 = value;
-
- ab8500_codec_error = ab8500_codec_UpdateCR37();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
-
- case AB8500_CODEC_SLOT13:
- p_ab8500_codec_configuration->cr37_adotoslot13 = value;
-
- ab8500_codec_error = ab8500_codec_UpdateCR37();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
-
- case AB8500_CODEC_SLOT14:
- p_ab8500_codec_configuration->cr38_adotoslot14 = value;
-
- ab8500_codec_error = ab8500_codec_UpdateCR38();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
-
- case AB8500_CODEC_SLOT15:
- p_ab8500_codec_configuration->cr38_adotoslot15 = value;
-
- ab8500_codec_error = ab8500_codec_UpdateCR38();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
-
- default:
- ab8500_codec_error = AB8500_CODEC_INVALID_PARAMETER;
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-PRIVATE t_ab8500_codec_error ab8500_codec_ADSlotAllocationSwitch3
- (IN t_ab8500_codec_slot ad_slot,
- IN t_ab8500_codec_cr31_to_cr46_ad_data_allocation value) {
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- switch (ad_slot) {
- case AB8500_CODEC_SLOT16:
- p_ab8500_codec_configuration->cr39_adotoslot16 = value;
-
- ab8500_codec_error = ab8500_codec_UpdateCR39();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
-
- case AB8500_CODEC_SLOT17:
- p_ab8500_codec_configuration->cr39_adotoslot17 = value;
-
- ab8500_codec_error = ab8500_codec_UpdateCR39();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
-
- case AB8500_CODEC_SLOT18:
- p_ab8500_codec_configuration->cr40_adotoslot18 = value;
-
- ab8500_codec_error = ab8500_codec_UpdateCR40();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
-
- case AB8500_CODEC_SLOT19:
- p_ab8500_codec_configuration->cr40_adotoslot19 = value;
-
- ab8500_codec_error = ab8500_codec_UpdateCR40();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
-
- case AB8500_CODEC_SLOT20:
- p_ab8500_codec_configuration->cr41_adotoslot20 = value;
-
- ab8500_codec_error = ab8500_codec_UpdateCR41();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
-
- case AB8500_CODEC_SLOT21:
- p_ab8500_codec_configuration->cr41_adotoslot21 = value;
-
- ab8500_codec_error = ab8500_codec_UpdateCR41();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
-
- case AB8500_CODEC_SLOT22:
- p_ab8500_codec_configuration->cr42_adotoslot22 = value;
-
- ab8500_codec_error = ab8500_codec_UpdateCR42();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
-
- case AB8500_CODEC_SLOT23:
- p_ab8500_codec_configuration->cr42_adotoslot23 = value;
-
- ab8500_codec_error = ab8500_codec_UpdateCR42();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
-
- default:
- ab8500_codec_error = AB8500_CODEC_INVALID_PARAMETER;
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-PRIVATE t_ab8500_codec_error ab8500_codec_ADSlotAllocationSwitch4
- (IN t_ab8500_codec_slot ad_slot,
- IN t_ab8500_codec_cr31_to_cr46_ad_data_allocation value) {
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- switch (ad_slot) {
- case AB8500_CODEC_SLOT24:
- p_ab8500_codec_configuration->cr43_adotoslot24 = value;
-
- ab8500_codec_error = ab8500_codec_UpdateCR43();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
-
- case AB8500_CODEC_SLOT25:
- p_ab8500_codec_configuration->cr43_adotoslot25 = value;
-
- ab8500_codec_error = ab8500_codec_UpdateCR43();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
-
- case AB8500_CODEC_SLOT26:
- p_ab8500_codec_configuration->cr44_adotoslot26 = value;
-
- ab8500_codec_error = ab8500_codec_UpdateCR44();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
-
- case AB8500_CODEC_SLOT27:
- p_ab8500_codec_configuration->cr44_adotoslot27 = value;
-
- ab8500_codec_error = ab8500_codec_UpdateCR44();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
-
- case AB8500_CODEC_SLOT28:
- p_ab8500_codec_configuration->cr45_adotoslot28 = value;
-
- ab8500_codec_error = ab8500_codec_UpdateCR45();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
-
- case AB8500_CODEC_SLOT29:
- p_ab8500_codec_configuration->cr45_adotoslot29 = value;
-
- ab8500_codec_error = ab8500_codec_UpdateCR45();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
-
- case AB8500_CODEC_SLOT30:
- p_ab8500_codec_configuration->cr46_adotoslot30 = value;
-
- ab8500_codec_error = ab8500_codec_UpdateCR46();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
-
- case AB8500_CODEC_SLOT31:
- p_ab8500_codec_configuration->cr46_adotoslot31 = value;
-
- ab8500_codec_error = ab8500_codec_UpdateCR46();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
-
- default:
- ab8500_codec_error = AB8500_CODEC_INVALID_PARAMETER;
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-PRIVATE t_ab8500_codec_error ab8500_codec_SrcPowerControlSwitch1(IN
- t_ab8500_codec_src
- src_device,
- t_ab8500_codec_src_state
- state)
-{
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- switch (src_device) {
- case AB8500_CODEC_SRC_LINEIN:
-
- if (AB8500_CODEC_SRC_STATE_ENABLE == state) {
- p_ab8500_codec_configuration->cr5_enlinl =
- AB8500_CODEC_CR5_ENLINL_ENABLED;
- p_ab8500_codec_configuration->cr5_enlinr =
- AB8500_CODEC_CR5_ENLINR_ENABLED;
- p_ab8500_codec_configuration->cr5_mutlinl =
- AB8500_CODEC_CR5_MUTLINL_DISABLED;
- p_ab8500_codec_configuration->cr5_mutlinr =
- AB8500_CODEC_CR5_MUTLINR_DISABLED;
-
- p_ab8500_codec_configuration->cr7_linrsel =
- AB8500_CODEC_CR7_LINRSEL_LINR;
- p_ab8500_codec_configuration->cr7_enadclinl =
- AB8500_CODEC_CR7_ENADCLINL_ENABLED;
- p_ab8500_codec_configuration->cr7_enadclinr =
- AB8500_CODEC_CR7_ENADCLINR_ENABLED;
- } else {
- p_ab8500_codec_configuration->cr5_enlinl =
- AB8500_CODEC_CR5_ENLINL_DISABLED;
- p_ab8500_codec_configuration->cr5_enlinr =
- AB8500_CODEC_CR5_ENLINR_DISABLED;
- p_ab8500_codec_configuration->cr5_mutlinl =
- AB8500_CODEC_CR5_MUTLINL_ENABLED;
- p_ab8500_codec_configuration->cr5_mutlinr =
- AB8500_CODEC_CR5_MUTLINR_ENABLED;
-
- p_ab8500_codec_configuration->cr7_linrsel =
- AB8500_CODEC_CR7_LINRSEL_MIC2;
- p_ab8500_codec_configuration->cr7_enadclinl =
- AB8500_CODEC_CR7_ENADCLINL_DISABLED;
- p_ab8500_codec_configuration->cr7_enadclinr =
- AB8500_CODEC_CR7_ENADCLINR_DISABLED;
- }
- break;
-
- case AB8500_CODEC_SRC_MICROPHONE_1A:
-
- if (AB8500_CODEC_SRC_STATE_ENABLE == state) {
- p_ab8500_codec_configuration->cr5_enmic1 =
- AB8500_CODEC_CR5_ENMIC1_ENABLED;
- p_ab8500_codec_configuration->cr5_mutmic1 =
- AB8500_CODEC_CR5_MUTMIC1_DISABLED;
-
- p_ab8500_codec_configuration->cr7_mic1sel =
- AB8500_CODEC_CR7_MIC1SEL_MIC1A;
- p_ab8500_codec_configuration->cr7_enadcmic =
- AB8500_CODEC_CR7_ENADCMIC_ENABLED;
- } else {
- p_ab8500_codec_configuration->cr5_enmic1 =
- AB8500_CODEC_CR5_ENMIC1_DISABLED;
- p_ab8500_codec_configuration->cr5_mutmic1 =
- AB8500_CODEC_CR5_MUTMIC1_ENABLED;
-
- p_ab8500_codec_configuration->cr7_enadcmic =
- AB8500_CODEC_CR7_ENADCMIC_DISABLED;
- }
- break;
-
- case AB8500_CODEC_SRC_MICROPHONE_1B:
-
- if (AB8500_CODEC_SRC_STATE_ENABLE == state) {
- p_ab8500_codec_configuration->cr5_enmic1 =
- AB8500_CODEC_CR5_ENMIC1_ENABLED;
- p_ab8500_codec_configuration->cr5_mutmic1 =
- AB8500_CODEC_CR5_MUTMIC1_DISABLED;
-
- p_ab8500_codec_configuration->cr7_mic1sel =
- AB8500_CODEC_CR7_MIC1SEL_MIC1B;
- p_ab8500_codec_configuration->cr7_enadcmic =
- AB8500_CODEC_CR7_ENADCMIC_ENABLED;
- } else {
- p_ab8500_codec_configuration->cr5_enmic1 =
- AB8500_CODEC_CR5_ENMIC1_DISABLED;
- p_ab8500_codec_configuration->cr5_mutmic1 =
- AB8500_CODEC_CR5_MUTMIC1_ENABLED;
-
- p_ab8500_codec_configuration->cr7_enadcmic =
- AB8500_CODEC_CR7_ENADCMIC_DISABLED;
- }
- break;
-
- case AB8500_CODEC_SRC_MICROPHONE_2:
-
- if (AB8500_CODEC_SRC_STATE_ENABLE == state) {
- p_ab8500_codec_configuration->cr5_enmic2 =
- AB8500_CODEC_CR5_ENMIC2_ENABLED;
- p_ab8500_codec_configuration->cr5_mutmic2 =
- AB8500_CODEC_CR5_MUTMIC2_DISABLED;
-
- p_ab8500_codec_configuration->cr7_linrsel =
- AB8500_CODEC_CR7_LINRSEL_MIC2;
- } else {
- p_ab8500_codec_configuration->cr5_enmic2 =
- AB8500_CODEC_CR5_ENMIC2_DISABLED;
- p_ab8500_codec_configuration->cr5_mutmic2 =
- AB8500_CODEC_CR5_MUTMIC2_ENABLED;
-
- p_ab8500_codec_configuration->cr7_linrsel =
- AB8500_CODEC_CR7_LINRSEL_LINR;
- }
- break;
-
- case AB8500_CODEC_SRC_D_MICROPHONE_1:
-
- if (AB8500_CODEC_SRC_STATE_ENABLE == state) {
- p_ab8500_codec_configuration->cr6_endmic1 =
- AB8500_CODEC_CR6_ENDMIC1_ENABLED;
-
- p_ab8500_codec_configuration->cr63_ad1sel =
- AB8500_CODEC_CR63_AD1SEL_DMIC1_SELECTED;
- } else {
- p_ab8500_codec_configuration->cr6_endmic1 =
- AB8500_CODEC_CR6_ENDMIC1_DISABLED;
-
- p_ab8500_codec_configuration->cr63_ad1sel =
- AB8500_CODEC_CR63_AD1SEL_LINLADL_SELECTED;
- }
- break;
-
- case AB8500_CODEC_SRC_D_MICROPHONE_2:
-
- if (AB8500_CODEC_SRC_STATE_ENABLE == state) {
- p_ab8500_codec_configuration->cr6_endmic2 =
- AB8500_CODEC_CR6_ENDMIC2_ENABLED;
-
- p_ab8500_codec_configuration->cr63_ad2sel =
- AB8500_CODEC_CR63_AD2SEL_DMIC2_SELECTED;
- } else {
- p_ab8500_codec_configuration->cr6_endmic2 =
- AB8500_CODEC_CR6_ENDMIC2_DISABLED;
-
- p_ab8500_codec_configuration->cr63_ad2sel =
- AB8500_CODEC_CR63_AD2SEL_LINRADR_SELECTED;
- }
- break;
-
- default:
- ab8500_codec_error = AB8500_CODEC_INVALID_PARAMETER;
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-PRIVATE t_ab8500_codec_error ab8500_codec_SrcPowerControlSwitch2(IN
- t_ab8500_codec_src
- src_device,
- t_ab8500_codec_src_state
- state)
-{
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- switch (src_device) {
- case AB8500_CODEC_SRC_D_MICROPHONE_3:
-
- if (AB8500_CODEC_SRC_STATE_ENABLE == state) {
- p_ab8500_codec_configuration->cr6_endmic3 =
- AB8500_CODEC_CR6_ENDMIC3_ENABLED;
-
- p_ab8500_codec_configuration->cr63_ad3sel =
- AB8500_CODEC_CR63_AD3SEL_DMIC3_SELECTED;
- } else {
- p_ab8500_codec_configuration->cr6_endmic3 =
- AB8500_CODEC_CR6_ENDMIC3_DISABLED;
-
- p_ab8500_codec_configuration->cr63_ad3sel =
- AB8500_CODEC_CR63_AD3SEL_ADMO_SELECTED;
- }
- break;
-
- case AB8500_CODEC_SRC_D_MICROPHONE_4:
-
- if (AB8500_CODEC_SRC_STATE_ENABLE == state) {
- p_ab8500_codec_configuration->cr6_endmic4 =
- AB8500_CODEC_CR6_ENDMIC4_ENABLED;
- } else {
- p_ab8500_codec_configuration->cr6_endmic4 =
- AB8500_CODEC_CR6_ENDMIC4_DISABLED;
- }
- break;
-
- case AB8500_CODEC_SRC_D_MICROPHONE_5:
-
- if (AB8500_CODEC_SRC_STATE_ENABLE == state) {
- p_ab8500_codec_configuration->cr6_endmic5 =
- AB8500_CODEC_CR6_ENDMIC5_ENABLED;
-
- p_ab8500_codec_configuration->cr63_ad5sel =
- AB8500_CODEC_CR63_AD5SEL_DMIC5_SELECTED;
- } else {
- p_ab8500_codec_configuration->cr6_endmic5 =
- AB8500_CODEC_CR6_ENDMIC5_DISABLED;
-
- p_ab8500_codec_configuration->cr63_ad5sel =
- AB8500_CODEC_CR63_AD5SEL_AMADR_SELECTED;
- }
- break;
-
- case AB8500_CODEC_SRC_D_MICROPHONE_6:
-
- if (AB8500_CODEC_SRC_STATE_ENABLE == state) {
- p_ab8500_codec_configuration->cr6_endmic6 =
- AB8500_CODEC_CR6_ENDMIC6_ENABLED;
-
- p_ab8500_codec_configuration->cr63_ad6sel =
- AB8500_CODEC_CR63_AD6SEL_DMIC6_SELECTED;
- } else {
- p_ab8500_codec_configuration->cr6_endmic6 =
- AB8500_CODEC_CR6_ENDMIC6_DISABLED;
-
- p_ab8500_codec_configuration->cr63_ad6sel =
- AB8500_CODEC_CR63_AD6SEL_ADMO_SELECTED;
- }
- break;
-
- case AB8500_CODEC_SRC_ALL:
-
- if (AB8500_CODEC_SRC_STATE_ENABLE == state) {
- p_ab8500_codec_configuration->cr5_enlinl =
- AB8500_CODEC_CR5_ENLINL_ENABLED;
- p_ab8500_codec_configuration->cr5_enlinr =
- AB8500_CODEC_CR5_ENLINR_ENABLED;
- p_ab8500_codec_configuration->cr5_enmic1 =
- AB8500_CODEC_CR5_ENMIC1_ENABLED;
- p_ab8500_codec_configuration->cr5_enmic2 =
- AB8500_CODEC_CR5_ENMIC2_ENABLED;
- p_ab8500_codec_configuration->cr6_endmic1 =
- AB8500_CODEC_CR6_ENDMIC1_ENABLED;
- p_ab8500_codec_configuration->cr6_endmic2 =
- AB8500_CODEC_CR6_ENDMIC2_ENABLED;
- p_ab8500_codec_configuration->cr6_endmic3 =
- AB8500_CODEC_CR6_ENDMIC3_ENABLED;
- p_ab8500_codec_configuration->cr6_endmic4 =
- AB8500_CODEC_CR6_ENDMIC4_ENABLED;
- p_ab8500_codec_configuration->cr6_endmic5 =
- AB8500_CODEC_CR6_ENDMIC5_ENABLED;
- p_ab8500_codec_configuration->cr6_endmic6 =
- AB8500_CODEC_CR6_ENDMIC6_ENABLED;
- p_ab8500_codec_configuration->cr7_enadcmic =
- AB8500_CODEC_CR7_ENADCMIC_ENABLED;
-
- p_ab8500_codec_configuration->cr5_mutlinl =
- AB8500_CODEC_CR5_MUTLINL_DISABLED;
- p_ab8500_codec_configuration->cr5_mutlinr =
- AB8500_CODEC_CR5_MUTLINR_DISABLED;
- p_ab8500_codec_configuration->cr5_mutmic1 =
- AB8500_CODEC_CR5_MUTMIC1_DISABLED;
- p_ab8500_codec_configuration->cr5_mutmic2 =
- AB8500_CODEC_CR5_MUTMIC2_DISABLED;
- } else {
- p_ab8500_codec_configuration->cr5_enlinl =
- AB8500_CODEC_CR5_ENLINL_DISABLED;
- p_ab8500_codec_configuration->cr5_enlinr =
- AB8500_CODEC_CR5_ENLINR_DISABLED;
- p_ab8500_codec_configuration->cr5_enmic1 =
- AB8500_CODEC_CR5_ENMIC1_DISABLED;
- p_ab8500_codec_configuration->cr5_enmic2 =
- AB8500_CODEC_CR5_ENMIC2_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic1 =
- AB8500_CODEC_CR6_ENDMIC1_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic2 =
- AB8500_CODEC_CR6_ENDMIC2_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic3 =
- AB8500_CODEC_CR6_ENDMIC3_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic4 =
- AB8500_CODEC_CR6_ENDMIC4_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic5 =
- AB8500_CODEC_CR6_ENDMIC5_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic6 =
- AB8500_CODEC_CR6_ENDMIC6_DISABLED;
- p_ab8500_codec_configuration->cr7_enadcmic =
- AB8500_CODEC_CR7_ENADCMIC_DISABLED;
-
- p_ab8500_codec_configuration->cr5_mutlinl =
- AB8500_CODEC_CR5_MUTLINL_ENABLED;
- p_ab8500_codec_configuration->cr5_mutlinr =
- AB8500_CODEC_CR5_MUTLINR_ENABLED;
- p_ab8500_codec_configuration->cr5_mutmic1 =
- AB8500_CODEC_CR5_MUTMIC1_ENABLED;
- p_ab8500_codec_configuration->cr5_mutmic2 =
- AB8500_CODEC_CR5_MUTMIC2_ENABLED;
- }
- break;
- case AB8500_CODEC_SRC_FM_RX:
- break;
-
- default:
- ab8500_codec_error = AB8500_CODEC_INVALID_PARAMETER;
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-PRIVATE t_ab8500_codec_error ab8500_codec_SetModeAndDirectionUpdateCR(void)
-{
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
- t_ab8500_codec_cr0_powerup ab8500_codec_cr0_powerup;
-
- ab8500_codec_cr0_powerup = p_ab8500_codec_configuration->cr0_powerup;
-
- p_ab8500_codec_configuration->cr0_powerup =
- AB8500_CODEC_CR0_POWERUP_OFF;
-
- ab8500_codec_error = ab8500_codec_UpdateCR0();
- if (AB8500_CODEC_OK != ab8500_codec_error) {
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR2();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR3();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR26();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR28();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR30();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR63();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- p_ab8500_codec_configuration->cr0_powerup = ab8500_codec_cr0_powerup;
-
- ab8500_codec_error = ab8500_codec_UpdateCR0();
-
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-PRIVATE t_ab8500_codec_error ab8500_codec_SetSrcVolumeUpdateCR(void)
-{
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
-
- ab8500_codec_error = ab8500_codec_UpdateCR20();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR21();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR22();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR23();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR65();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR66();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR67();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR68();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR69();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR70();
-
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-PRIVATE t_ab8500_codec_error ab8500_codec_SetDestVolumeUpdateCR(void)
-{
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
-
- ab8500_codec_error = ab8500_codec_UpdateCR16();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR17();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR18();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR19();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR22();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR23();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR71();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR72();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR73();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR74();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR75();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR76();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR79();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR80();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR101();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR102();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR103();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- return (ab8500_codec_error);
-}
-
-PRIVATE t_ab8500_codec_error ab8500_codec_ProgramDirectionIN(void)
-{
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- switch (g_ab8500_codec_system_context.ab8500_codec_src) {
- case AB8500_CODEC_SRC_LINEIN:
- p_ab8500_codec_configuration->cr5_enlinl =
- AB8500_CODEC_CR5_ENLINL_ENABLED;
- p_ab8500_codec_configuration->cr5_enlinr =
- AB8500_CODEC_CR5_ENLINR_ENABLED;
- p_ab8500_codec_configuration->cr6_endmic1 =
- AB8500_CODEC_CR6_ENDMIC1_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic2 =
- AB8500_CODEC_CR6_ENDMIC2_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic3 =
- AB8500_CODEC_CR6_ENDMIC3_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic4 =
- AB8500_CODEC_CR6_ENDMIC4_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic5 =
- AB8500_CODEC_CR6_ENDMIC5_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic6 =
- AB8500_CODEC_CR6_ENDMIC6_DISABLED;
- p_ab8500_codec_configuration->cr5_enmic1 =
- AB8500_CODEC_CR5_ENMIC1_DISABLED;
- p_ab8500_codec_configuration->cr5_enmic2 =
- AB8500_CODEC_CR5_ENMIC2_DISABLED;
-
- p_ab8500_codec_configuration->cr7_linrsel =
- AB8500_CODEC_CR7_LINRSEL_LINR;
- p_ab8500_codec_configuration->cr7_enadclinl =
- AB8500_CODEC_CR7_ENADCLINL_ENABLED;
- p_ab8500_codec_configuration->cr7_enadclinr =
- AB8500_CODEC_CR7_ENADCLINR_ENABLED;
-
- p_ab8500_codec_configuration->cr5_mutlinl =
- AB8500_CODEC_CR5_MUTLINL_DISABLED;
- p_ab8500_codec_configuration->cr5_mutlinr =
- AB8500_CODEC_CR5_MUTLINR_DISABLED;
- p_ab8500_codec_configuration->cr5_mutmic1 =
- AB8500_CODEC_CR5_MUTMIC1_ENABLED;
- p_ab8500_codec_configuration->cr5_mutmic2 =
- AB8500_CODEC_CR5_MUTMIC2_ENABLED;
-
- break;
-
- case AB8500_CODEC_SRC_MICROPHONE_1A:
- p_ab8500_codec_configuration->cr5_enlinl =
- AB8500_CODEC_CR5_ENLINL_DISABLED;
- p_ab8500_codec_configuration->cr5_enlinr =
- AB8500_CODEC_CR5_ENLINR_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic1 =
- AB8500_CODEC_CR6_ENDMIC1_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic2 =
- AB8500_CODEC_CR6_ENDMIC2_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic3 =
- AB8500_CODEC_CR6_ENDMIC3_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic4 =
- AB8500_CODEC_CR6_ENDMIC4_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic5 =
- AB8500_CODEC_CR6_ENDMIC5_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic6 =
- AB8500_CODEC_CR6_ENDMIC6_DISABLED;
-
- p_ab8500_codec_configuration->cr5_enmic1 =
- AB8500_CODEC_CR5_ENMIC1_ENABLED;
- p_ab8500_codec_configuration->cr5_enmic2 =
- AB8500_CODEC_CR5_ENMIC2_DISABLED;
-
- p_ab8500_codec_configuration->cr7_mic1sel =
- AB8500_CODEC_CR7_MIC1SEL_MIC1A;
- p_ab8500_codec_configuration->cr7_enadcmic =
- AB8500_CODEC_CR7_ENADCMIC_ENABLED;
- p_ab8500_codec_configuration->cr7_enadclinl =
- AB8500_CODEC_CR7_ENADCLINL_DISABLED;
- p_ab8500_codec_configuration->cr7_enadclinr =
- AB8500_CODEC_CR7_ENADCLINR_DISABLED;
-
- p_ab8500_codec_configuration->cr5_mutlinl =
- AB8500_CODEC_CR5_MUTLINL_ENABLED;
- p_ab8500_codec_configuration->cr5_mutlinr =
- AB8500_CODEC_CR5_MUTLINR_ENABLED;
- p_ab8500_codec_configuration->cr5_mutmic1 =
- AB8500_CODEC_CR5_MUTMIC1_DISABLED;
- p_ab8500_codec_configuration->cr5_mutmic2 =
- AB8500_CODEC_CR5_MUTMIC2_ENABLED;
-
- break;
-
- case AB8500_CODEC_SRC_MICROPHONE_1B:
- p_ab8500_codec_configuration->cr5_enlinl =
- AB8500_CODEC_CR5_ENLINL_DISABLED;
- p_ab8500_codec_configuration->cr5_enlinr =
- AB8500_CODEC_CR5_ENLINR_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic1 =
- AB8500_CODEC_CR6_ENDMIC1_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic2 =
- AB8500_CODEC_CR6_ENDMIC2_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic3 =
- AB8500_CODEC_CR6_ENDMIC3_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic4 =
- AB8500_CODEC_CR6_ENDMIC4_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic5 =
- AB8500_CODEC_CR6_ENDMIC5_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic6 =
- AB8500_CODEC_CR6_ENDMIC6_DISABLED;
-
- p_ab8500_codec_configuration->cr5_enmic1 =
- AB8500_CODEC_CR5_ENMIC1_ENABLED;
- p_ab8500_codec_configuration->cr5_enmic2 =
- AB8500_CODEC_CR5_ENMIC2_DISABLED;
-
- p_ab8500_codec_configuration->cr7_mic1sel =
- AB8500_CODEC_CR7_MIC1SEL_MIC1B;
- p_ab8500_codec_configuration->cr7_enadcmic =
- AB8500_CODEC_CR7_ENADCMIC_ENABLED;
- p_ab8500_codec_configuration->cr7_enadclinl =
- AB8500_CODEC_CR7_ENADCLINL_DISABLED;
- p_ab8500_codec_configuration->cr7_enadclinr =
- AB8500_CODEC_CR7_ENADCLINR_DISABLED;
-
- p_ab8500_codec_configuration->cr5_mutlinl =
- AB8500_CODEC_CR5_MUTLINL_ENABLED;
- p_ab8500_codec_configuration->cr5_mutlinr =
- AB8500_CODEC_CR5_MUTLINR_ENABLED;
- p_ab8500_codec_configuration->cr5_mutmic1 =
- AB8500_CODEC_CR5_MUTMIC1_DISABLED;
- p_ab8500_codec_configuration->cr5_mutmic2 =
- AB8500_CODEC_CR5_MUTMIC2_ENABLED;
-
- break;
-
- case AB8500_CODEC_SRC_MICROPHONE_2:
- p_ab8500_codec_configuration->cr5_enlinl =
- AB8500_CODEC_CR5_ENLINL_DISABLED;
- p_ab8500_codec_configuration->cr5_enlinr =
- AB8500_CODEC_CR5_ENLINR_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic1 =
- AB8500_CODEC_CR6_ENDMIC1_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic2 =
- AB8500_CODEC_CR6_ENDMIC2_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic3 =
- AB8500_CODEC_CR6_ENDMIC3_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic4 =
- AB8500_CODEC_CR6_ENDMIC4_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic5 =
- AB8500_CODEC_CR6_ENDMIC5_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic6 =
- AB8500_CODEC_CR6_ENDMIC6_DISABLED;
- p_ab8500_codec_configuration->cr5_enmic1 =
- AB8500_CODEC_CR5_ENMIC1_DISABLED;
- p_ab8500_codec_configuration->cr5_enmic2 =
- AB8500_CODEC_CR5_ENMIC2_ENABLED;
-
- p_ab8500_codec_configuration->cr7_enadcmic =
- AB8500_CODEC_CR7_ENADCMIC_ENABLED;
- p_ab8500_codec_configuration->cr7_linrsel =
- AB8500_CODEC_CR7_LINRSEL_MIC2;
- p_ab8500_codec_configuration->cr7_enadclinl =
- AB8500_CODEC_CR7_ENADCLINL_DISABLED;
- p_ab8500_codec_configuration->cr7_enadclinr =
- AB8500_CODEC_CR7_ENADCLINR_DISABLED;
-
- p_ab8500_codec_configuration->cr5_mutlinl =
- AB8500_CODEC_CR5_MUTLINL_ENABLED;
- p_ab8500_codec_configuration->cr5_mutlinr =
- AB8500_CODEC_CR5_MUTLINR_ENABLED;
- p_ab8500_codec_configuration->cr5_mutmic1 =
- AB8500_CODEC_CR5_MUTMIC1_ENABLED;
- p_ab8500_codec_configuration->cr5_mutmic2 =
- AB8500_CODEC_CR5_MUTMIC2_DISABLED;
-
- break;
-
- case AB8500_CODEC_SRC_D_MICROPHONE_1:
- p_ab8500_codec_configuration->cr5_enlinl =
- AB8500_CODEC_CR5_ENLINL_DISABLED;
- p_ab8500_codec_configuration->cr5_enlinr =
- AB8500_CODEC_CR5_ENLINR_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic1 =
- AB8500_CODEC_CR6_ENDMIC1_ENABLED;
- p_ab8500_codec_configuration->cr6_endmic2 =
- AB8500_CODEC_CR6_ENDMIC2_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic3 =
- AB8500_CODEC_CR6_ENDMIC3_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic4 =
- AB8500_CODEC_CR6_ENDMIC4_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic5 =
- AB8500_CODEC_CR6_ENDMIC5_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic6 =
- AB8500_CODEC_CR6_ENDMIC6_DISABLED;
- p_ab8500_codec_configuration->cr5_enmic1 =
- AB8500_CODEC_CR5_ENMIC1_DISABLED;
- p_ab8500_codec_configuration->cr5_enmic2 =
- AB8500_CODEC_CR5_ENMIC2_DISABLED;
-
- p_ab8500_codec_configuration->cr7_enadclinl =
- AB8500_CODEC_CR7_ENADCLINL_DISABLED;
- p_ab8500_codec_configuration->cr7_enadclinr =
- AB8500_CODEC_CR7_ENADCLINR_DISABLED;
-
- p_ab8500_codec_configuration->cr63_ad1sel =
- AB8500_CODEC_CR63_AD1SEL_DMIC1_SELECTED;
-
- p_ab8500_codec_configuration->cr5_mutlinl =
- AB8500_CODEC_CR5_MUTLINL_ENABLED;
- p_ab8500_codec_configuration->cr5_mutlinr =
- AB8500_CODEC_CR5_MUTLINR_ENABLED;
- p_ab8500_codec_configuration->cr5_mutmic1 =
- AB8500_CODEC_CR5_MUTMIC1_ENABLED;
- p_ab8500_codec_configuration->cr5_mutmic2 =
- AB8500_CODEC_CR5_MUTMIC2_ENABLED;
-
- break;
-
- case AB8500_CODEC_SRC_D_MICROPHONE_2:
- p_ab8500_codec_configuration->cr5_enlinl =
- AB8500_CODEC_CR5_ENLINL_DISABLED;
- p_ab8500_codec_configuration->cr5_enlinr =
- AB8500_CODEC_CR5_ENLINR_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic1 =
- AB8500_CODEC_CR6_ENDMIC1_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic2 =
- AB8500_CODEC_CR6_ENDMIC2_ENABLED;
- p_ab8500_codec_configuration->cr6_endmic3 =
- AB8500_CODEC_CR6_ENDMIC3_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic4 =
- AB8500_CODEC_CR6_ENDMIC4_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic5 =
- AB8500_CODEC_CR6_ENDMIC5_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic6 =
- AB8500_CODEC_CR6_ENDMIC6_DISABLED;
- p_ab8500_codec_configuration->cr5_enmic1 =
- AB8500_CODEC_CR5_ENMIC1_DISABLED;
- p_ab8500_codec_configuration->cr5_enmic2 =
- AB8500_CODEC_CR5_ENMIC2_DISABLED;
-
- p_ab8500_codec_configuration->cr7_enadclinl =
- AB8500_CODEC_CR7_ENADCLINL_DISABLED;
- p_ab8500_codec_configuration->cr7_enadclinr =
- AB8500_CODEC_CR7_ENADCLINR_DISABLED;
-
- p_ab8500_codec_configuration->cr63_ad2sel =
- AB8500_CODEC_CR63_AD2SEL_DMIC2_SELECTED;
-
- p_ab8500_codec_configuration->cr5_mutlinl =
- AB8500_CODEC_CR5_MUTLINL_ENABLED;
- p_ab8500_codec_configuration->cr5_mutlinr =
- AB8500_CODEC_CR5_MUTLINR_ENABLED;
- p_ab8500_codec_configuration->cr5_mutmic1 =
- AB8500_CODEC_CR5_MUTMIC1_ENABLED;
- p_ab8500_codec_configuration->cr5_mutmic2 =
- AB8500_CODEC_CR5_MUTMIC2_ENABLED;
-
- break;
-
- case AB8500_CODEC_SRC_D_MICROPHONE_3:
- p_ab8500_codec_configuration->cr5_enlinl =
- AB8500_CODEC_CR5_ENLINL_DISABLED;
- p_ab8500_codec_configuration->cr5_enlinr =
- AB8500_CODEC_CR5_ENLINR_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic1 =
- AB8500_CODEC_CR6_ENDMIC1_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic2 =
- AB8500_CODEC_CR6_ENDMIC2_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic3 =
- AB8500_CODEC_CR6_ENDMIC3_ENABLED;
- p_ab8500_codec_configuration->cr6_endmic4 =
- AB8500_CODEC_CR6_ENDMIC4_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic5 =
- AB8500_CODEC_CR6_ENDMIC5_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic6 =
- AB8500_CODEC_CR6_ENDMIC6_DISABLED;
- p_ab8500_codec_configuration->cr5_enmic1 =
- AB8500_CODEC_CR5_ENMIC1_DISABLED;
- p_ab8500_codec_configuration->cr5_enmic2 =
- AB8500_CODEC_CR5_ENMIC2_DISABLED;
-
- p_ab8500_codec_configuration->cr7_enadclinl =
- AB8500_CODEC_CR7_ENADCLINL_DISABLED;
- p_ab8500_codec_configuration->cr7_enadclinr =
- AB8500_CODEC_CR7_ENADCLINR_DISABLED;
-
- p_ab8500_codec_configuration->cr63_ad3sel =
- AB8500_CODEC_CR63_AD3SEL_DMIC3_SELECTED;
-
- p_ab8500_codec_configuration->cr5_mutlinl =
- AB8500_CODEC_CR5_MUTLINL_ENABLED;
- p_ab8500_codec_configuration->cr5_mutlinr =
- AB8500_CODEC_CR5_MUTLINR_ENABLED;
- p_ab8500_codec_configuration->cr5_mutmic1 =
- AB8500_CODEC_CR5_MUTMIC1_ENABLED;
- p_ab8500_codec_configuration->cr5_mutmic2 =
- AB8500_CODEC_CR5_MUTMIC2_ENABLED;
-
- break;
-
- case AB8500_CODEC_SRC_D_MICROPHONE_4:
- p_ab8500_codec_configuration->cr5_enlinl =
- AB8500_CODEC_CR5_ENLINL_DISABLED;
- p_ab8500_codec_configuration->cr5_enlinr =
- AB8500_CODEC_CR5_ENLINR_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic1 =
- AB8500_CODEC_CR6_ENDMIC1_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic2 =
- AB8500_CODEC_CR6_ENDMIC2_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic3 =
- AB8500_CODEC_CR6_ENDMIC3_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic4 =
- AB8500_CODEC_CR6_ENDMIC4_ENABLED;
- p_ab8500_codec_configuration->cr6_endmic5 =
- AB8500_CODEC_CR6_ENDMIC5_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic6 =
- AB8500_CODEC_CR6_ENDMIC6_DISABLED;
- p_ab8500_codec_configuration->cr5_enmic1 =
- AB8500_CODEC_CR5_ENMIC1_DISABLED;
- p_ab8500_codec_configuration->cr5_enmic2 =
- AB8500_CODEC_CR5_ENMIC2_DISABLED;
-
- p_ab8500_codec_configuration->cr7_enadclinl =
- AB8500_CODEC_CR7_ENADCLINL_DISABLED;
- p_ab8500_codec_configuration->cr7_enadclinr =
- AB8500_CODEC_CR7_ENADCLINR_DISABLED;
-
- p_ab8500_codec_configuration->cr5_mutlinl =
- AB8500_CODEC_CR5_MUTLINL_ENABLED;
- p_ab8500_codec_configuration->cr5_mutlinr =
- AB8500_CODEC_CR5_MUTLINR_ENABLED;
- p_ab8500_codec_configuration->cr5_mutmic1 =
- AB8500_CODEC_CR5_MUTMIC1_ENABLED;
- p_ab8500_codec_configuration->cr5_mutmic2 =
- AB8500_CODEC_CR5_MUTMIC2_ENABLED;
-
- break;
-
- case AB8500_CODEC_SRC_D_MICROPHONE_5:
- p_ab8500_codec_configuration->cr5_enlinl =
- AB8500_CODEC_CR5_ENLINL_DISABLED;
- p_ab8500_codec_configuration->cr5_enlinr =
- AB8500_CODEC_CR5_ENLINR_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic1 =
- AB8500_CODEC_CR6_ENDMIC1_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic2 =
- AB8500_CODEC_CR6_ENDMIC2_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic3 =
- AB8500_CODEC_CR6_ENDMIC3_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic4 =
- AB8500_CODEC_CR6_ENDMIC4_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic5 =
- AB8500_CODEC_CR6_ENDMIC5_ENABLED;
- p_ab8500_codec_configuration->cr6_endmic6 =
- AB8500_CODEC_CR6_ENDMIC6_DISABLED;
- p_ab8500_codec_configuration->cr5_enmic1 =
- AB8500_CODEC_CR5_ENMIC1_DISABLED;
- p_ab8500_codec_configuration->cr5_enmic2 =
- AB8500_CODEC_CR5_ENMIC2_DISABLED;
-
- p_ab8500_codec_configuration->cr7_enadclinl =
- AB8500_CODEC_CR7_ENADCLINL_DISABLED;
- p_ab8500_codec_configuration->cr7_enadclinr =
- AB8500_CODEC_CR7_ENADCLINR_DISABLED;
-
- p_ab8500_codec_configuration->cr63_ad5sel =
- AB8500_CODEC_CR63_AD5SEL_DMIC5_SELECTED;
-
- p_ab8500_codec_configuration->cr5_mutlinl =
- AB8500_CODEC_CR5_MUTLINL_ENABLED;
- p_ab8500_codec_configuration->cr5_mutlinr =
- AB8500_CODEC_CR5_MUTLINR_ENABLED;
- p_ab8500_codec_configuration->cr5_mutmic1 =
- AB8500_CODEC_CR5_MUTMIC1_ENABLED;
- p_ab8500_codec_configuration->cr5_mutmic2 =
- AB8500_CODEC_CR5_MUTMIC2_ENABLED;
-
- break;
-
- case AB8500_CODEC_SRC_D_MICROPHONE_6:
- p_ab8500_codec_configuration->cr5_enlinl =
- AB8500_CODEC_CR5_ENLINL_DISABLED;
- p_ab8500_codec_configuration->cr5_enlinr =
- AB8500_CODEC_CR5_ENLINR_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic1 =
- AB8500_CODEC_CR6_ENDMIC1_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic2 =
- AB8500_CODEC_CR6_ENDMIC2_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic3 =
- AB8500_CODEC_CR6_ENDMIC3_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic4 =
- AB8500_CODEC_CR6_ENDMIC4_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic5 =
- AB8500_CODEC_CR6_ENDMIC5_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic6 =
- AB8500_CODEC_CR6_ENDMIC6_ENABLED;
- p_ab8500_codec_configuration->cr5_enmic1 =
- AB8500_CODEC_CR5_ENMIC1_DISABLED;
- p_ab8500_codec_configuration->cr5_enmic2 =
- AB8500_CODEC_CR5_ENMIC2_DISABLED;
-
- p_ab8500_codec_configuration->cr7_enadclinl =
- AB8500_CODEC_CR7_ENADCLINL_DISABLED;
- p_ab8500_codec_configuration->cr7_enadclinr =
- AB8500_CODEC_CR7_ENADCLINR_DISABLED;
-
- p_ab8500_codec_configuration->cr63_ad6sel =
- AB8500_CODEC_CR63_AD6SEL_DMIC6_SELECTED;
-
- p_ab8500_codec_configuration->cr5_mutlinl =
- AB8500_CODEC_CR5_MUTLINL_ENABLED;
- p_ab8500_codec_configuration->cr5_mutlinr =
- AB8500_CODEC_CR5_MUTLINR_ENABLED;
- p_ab8500_codec_configuration->cr5_mutmic1 =
- AB8500_CODEC_CR5_MUTMIC1_ENABLED;
- p_ab8500_codec_configuration->cr5_mutmic2 =
- AB8500_CODEC_CR5_MUTMIC2_ENABLED;
-
- break;
-
- case AB8500_CODEC_SRC_ALL:
- p_ab8500_codec_configuration->cr5_enlinl =
- AB8500_CODEC_CR5_ENLINL_ENABLED;
- p_ab8500_codec_configuration->cr5_enlinr =
- AB8500_CODEC_CR5_ENLINR_ENABLED;
- p_ab8500_codec_configuration->cr5_enmic1 =
- AB8500_CODEC_CR5_ENMIC1_ENABLED;
- p_ab8500_codec_configuration->cr5_enmic2 =
- AB8500_CODEC_CR5_ENMIC2_ENABLED;
- p_ab8500_codec_configuration->cr6_endmic1 =
- AB8500_CODEC_CR6_ENDMIC1_ENABLED;
- p_ab8500_codec_configuration->cr6_endmic2 =
- AB8500_CODEC_CR6_ENDMIC2_ENABLED;
- p_ab8500_codec_configuration->cr6_endmic3 =
- AB8500_CODEC_CR6_ENDMIC3_ENABLED;
- p_ab8500_codec_configuration->cr6_endmic4 =
- AB8500_CODEC_CR6_ENDMIC4_ENABLED;
- p_ab8500_codec_configuration->cr6_endmic5 =
- AB8500_CODEC_CR6_ENDMIC5_ENABLED;
- p_ab8500_codec_configuration->cr6_endmic6 =
- AB8500_CODEC_CR6_ENDMIC6_ENABLED;
- p_ab8500_codec_configuration->cr7_enadcmic =
- AB8500_CODEC_CR7_ENADCMIC_ENABLED;
- p_ab8500_codec_configuration->cr7_enadclinl =
- AB8500_CODEC_CR7_ENADCLINL_ENABLED;
- p_ab8500_codec_configuration->cr7_enadclinr =
- AB8500_CODEC_CR7_ENADCLINR_ENABLED;
-
- p_ab8500_codec_configuration->cr5_mutlinl =
- AB8500_CODEC_CR5_MUTLINL_DISABLED;
- p_ab8500_codec_configuration->cr5_mutlinr =
- AB8500_CODEC_CR5_MUTLINR_DISABLED;
- p_ab8500_codec_configuration->cr5_mutmic1 =
- AB8500_CODEC_CR5_MUTMIC1_DISABLED;
- p_ab8500_codec_configuration->cr5_mutmic2 =
- AB8500_CODEC_CR5_MUTMIC2_DISABLED;
-
- break;
-
- default:
- ab8500_codec_error = AB8500_CODEC_INVALID_PARAMETER;
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-PRIVATE t_ab8500_codec_error ab8500_codec_ProgramDirectionOUT(void)
-{
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
- t_ab8500_codec_configuration *p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
-
- switch (g_ab8500_codec_system_context.ab8500_codec_dest) {
- case AB8500_CODEC_DEST_HEADSET:
- p_ab8500_codec_configuration->cr7_endrvhsl =
- AB8500_CODEC_CR7_ENDRVHSL_ENABLED;
- p_ab8500_codec_configuration->cr7_endrvhsr =
- AB8500_CODEC_CR7_ENDRVHSR_ENABLED;
-
- p_ab8500_codec_configuration->cr8_enear =
- AB8500_CODEC_CR8_ENEAR_DISABLED;
- p_ab8500_codec_configuration->cr8_enhsl =
- AB8500_CODEC_CR8_ENHSL_ENABLED;
- p_ab8500_codec_configuration->cr8_enhsr =
- AB8500_CODEC_CR8_ENHSR_ENABLED;
- p_ab8500_codec_configuration->cr8_enhfl =
- AB8500_CODEC_CR8_ENHFL_DISABLED;
- p_ab8500_codec_configuration->cr8_enhfr =
- AB8500_CODEC_CR8_ENHFR_DISABLED;
- p_ab8500_codec_configuration->cr8_envibl =
- AB8500_CODEC_CR8_ENVIBL_DISABLED;
- p_ab8500_codec_configuration->cr8_envibr =
- AB8500_CODEC_CR8_ENVIBR_DISABLED;
-
- p_ab8500_codec_configuration->cr9_endachsl =
- AB8500_CODEC_CR9_ENDACHSL_ENABLED;
- p_ab8500_codec_configuration->cr9_endachsr =
- AB8500_CODEC_CR9_ENDACHSR_ENABLED;
-
- p_ab8500_codec_configuration->cr10_muteear =
- AB8500_CODEC_CR10_MUTEEAR_ENABLED;
- p_ab8500_codec_configuration->cr10_mutehsl =
- AB8500_CODEC_CR10_MUTEHSL_DISABLED;
- p_ab8500_codec_configuration->cr10_mutehsr =
- AB8500_CODEC_CR10_MUTEHSR_DISABLED;
- p_ab8500_codec_configuration->cr10_mutehfl =
- AB8500_CODEC_CR10_MUTEHFL_ENABLED;
- p_ab8500_codec_configuration->cr10_mutehfr =
- AB8500_CODEC_CR10_MUTEHFR_ENABLED;
- p_ab8500_codec_configuration->cr10_mutevibl =
- AB8500_CODEC_CR10_MUTEVIBL_ENABLED;
- p_ab8500_codec_configuration->cr10_mutevibr =
- AB8500_CODEC_CR10_MUTEVIBR_ENABLED;
-
- p_ab8500_codec_configuration->cr12_encphs =
- AB8500_CODEC_CR12_ENCPHS_ENABLED;
-
- break;
-
- case AB8500_CODEC_DEST_EARPIECE:
- p_ab8500_codec_configuration->cr8_enear =
- AB8500_CODEC_CR8_ENEAR_ENABLED;
- p_ab8500_codec_configuration->cr8_enhsl =
- AB8500_CODEC_CR8_ENHSL_DISABLED;
- p_ab8500_codec_configuration->cr8_enhsr =
- AB8500_CODEC_CR8_ENHSR_DISABLED;
- p_ab8500_codec_configuration->cr8_enhfl =
- AB8500_CODEC_CR8_ENHFL_DISABLED;
- p_ab8500_codec_configuration->cr8_enhfr =
- AB8500_CODEC_CR8_ENHFR_DISABLED;
- p_ab8500_codec_configuration->cr8_envibl =
- AB8500_CODEC_CR8_ENVIBL_DISABLED;
- p_ab8500_codec_configuration->cr8_envibr =
- AB8500_CODEC_CR8_ENVIBR_DISABLED;
-
- p_ab8500_codec_configuration->cr9_endacear =
- AB8500_CODEC_CR9_ENDACEAR_ENABLED;
-
- p_ab8500_codec_configuration->cr10_muteear =
- AB8500_CODEC_CR10_MUTEEAR_DISABLED;
- p_ab8500_codec_configuration->cr10_mutehsl =
- AB8500_CODEC_CR10_MUTEHSL_ENABLED;
- p_ab8500_codec_configuration->cr10_mutehsr =
- AB8500_CODEC_CR10_MUTEHSR_ENABLED;
- p_ab8500_codec_configuration->cr10_mutehfl =
- AB8500_CODEC_CR10_MUTEHFL_ENABLED;
- p_ab8500_codec_configuration->cr10_mutehfr =
- AB8500_CODEC_CR10_MUTEHFR_ENABLED;
- p_ab8500_codec_configuration->cr10_mutevibl =
- AB8500_CODEC_CR10_MUTEVIBL_ENABLED;
- p_ab8500_codec_configuration->cr10_mutevibr =
- AB8500_CODEC_CR10_MUTEVIBR_ENABLED;
-
- break;
-
- case AB8500_CODEC_DEST_HANDSFREE:
- p_ab8500_codec_configuration->cr8_enear =
- AB8500_CODEC_CR8_ENEAR_DISABLED;
- p_ab8500_codec_configuration->cr8_enhsl =
- AB8500_CODEC_CR8_ENHSL_DISABLED;
- p_ab8500_codec_configuration->cr8_enhsr =
- AB8500_CODEC_CR8_ENHSR_DISABLED;
- p_ab8500_codec_configuration->cr8_enhfl =
- AB8500_CODEC_CR8_ENHFL_ENABLED;
- p_ab8500_codec_configuration->cr8_enhfr =
- AB8500_CODEC_CR8_ENHFR_ENABLED;
- p_ab8500_codec_configuration->cr8_envibl =
- AB8500_CODEC_CR8_ENVIBL_DISABLED;
- p_ab8500_codec_configuration->cr8_envibr =
- AB8500_CODEC_CR8_ENVIBR_DISABLED;
-
- p_ab8500_codec_configuration->cr9_endachfl =
- AB8500_CODEC_CR9_ENDACHFL_ENABLED;
- p_ab8500_codec_configuration->cr9_endachfr =
- AB8500_CODEC_CR9_ENDACHFR_ENABLED;
-
- p_ab8500_codec_configuration->cr10_muteear =
- AB8500_CODEC_CR10_MUTEEAR_ENABLED;
- p_ab8500_codec_configuration->cr10_mutehsl =
- AB8500_CODEC_CR10_MUTEHSL_ENABLED;
- p_ab8500_codec_configuration->cr10_mutehsr =
- AB8500_CODEC_CR10_MUTEHSR_ENABLED;
- p_ab8500_codec_configuration->cr10_mutehfl =
- AB8500_CODEC_CR10_MUTEHFL_DISABLED;
- p_ab8500_codec_configuration->cr10_mutehfr =
- AB8500_CODEC_CR10_MUTEHFR_DISABLED;
- p_ab8500_codec_configuration->cr10_mutevibl =
- AB8500_CODEC_CR10_MUTEVIBL_ENABLED;
- p_ab8500_codec_configuration->cr10_mutevibr =
- AB8500_CODEC_CR10_MUTEVIBR_ENABLED;
-
- break;
-
- case AB8500_CODEC_DEST_VIBRATOR_L:
- p_ab8500_codec_configuration->cr8_enear =
- AB8500_CODEC_CR8_ENEAR_DISABLED;
- p_ab8500_codec_configuration->cr8_enhsl =
- AB8500_CODEC_CR8_ENHSL_DISABLED;
- p_ab8500_codec_configuration->cr8_enhsr =
- AB8500_CODEC_CR8_ENHSR_DISABLED;
- p_ab8500_codec_configuration->cr8_enhfl =
- AB8500_CODEC_CR8_ENHFL_DISABLED;
- p_ab8500_codec_configuration->cr8_enhfr =
- AB8500_CODEC_CR8_ENHFR_DISABLED;
- p_ab8500_codec_configuration->cr8_envibl =
- AB8500_CODEC_CR8_ENVIBL_ENABLED;
- p_ab8500_codec_configuration->cr8_envibr =
- AB8500_CODEC_CR8_ENVIBR_DISABLED;
-
- p_ab8500_codec_configuration->cr9_endacvibl =
- AB8500_CODEC_CR9_ENDACVIBL_ENABLED;
-
- p_ab8500_codec_configuration->cr10_muteear =
- AB8500_CODEC_CR10_MUTEEAR_ENABLED;
- p_ab8500_codec_configuration->cr10_mutehsl =
- AB8500_CODEC_CR10_MUTEHSL_ENABLED;
- p_ab8500_codec_configuration->cr10_mutehsr =
- AB8500_CODEC_CR10_MUTEHSR_ENABLED;
- p_ab8500_codec_configuration->cr10_mutehfl =
- AB8500_CODEC_CR10_MUTEHFL_ENABLED;
- p_ab8500_codec_configuration->cr10_mutehfr =
- AB8500_CODEC_CR10_MUTEHFR_ENABLED;
- p_ab8500_codec_configuration->cr10_mutevibl =
- AB8500_CODEC_CR10_MUTEVIBL_DISABLED;
- p_ab8500_codec_configuration->cr10_mutevibr =
- AB8500_CODEC_CR10_MUTEVIBR_ENABLED;
-
- p_ab8500_codec_configuration->cr15_pwmtovibl =
- AB8500_CODEC_CR15_PWMTOVIBL_PWM;
- p_ab8500_codec_configuration->cr15_pwmlctrl =
- AB8500_CODEC_CR15_PWMLCTRL_PWMNPLDUTYCYCLE;
- p_ab8500_codec_configuration->cr15_pwmnlctrl =
- AB8500_CODEC_CR15_PWMNLCTRL_PWMNLDUTYCYCLE;
- p_ab8500_codec_configuration->cr15_pwmplctrl =
- AB8500_CODEC_CR15_PWMPLCTRL_PWMPLDUTYCYCLE;
-
- break;
-
- case AB8500_CODEC_DEST_VIBRATOR_R:
- p_ab8500_codec_configuration->cr8_enear =
- AB8500_CODEC_CR8_ENEAR_DISABLED;
- p_ab8500_codec_configuration->cr8_enhsl =
- AB8500_CODEC_CR8_ENHSL_DISABLED;
- p_ab8500_codec_configuration->cr8_enhsr =
- AB8500_CODEC_CR8_ENHSR_DISABLED;
- p_ab8500_codec_configuration->cr8_enhfl =
- AB8500_CODEC_CR8_ENHFL_DISABLED;
- p_ab8500_codec_configuration->cr8_enhfr =
- AB8500_CODEC_CR8_ENHFR_DISABLED;
- p_ab8500_codec_configuration->cr8_envibl =
- AB8500_CODEC_CR8_ENVIBL_DISABLED;
- p_ab8500_codec_configuration->cr8_envibr =
- AB8500_CODEC_CR8_ENVIBR_ENABLED;
-
- p_ab8500_codec_configuration->cr9_endacvibr =
- AB8500_CODEC_CR9_ENDACVIBR_ENABLED;
-
- p_ab8500_codec_configuration->cr10_muteear =
- AB8500_CODEC_CR10_MUTEEAR_ENABLED;
- p_ab8500_codec_configuration->cr10_mutehsl =
- AB8500_CODEC_CR10_MUTEHSL_ENABLED;
- p_ab8500_codec_configuration->cr10_mutehsr =
- AB8500_CODEC_CR10_MUTEHSR_ENABLED;
- p_ab8500_codec_configuration->cr10_mutehfl =
- AB8500_CODEC_CR10_MUTEHFL_ENABLED;
- p_ab8500_codec_configuration->cr10_mutehfr =
- AB8500_CODEC_CR10_MUTEHFR_ENABLED;
- p_ab8500_codec_configuration->cr10_mutevibl =
- AB8500_CODEC_CR10_MUTEVIBL_ENABLED;
- p_ab8500_codec_configuration->cr10_mutevibr =
- AB8500_CODEC_CR10_MUTEVIBR_DISABLED;
-
- p_ab8500_codec_configuration->cr15_pwmtovibr =
- AB8500_CODEC_CR15_PWMTOVIBR_PWM;
- p_ab8500_codec_configuration->cr15_pwmrctrl =
- AB8500_CODEC_CR15_PWMRCTRL_PWMNPRDUTYCYCLE;
- p_ab8500_codec_configuration->cr15_pwmnrctrl =
- AB8500_CODEC_CR15_PWMNRCTRL_PWMNRDUTYCYCLE;
- p_ab8500_codec_configuration->cr15_pwmprctrl =
- AB8500_CODEC_CR15_PWMPRCTRL_PWMPRDUTYCYCLE;
-
- break;
-
- case AB8500_CODEC_DEST_ALL:
- p_ab8500_codec_configuration->cr8_enhsl =
- AB8500_CODEC_CR8_ENHSL_ENABLED;
- p_ab8500_codec_configuration->cr8_enhsr =
- AB8500_CODEC_CR8_ENHSR_ENABLED;
- p_ab8500_codec_configuration->cr8_enear =
- AB8500_CODEC_CR8_ENEAR_ENABLED;
- p_ab8500_codec_configuration->cr8_enhfl =
- AB8500_CODEC_CR8_ENHFL_ENABLED;
- p_ab8500_codec_configuration->cr8_enhfr =
- AB8500_CODEC_CR8_ENHFR_ENABLED;
- p_ab8500_codec_configuration->cr8_envibl =
- AB8500_CODEC_CR8_ENVIBL_ENABLED;
- p_ab8500_codec_configuration->cr8_envibr =
- AB8500_CODEC_CR8_ENVIBR_ENABLED;
-
- p_ab8500_codec_configuration->cr9_endacear =
- AB8500_CODEC_CR9_ENDACEAR_ENABLED;
- p_ab8500_codec_configuration->cr9_endachfl =
- AB8500_CODEC_CR9_ENDACHFL_ENABLED;
- p_ab8500_codec_configuration->cr9_endachfr =
- AB8500_CODEC_CR9_ENDACHFR_ENABLED;
- p_ab8500_codec_configuration->cr9_endacvibl =
- AB8500_CODEC_CR9_ENDACVIBL_ENABLED;
- p_ab8500_codec_configuration->cr9_endacvibr =
- AB8500_CODEC_CR9_ENDACVIBR_ENABLED;
-
- p_ab8500_codec_configuration->cr10_mutehsl =
- AB8500_CODEC_CR10_MUTEHSL_DISABLED;
- p_ab8500_codec_configuration->cr10_mutehsr =
- AB8500_CODEC_CR10_MUTEHSR_DISABLED;
- p_ab8500_codec_configuration->cr10_muteear =
- AB8500_CODEC_CR10_MUTEEAR_DISABLED;
- p_ab8500_codec_configuration->cr10_mutehfl =
- AB8500_CODEC_CR10_MUTEHFL_DISABLED;
- p_ab8500_codec_configuration->cr10_mutehfr =
- AB8500_CODEC_CR10_MUTEHFR_DISABLED;
- p_ab8500_codec_configuration->cr10_mutevibl =
- AB8500_CODEC_CR10_MUTEVIBL_DISABLED;
- p_ab8500_codec_configuration->cr10_mutevibr =
- AB8500_CODEC_CR10_MUTEVIBR_DISABLED;
-
- p_ab8500_codec_configuration->cr15_pwmtovibl =
- AB8500_CODEC_CR15_PWMTOVIBL_PWM;
- p_ab8500_codec_configuration->cr15_pwmlctrl =
- AB8500_CODEC_CR15_PWMLCTRL_PWMNPLDUTYCYCLE;
- p_ab8500_codec_configuration->cr15_pwmnlctrl =
- AB8500_CODEC_CR15_PWMNLCTRL_PWMNLDUTYCYCLE;
- p_ab8500_codec_configuration->cr15_pwmplctrl =
- AB8500_CODEC_CR15_PWMPLCTRL_PWMPLDUTYCYCLE;
- p_ab8500_codec_configuration->cr15_pwmtovibr =
- AB8500_CODEC_CR15_PWMTOVIBR_PWM;
- p_ab8500_codec_configuration->cr15_pwmrctrl =
- AB8500_CODEC_CR15_PWMRCTRL_PWMNPRDUTYCYCLE;
- p_ab8500_codec_configuration->cr15_pwmnrctrl =
- AB8500_CODEC_CR15_PWMNRCTRL_PWMNRDUTYCYCLE;
- p_ab8500_codec_configuration->cr15_pwmprctrl =
- AB8500_CODEC_CR15_PWMPRCTRL_PWMPRDUTYCYCLE;
-
- break;
-
- default:
- ab8500_codec_error = AB8500_CODEC_INVALID_PARAMETER;
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-PRIVATE t_ab8500_codec_error ab8500_codec_DestPowerControlUpdateCR(void)
-{
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
-
- ab8500_codec_error = ab8500_codec_UpdateCR8();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR9();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR10();
- if (ab8500_codec_error != AB8500_CODEC_OK) {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
-
- ab8500_codec_error = ab8500_codec_UpdateCR15();
-
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
diff --git a/sound/ab8500_codec_v1_0.c b/sound/ab8500_codec_v1_0.c
deleted file mode 100644
index 5df1ca3eae4..00000000000
--- a/sound/ab8500_codec_v1_0.c
+++ /dev/null
@@ -1,6405 +0,0 @@
-/*****************************************************************************/
-
-/**
-* © ST-Ericsson, 2009 - All rights reserved
-* Reproduction and Communication of this document is strictly prohibited
-* unless specifically authorized in writing by ST-Ericsson
-*
-* \brief This module provides some support routines for the AB8500 CODEC
-* \author ST-Ericsson
-*/
-/*****************************************************************************/
-
-/*----------------------------------------------------------------------------
- * Includes
- *---------------------------------------------------------------------------*/
-
-#ifdef CONFIG_U8500_AB8500_CUT10
-#include <mach/ab8500_codec_v1_0.h>
-#include <mach/ab8500_codec_p_v1_0.h>
-#else /* */
-#include <mach/ab8500_codec.h>
-#include <mach/ab8500_codec_p.h>
-#endif /* */
-
-/*--------------------------------------------------------------------------*
- * debug stuff *
- *--------------------------------------------------------------------------*/
-#ifdef __DEBUG
-#define MY_DEBUG_LEVEL_VAR_NAME myDebugLevel_AB8500_CODEC
-#define MY_DEBUG_ID myDebugID_AB8500_CODEC
-PRIVATE t_dbg_level MY_DEBUG_LEVEL_VAR_NAME = DEBUG_LEVEL0;
-PRIVATE t_dbg_id MY_DEBUG_ID = AB8500_CODEC_HCL_DBG_ID;
-
-#endif /* */
-
-/*--------------------------------------------------------------------------*
- * Global data for interrupt mode management *
- *--------------------------------------------------------------------------*/
-PRIVATE t_ab8500_codec_system_context g_ab8500_codec_system_context;
-
-/*--------------------------------------------------------------------------*
- * Default Values *
- *--------------------------------------------------------------------------*/
-#define AB8500_CODEC_DEFAULT_SLAVE_ADDRESS_OF_CODEC 0xD
-#define AB8500_CODEC_DEFAULT_DIRECTION AB8500_CODEC_DIRECTION_OUT
-
-#define AB8500_CODEC_DEFAULT_MODE_IN AB8500_CODEC_MODE_VOICE
-#define AB8500_CODEC_DEFAULT_MODE_OUT AB8500_CODEC_MODE_VOICE
-
-#define AB8500_CODEC_DEFAULT_INPUT_SRC AB8500_CODEC_SRC_MICROPHONE_1A
-#define AB8500_CODEC_DEFAULT_OUTPUT_DEST AB8500_CODEC_DEST_HEADSET
-
-#define AB8500_CODEC_DEFAULT_VOLUME_LEFT_IN 75
-#define AB8500_CODEC_DEFAULT_VOLUME_RIGHT_IN 75
-#define AB8500_CODEC_DEFAULT_VOLUME_LEFT_OUT 75
-#define AB8500_CODEC_DEFAULT_VOLUME_RIGHT_OUT 75
-
-/*---------------------------------------------------------------------
- * PRIVATE APIs
- *--------------------------------------------------------------------*/
-PRIVATE t_ab8500_codec_error ab8500_codec_ADSlotAllocationSwitch1(IN
- t_ab8500_codec_slot
- ad_slot,
- IN
- t_ab8500_codec_cr31_to_cr46_ad_data_allocation
- value);
-PRIVATE t_ab8500_codec_error ab8500_codec_ADSlotAllocationSwitch2(IN
- t_ab8500_codec_slot
- ad_slot,
- IN
- t_ab8500_codec_cr31_to_cr46_ad_data_allocation
- value);
-PRIVATE t_ab8500_codec_error ab8500_codec_ADSlotAllocationSwitch3(IN
- t_ab8500_codec_slot
- ad_slot,
- IN
- t_ab8500_codec_cr31_to_cr46_ad_data_allocation
- value);
-PRIVATE t_ab8500_codec_error ab8500_codec_ADSlotAllocationSwitch4(IN
- t_ab8500_codec_slot
- ad_slot,
- IN
- t_ab8500_codec_cr31_to_cr46_ad_data_allocation
- value);
-PRIVATE t_ab8500_codec_error ab8500_codec_SrcPowerControlSwitch1(IN
- t_ab8500_codec_src
- src_device,
- t_ab8500_codec_src_state
- state);
-PRIVATE t_ab8500_codec_error ab8500_codec_SrcPowerControlSwitch2(IN
- t_ab8500_codec_src
- src_device,
- t_ab8500_codec_src_state
- state);
-PRIVATE t_ab8500_codec_error ab8500_codec_SetModeAndDirectionUpdateCR(void);
-PRIVATE t_ab8500_codec_error ab8500_codec_SetSrcVolumeUpdateCR(void);
-PRIVATE t_ab8500_codec_error ab8500_codec_SetDestVolumeUpdateCR(void);
-PRIVATE t_ab8500_codec_error ab8500_codec_ProgramDirectionIN(void);
-PRIVATE t_ab8500_codec_error ab8500_codec_ProgramDirectionOUT(void);
-PRIVATE t_ab8500_codec_error ab8500_codec_DestPowerControlUpdateCR(void);
-
-/********************************************************************************************/
-/* Name: ab8500_codec_SingleWrite */
-/********************************************************************************************/
- PRIVATE t_ab8500_codec_error ab8500_codec_SingleWrite(t_uint8
- register_offset,
- t_uint8 data)
-{
- return (t_ab8500_codec_error) (AB8500_CODEC_Write
- (register_offset, 0x01, &data));
-}
-
-#if 0
-
-/********************************************************************************************/
-/* Name: ab8500_codec_SingleRead */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_SingleRead(t_uint8
- register_offset,
- t_uint8 data)
-{
- t_uint8 dummy_data = 0xAA;
- return (t_ab8500_codec_error) (AB8500_CODEC_Read
- (register_offset, 0x01, &dummy_data,
- &data));
-}
-
-#endif /* */
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR0 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR0(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr0_powerup, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR0_POWERUP );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr0_enaana, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR0_ENAANA );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR0, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR1 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR1(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr1_swreset, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR1_SWRESET );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR1, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR2 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR2(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr2_enad1, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR2_ENAD1 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr2_enad2, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR2_ENAD2 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr2_enad3, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR2_ENAD3 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr2_enad4, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR2_ENAD4 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr2_enad5, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR2_ENAD5 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr2_enad6, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR2_ENAD6 );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR2, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR3 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR3(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr3_enda1, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR3_ENDA1 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr3_enda2, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR3_ENDA2 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr3_enda3, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR3_ENDA3 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr3_enda4, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR3_ENDA4 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr3_enda5, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR3_ENDA5 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr3_enda6, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR3_ENDA6 );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR3, value));
-}
-
-#if 0
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR4 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR4(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr4_lowpowhs, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR4_LOWPOWHS );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr4_lowpowdachs,
- AB8500_CODEC_MASK_TWO_BITS,
- AB8500_CODEC_CR4_LOWPOWDACHS );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr4_lowpowear, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR4_LOWPOWEAR );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr4_ear_sel_cm, AB8500_CODEC_MASK_TWO_BITS,
- AB8500_CODEC_CR4_EAR_SEL_CM );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr4_hs_hp_en, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR4_HS_HP_EN );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR4, value));
-}
-
-#endif /* */
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR5 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR5(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr5_enmic1, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR5_ENMIC1 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr5_enmic2, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR5_ENMIC2 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr5_enlinl, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR5_ENLINL );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr5_enlinr, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR5_ENLINR );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr5_mutmic1, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR5_MUTMIC1 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr5_mutmic2, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR5_MUTMIC2 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr5_mutlinl, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR5_MUTELINL );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr5_mutlinr, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR5_MUTELINR );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR5, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR6 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR6(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr6_endmic1, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR6_ENDMIC1 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr6_endmic2, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR6_ENDMIC2 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr6_endmic3, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR6_ENDMIC3 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr6_endmic4, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR6_ENDMIC4 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr6_endmic5, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR6_ENDMIC5 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr6_endmic6, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR6_ENDMIC6 );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR6, value));
-}
-
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR7 */
-/********************************************************************************************/
- PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR7(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr7_mic1sel, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR7_MIC1SEL );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr7_linrsel, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR7_LINRSEL );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr7_endrvhsl, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR7_ENDRVHSL );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr7_endrvhsr, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR7_ENDRVHSR );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr7_enadcmic, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR7_ENADCMIC );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr7_enadclinl, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR7_ENADCLINL );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr7_enadclinr, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR7_ENADCLINR );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR7, value));
-}
-
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR8 */
-/********************************************************************************************/
- PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR8(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr8_cp_dis_pldwn,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR8_CP_DIS_PLDWN );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr8_enear, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR8_ENEAR );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr8_enhsl, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR8_ENHSL );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr8_enhsr, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR8_ENHSR );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr8_enhfl, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR8_ENHFL );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr8_enhfr, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR8_ENHFR );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr8_envibl, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR8_ENVIBL );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr8_envibr, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR8_ENVIBR );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR8, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR9 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR9(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr9_endacear, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR9_ENADACEAR );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr9_endachsl, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR9_ENADACHSL );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr9_endachsr, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR9_ENADACHSR );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr9_endachfl, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR9_ENADACHFL );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr9_endachfr, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR9_ENADACHFR );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr9_endacvibl, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR9_ENADACVIBL );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr9_endacvibr, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR9_ENADACVIBR );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR9, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR10 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR10(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr10_muteear, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR10_MUTEEAR );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr10_mutehsl, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR10_MUTEHSL );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr10_mutehsr, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR10_MUTEHSR );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR10, value));
-}
-
-#if 0
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR11 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR11(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr11_earshortpwd,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR11_ENSHORTPWD );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr11_earshortdis,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR11_EARSHORTDIS );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr11_hsshortdis, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR11_HSSHORTDIS );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr11_hspullden, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR11_HSPULLDEN );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr11_hsoscen, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR11_HSOSCEN );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr11_hsfaden, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR11_HSFADEN );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr11_hszcddis, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR11_HSZCDDIS );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR11, value));
-}
-
-#endif /* */
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR12 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR12(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr12_encphs, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR12_ENCPHS );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr12_hsautoen, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR12_HSAUTOEN );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR12, value));
-}
-
-#if 0
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR13 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR13(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr13_envdet_hthresh,
- AB8500_CODEC_MASK_FOUR_BITS,
- AB8500_CODEC_CR13_ENVDET_HTHRESH );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr13_envdet_lthresh,
- AB8500_CODEC_MASK_FOUR_BITS,
- AB8500_CODEC_CR13_ENVDET_LTHRESH );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR13, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR14 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR14(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr14_smpslven, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR14_SMPSLVEN );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr14_envdetsmpsen,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR14_ENVDETSMPSEN );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr14_cplven, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR14_CPLVEN );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr14_envdetcpen, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR14_ENVDETCPEN );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr14_envet_time,
- AB8500_CODEC_MASK_FOUR_BITS,
- AB8500_CODEC_CR14_ENVDET_TIME );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR14, value));
-}
-
-#endif /* */
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR15 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR15(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr15_pwmtovibl, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR15_PWMTOVIBL );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr15_pwmtovibr, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR15_PWMTOVIBR );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr15_pwmlctrl, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR15_PWMLCTRL );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr15_pwmrctrl, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR15_PWMRCTRL );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr15_pwmnlctrl, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR15_PWMNLCTRL );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr15_pwmplctrl, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR15_PWMPLCTRL );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr15_pwmnrctrl, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR15_PWMNRCTRL );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr15_pwmprctrl, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR15_PWMPRCTRL );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR15, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR16 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR16(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr16_pwmnlpol, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR16_PWMNLPOL );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr16_pwmnldutycycle,
- AB8500_CODEC_MASK_SEVEN_BITS,
- AB8500_CODEC_CR16_PWMNLDUTYCYCLE );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR16, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR17 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR17(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr17_pwmplpol, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR17_PWMPLPOL );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr17_pwmpldutycycle,
- AB8500_CODEC_MASK_SEVEN_BITS,
- AB8500_CODEC_CR17_PWMLPDUTYCYCLE );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR17, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR18 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR18(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr18_pwmnrpol, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR18_PWMNRPOL );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr18_pwmnrdutycycle,
- AB8500_CODEC_MASK_SEVEN_BITS,
- AB8500_CODEC_CR18_PWMNRDUTYCYCLE );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR18, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR19 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR19(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr19_pwmprpol, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR19_PWMPRPOL );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr19_pwmprdutycycle,
- AB8500_CODEC_MASK_SEVEN_BITS,
- AB8500_CODEC_CR19_PWMRPDUTYCYCLE );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR19, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR20 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR20(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr20_en_se_mic1,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR20_EN_SE_MIC1 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr20_low_pow_mic1,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR20_LOW_POW_MIC1 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr20_mic1_gain,
- AB8500_CODEC_MASK_FIVE_BITS,
- AB8500_CODEC_CR20_MIC1_GAIN );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR20, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR21 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR21(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr21_en_se_mic2,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR21_EN_SE_MIC2 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr21_low_pow_mic2,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR21_LOW_POW_MIC2 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr21_mic2_gain,
- AB8500_CODEC_MASK_FIVE_BITS,
- AB8500_CODEC_CR21_MIC2_GAIN );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR21, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR22 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR22(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr22_hsl_gain,
- AB8500_CODEC_MASK_FOUR_BITS,
- AB8500_CODEC_CR22_HSL_GAIN );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr22_hsr_gain, AB8500_CODEC_MASK_FOUR_BITS,
- AB8500_CODEC_CR22_HSR_GAIN );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR22, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR23 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR23(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr23_linl_gain,
- AB8500_CODEC_MASK_FOUR_BITS,
- AB8500_CODEC_CR23_LINL_GAIN );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr23_linr_gain,
- AB8500_CODEC_MASK_FOUR_BITS,
- AB8500_CODEC_CR23_LINR_GAIN );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR23, value));
-}
-
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR24 */
-/********************************************************************************************/
- PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR24(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr24_lintohsl_gain,
- AB8500_CODEC_MASK_FIVE_BITS,
- AB8500_CODEC_CR24_LINTOHSL_GAIN );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR24, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR25 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR25(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr25_lintohsr_gain,
- AB8500_CODEC_MASK_FIVE_BITS,
- AB8500_CODEC_CR25_LINTOHSR_GAIN );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR25, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR26 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR26(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr26_ad1nh, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR26_AD1NH );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr26_ad2nh, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR26_AD2NH );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr26_ad3nh, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR26_AD3NH );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr26_ad4nh, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR26_AD4NH );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr26_ad1_voice, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR26_AD1_VOICE );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr26_ad2_voice, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR26_AD2_VOICE );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr26_ad3_voice, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR26_AD3_VOICE );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr26_ad4_voice, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR26_AD4_VOICE );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR26, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR27 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR27(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr27_en_mastgen,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR27_EN_MASTGEN );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr27_if1_bitclk_osr,
- AB8500_CODEC_MASK_TWO_BITS,
- AB8500_CODEC_CR27_IF1_BITCLK_OSR );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr27_enfs_bitclk1,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR27_ENFS_BITCLK1 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr27_if0_bitclk_osr,
- AB8500_CODEC_MASK_TWO_BITS,
- AB8500_CODEC_CR27_IF0_BITCLK_OSR );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr27_enfs_bitclk0,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR27_ENFS_BITCLK0 );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR27, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR28 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR28(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr28_fsync0p, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR28_FSYNC0P );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr28_bitclk0p, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR28_BITCLK0P );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr28_if0del, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR28_IF0DEL );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr28_if0format, AB8500_CODEC_MASK_TWO_BITS,
- AB8500_CODEC_CR28_IF0FORMAT );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr28_if0wl, AB8500_CODEC_MASK_TWO_BITS,
- AB8500_CODEC_CR28_IF0WL );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR28, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR29 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR29(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr29_if0datoif1ad,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR29_IF0DATOIF1AD );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr29_if0cktoif1ck,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR29_IF0CKTOIF1CK );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr29_if1master, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR29_IF1MASTER );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr29_if1datoif0ad,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR29_IF1DATOIF0AD );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr29_if1cktoif0ck,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR29_IF1CKTOIF0CK );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr29_if0master, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR29_IF0MASTER );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr29_if0bfifoen, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR29_IF0BFIFOEN );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR29, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR30 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR30(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr30_fsync1p, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR30_FSYNC1P );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr30_bitclk1p, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR30_BITCLK1P );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr30_if1del, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR30_IF1DEL );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr30_if1format, AB8500_CODEC_MASK_TWO_BITS,
- AB8500_CODEC_CR30_IF1FORMAT );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr30_if1wl, AB8500_CODEC_MASK_TWO_BITS,
- AB8500_CODEC_CR30_IF1WL );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR30, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR31 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR31(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr31_adotoslot1,
- AB8500_CODEC_MASK_FOUR_BITS,
- AB8500_CODEC_CR31_ADOTOSLOT1 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr31_adotoslot0,
- AB8500_CODEC_MASK_FOUR_BITS,
- AB8500_CODEC_CR31_ADOTOSLOT0 );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR31, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR32 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR32(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr32_adotoslot3,
- AB8500_CODEC_MASK_FOUR_BITS,
- AB8500_CODEC_CR32_ADOTOSLOT3 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr32_adotoslot2,
- AB8500_CODEC_MASK_FOUR_BITS,
- AB8500_CODEC_CR32_ADOTOSLOT2 );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR32, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR33 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR33(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr33_adotoslot5,
- AB8500_CODEC_MASK_FOUR_BITS,
- AB8500_CODEC_CR33_ADOTOSLOT5 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr33_adotoslot4,
- AB8500_CODEC_MASK_FOUR_BITS,
- AB8500_CODEC_CR33_ADOTOSLOT4 );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR33, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR34 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR34(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr34_adotoslot7,
- AB8500_CODEC_MASK_FOUR_BITS,
- AB8500_CODEC_CR34_ADOTOSLOT7 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr34_adotoslot6,
- AB8500_CODEC_MASK_FOUR_BITS,
- AB8500_CODEC_CR34_ADOTOSLOT6 );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR34, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR35 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR35(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr35_adotoslot9,
- AB8500_CODEC_MASK_FOUR_BITS,
- AB8500_CODEC_CR35_ADOTOSLOT9 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr35_adotoslot8,
- AB8500_CODEC_MASK_FOUR_BITS,
- AB8500_CODEC_CR35_ADOTOSLOT8 );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR35, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR36 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR36(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr36_adotoslot11,
- AB8500_CODEC_MASK_FOUR_BITS,
- AB8500_CODEC_CR36_ADOTOSLOT11 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr36_adotoslot10,
- AB8500_CODEC_MASK_FOUR_BITS,
- AB8500_CODEC_CR36_ADOTOSLOT10 );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR36, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR37 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR37(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr37_adotoslot13,
- AB8500_CODEC_MASK_FOUR_BITS,
- AB8500_CODEC_CR37_ADOTOSLOT13 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr37_adotoslot12,
- AB8500_CODEC_MASK_FOUR_BITS,
- AB8500_CODEC_CR37_ADOTOSLOT12 );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR37, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR38 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR38(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr38_adotoslot15,
- AB8500_CODEC_MASK_FOUR_BITS,
- AB8500_CODEC_CR38_ADOTOSLOT15 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr38_adotoslot14,
- AB8500_CODEC_MASK_FOUR_BITS,
- AB8500_CODEC_CR38_ADOTOSLOT14 );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR38, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR39 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR39(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr39_adotoslot17,
- AB8500_CODEC_MASK_FOUR_BITS,
- AB8500_CODEC_CR39_ADOTOSLOT17 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr39_adotoslot16,
- AB8500_CODEC_MASK_FOUR_BITS,
- AB8500_CODEC_CR39_ADOTOSLOT16 );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR39, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR40 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR40(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr40_adotoslot19,
- AB8500_CODEC_MASK_FOUR_BITS,
- AB8500_CODEC_CR40_ADOTOSLOT19 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr40_adotoslot18,
- AB8500_CODEC_MASK_FOUR_BITS,
- AB8500_CODEC_CR40_ADOTOSLOT18 );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR40, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR41 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR41(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr41_adotoslot21,
- AB8500_CODEC_MASK_FOUR_BITS,
- AB8500_CODEC_CR41_ADOTOSLOT21 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr41_adotoslot20,
- AB8500_CODEC_MASK_FOUR_BITS,
- AB8500_CODEC_CR41_ADOTOSLOT20 );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR41, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR42 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR42(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr42_adotoslot23,
- AB8500_CODEC_MASK_FOUR_BITS,
- AB8500_CODEC_CR42_ADOTOSLOT23 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr42_adotoslot22,
- AB8500_CODEC_MASK_FOUR_BITS,
- AB8500_CODEC_CR42_ADOTOSLOT22 );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR42, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR43 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR43(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr43_adotoslot25,
- AB8500_CODEC_MASK_FOUR_BITS,
- AB8500_CODEC_CR43_ADOTOSLOT25 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr43_adotoslot24,
- AB8500_CODEC_MASK_FOUR_BITS,
- AB8500_CODEC_CR43_ADOTOSLOT24 );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR43, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR44 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR44(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr44_adotoslot27,
- AB8500_CODEC_MASK_FOUR_BITS,
- AB8500_CODEC_CR44_ADOTOSLOT27 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr44_adotoslot26,
- AB8500_CODEC_MASK_FOUR_BITS,
- AB8500_CODEC_CR44_ADOTOSLOT26 );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR44, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR45 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR45(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr45_adotoslot29,
- AB8500_CODEC_MASK_FOUR_BITS,
- AB8500_CODEC_CR45_ADOTOSLOT29 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr45_adotoslot28,
- AB8500_CODEC_MASK_FOUR_BITS,
- AB8500_CODEC_CR45_ADOTOSLOT28 );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR45, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR46 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR46(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr46_adotoslot31,
- AB8500_CODEC_MASK_FOUR_BITS,
- AB8500_CODEC_CR46_ADOTOSLOT31 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr46_adotoslot30,
- AB8500_CODEC_MASK_FOUR_BITS,
- AB8500_CODEC_CR46_ADOTOSLOT30 );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR46, value));
-}
-
-#if 0
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR47 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR47(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr47_hiz_sl7, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR47_HIZ_SL7 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr47_hiz_sl6, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR47_HIZ_SL6 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr47_hiz_sl5, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR47_HIZ_SL5 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr47_hiz_sl4, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR47_HIZ_SL4 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr47_hiz_sl3, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR47_HIZ_SL3 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr47_hiz_sl2, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR47_HIZ_SL2 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr47_hiz_sl1, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR47_HIZ_SL1 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr47_hiz_sl0, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR47_HIZ_SL0 );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR47, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR48 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR48(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr48_hiz_sl15, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR48_HIZ_SL15 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr48_hiz_sl14, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR48_HIZ_SL14 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr48_hiz_sl13, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR48_HIZ_SL13 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr48_hiz_sl12, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR48_HIZ_SL12 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr48_hiz_sl11, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR48_HIZ_SL11 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr48_hiz_sl10, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR48_HIZ_SL10 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr48_hiz_sl9, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR48_HIZ_SL9 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr48_hiz_sl8, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR48_HIZ_SL8 );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR48, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR49 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR49(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr49_hiz_sl23, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR49_HIZ_SL23 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr49_hiz_sl22, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR49_HIZ_SL22 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr49_hiz_sl21, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR49_HIZ_SL21 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr49_hiz_sl20, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR49_HIZ_SL20 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr49_hiz_sl19, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR49_HIZ_SL19 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr49_hiz_sl18, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR49_HIZ_SL18 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr49_hiz_sl17, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR49_HIZ_SL17 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr49_hiz_sl16, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR49_HIZ_SL16 );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR49, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR50 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR50(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr50_hiz_sl31, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR50_HIZ_SL31 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr50_hiz_sl30, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR50_HIZ_SL30 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr50_hiz_sl29, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR50_HIZ_SL29 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr50_hiz_sl28, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR50_HIZ_SL28 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr50_hiz_sl27, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR50_HIZ_SL27 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr50_hiz_sl26, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR50_HIZ_SL26 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr50_hiz_sl25, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR50_HIZ_SL25 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr50_hiz_sl24, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR50_HIZ_SL24 );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR50, value));
-}
-
-#endif /* */
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR51 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR51(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr51_da12_voice,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR51_DA12_VOICE );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr51_swapda12_34,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR51_SWAP_DA12_34 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr51_sldai7toslado1,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR51_SLDAI7TOSLADO1 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr51_sltoda1, AB8500_CODEC_MASK_FIVE_BITS,
- AB8500_CODEC_CR51_SLTODA1 );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR51, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR52 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR52(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr52_sldai8toslado2,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR52_SLDAI8TOSLADO2 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr52_sltoda2, AB8500_CODEC_MASK_FIVE_BITS,
- AB8500_CODEC_CR52_SLTODA2 );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR52, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR53 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR53(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr53_da34_voice,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR53_DA34_VOICE );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr53_sldai7toslado3,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR53_SLDAI7TOSLADO3 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr53_sltoda3, AB8500_CODEC_MASK_FIVE_BITS,
- AB8500_CODEC_CR53_SLTODA3 );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR53, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR54 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR54(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr54_sldai8toslado4,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR54_SLDAI8TOSLADO4 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr54_sltoda4, AB8500_CODEC_MASK_FIVE_BITS,
- AB8500_CODEC_CR54_SLTODA4 );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR54, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR55 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR55(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr55_da56_voice,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR55_DA56_VOICE );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr55_sldai7toslado5,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR55_SLDAI7TOSLADO5 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr55_sltoda5, AB8500_CODEC_MASK_FIVE_BITS,
- AB8500_CODEC_CR55_SLTODA5 );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR55, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR56 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR56(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr56_sldai8toslado6,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR56_SLDAI8TOSLADO6 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr56_sltoda6, AB8500_CODEC_MASK_FIVE_BITS,
- AB8500_CODEC_CR56_SLTODA6 );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR56, value));
-}
-
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR57 */
-/********************************************************************************************/
- PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR57(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr57_sldai8toslado7,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR57_SLDAI8TOSLADO7 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr57_sltoda7, AB8500_CODEC_MASK_FIVE_BITS,
- AB8500_CODEC_CR57_SLTODA7 );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR57, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR58 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR58(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr58_sldai7toslado8,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR58_SLDAI7TOSLADO8 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr58_sltoda8, AB8500_CODEC_MASK_FIVE_BITS,
- AB8500_CODEC_CR58_SLTODA8 );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR58, value));
-}
-
-#if 0
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR59 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR59(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr59_parlhf, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR59_PARLHF );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr59_parlvib, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR59_PARLVIB );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr59_classdvib1_swapen,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR59_CLASSDVIB1SWAPEN );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr59_classdvib2_swapen,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR59_CLASSDVIB2SWAPEN );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr59_classdhfl_swapen,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR59_CLASSDHFLSWAPEN );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr59_classdhfr_swapen,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR59_CLASSDHFRSWAPEN );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR59, value));
-}
-
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR60 */
-/********************************************************************************************/
- PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR60(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr60_classd_firbyp,
- AB8500_CODEC_MASK_FOUR_BITS,
- AB8500_CODEC_CR60_CLASSD_FIR_BYP );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr60_classd_highvolen,
- AB8500_CODEC_MASK_FOUR_BITS,
- AB8500_CODEC_CR60_CLASSD_HIGHVOL_EN );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR60, value));
-}
-
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR61 */
-/********************************************************************************************/
- PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR61(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
-
- /* 5 bits are Read Only */
- AB8500_CODEC_WRITE_BITS
- (value,
- (t_uint8) p_ab8500_codec_configuration->cr61_classddith_hpgain,
- AB8500_CODEC_MASK_FOUR_BITS,
- AB8500_CODEC_CR61_CLASSD_DITH_HPGAIN );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr61_classddith_wgain,
- AB8500_CODEC_MASK_FOUR_BITS,
- AB8500_CODEC_CR61_CLASSD_DITH_WGAIN );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR61, value));
-}
-
-#endif /* */
-
-/* CR62 is Read Only */
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR63 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR63(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr63_datohslen, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR63_DATOHSLEN );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr63_datohsren, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR63_DATOHSREN );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr63_ad1sel, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR63_AD1SEL );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr63_ad2sel, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR63_AD2SEL );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr63_ad3sel, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR63_AD3SEL );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr63_ad5sel, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR63_AD5SEL );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr63_ad6sel, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR63_AD6SEL );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr63_ancsel, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR63_ANCSEL );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR63, value));
-}
-
-#if 0
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR64 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR64(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr64_datohfren, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR64_DATOHFREN );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr64_datohflen, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR64_DATOHFLEN );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr64_hfrsel, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR64_HFRSEL );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr64_hflsel, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR64_HFLSEL );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr64_stfir1sel, AB8500_CODEC_MASK_TWO_BITS,
- AB8500_CODEC_CR64_STFIR1SEL );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr64_stfir2sel, AB8500_CODEC_MASK_TWO_BITS,
- AB8500_CODEC_CR64_STFIR2SEL );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR64, value));
-}
-
-#endif /* */
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR65 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR65(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr65_fadedis_ad1,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR65_FADEDIS_AD1 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr65_ad1gain, AB8500_CODEC_MASK_SIX_BITS,
- AB8500_CODEC_CR65_AD1GAIN );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR65, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR66 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR66(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr66_fadedis_ad2,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR66_FADEDIS_AD2 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr66_ad2gain, AB8500_CODEC_MASK_SIX_BITS,
- AB8500_CODEC_CR66_AD2GAIN );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR66, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR67 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR67(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr67_fadedis_ad3,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR67_FADEDIS_AD3 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr67_ad3gain, AB8500_CODEC_MASK_SIX_BITS,
- AB8500_CODEC_CR67_AD3GAIN );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR67, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR68 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR68(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr68_fadedis_ad4,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR68_FADEDIS_AD4 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr68_ad4gain, AB8500_CODEC_MASK_SIX_BITS,
- AB8500_CODEC_CR68_AD4GAIN );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR68, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR69 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR69(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr69_fadedis_ad5,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR69_FADEDIS_AD5 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr69_ad5gain, AB8500_CODEC_MASK_SIX_BITS,
- AB8500_CODEC_CR69_AD5GAIN );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR69, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR70 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR70(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr70_fadedis_ad6,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR70_FADEDIS_AD6 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr70_ad6gain, AB8500_CODEC_MASK_SIX_BITS,
- AB8500_CODEC_CR70_AD6GAIN );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR70, value));
-}
-
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR71 */
-/********************************************************************************************/
- PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR71(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr71_fadedis_da1,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR71_FADEDIS_DA1 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr71_da1gain, AB8500_CODEC_MASK_SIX_BITS,
- AB8500_CODEC_CR71_DA1GAIN );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR71, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR72 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR72(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr72_fadedis_da2,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR72_FADEDIS_DA2 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr72_da2gain, AB8500_CODEC_MASK_SIX_BITS,
- AB8500_CODEC_CR72_DA2GAIN );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR72, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR73 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR73(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr73_fadedis_da3,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR73_FADEDIS_DA3 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr73_da3gain, AB8500_CODEC_MASK_SIX_BITS,
- AB8500_CODEC_CR73_DA3GAIN );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR73, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR74 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR74(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr74_fadedis_da4,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR74_FADEDIS_DA4 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr74_da4gain, AB8500_CODEC_MASK_SIX_BITS,
- AB8500_CODEC_CR74_DA4GAIN );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR74, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR75 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR75(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr75_fadedis_da5,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR75_FADEDIS_DA5 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr75_da5gain, AB8500_CODEC_MASK_SIX_BITS,
- AB8500_CODEC_CR75_DA5GAIN );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR75, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR76 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR76(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr76_fadedis_da6,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR76_FADEDIS_DA6 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr76_da6gain, AB8500_CODEC_MASK_SIX_BITS,
- AB8500_CODEC_CR76_DA6GAIN );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR76, value));
-}
-
-#if 0
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR77 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR77(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr77_fadedis_ad1l,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR77_FADEDIS_AD1L );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr77_ad1lbgain_to_hfl,
- AB8500_CODEC_MASK_SIX_BITS,
- AB8500_CODEC_CR77_AD1LBGAIN );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR77, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR78 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR78(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr78_fadedis_ad2l,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR78_FADEDIS_AD2L );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr78_ad2lbgain_to_hfr,
- AB8500_CODEC_MASK_SIX_BITS,
- AB8500_CODEC_CR78_AD2LBGAIN );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR78, value));
-}
-
-#endif /* */
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR79 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR79(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr79_hssinc1, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR79_HSSINC1 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr79_fadedis_hsl,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR79_FADEDIS_HSL );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr79_hsldgain, AB8500_CODEC_MASK_FOUR_BITS,
- AB8500_CODEC_CR79_HSLDGAIN );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR79, value));
-}
-
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR80 */
-/********************************************************************************************/
- PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR80(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr80_fade_speed,
- AB8500_CODEC_MASK_TWO_BITS,
- AB8500_CODEC_CR80_FADE_SPEED );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr80_fadedis_hsr,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR80_FADEDIS_HSR );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr80_hsrdgain, AB8500_CODEC_MASK_FOUR_BITS,
- AB8500_CODEC_CR80_HSRDGAIN );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR80, value));
-}
-
-#if 0
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR81 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR81(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr81_stfir1gain,
- AB8500_CODEC_MASK_FIVE_BITS,
- AB8500_CODEC_CR81_STFIR1GAIN );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR81, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR82 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR82(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr82_stfir2gain,
- AB8500_CODEC_MASK_FIVE_BITS,
- AB8500_CODEC_CR82_STFIR2GAIN );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR82, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR83 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR83(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr83_enanc, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR83_ENANC );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr83_anciirinit, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR83_ANCIIRINIT );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr83_ancfirupdate,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR83_ANCFIRUPDATE );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR83, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR84 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR84(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr84_ancinshift,
- AB8500_CODEC_MASK_FIVE_BITS,
- AB8500_CODEC_CR84_ANCINSHIFT );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR84, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR85 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR85(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr85_ancfiroutshift,
- AB8500_CODEC_MASK_FIVE_BITS,
- AB8500_CODEC_CR85_ANCFIROUTSHIFT );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR85, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR86 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR86(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr86_ancshiftout,
- AB8500_CODEC_MASK_FIVE_BITS,
- AB8500_CODEC_CR86_ANCSHIFTOUT );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR86, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR87 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR87(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr87_ancfircoeff_msb,
- AB8500_CODEC_MASK_EIGHT_BITS,
- AB8500_CODEC_CR87_ANCFIRCOEFF_MSB );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR87, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR88 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR88(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr88_ancfircoeff_lsb,
- AB8500_CODEC_MASK_EIGHT_BITS,
- AB8500_CODEC_CR88_ANCFIRCOEFF_LSB );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR88, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR89 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR89(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr89_anciircoeff_msb,
- AB8500_CODEC_MASK_EIGHT_BITS,
- AB8500_CODEC_CR89_ANCIIRCOEFF_MSB );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR89, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR90 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR90(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr90_anciircoeff_lsb,
- AB8500_CODEC_MASK_EIGHT_BITS,
- AB8500_CODEC_CR90_ANCIIRCOEFF_LSB );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR90, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR91 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR91(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr91_ancwarpdel_msb,
- AB8500_CODEC_MASK_EIGHT_BITS,
- AB8500_CODEC_CR91_ANCWARPDEL_MSB );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR91, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR92 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR92(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr92_ancwarpdel_lsb,
- AB8500_CODEC_MASK_EIGHT_BITS,
- AB8500_CODEC_CR92_ANCWARPDEL_LSB );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR92, value));
-}
-
-/* CR93 is Read Only */
-/* CR94 is Read Only */
-/* CR95 is Read Only */
-/* CR96 is Read Only */
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR97 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR97(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr97_stfir_set, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR97_STFIR_SET );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr97_stfir_addr,
- AB8500_CODEC_MASK_SEVEN_BITS,
- AB8500_CODEC_CR97_STFIR_ADDR );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR97, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR98 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR98(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr98_stfir_coeff_msb,
- AB8500_CODEC_MASK_EIGHT_BITS,
- AB8500_CODEC_CR98_STFIR_COEFF_MSB );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR98, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR99 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR99(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr99_stfir_coeff_lsb,
- AB8500_CODEC_MASK_EIGHT_BITS,
- AB8500_CODEC_CR99_STFIR_COEFF_LSB );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR99, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR100 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR100(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr100_enstfirs, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR100_ENSTFIRS );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr100_stfirstoif1,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR100_STFIRSTOIF1 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr100_stfir_busy,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR100_STFIR_BUSY );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR100, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR101 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR101(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr101_hsoffst_mask,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR101_HSOFFSTMASK );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr101_fifofull_mask,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR101_FIFOFULLMASK );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr101_fifoempty_mask,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR101_FIFOEMPTYMASK );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr101_dasat_mask,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR101_DASATMASK );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr101_adsat_mask,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR101_ADSATMASK );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr101_addsp_mask,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR101_ADDSPMASK );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr101_dadsp_mask,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR101_DADSPMASK );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr101_firsid_mask,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR101_FIRSIDMASK );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR101, value));
-}
-
-/* CR102 is Read Only */
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR103 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR103(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr103_vssready_mask,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR103_VSSREADYMASK );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr103_shorthsl_mask,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR103_SHORTHSLMASK );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr103_shorthsr_mask,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR103_SHORTHSRMASK );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr103_shortear_mask,
- AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR103_SHORTEARMASK );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR103, value));
-}
-
-#endif /* */
-
-/* CR104 is Read Only */
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR105 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR105(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr105_bfifomsk, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR105_BFIFOMASK );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr105_bfifoint, AB8500_CODEC_MASK_SIX_BITS,
- AB8500_CODEC_CR105_BFIFOINT );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR105, value));
-}
-
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR106 */
-/********************************************************************************************/
- PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR106(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr106_bfifotx,
- AB8500_CODEC_MASK_EIGHT_BITS,
- AB8500_CODEC_CR106_BFIFOTX );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR106, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR107 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR107(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr107_bfifoexsl,
- AB8500_CODEC_MASK_THREE_BITS,
- AB8500_CODEC_CR107_BFIFOEXSL );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr107_prebitclk0,
- AB8500_CODEC_MASK_THREE_BITS,
- AB8500_CODEC_CR107_PREBITCLK0 );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr107_bfifomast, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR107_BFIFOMAST );
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr107_bfiforun, AB8500_CODEC_MASK_ONE_BIT,
- AB8500_CODEC_CR107_BFIFORUN );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR107, value));
-}
-
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR108 */
-/********************************************************************************************/
- PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR108(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr108_bfifoframsw,
- AB8500_CODEC_MASK_EIGHT_BITS,
- AB8500_CODEC_CR108_BFIFOFRAMESW );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR108, value));
-}
-
-/********************************************************************************************/
-/* Name: ab8500_codec_UpdateCR109 */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_UpdateCR109(void)
-{
- t_uint8 value = 0x00;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- AB8500_CODEC_WRITE_BITS (value,
- (t_uint8) p_ab8500_codec_configuration->
- cr109_bfifowakeup,
- AB8500_CODEC_MASK_EIGHT_BITS,
- AB8500_CODEC_CR109_BFIFOWAKEUP );
- return (ab8500_codec_SingleWrite(AB8500_CODEC_CR109, value));
-}
-
-/* CR110 is Read Only */
-
-/* CR111 is Read Only */
-
-/********************************************************************************************/
-/* Name: ab8500_codec_Reset() */
-
-/********************************************************************************************/
-PRIVATE t_ab8500_codec_error ab8500_codec_Reset(void)
-{
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- p_ab8500_codec_configuration->cr1_swreset =
- AB8500_CODEC_CR1_SWRESET_ENABLED;
- ab8500_codec_error = ab8500_codec_UpdateCR1();
- if (AB8500_CODEC_OK != ab8500_codec_error)
- {
- return (ab8500_codec_error);
- }
- return (ab8500_codec_error);
-}
-
-PRIVATE t_ab8500_codec_error ab8500_codec_ProgramDirection(IN
- t_ab8500_codec_direction
- ab8500_codec_direction)
- /*only IN or OUT must be passed (not INOUT) */
-{
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
- if (AB8500_CODEC_DIRECTION_IN == ab8500_codec_direction)
- {
- ab8500_codec_error = ab8500_codec_ProgramDirectionIN();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- }
- if (AB8500_CODEC_DIRECTION_OUT == ab8500_codec_direction)
- {
- ab8500_codec_error = ab8500_codec_ProgramDirectionOUT();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- }
- return (ab8500_codec_error);
-}
-
-PRIVATE t_ab8500_codec_error ab8500_codec_SetDirection(IN
- t_ab8500_codec_direction
- ab8500_codec_direction)
-{
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
- switch (ab8500_codec_direction)
- {
- case AB8500_CODEC_DIRECTION_IN:
- ab8500_codec_error =
- ab8500_codec_ProgramDirection(AB8500_CODEC_DIRECTION_IN);
- break;
- case AB8500_CODEC_DIRECTION_OUT:
- ab8500_codec_error =
- ab8500_codec_ProgramDirection(AB8500_CODEC_DIRECTION_OUT);
- break;
- case AB8500_CODEC_DIRECTION_INOUT:
- ab8500_codec_error =
- ab8500_codec_ProgramDirection(AB8500_CODEC_DIRECTION_IN);
- if (AB8500_CODEC_OK == ab8500_codec_error)
- {
- ab8500_codec_error =
- ab8500_codec_ProgramDirection
- (AB8500_CODEC_DIRECTION_OUT);
- }
- break;
- }
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR5();
- if (AB8500_CODEC_OK != ab8500_codec_error)
- {
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR6();
- if (AB8500_CODEC_OK != ab8500_codec_error)
- {
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR7();
- if (AB8500_CODEC_OK != ab8500_codec_error)
- {
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR8();
- if (AB8500_CODEC_OK != ab8500_codec_error)
- {
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR9();
- if (AB8500_CODEC_OK != ab8500_codec_error)
- {
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR10();
- if (AB8500_CODEC_OK != ab8500_codec_error)
- {
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR12();
- if (AB8500_CODEC_OK != ab8500_codec_error)
- {
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR15();
- if (AB8500_CODEC_OK != ab8500_codec_error)
- {
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR63();
- if (AB8500_CODEC_OK != ab8500_codec_error)
- {
- return (ab8500_codec_error);
- }
- return (ab8500_codec_error);
-}
-
-/****************************************************************************/
-/* NAME: AB8500_CODEC_Init */
-/*--------------------------------------------------------------------------*/
-/* DESCRIPTION: */
-/* Initialize the global variables & stores the slave address of codec. */
-/* */
-/* ARGUMENTS */
-/* IN: */
-/* slave_address_of_ab8500_codec: Audio codec slave address */
-/* OUT: */
-/* None */
-/* */
-/* RETURN: */
-/* Returns AB8500_CODEC_OK */
-/* COMMENTS: */
-/* 1) Saves the supplied slave_address_of_codec in global variable */
-/*--------------------------------------------------------------------------*/
-/* REENTRANCY: Non Re-Entrant */
-
-/****************************************************************************/
-PUBLIC t_ab8500_codec_error AB8500_CODEC_Init(IN t_uint8
- slave_address_of_ab8500_codec)
-{
- DBGENTER1(" (%lx)", slave_address_of_ab8500_codec);
- g_ab8500_codec_system_context.slave_address_of_ab8500_codec =
- slave_address_of_ab8500_codec;
- DBGEXIT(AB8500_CODEC_OK);
- return (AB8500_CODEC_OK);
-}
-
-/****************************************************************************/
-/* NAME: AB8500_CODEC_Reset */
-/*--------------------------------------------------------------------------*/
-/* DESCRIPTION: */
-/* Reset the global variables and clear audiocodec settings to default. */
-/* */
-/* ARGUMENTS */
-/* IN: */
-/* None */
-/* OUT: */
-/* None */
-/* */
-/* RETURN: */
-/* AB8500_CODEC_TRANSACTION_FAILED: If transaction fails. */
-/* AB8500_CODEC_OK: if successful. */
-/*--------------------------------------------------------------------------*/
-/* REENTRANCY: Non Re-Entrant */
-
-/****************************************************************************/
-PUBLIC t_ab8500_codec_error AB8500_CODEC_Reset(void)
-{
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
- DBGENTER();
- g_ab8500_codec_system_context.ab8500_codec_direction =
- AB8500_CODEC_DEFAULT_DIRECTION;
- g_ab8500_codec_system_context.ab8500_codec_mode_in =
- AB8500_CODEC_DEFAULT_MODE_IN;
- g_ab8500_codec_system_context.ab8500_codec_mode_out =
- AB8500_CODEC_DEFAULT_MODE_OUT;
- g_ab8500_codec_system_context.ab8500_codec_src =
- AB8500_CODEC_DEFAULT_INPUT_SRC;
- g_ab8500_codec_system_context.ab8500_codec_dest =
- AB8500_CODEC_DEFAULT_OUTPUT_DEST;
- g_ab8500_codec_system_context.in_left_volume =
- AB8500_CODEC_DEFAULT_VOLUME_LEFT_IN;
- g_ab8500_codec_system_context.in_right_volume =
- AB8500_CODEC_DEFAULT_VOLUME_RIGHT_IN;
- g_ab8500_codec_system_context.out_left_volume =
- AB8500_CODEC_DEFAULT_VOLUME_LEFT_OUT;
- g_ab8500_codec_system_context.out_right_volume =
- AB8500_CODEC_DEFAULT_VOLUME_RIGHT_OUT;
- ab8500_codec_error = ab8500_codec_Reset();
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-/****************************************************************************/
-/* NAME: AB8500_CODEC_SetModeAndDirection */
-/*--------------------------------------------------------------------------*/
-/* DESCRIPTION: */
-/* Configures the whole audio codec to work in audio mode */
-/* (using I2S protocol). */
-/* */
-/* ARGUMENTS */
-/* IN: */
-/* direction: select the direction (IN, OUT or INOUT) */
-/* in_mode: codec mode for recording. If direction is OUT only, */
-/* this parameter is ignored. */
-/* out_mode: codec mode for playing. If direction is IN only, */
-/* this parameter is ignored. */
-/* p_tdm_config: TDM configuration required to be configured by user */
-/* OUT: */
-/* None */
-/* */
-/* RETURN: */
-/* AB8500_CODEC_UNSUPPORTED_FEATURE: The API may not allow setting */
-/* 2 different modes, in which case it should return this value. */
-/* AB8500_CODEC_TRANSACTION_FAILED: If transaction fails. */
-/* AB8500_CODEC_OK: if successful. */
-/*--------------------------------------------------------------------------*/
-/* REENTRANCY: Non Re-Entrant */
-
-/****************************************************************************/
-PUBLIC t_ab8500_codec_error AB8500_CODEC_SetModeAndDirection
- (IN t_ab8500_codec_direction ab8500_codec_direction,
- IN t_ab8500_codec_mode ab8500_codec_mode_in,
- IN t_ab8500_codec_mode ab8500_codec_mode_out,
- IN t_ab8500_codec_tdm_config const *const p_tdm_config ) {
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- DBGENTER3(" (%lx %lx %lx)", ab8500_codec_direction,
- ab8500_codec_mode_in, ab8500_codec_mode_out);
- if (AB8500_CODEC_AUDIO_INTERFACE_1 ==
- g_ab8500_codec_system_context.audio_interface)
- {
- if (AB8500_CODEC_DIRECTION_OUT == ab8500_codec_direction
- || AB8500_CODEC_DIRECTION_INOUT ==
- ab8500_codec_direction )
- {
- p_ab8500_codec_configuration->cr3_enda1 =
- AB8500_CODEC_CR3_ENDA1_ENABLED;
- p_ab8500_codec_configuration->cr3_enda2 =
- AB8500_CODEC_CR3_ENDA2_ENABLED;
- p_ab8500_codec_configuration->cr3_enda3 =
- AB8500_CODEC_CR3_ENDA3_ENABLED;
- p_ab8500_codec_configuration->cr3_enda4 =
- AB8500_CODEC_CR3_ENDA4_ENABLED;
- p_ab8500_codec_configuration->cr3_enda5 =
- AB8500_CODEC_CR3_ENDA5_ENABLED;
- p_ab8500_codec_configuration->cr3_enda6 =
- AB8500_CODEC_CR3_ENDA6_ENABLED;
- p_ab8500_codec_configuration->cr27_if1_bitclk_osr =
- p_tdm_config->cr27_if1_bitclk_osr;
- if (AB8500_CODEC_MODE_HIFI == ab8500_codec_mode_out)
- {
- p_ab8500_codec_configuration->cr30_fsync1p =
- AB8500_CODEC_CR30_FSYNC1P_FALLING_EDGE;
- p_ab8500_codec_configuration->cr30_bitclk1p =
- AB8500_CODEC_CR30_BITCLK1P_FALLING_EDGE;
- p_ab8500_codec_configuration->cr30_if1del =
- AB8500_CODEC_CR30_IF1DEL_DELAYED;
- p_ab8500_codec_configuration->cr30_if1format =
- AB8500_CODEC_CR30_IF1FORMAT_I2S_LEFTALIGNED;
- p_ab8500_codec_configuration->cr30_if1wl =
- p_tdm_config->cr30_if1wl;
- }
-
- else
- {
- p_ab8500_codec_configuration->cr30_fsync1p =
- AB8500_CODEC_CR30_FSYNC1P_FALLING_EDGE;
- p_ab8500_codec_configuration->cr30_bitclk1p =
- AB8500_CODEC_CR30_BITCLK1P_FALLING_EDGE;
- p_ab8500_codec_configuration->cr30_if1del =
- AB8500_CODEC_CR30_IF1DEL_DELAYED;
- p_ab8500_codec_configuration->cr30_if1format =
- AB8500_CODEC_CR30_IF1FORMAT_TDM;
- p_ab8500_codec_configuration->cr30_if1wl =
- p_tdm_config->cr30_if1wl;
- }
- }
- if (AB8500_CODEC_DIRECTION_IN == ab8500_codec_direction
- || AB8500_CODEC_DIRECTION_INOUT ==
- ab8500_codec_direction )
- {
- p_ab8500_codec_configuration->cr2_enad1 =
- AB8500_CODEC_CR2_ENAD1_ENABLED;
- p_ab8500_codec_configuration->cr2_enad2 =
- AB8500_CODEC_CR2_ENAD2_ENABLED;
- p_ab8500_codec_configuration->cr2_enad3 =
- AB8500_CODEC_CR2_ENAD3_ENABLED;
- p_ab8500_codec_configuration->cr2_enad4 =
- AB8500_CODEC_CR2_ENAD4_ENABLED;
- p_ab8500_codec_configuration->cr2_enad5 =
- AB8500_CODEC_CR2_ENAD5_ENABLED;
- p_ab8500_codec_configuration->cr2_enad6 =
- AB8500_CODEC_CR2_ENAD6_ENABLED;
- p_ab8500_codec_configuration->cr27_if1_bitclk_osr =
- p_tdm_config->cr27_if1_bitclk_osr;
- if (AB8500_CODEC_MODE_HIFI == ab8500_codec_mode_in)
- {
- p_ab8500_codec_configuration->cr30_fsync1p =
- AB8500_CODEC_CR30_FSYNC1P_FALLING_EDGE;
- p_ab8500_codec_configuration->cr30_bitclk1p =
- AB8500_CODEC_CR30_BITCLK1P_FALLING_EDGE;
- p_ab8500_codec_configuration->cr30_if1del =
- AB8500_CODEC_CR30_IF1DEL_DELAYED;
- p_ab8500_codec_configuration->cr30_if1format =
- AB8500_CODEC_CR30_IF1FORMAT_I2S_LEFTALIGNED;
- p_ab8500_codec_configuration->cr30_if1wl =
- p_tdm_config->cr30_if1wl;
- }
-
- else
- {
- p_ab8500_codec_configuration->cr30_fsync1p =
- AB8500_CODEC_CR30_FSYNC1P_RISING_EDGE;
- p_ab8500_codec_configuration->cr30_bitclk1p =
- AB8500_CODEC_CR30_BITCLK1P_FALLING_EDGE;
- p_ab8500_codec_configuration->cr30_if1del =
- AB8500_CODEC_CR30_IF1DEL_NOT_DELAYED;
- p_ab8500_codec_configuration->cr30_if1format =
- AB8500_CODEC_CR30_IF1FORMAT_TDM;
- p_ab8500_codec_configuration->cr30_if1wl =
- p_tdm_config->cr30_if1wl;
- }
- }
- }
-
- else
- {
- if (AB8500_CODEC_DIRECTION_OUT == ab8500_codec_direction
- || AB8500_CODEC_DIRECTION_INOUT ==
- ab8500_codec_direction )
- {
- p_ab8500_codec_configuration->cr3_enda1 =
- AB8500_CODEC_CR3_ENDA1_ENABLED;
- p_ab8500_codec_configuration->cr3_enda2 =
- AB8500_CODEC_CR3_ENDA2_ENABLED;
- p_ab8500_codec_configuration->cr3_enda3 =
- AB8500_CODEC_CR3_ENDA3_ENABLED;
- p_ab8500_codec_configuration->cr3_enda4 =
- AB8500_CODEC_CR3_ENDA4_ENABLED;
- p_ab8500_codec_configuration->cr3_enda5 =
- AB8500_CODEC_CR3_ENDA5_ENABLED;
- p_ab8500_codec_configuration->cr3_enda6 =
- AB8500_CODEC_CR3_ENDA6_ENABLED;
- p_ab8500_codec_configuration->cr27_if0_bitclk_osr =
- p_tdm_config->cr27_if0_bitclk_osr;
- p_ab8500_codec_configuration->cr63_datohslen =
- AB8500_CODEC_CR63_DATOHSLEN_ENABLED;
- p_ab8500_codec_configuration->cr63_datohsren =
- AB8500_CODEC_CR63_DATOHSREN_ENABLED;
- if (AB8500_CODEC_MODE_HIFI == ab8500_codec_mode_out)
- {
- p_ab8500_codec_configuration->cr28_fsync0p =
- AB8500_CODEC_CR28_FSYNC0P_FALLING_EDGE;
- p_ab8500_codec_configuration->cr28_bitclk0p = p_tdm_config->cr28_bitclk0p; /*AB8500_CODEC_CR28_BITCLK0P_FALLING_EDGE; */
- p_ab8500_codec_configuration->cr28_if0del = p_tdm_config->cr28_if0del; /*AB8500_CODEC_CR28_IF0DEL_DELAYED; */
- p_ab8500_codec_configuration->cr28_if0format =
- AB8500_CODEC_CR28_IF0FORMAT_I2S_LEFTALIGNED;
- p_ab8500_codec_configuration->cr28_if0wl =
- p_tdm_config->cr28_if0wl;
- }
-
- else
- {
- p_ab8500_codec_configuration->cr28_fsync0p =
- AB8500_CODEC_CR28_FSYNC0P_FALLING_EDGE;
- p_ab8500_codec_configuration->cr28_bitclk0p = p_tdm_config->cr28_bitclk0p; /*AB8500_CODEC_CR28_BITCLK0P_FALLING_EDGE; */
- p_ab8500_codec_configuration->cr28_if0del = p_tdm_config->cr28_if0del; /*AB8500_CODEC_CR28_IF0DEL_DELAYED; */
- p_ab8500_codec_configuration->cr28_if0format =
- AB8500_CODEC_CR28_IF0FORMAT_TDM;
- p_ab8500_codec_configuration->cr28_if0wl =
- p_tdm_config->cr28_if0wl;
- }
- }
- if (AB8500_CODEC_DIRECTION_IN == ab8500_codec_direction
- || AB8500_CODEC_DIRECTION_INOUT ==
- ab8500_codec_direction )
- {
- p_ab8500_codec_configuration->cr2_enad1 =
- AB8500_CODEC_CR2_ENAD1_ENABLED;
- p_ab8500_codec_configuration->cr2_enad2 =
- AB8500_CODEC_CR2_ENAD2_ENABLED;
- p_ab8500_codec_configuration->cr2_enad3 =
- AB8500_CODEC_CR2_ENAD3_ENABLED;
- p_ab8500_codec_configuration->cr2_enad4 =
- AB8500_CODEC_CR2_ENAD4_ENABLED;
- p_ab8500_codec_configuration->cr2_enad5 =
- AB8500_CODEC_CR2_ENAD5_ENABLED;
- p_ab8500_codec_configuration->cr2_enad6 =
- AB8500_CODEC_CR2_ENAD6_ENABLED;
- p_ab8500_codec_configuration->cr26_ad1_voice =
- AB8500_CODEC_CR26_AD1_VOICE_LOWLATENCYFILTER;
- p_ab8500_codec_configuration->cr26_ad2_voice =
- AB8500_CODEC_CR26_AD2_VOICE_LOWLATENCYFILTER;
- p_ab8500_codec_configuration->cr26_ad3_voice =
- AB8500_CODEC_CR26_AD3_VOICE_LOWLATENCYFILTER;
- p_ab8500_codec_configuration->cr26_ad4_voice =
- AB8500_CODEC_CR26_AD4_VOICE_LOWLATENCYFILTER;
- p_ab8500_codec_configuration->cr27_if0_bitclk_osr =
- p_tdm_config->cr27_if0_bitclk_osr;
- if (AB8500_CODEC_MODE_HIFI == ab8500_codec_mode_in)
- {
- p_ab8500_codec_configuration->cr28_fsync0p =
- AB8500_CODEC_CR28_FSYNC0P_RISING_EDGE;
- p_ab8500_codec_configuration->cr28_bitclk0p = p_tdm_config->cr28_bitclk0p; /*AB8500_CODEC_CR28_BITCLK0P_RISING_EDGE; */
- p_ab8500_codec_configuration->cr28_if0del = p_tdm_config->cr28_if0del; /*AB8500_CODEC_CR28_IF0DEL_NOT_DELAYED; */
- p_ab8500_codec_configuration->cr28_if0format =
- AB8500_CODEC_CR28_IF0FORMAT_I2S_LEFTALIGNED;
- p_ab8500_codec_configuration->cr28_if0wl =
- p_tdm_config->cr28_if0wl;
- }
-
- else
- {
- p_ab8500_codec_configuration->cr28_fsync0p =
- AB8500_CODEC_CR28_FSYNC0P_RISING_EDGE;
- p_ab8500_codec_configuration->cr28_bitclk0p = p_tdm_config->cr28_bitclk0p; /*AB8500_CODEC_CR28_BITCLK0P_FALLING_EDGE; */
- p_ab8500_codec_configuration->cr28_if0del = p_tdm_config->cr28_if0del; /*AB8500_CODEC_CR28_IF0DEL_NOT_DELAYED; */
- p_ab8500_codec_configuration->cr28_if0format =
- AB8500_CODEC_CR28_IF0FORMAT_TDM;
- p_ab8500_codec_configuration->cr28_if0wl =
- p_tdm_config->cr28_if0wl;
- }
- }
- }
- ab8500_codec_error = ab8500_codec_SetModeAndDirectionUpdateCR();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- g_ab8500_codec_system_context.ab8500_codec_direction =
- ab8500_codec_direction;
- g_ab8500_codec_system_context.ab8500_codec_mode_in =
- ab8500_codec_mode_in;
- g_ab8500_codec_system_context.ab8500_codec_mode_out =
- ab8500_codec_mode_out;
- ab8500_codec_error =
- ab8500_codec_SetDirection(ab8500_codec_direction);
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-/****************************************************************************/
-/* NAME: AB8500_CODEC_SetSrcVolume */
-/*--------------------------------------------------------------------------*/
-/* DESCRIPTION: */
-/* Sets the record volumes. */
-/* */
-/* ARGUMENTS */
-/* IN: */
-/* t_ab8500_codec_src: select source device for recording. */
-/* in_left_volume: record volume for left channel. */
-/* in_right_volume: record volume for right channel. */
-/* OUT: */
-/* None */
-/* */
-/* RETURN: */
-/* AB8500_CODEC_TRANSACTION_FAILED: If transaction fails. */
-/* AB8500_CODEC_OK: if successful. */
-/*--------------------------------------------------------------------------*/
-/* REENTRANCY: Non Re-Entrant */
-
-/****************************************************************************/
-PUBLIC t_ab8500_codec_error AB8500_CODEC_SetSrcVolume
- (IN t_ab8500_codec_src src_device, IN t_uint8 in_left_volume,
- IN t_uint8 in_right_volume ) {
- t_ab8500_codec_error ab8500_codec_error;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- DBGENTER3(" (%lx %lx %lx)", src_device, in_left_volume,
- in_right_volume);
- if (in_left_volume > AB8500_CODEC_MAX_VOLUME)
- {
- in_left_volume = AB8500_CODEC_MAX_VOLUME;
- }
- if (in_right_volume > AB8500_CODEC_MAX_VOLUME)
- {
- in_right_volume = AB8500_CODEC_MAX_VOLUME;
- }
- g_ab8500_codec_system_context.in_left_volume = in_left_volume;
- g_ab8500_codec_system_context.in_right_volume = in_right_volume;
- p_ab8500_codec_configuration->cr65_ad1gain =
- AB8500_CODEC_AD_D_VOLUME_MIN +
- (in_left_volume *
- (AB8500_CODEC_AD_D_VOLUME_MAX -
- AB8500_CODEC_AD_D_VOLUME_MIN)) / 100;
- p_ab8500_codec_configuration->cr66_ad2gain =
- AB8500_CODEC_AD_D_VOLUME_MIN +
- (in_left_volume *
- (AB8500_CODEC_AD_D_VOLUME_MAX -
- AB8500_CODEC_AD_D_VOLUME_MIN)) / 100;
- p_ab8500_codec_configuration->cr67_ad3gain =
- AB8500_CODEC_AD_D_VOLUME_MIN +
- (in_left_volume *
- (AB8500_CODEC_AD_D_VOLUME_MAX -
- AB8500_CODEC_AD_D_VOLUME_MIN)) / 100;
- p_ab8500_codec_configuration->cr68_ad4gain =
- AB8500_CODEC_AD_D_VOLUME_MIN +
- (in_left_volume *
- (AB8500_CODEC_AD_D_VOLUME_MAX -
- AB8500_CODEC_AD_D_VOLUME_MIN)) / 100;
- p_ab8500_codec_configuration->cr69_ad5gain =
- AB8500_CODEC_AD_D_VOLUME_MIN +
- (in_left_volume *
- (AB8500_CODEC_AD_D_VOLUME_MAX -
- AB8500_CODEC_AD_D_VOLUME_MIN)) / 100;
- p_ab8500_codec_configuration->cr70_ad6gain =
- AB8500_CODEC_AD_D_VOLUME_MIN +
- (in_left_volume *
- (AB8500_CODEC_AD_D_VOLUME_MAX -
- AB8500_CODEC_AD_D_VOLUME_MIN)) / 100;
-
- /* Set mininimum volume if volume is zero */
- switch (src_device)
- {
- case AB8500_CODEC_SRC_LINEIN:
- p_ab8500_codec_configuration->cr23_linl_gain =
- AB8500_CODEC_LINEIN_VOLUME_MIN +
- (in_left_volume *
- (AB8500_CODEC_LINEIN_VOLUME_MAX -
- AB8500_CODEC_LINEIN_VOLUME_MIN)) / 100;
- p_ab8500_codec_configuration->cr23_linr_gain =
- AB8500_CODEC_LINEIN_VOLUME_MIN +
- (in_right_volume *
- (AB8500_CODEC_LINEIN_VOLUME_MAX -
- AB8500_CODEC_LINEIN_VOLUME_MIN)) / 100;
- break;
- case AB8500_CODEC_SRC_MICROPHONE_1A:
- case AB8500_CODEC_SRC_MICROPHONE_1B:
- p_ab8500_codec_configuration->cr20_mic1_gain =
- AB8500_CODEC_MIC_VOLUME_MIN +
- (in_left_volume *
- (AB8500_CODEC_MIC_VOLUME_MAX -
- AB8500_CODEC_MIC_VOLUME_MIN)) / 100;
- break;
- case AB8500_CODEC_SRC_MICROPHONE_2:
- p_ab8500_codec_configuration->cr21_mic2_gain =
- AB8500_CODEC_MIC_VOLUME_MIN +
- (in_left_volume *
- (AB8500_CODEC_MIC_VOLUME_MAX -
- AB8500_CODEC_MIC_VOLUME_MIN)) / 100;
- break;
- case AB8500_CODEC_SRC_D_MICROPHONE_1:
- break;
- case AB8500_CODEC_SRC_D_MICROPHONE_2:
- break;
- case AB8500_CODEC_SRC_D_MICROPHONE_3:
- break;
- case AB8500_CODEC_SRC_D_MICROPHONE_4:
- break;
- case AB8500_CODEC_SRC_D_MICROPHONE_5:
- break;
- case AB8500_CODEC_SRC_D_MICROPHONE_6:
- break;
- case AB8500_CODEC_SRC_ALL:
- p_ab8500_codec_configuration->cr23_linl_gain =
- AB8500_CODEC_LINEIN_VOLUME_MIN +
- (in_left_volume *
- (AB8500_CODEC_LINEIN_VOLUME_MAX -
- AB8500_CODEC_LINEIN_VOLUME_MIN)) / 100;
- p_ab8500_codec_configuration->cr23_linr_gain =
- AB8500_CODEC_LINEIN_VOLUME_MIN +
- (in_right_volume *
- (AB8500_CODEC_LINEIN_VOLUME_MAX -
- AB8500_CODEC_LINEIN_VOLUME_MIN)) / 100;
- p_ab8500_codec_configuration->cr20_mic1_gain =
- AB8500_CODEC_MIC_VOLUME_MIN +
- (in_left_volume *
- (AB8500_CODEC_MIC_VOLUME_MAX -
- AB8500_CODEC_MIC_VOLUME_MIN)) / 100;
- p_ab8500_codec_configuration->cr21_mic2_gain =
- AB8500_CODEC_MIC_VOLUME_MIN +
- (in_left_volume *
- (AB8500_CODEC_MIC_VOLUME_MAX -
- AB8500_CODEC_MIC_VOLUME_MIN)) / 100;
- break;
- default:
- ab8500_codec_error = AB8500_CODEC_INVALID_PARAMETER;
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_SetSrcVolumeUpdateCR();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-/****************************************************************************/
-/* NAME: AB8500_CODEC_SetDestVolume */
-/*--------------------------------------------------------------------------*/
-/* DESCRIPTION: */
-/* Sets the play volumes. */
-/* */
-/* ARGUMENTS */
-/* IN: */
-/* out_left_volume: play volume for left channel. */
-/* out_right_volume: play volume for right channel. */
-/* OUT: */
-/* None */
-/* */
-/* RETURN: */
-/* AB8500_CODEC_TRANSACTION_FAILED: If transaction fails. */
-/* AB8500_CODEC_OK: if successful. */
-/*--------------------------------------------------------------------------*/
-/* REENTRANCY: Non Re-Entrant */
-
-/****************************************************************************/
-PUBLIC t_ab8500_codec_error AB8500_CODEC_SetDestVolume
- (IN t_ab8500_codec_dest dest_device, IN t_uint8 out_left_volume,
- IN t_uint8 out_right_volume ) {
- t_ab8500_codec_error ab8500_codec_error;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- DBGENTER3(" (%lx %lx %lx)", dest_device, out_left_volume,
- out_right_volume);
- if (out_left_volume > AB8500_CODEC_MAX_VOLUME)
- {
- out_left_volume = AB8500_CODEC_MAX_VOLUME;
- }
- if (out_right_volume > AB8500_CODEC_MAX_VOLUME)
- {
- out_right_volume = AB8500_CODEC_MAX_VOLUME;
- }
- g_ab8500_codec_system_context.out_left_volume = out_left_volume;
- g_ab8500_codec_system_context.out_right_volume = out_right_volume;
- p_ab8500_codec_configuration->cr71_da1gain =
- AB8500_CODEC_DA_D_VOLUME_MIN +
- (out_left_volume *
- (AB8500_CODEC_DA_D_VOLUME_MAX -
- AB8500_CODEC_DA_D_VOLUME_MIN)) / 100;
- p_ab8500_codec_configuration->cr72_da2gain =
- AB8500_CODEC_DA_D_VOLUME_MIN +
- (out_left_volume *
- (AB8500_CODEC_DA_D_VOLUME_MAX -
- AB8500_CODEC_DA_D_VOLUME_MIN)) / 100;
- p_ab8500_codec_configuration->cr73_da3gain =
- AB8500_CODEC_DA_D_VOLUME_MIN +
- (out_left_volume *
- (AB8500_CODEC_DA_D_VOLUME_MAX -
- AB8500_CODEC_DA_D_VOLUME_MIN)) / 100;
- p_ab8500_codec_configuration->cr74_da4gain =
- AB8500_CODEC_DA_D_VOLUME_MIN +
- (out_left_volume *
- (AB8500_CODEC_DA_D_VOLUME_MAX -
- AB8500_CODEC_DA_D_VOLUME_MIN)) / 100;
- p_ab8500_codec_configuration->cr75_da5gain =
- AB8500_CODEC_DA_D_VOLUME_MIN +
- (out_left_volume *
- (AB8500_CODEC_DA_D_VOLUME_MAX -
- AB8500_CODEC_DA_D_VOLUME_MIN)) / 100;
- p_ab8500_codec_configuration->cr76_da6gain =
- AB8500_CODEC_DA_D_VOLUME_MIN +
- (out_left_volume *
- (AB8500_CODEC_DA_D_VOLUME_MAX -
- AB8500_CODEC_DA_D_VOLUME_MIN)) / 100;
-
- /* Set mininimum volume if volume is zero */
- switch (dest_device)
- {
- case AB8500_CODEC_DEST_HEADSET:
- p_ab8500_codec_configuration->cr22_hsl_gain =
- AB8500_CODEC_HEADSET_VOLUME_MIN +
- (out_left_volume *
- (AB8500_CODEC_HEADSET_VOLUME_MAX -
- AB8500_CODEC_HEADSET_VOLUME_MIN)) / 100;
- p_ab8500_codec_configuration->cr22_hsr_gain =
- AB8500_CODEC_HEADSET_VOLUME_MIN +
- (out_right_volume *
- (AB8500_CODEC_HEADSET_VOLUME_MAX -
- AB8500_CODEC_HEADSET_VOLUME_MIN)) / 100;
- p_ab8500_codec_configuration->cr79_hsldgain =
- AB8500_CODEC_HEADSET_D_VOLUME_0DB;
- p_ab8500_codec_configuration->cr80_hsrdgain =
- AB8500_CODEC_HEADSET_D_VOLUME_0DB;
- break;
- case AB8500_CODEC_DEST_EARPIECE:
- p_ab8500_codec_configuration->cr79_hsldgain =
- AB8500_CODEC_HEADSET_D_VOLUME_0DB;
- break;
- case AB8500_CODEC_DEST_HANDSFREE:
- break;
- case AB8500_CODEC_DEST_VIBRATOR_L:
- p_ab8500_codec_configuration->cr16_pwmnldutycycle =
- AB8500_CODEC_VIBRATOR_VOLUME_MIN;
- p_ab8500_codec_configuration->cr17_pwmpldutycycle =
- AB8500_CODEC_VIBRATOR_VOLUME_MIN +
- (out_right_volume *
- (AB8500_CODEC_VIBRATOR_VOLUME_MAX -
- AB8500_CODEC_VIBRATOR_VOLUME_MIN)) / 100;
- break;
- case AB8500_CODEC_DEST_VIBRATOR_R:
- p_ab8500_codec_configuration->cr18_pwmnrdutycycle =
- AB8500_CODEC_VIBRATOR_VOLUME_MIN;
- p_ab8500_codec_configuration->cr19_pwmprdutycycle =
- AB8500_CODEC_VIBRATOR_VOLUME_MIN +
- (out_right_volume *
- (AB8500_CODEC_VIBRATOR_VOLUME_MAX -
- AB8500_CODEC_VIBRATOR_VOLUME_MIN)) / 100;
- break;
- case AB8500_CODEC_DEST_ALL:
- p_ab8500_codec_configuration->cr22_hsl_gain =
- AB8500_CODEC_HEADSET_VOLUME_MIN +
- (out_left_volume *
- (AB8500_CODEC_HEADSET_VOLUME_MAX -
- AB8500_CODEC_HEADSET_VOLUME_MIN)) / 100;
- p_ab8500_codec_configuration->cr22_hsr_gain =
- AB8500_CODEC_HEADSET_VOLUME_MIN +
- (out_right_volume *
- (AB8500_CODEC_HEADSET_VOLUME_MAX -
- AB8500_CODEC_HEADSET_VOLUME_MIN)) / 100;
- p_ab8500_codec_configuration->cr79_hsldgain =
- AB8500_CODEC_HEADSET_D_VOLUME_0DB;
- break;
- default:
- ab8500_codec_error = AB8500_CODEC_INVALID_PARAMETER;
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_SetDestVolumeUpdateCR();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-/****************************************************************************/
-/* NAME: AB8500_CODEC_SetMasterMode */
-/*--------------------------------------------------------------------------*/
-/* DESCRIPTION: */
-/* Set the Audio Codec in Master mode. */
-/* */
-/* ARGUMENTS */
-/* IN: t_codec_master_mode: Enable/disable master mode */
-/* OUT: */
-/* None */
-/* RETURN: */
-/* AB8500_CODEC_TRANSACTION_FAILED: If transaction fails. */
-/* AB8500_CODEC_OK: if successful. */
-/* REMARK: Call this API after calling AB8500_CODEC_SetModeAndDirection() API*/
-/*--------------------------------------------------------------------------*/
-/* REENTRANCY: Non Re-Entrant */
-
-/****************************************************************************/
-PUBLIC t_ab8500_codec_error AB8500_CODEC_SetMasterMode(IN
- t_ab8500_codec_master_mode
- mode)
-{
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
- DBGENTER0();
- if (AB8500_CODEC_AUDIO_INTERFACE_1 ==
- g_ab8500_codec_system_context.audio_interface)
- {
- p_ab8500_codec_configuration->cr27_en_mastgen =
- AB8500_CODEC_CR27_EN_MASTGEN_ENABLED;
- p_ab8500_codec_configuration->cr27_enfs_bitclk1 =
- AB8500_CODEC_CR27_ENFS_BITCLK1_ENABLED;
- if (AB8500_CODEC_MASTER_MODE_ENABLE == mode)
- {
- p_ab8500_codec_configuration->cr29_if1master =
- AB8500_CODEC_CR29_IF1MASTER_FS1CK1_OUTPUT;
- }
-
- else
- {
- p_ab8500_codec_configuration->cr29_if1master =
- AB8500_CODEC_CR29_IF1MASTER_FS1CK1_INPUT;
- }
- }
-
- else
- {
- p_ab8500_codec_configuration->cr27_en_mastgen =
- AB8500_CODEC_CR27_EN_MASTGEN_ENABLED;
- p_ab8500_codec_configuration->cr27_enfs_bitclk0 =
- AB8500_CODEC_CR27_ENFS_BITCLK0_ENABLED;
- if (AB8500_CODEC_MASTER_MODE_ENABLE == mode)
- {
- p_ab8500_codec_configuration->cr29_if0master =
- AB8500_CODEC_CR29_IF0MASTER_FS0CK0_OUTPUT;
- }
-
- else
- {
- p_ab8500_codec_configuration->cr29_if0master =
- AB8500_CODEC_CR29_IF0MASTER_FS0CK0_INPUT;
- }
- }
- ab8500_codec_error = ab8500_codec_UpdateCR27();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR29();
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-/****************************************************************************/
-/* NAME: AB8500_CODEC_SelectInput */
-/*--------------------------------------------------------------------------*/
-/* DESCRIPTION: */
-/* Select input source for recording. */
-/* */
-/* ARGUMENTS */
-/* IN: */
-/* input_src: select input source for recording when several sources */
-/* are supported in codec. */
-/* OUT: */
-/* None */
-/* */
-/* RETURN: */
-/* AB8500_CODEC_INVALID_PARAMETER: If input_src provided is invalid */
-/* by the codec hardware in use. */
-/* AB8500_CODEC_TRANSACTION_FAILED: If transaction fails. */
-/* AB8500_CODEC_OK: if successful. */
-/*--------------------------------------------------------------------------*/
-/* REENTRANCY: Non Re-Entrant */
-
-/****************************************************************************/
-PUBLIC t_ab8500_codec_error AB8500_CODEC_SelectInput(IN t_ab8500_codec_src
- ab8500_codec_src)
-{
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
- DBGENTER1(" (%lx)", ab8500_codec_src);
- g_ab8500_codec_system_context.ab8500_codec_src = ab8500_codec_src;
- ab8500_codec_error =
- ab8500_codec_SetDirection(AB8500_CODEC_DIRECTION_IN);
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-/****************************************************************************/
-/* NAME: AB8500_CODEC_SelectOutput */
-/*--------------------------------------------------------------------------*/
-/* DESCRIPTION: */
-/* Select output desination for playing. */
-/* */
-/* ARGUMENTS */
-/* IN: */
-/* output_dest: select output destination for playing when several are */
-/* supported by codec hardware. */
-/* OUT: */
-/* None */
-/* */
-/* RETURN: */
-/* AB8500_CODEC_INVALID_PARAMETER: If output_src provided is invalid */
-/* AB8500_CODEC_TRANSACTION_FAILED: If transaction fails. */
-/* AB8500_CODEC_OK: if successful. */
-/*--------------------------------------------------------------------------*/
-/* REENTRANCY: Non Re-Entrant */
-
-/****************************************************************************/
-PUBLIC t_ab8500_codec_error AB8500_CODEC_SelectOutput(IN t_ab8500_codec_dest
- ab8500_codec_dest)
-{
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
- g_ab8500_codec_system_context.ab8500_codec_dest = ab8500_codec_dest;
- DBGENTER1(" (%lx)", ab8500_codec_dest);
- ab8500_codec_error =
- ab8500_codec_SetDirection(AB8500_CODEC_DIRECTION_OUT);
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-/****************************************************************************/
-/* NAME: AB8500_CODEC_PowerDown */
-/*--------------------------------------------------------------------------*/
-/* DESCRIPTION: */
-/* Shuts the audio codec down completely. */
-/* */
-/* ARGUMENTS */
-/* IN: */
-/* OUT: */
-/* */
-/* RETURN: */
-/* AB8500_CODEC_TRANSACTION_FAILED: If transaction fails. */
-/* AB8500_CODEC_OK: if successful. */
-/*--------------------------------------------------------------------------*/
-/* REENTRANCY: Non Re-Entrant */
-
-/****************************************************************************/
-PUBLIC t_ab8500_codec_error AB8500_CODEC_PowerDown(void)
-{
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
- g_ab8500_codec_system_context.ab8500_codec_configuration.cr0_powerup =
- AB8500_CODEC_CR0_POWERUP_OFF;
- ab8500_codec_error = ab8500_codec_UpdateCR0();
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-/****************************************************************************/
-/* NAME: AB8500_CODEC_PowerUp */
-/*--------------------------------------------------------------------------*/
-/* DESCRIPTION: */
-/* Switch on the audio codec. */
-/* */
-/* ARGUMENTS */
-/* IN: */
-/* None */
-/* OUT: */
-/* None */
-/* RETURN: */
-/* AB8500_CODEC_TRANSACTION_FAILED: If transaction fails. */
-/* CODEC_OK: if successful. */
-/*--------------------------------------------------------------------------*/
-/* REENTRANCY: Non Re-Entrant */
-
-/****************************************************************************/
-PUBLIC t_ab8500_codec_error AB8500_CODEC_PowerUp(void)
-{
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
- DBGENTER();
- g_ab8500_codec_system_context.ab8500_codec_configuration.cr0_powerup =
- AB8500_CODEC_CR0_POWERUP_ON;
- g_ab8500_codec_system_context.ab8500_codec_configuration.cr0_enaana =
- AB8500_CODEC_CR0_ENAANA_ON;
- ab8500_codec_error = ab8500_codec_UpdateCR0();
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-/****************************************************************************/
-/* NAME: AB8500_CODEC_SelectInterface */
-/*--------------------------------------------------------------------------*/
-/* DESCRIPTION: */
-/* Select the Audio Interface 0 or 1. */
-/* */
-/* ARGUMENTS */
-/* IN: t_ab8500_codec_audio_interface: The selected interface */
-/* */
-/* OUT: */
-/* None */
-/* RETURN: */
-/* AB8500_CODEC_OK: Always. */
-/* REMARK: Call this API before using a function of the low level drivers */
-/* to select the interface that you want to configure */
-/*--------------------------------------------------------------------------*/
-/* REENTRANCY: Non Re-Entrant */
-
-/****************************************************************************/
-PUBLIC t_ab8500_codec_error AB8500_CODEC_SelectInterface(IN
- t_ab8500_codec_audio_interface
- audio_interface)
-{
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
- DBGENTER0();
- g_ab8500_codec_system_context.audio_interface = audio_interface;
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-/****************************************************************************/
-/* NAME: AB8500_CODEC_GetInterface */
-/*--------------------------------------------------------------------------*/
-/* DESCRIPTION: */
-/* Get the Audio Interface 0 or 1. */
-/* */
-/* ARGUMENTS */
-/* IN: */
-/* None */
-/* OUT: p_audio_interface: Store the selected interface */
-/* RETURN: */
-/* AB8500_CODEC_OK: Always */
-/*--------------------------------------------------------------------------*/
-/* REENTRANCY: Re-Entrant */
-/* REENTRANCY ISSUES: No Issues */
-
-/****************************************************************************/
-PUBLIC t_ab8500_codec_error AB8500_CODEC_GetInterface(OUT
- t_ab8500_codec_audio_interface
- * p_audio_interface)
-{
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
- DBGENTER0();
- *p_audio_interface = g_ab8500_codec_system_context.audio_interface;
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-/****************************************************************************/
-/* NAME: AB8500_CODEC_SetAnalogLoopback */
-/*--------------------------------------------------------------------------*/
-/* DESCRIPTION: */
-/* Sets Line-In to HeadSet loopback with the required gain. */
-/* */
-/* ARGUMENTS */
-/* IN: */
-/* out_left_volume: play volume for left channel. */
-/* out_right_volume: play volume for right channel. */
-/* OUT: */
-/* None */
-/* */
-/* RETURN: */
-/* AB8500_CODEC_TRANSACTION_FAILED: If transaction fails. */
-/* AB8500_CODEC_OK: if successful. */
-/*--------------------------------------------------------------------------*/
-/* REENTRANCY: Non Re-Entrant */
-
-/****************************************************************************/
-PUBLIC t_ab8500_codec_error AB8500_CODEC_SetAnalogLoopback(IN t_uint8
- out_left_volume,
- IN t_uint8
- out_right_volume)
-{
- t_ab8500_codec_error ab8500_codec_error;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
- DBGENTER2(" (%lx %lx)", out_left_volume, out_right_volume);
- if (out_left_volume > AB8500_CODEC_MAX_VOLUME)
- {
- out_left_volume = AB8500_CODEC_MAX_VOLUME;
- }
- if (out_right_volume > AB8500_CODEC_MAX_VOLUME)
- {
- out_right_volume = AB8500_CODEC_MAX_VOLUME;
- }
- g_ab8500_codec_system_context.out_left_volume = out_left_volume;
- g_ab8500_codec_system_context.out_right_volume = out_right_volume;
- p_ab8500_codec_configuration->cr24_lintohsl_gain =
- AB8500_CODEC_LINEIN_TO_HS_L_R_VOLUME_MIN +
- (out_left_volume *
- (AB8500_CODEC_LINEIN_TO_HS_L_R_VOLUME_MAX -
- AB8500_CODEC_LINEIN_TO_HS_L_R_VOLUME_MIN)) / 100;
- p_ab8500_codec_configuration->cr25_lintohsr_gain =
- AB8500_CODEC_LINEIN_TO_HS_L_R_VOLUME_MIN +
- (out_right_volume *
- (AB8500_CODEC_LINEIN_TO_HS_L_R_VOLUME_MAX -
- AB8500_CODEC_LINEIN_TO_HS_L_R_VOLUME_MIN)) / 100;
- ab8500_codec_error = ab8500_codec_UpdateCR24();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR25();
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-/****************************************************************************/
-/* NAME: AB8500_CODEC_RemoveAnalogLoopback */
-/*--------------------------------------------------------------------------*/
-/* DESCRIPTION: */
-/* Remove Line-In to HeadSet loopback. */
-/* */
-/* ARGUMENTS */
-/* IN: */
-/* None */
-/* OUT: */
-/* None */
-/* */
-/* RETURN: */
-/* AB8500_CODEC_TRANSACTION_FAILED: If transaction fails. */
-/* AB8500_CODEC_OK: if successful. */
-/*--------------------------------------------------------------------------*/
-/* REENTRANCY: Non Re-Entrant */
-
-/****************************************************************************/
-PUBLIC t_ab8500_codec_error AB8500_CODEC_RemoveAnalogLoopback(void)
-{
- t_ab8500_codec_error ab8500_codec_error;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
- DBGENTER0();
- p_ab8500_codec_configuration->cr24_lintohsl_gain =
- AB8500_CODEC_LINEIN_TO_HS_L_R_LOOP_OPEN;
- p_ab8500_codec_configuration->cr25_lintohsr_gain =
- AB8500_CODEC_LINEIN_TO_HS_L_R_LOOP_OPEN;
- ab8500_codec_error = ab8500_codec_UpdateCR24();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR25();
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-/****************************************************************************/
-/* NAME: AB8500_CODEC_EnableBypassMode */
-/*--------------------------------------------------------------------------*/
-/* DESCRIPTION: */
-/* Enables IF0 to IF1 path or vice versa */
-/* */
-/* ARGUMENTS */
-/* IN: */
-/* None */
-/* OUT: */
-/* None */
-/* */
-/* RETURN: */
-/* AB8500_CODEC_TRANSACTION_FAILED: If transaction fails. */
-/* AB8500_CODEC_OK: if successful. */
-/*--------------------------------------------------------------------------*/
-/* REENTRANCY: Non Re-Entrant */
-
-/****************************************************************************/
-PUBLIC t_ab8500_codec_error AB8500_CODEC_EnableBypassMode(void)
-{
- t_ab8500_codec_error ab8500_codec_error;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
- DBGENTER0();
- if (AB8500_CODEC_AUDIO_INTERFACE_1 ==
- g_ab8500_codec_system_context.audio_interface)
- {
- p_ab8500_codec_configuration->cr29_if1datoif0ad =
- AB8500_CODEC_CR29_IF1DATOIF0AD_SENT;
- p_ab8500_codec_configuration->cr29_if1cktoif0ck =
- AB8500_CODEC_CR29_IF1CKTOIF0CK_SENT;
- }
-
- else
- {
- p_ab8500_codec_configuration->cr29_if0datoif1ad =
- AB8500_CODEC_CR29_IF0DATOIF1AD_SENT;
- p_ab8500_codec_configuration->cr29_if0cktoif1ck =
- AB8500_CODEC_CR29_IF0CKTOIF1CK_SENT;
- }
- ab8500_codec_error = ab8500_codec_UpdateCR29();
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-/****************************************************************************/
-/* NAME: AB8500_CODEC_DisableBypassMode */
-/*--------------------------------------------------------------------------*/
-/* DESCRIPTION: */
-/* Disables IF0 to IF1 path or vice versa */
-/* */
-/* ARGUMENTS */
-/* IN: */
-/* None */
-/* OUT: */
-/* None */
-/* */
-/* RETURN: */
-/* AB8500_CODEC_TRANSACTION_FAILED: If transaction fails. */
-/* AB8500_CODEC_OK: if successful. */
-/*--------------------------------------------------------------------------*/
-/* REENTRANCY: Non Re-Entrant */
-
-/****************************************************************************/
-PUBLIC t_ab8500_codec_error AB8500_CODEC_DisableBypassMode(void)
-{
- t_ab8500_codec_error ab8500_codec_error;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
- DBGENTER0();
- if (AB8500_CODEC_AUDIO_INTERFACE_1 ==
- g_ab8500_codec_system_context.audio_interface)
- {
- p_ab8500_codec_configuration->cr29_if1datoif0ad =
- AB8500_CODEC_CR29_IF1DATOIF0AD_NOTSENT;
- p_ab8500_codec_configuration->cr29_if1cktoif0ck =
- AB8500_CODEC_CR29_IF1CKTOIF0CK_NOTSENT;
- }
-
- else
- {
- p_ab8500_codec_configuration->cr29_if0datoif1ad =
- AB8500_CODEC_CR29_IF0DATOIF1AD_NOTSENT;
- p_ab8500_codec_configuration->cr29_if0cktoif1ck =
- AB8500_CODEC_CR29_IF0CKTOIF1CK_NOTSENT;
- }
- ab8500_codec_error = ab8500_codec_UpdateCR29();
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-/****************************************************************************/
-/* NAME: AB8500_CODEC_SrcPowerControl */
-/*--------------------------------------------------------------------------*/
-/* DESCRIPTION: */
-/* Enables/Disables & UnMute/Mute the desired source */
-/* */
-/* ARGUMENTS */
-/* IN: */
-/* t_ab8500_codec_src: select source device for enabling/disabling. */
-/* t_ab8500_codec_src_state: Enable/Disable */
-/* OUT: */
-/* None */
-/* */
-/* RETURN: */
-/* AB8500_CODEC_TRANSACTION_FAILED: If transaction fails. */
-/* AB8500_CODEC_OK: if successful. */
-/*--------------------------------------------------------------------------*/
-/* REENTRANCY: Non Re-Entrant */
-
-/****************************************************************************/
-PUBLIC t_ab8500_codec_error AB8500_CODEC_SrcPowerControl(IN
- t_ab8500_codec_src
- src_device,
- t_ab8500_codec_src_state
- state)
-{
- t_ab8500_codec_error ab8500_codec_error;
- DBGENTER2(" (%lx %lx)", src_device, state);
- if (src_device <= AB8500_CODEC_SRC_D_MICROPHONE_2)
- {
- ab8500_codec_error =
- ab8500_codec_SrcPowerControlSwitch1(src_device, state);
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- }
-
- else if (src_device <= AB8500_CODEC_SRC_ALL)
- {
- ab8500_codec_error =
- ab8500_codec_SrcPowerControlSwitch2(src_device, state);
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- }
-
- else
- {
- ab8500_codec_error = AB8500_CODEC_INVALID_PARAMETER;
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR5();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR6();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR7();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR63();
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-/****************************************************************************/
-/* NAME: AB8500_CODEC_DestPowerControl */
-/*--------------------------------------------------------------------------*/
-/* DESCRIPTION: */
-/* Enables/Disables & UnMute/Mute the desired destination */
-/* */
-/* ARGUMENTS */
-/* IN: */
-/* t_ab8500_codec_dest: select destination device for enabling/disabling. */
-/* t_ab8500_codec_dest_state: Enable/Disable */
-/* OUT: */
-/* None */
-/* */
-/* RETURN: */
-/* AB8500_CODEC_TRANSACTION_FAILED: If transaction fails. */
-/* AB8500_CODEC_OK: if successful. */
-/*--------------------------------------------------------------------------*/
-/* REENTRANCY: Non Re-Entrant */
-
-/****************************************************************************/
-PUBLIC t_ab8500_codec_error AB8500_CODEC_DestPowerControl(IN
- t_ab8500_codec_dest
- dest_device,
- t_ab8500_codec_dest_state
- state)
-{
- t_ab8500_codec_error ab8500_codec_error;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context.ab8500_codec_configuration;
- DBGENTER2(" (%lx %lx)", dest_device, state);
- switch (dest_device)
- {
- case AB8500_CODEC_DEST_HEADSET:
- if (AB8500_CODEC_DEST_STATE_ENABLE == state)
- {
- p_ab8500_codec_configuration->cr8_enhsl =
- AB8500_CODEC_CR8_ENHSL_ENABLED;
- p_ab8500_codec_configuration->cr8_enhsr =
- AB8500_CODEC_CR8_ENHSR_ENABLED;
- p_ab8500_codec_configuration->cr10_mutehsl =
- AB8500_CODEC_CR10_MUTEHSL_DISABLED;
- p_ab8500_codec_configuration->cr10_mutehsr =
- AB8500_CODEC_CR10_MUTEHSR_DISABLED;
- p_ab8500_codec_configuration->cr9_endachsl =
- AB8500_CODEC_CR9_ENDACHSL_ENABLED;
- p_ab8500_codec_configuration->cr9_endachsr =
- AB8500_CODEC_CR9_ENDACHSR_ENABLED;
- }
-
- else
- {
- p_ab8500_codec_configuration->cr8_enhsl =
- AB8500_CODEC_CR8_ENHSL_DISABLED;
- p_ab8500_codec_configuration->cr8_enhsr =
- AB8500_CODEC_CR8_ENHSR_DISABLED;
- p_ab8500_codec_configuration->cr10_mutehsl =
- AB8500_CODEC_CR10_MUTEHSL_ENABLED;
- p_ab8500_codec_configuration->cr10_mutehsr =
- AB8500_CODEC_CR10_MUTEHSR_ENABLED;
- p_ab8500_codec_configuration->cr9_endachsl =
- AB8500_CODEC_CR9_ENDACHSL_DISABLED;
- p_ab8500_codec_configuration->cr9_endachsr =
- AB8500_CODEC_CR9_ENDACHSR_DISABLED;
- }
- break;
- case AB8500_CODEC_DEST_EARPIECE:
- if (AB8500_CODEC_DEST_STATE_ENABLE == state)
- {
- p_ab8500_codec_configuration->cr8_enear =
- AB8500_CODEC_CR8_ENEAR_ENABLED;
- p_ab8500_codec_configuration->cr9_endacear =
- AB8500_CODEC_CR9_ENDACEAR_ENABLED;
- p_ab8500_codec_configuration->cr10_muteear =
- AB8500_CODEC_CR10_MUTEEAR_DISABLED;
- }
-
- else
- {
- p_ab8500_codec_configuration->cr8_enear =
- AB8500_CODEC_CR8_ENEAR_DISABLED;
- p_ab8500_codec_configuration->cr9_endacear =
- AB8500_CODEC_CR9_ENDACEAR_DISABLED;
- p_ab8500_codec_configuration->cr10_muteear =
- AB8500_CODEC_CR10_MUTEEAR_ENABLED;
- }
- break;
- case AB8500_CODEC_DEST_HANDSFREE:
- if (AB8500_CODEC_DEST_STATE_ENABLE == state)
- {
- p_ab8500_codec_configuration->cr8_enhfl =
- AB8500_CODEC_CR8_ENHFL_ENABLED;
- p_ab8500_codec_configuration->cr8_enhfr =
- AB8500_CODEC_CR8_ENHFR_ENABLED;
- p_ab8500_codec_configuration->cr9_endachfl =
- AB8500_CODEC_CR9_ENDACHFL_ENABLED;
- p_ab8500_codec_configuration->cr9_endachfr =
- AB8500_CODEC_CR9_ENDACHFR_ENABLED;
- }
-
- else
- {
- p_ab8500_codec_configuration->cr8_enhfl =
- AB8500_CODEC_CR8_ENHFL_DISABLED;
- p_ab8500_codec_configuration->cr8_enhfr =
- AB8500_CODEC_CR8_ENHFR_DISABLED;
- p_ab8500_codec_configuration->cr9_endachfl =
- AB8500_CODEC_CR9_ENDACHFL_DISABLED;
- p_ab8500_codec_configuration->cr9_endachfr =
- AB8500_CODEC_CR9_ENDACHFR_DISABLED;
- }
- break;
- case AB8500_CODEC_DEST_VIBRATOR_L:
- if (AB8500_CODEC_DEST_STATE_ENABLE == state)
- {
- p_ab8500_codec_configuration->cr8_envibl =
- AB8500_CODEC_CR8_ENVIBL_ENABLED;
- p_ab8500_codec_configuration->cr9_endacvibl =
- AB8500_CODEC_CR9_ENDACVIBL_ENABLED;
- p_ab8500_codec_configuration->cr15_pwmtovibl =
- AB8500_CODEC_CR15_PWMTOVIBL_PWM;
- p_ab8500_codec_configuration->cr15_pwmlctrl =
- AB8500_CODEC_CR15_PWMLCTRL_PWMNPLDUTYCYCLE;
- p_ab8500_codec_configuration->cr15_pwmnlctrl =
- AB8500_CODEC_CR15_PWMNLCTRL_PWMNLDUTYCYCLE;
- p_ab8500_codec_configuration->cr15_pwmplctrl =
- AB8500_CODEC_CR15_PWMPLCTRL_PWMPLDUTYCYCLE;
- }
-
- else
- {
- p_ab8500_codec_configuration->cr8_envibl =
- AB8500_CODEC_CR8_ENVIBL_DISABLED;
- p_ab8500_codec_configuration->cr9_endacvibl =
- AB8500_CODEC_CR9_ENDACVIBL_DISABLED;
- p_ab8500_codec_configuration->cr15_pwmtovibl =
- AB8500_CODEC_CR15_PWMTOVIBL_DA_PATH;
- p_ab8500_codec_configuration->cr15_pwmlctrl =
- AB8500_CODEC_CR15_PWMLCTRL_PWMNPLGPOL;
- p_ab8500_codec_configuration->cr15_pwmnlctrl =
- AB8500_CODEC_CR15_PWMNLCTRL_PWMNLGPOL;
- p_ab8500_codec_configuration->cr15_pwmplctrl =
- AB8500_CODEC_CR15_PWMPLCTRL_PWMPLGPOL;
- }
- break;
- case AB8500_CODEC_DEST_VIBRATOR_R:
- if (AB8500_CODEC_DEST_STATE_ENABLE == state)
- {
- p_ab8500_codec_configuration->cr8_envibr =
- AB8500_CODEC_CR8_ENVIBR_ENABLED;
- p_ab8500_codec_configuration->cr9_endacvibr =
- AB8500_CODEC_CR9_ENDACVIBR_ENABLED;
- p_ab8500_codec_configuration->cr15_pwmtovibr =
- AB8500_CODEC_CR15_PWMTOVIBR_PWM;
- p_ab8500_codec_configuration->cr15_pwmrctrl =
- AB8500_CODEC_CR15_PWMRCTRL_PWMNPRDUTYCYCLE;
- p_ab8500_codec_configuration->cr15_pwmnrctrl =
- AB8500_CODEC_CR15_PWMNRCTRL_PWMNRDUTYCYCLE;
- p_ab8500_codec_configuration->cr15_pwmprctrl =
- AB8500_CODEC_CR15_PWMPRCTRL_PWMPRDUTYCYCLE;
- }
-
- else
- {
- p_ab8500_codec_configuration->cr8_envibr =
- AB8500_CODEC_CR8_ENVIBR_DISABLED;
- p_ab8500_codec_configuration->cr9_endacvibr =
- AB8500_CODEC_CR9_ENDACVIBR_DISABLED;
- p_ab8500_codec_configuration->cr15_pwmtovibr =
- AB8500_CODEC_CR15_PWMTOVIBR_DA_PATH;
- p_ab8500_codec_configuration->cr15_pwmrctrl =
- AB8500_CODEC_CR15_PWMRCTRL_PWMNPRGPOL;
- p_ab8500_codec_configuration->cr15_pwmnrctrl =
- AB8500_CODEC_CR15_PWMNRCTRL_PWMNRGPOL;
- p_ab8500_codec_configuration->cr15_pwmprctrl =
- AB8500_CODEC_CR15_PWMPRCTRL_PWMPRGPOL;
- }
- break;
- case AB8500_CODEC_DEST_ALL:
- if (AB8500_CODEC_DEST_STATE_ENABLE == state)
- {
- p_ab8500_codec_configuration->cr8_enhsl =
- AB8500_CODEC_CR8_ENHSL_ENABLED;
- p_ab8500_codec_configuration->cr8_enhsr =
- AB8500_CODEC_CR8_ENHSR_ENABLED;
- p_ab8500_codec_configuration->cr8_enear =
- AB8500_CODEC_CR8_ENEAR_ENABLED;
- p_ab8500_codec_configuration->cr8_enhfl =
- AB8500_CODEC_CR8_ENHFL_ENABLED;
- p_ab8500_codec_configuration->cr8_enhfr =
- AB8500_CODEC_CR8_ENHFR_ENABLED;
- p_ab8500_codec_configuration->cr8_envibl =
- AB8500_CODEC_CR8_ENVIBL_ENABLED;
- p_ab8500_codec_configuration->cr8_envibr =
- AB8500_CODEC_CR8_ENVIBR_ENABLED;
- p_ab8500_codec_configuration->cr9_endacear =
- AB8500_CODEC_CR9_ENDACEAR_ENABLED;
- p_ab8500_codec_configuration->cr9_endachfl =
- AB8500_CODEC_CR9_ENDACHFL_ENABLED;
- p_ab8500_codec_configuration->cr9_endachfr =
- AB8500_CODEC_CR9_ENDACHFR_ENABLED;
- p_ab8500_codec_configuration->cr9_endacvibl =
- AB8500_CODEC_CR9_ENDACVIBL_ENABLED;
- p_ab8500_codec_configuration->cr9_endacvibr =
- AB8500_CODEC_CR9_ENDACVIBR_ENABLED;
- p_ab8500_codec_configuration->cr10_mutehsl =
- AB8500_CODEC_CR10_MUTEHSL_DISABLED;
- p_ab8500_codec_configuration->cr10_mutehsr =
- AB8500_CODEC_CR10_MUTEHSR_DISABLED;
- p_ab8500_codec_configuration->cr10_muteear =
- AB8500_CODEC_CR10_MUTEEAR_DISABLED;
- p_ab8500_codec_configuration->cr15_pwmtovibl =
- AB8500_CODEC_CR15_PWMTOVIBL_PWM;
- p_ab8500_codec_configuration->cr15_pwmlctrl =
- AB8500_CODEC_CR15_PWMLCTRL_PWMNPLDUTYCYCLE;
- p_ab8500_codec_configuration->cr15_pwmnlctrl =
- AB8500_CODEC_CR15_PWMNLCTRL_PWMNLDUTYCYCLE;
- p_ab8500_codec_configuration->cr15_pwmplctrl =
- AB8500_CODEC_CR15_PWMPLCTRL_PWMPLDUTYCYCLE;
- p_ab8500_codec_configuration->cr15_pwmtovibr =
- AB8500_CODEC_CR15_PWMTOVIBR_PWM;
- p_ab8500_codec_configuration->cr15_pwmrctrl =
- AB8500_CODEC_CR15_PWMRCTRL_PWMNPRDUTYCYCLE;
- p_ab8500_codec_configuration->cr15_pwmnrctrl =
- AB8500_CODEC_CR15_PWMNRCTRL_PWMNRDUTYCYCLE;
- p_ab8500_codec_configuration->cr15_pwmprctrl =
- AB8500_CODEC_CR15_PWMPRCTRL_PWMPRDUTYCYCLE;
- }
-
- else
- {
- p_ab8500_codec_configuration->cr8_enhsl =
- AB8500_CODEC_CR8_ENHSL_DISABLED;
- p_ab8500_codec_configuration->cr8_enhsr =
- AB8500_CODEC_CR8_ENHSR_DISABLED;
- p_ab8500_codec_configuration->cr8_enear =
- AB8500_CODEC_CR8_ENEAR_DISABLED;
- p_ab8500_codec_configuration->cr8_enhfl =
- AB8500_CODEC_CR8_ENHFL_DISABLED;
- p_ab8500_codec_configuration->cr8_enhfr =
- AB8500_CODEC_CR8_ENHFR_DISABLED;
- p_ab8500_codec_configuration->cr8_envibl =
- AB8500_CODEC_CR8_ENVIBL_DISABLED;
- p_ab8500_codec_configuration->cr8_envibr =
- AB8500_CODEC_CR8_ENVIBR_DISABLED;
- p_ab8500_codec_configuration->cr9_endacear =
- AB8500_CODEC_CR9_ENDACEAR_DISABLED;
- p_ab8500_codec_configuration->cr9_endachfl =
- AB8500_CODEC_CR9_ENDACHFL_DISABLED;
- p_ab8500_codec_configuration->cr9_endachfr =
- AB8500_CODEC_CR9_ENDACHFR_DISABLED;
- p_ab8500_codec_configuration->cr9_endacvibl =
- AB8500_CODEC_CR9_ENDACVIBL_DISABLED;
- p_ab8500_codec_configuration->cr9_endacvibr =
- AB8500_CODEC_CR9_ENDACVIBR_DISABLED;
- p_ab8500_codec_configuration->cr10_mutehsl =
- AB8500_CODEC_CR10_MUTEHSL_ENABLED;
- p_ab8500_codec_configuration->cr10_mutehsr =
- AB8500_CODEC_CR10_MUTEHSR_ENABLED;
- p_ab8500_codec_configuration->cr10_muteear =
- AB8500_CODEC_CR10_MUTEEAR_ENABLED;
- p_ab8500_codec_configuration->cr15_pwmtovibl =
- AB8500_CODEC_CR15_PWMTOVIBL_DA_PATH;
- p_ab8500_codec_configuration->cr15_pwmlctrl =
- AB8500_CODEC_CR15_PWMLCTRL_PWMNPLGPOL;
- p_ab8500_codec_configuration->cr15_pwmnlctrl =
- AB8500_CODEC_CR15_PWMNLCTRL_PWMNLGPOL;
- p_ab8500_codec_configuration->cr15_pwmplctrl =
- AB8500_CODEC_CR15_PWMPLCTRL_PWMPLGPOL;
- p_ab8500_codec_configuration->cr15_pwmtovibr =
- AB8500_CODEC_CR15_PWMTOVIBR_DA_PATH;
- p_ab8500_codec_configuration->cr15_pwmrctrl =
- AB8500_CODEC_CR15_PWMRCTRL_PWMNPRGPOL;
- p_ab8500_codec_configuration->cr15_pwmnrctrl =
- AB8500_CODEC_CR15_PWMNRCTRL_PWMNRGPOL;
- p_ab8500_codec_configuration->cr15_pwmprctrl =
- AB8500_CODEC_CR15_PWMPRCTRL_PWMPRGPOL;
- }
- break;
- default:
- ab8500_codec_error = AB8500_CODEC_INVALID_PARAMETER;
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_DestPowerControlUpdateCR();
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-/****************************************************************************/
-/* NAME: AB8500_CODEC_GetVersion */
-/*--------------------------------------------------------------------------*/
-/* DESCRIPTION: */
-/* This routine populates the pVersion structure with */
-/* the current version of HCL. */
-/* */
-/* ARGUMENTS */
-/* IN: */
-/* None */
-/* OUT: */
-/* p_version: this parameter is used to return current HCL version. */
-/* */
-/* RETURN: */
-/* AB8500_CODEC_ERROR: if p_version is NULL. */
-/* AB8500_CODEC_OK: if successful */
-/*--------------------------------------------------------------------------*/
-/* REENTRANCY: Re-Entrant */
-/* REENTRANCY ISSUES: No Issues */
-
-/****************************************************************************/
-PUBLIC t_ab8500_codec_error AB8500_CODEC_GetVersion(OUT t_version * p_version)
-{
- DBGENTER1(" (%lx)", p_version);
- if (p_version != NULL)
- {
- p_version->minor = AB8500_CODEC_HCL_MINOR_ID;
- p_version->major = AB8500_CODEC_HCL_MAJOR_ID;
- p_version->version = AB8500_CODEC_HCL_VERSION_ID;
- DBGEXIT0(AB8500_CODEC_OK);
- return (AB8500_CODEC_OK);
- }
-
- else
- {
- DBGEXIT0(AB8500_CODEC_INVALID_PARAMETER);
- return (AB8500_CODEC_INVALID_PARAMETER);
- }
-}
-
-/****************************************************************************/
-/* NAME: AB8500_CODEC_SetDbgLevel */
-/*--------------------------------------------------------------------------*/
-/* DESCRIPTION: */
-/* Set the debug level used by the debug module (mask-like value). */
-/* */
-/* ARGUMENTS */
-/* IN: */
-/* debug_level: debug level to be set */
-/* OUT: */
-/* None */
-/* */
-/* RETURN: */
-/* AB8500_CODEC_OK: always */
-/*--------------------------------------------------------------------------*/
-/* REENTRANCY: Re-Entrant */
-/* REENTRANCY ISSUES: No Issues */
-
-/****************************************************************************/
-/*
-PUBLIC t_ab8500_codec_error AB8500_CODEC_SetDbgLevel(IN t_dbg_level dbg_level)
-{
- DBGENTER1(" (%d)", dbg_level);
- dbg_level = dbg_level;
-#ifdef __DEBUG
- MY_DEBUG_LEVEL_VAR_NAME = dbg_level;
-#endif
- DBGEXIT(AB8500_CODEC_OK);
- return(AB8500_CODEC_OK);
-}
- */
-
-/****************************************************************************/
-/* NAME: AB8500_CODEC_GetDbgLevel */
-/*--------------------------------------------------------------------------*/
-/* DESCRIPTION: */
-/* Set the debug level used by the debug module (mask-like value). */
-/* */
-/* ARGUMENTS */
-/* IN: */
-/* None */
-/* OUT: */
-/* p_dbg_level: this parameter is used to return debug level. */
-/* */
-/* RETURN: */
-/* AB8500_CODEC_ERROR: if p_version is NULL. */
-/* AB8500_CODEC_OK: if successful */
-/*--------------------------------------------------------------------------*/
-/* REENTRANCY: Re-Entrant */
-/* REENTRANCY ISSUES: No Issues */
-
-/****************************************************************************/
-/*
-PUBLIC t_ab8500_codec_error AB8500_CODEC_GetDbgLevel(OUT t_dbg_level *p_dbg_level)
-{
- if (NULL == p_dbg_level)
- {
- DBGEXIT(AB8500_CODEC_INVALID_PARAMETER);
- return(AB8500_CODEC_INVALID_PARAMETER);
- }
-
-#ifdef __DEBUG
- * p_dbg_level = MY_DEBUG_LEVEL_VAR_NAME;
-#endif
- DBGEXIT(AB8500_CODEC_OK);
- return(AB8500_CODEC_OK);
-}
-*/
-/****************************************************************************/
-/* NAME: AB8500_CODEC_ADSlotAllocation */
-/*--------------------------------------------------------------------------*/
-/* DESCRIPTION: */
-/* AD Data Allocation in slots. */
-/* */
-/* ARGUMENTS */
-/* IN: t_ab8500_codec_slot: The slot to be allocated. */
-/* IN: t_ab8500_codec_cr31_to_cr46_ad_data_allocation: The value */
-/* to be allocated. */
-/* OUT: */
-/* None */
-/* RETURN: */
-/* AB8500_CODEC_INVALID_PARAMETER: If invalid slot number */
-/* AB8500_CODEC_OK: if successful. */
-/* REMARK: */
-/*--------------------------------------------------------------------------*/
-/* REENTRANCY: Non Re-Entrant */
-
-/****************************************************************************/
-PUBLIC t_ab8500_codec_error AB8500_CODEC_ADSlotAllocation
- (IN t_ab8500_codec_slot ad_slot,
- IN t_ab8500_codec_cr31_to_cr46_ad_data_allocation value ) {
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
- DBGENTER2(" (%lx %lx)", ad_slot, value);
- if (ad_slot <= AB8500_CODEC_SLOT7)
- {
- ab8500_codec_error =
- ab8500_codec_ADSlotAllocationSwitch1(ad_slot, value);
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- }
-
- else if (ad_slot <= AB8500_CODEC_SLOT15)
- {
- ab8500_codec_error =
- ab8500_codec_ADSlotAllocationSwitch2(ad_slot, value);
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- }
-
- else if (ad_slot <= AB8500_CODEC_SLOT23)
- {
- ab8500_codec_error =
- ab8500_codec_ADSlotAllocationSwitch3(ad_slot, value);
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- }
-
- else if (ad_slot <= AB8500_CODEC_SLOT31)
- {
- ab8500_codec_error =
- ab8500_codec_ADSlotAllocationSwitch4(ad_slot, value);
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- }
-
- else
- {
- ab8500_codec_error = AB8500_CODEC_INVALID_PARAMETER;
- }
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-/****************************************************************************/
-/* NAME: AB8500_CODEC_DASlotAllocation */
-/*--------------------------------------------------------------------------*/
-/* DESCRIPTION: */
-/* Allocate the Audio Interface slot for DA paths. */
-/* */
-/* ARGUMENTS */
-/* IN: t_ab8500_codec_da_channel_number: Channel number 1/2/3/4/5/6 */
-/* IN: t_ab8500_codec_cr51_to_cr56_sltoda: Slot number */
-/* */
-/* OUT: */
-/* None */
-/* RETURN: */
-/* AB8500_CODEC_INVALID_PARAMETER: If invalid channel number */
-/* AB8500_CODEC_OK: if successful. */
-/* REMARK: */
-/*--------------------------------------------------------------------------*/
-/* REENTRANCY: Non Re-Entrant */
-
-/****************************************************************************/
-PUBLIC t_ab8500_codec_error AB8500_CODEC_DASlotAllocation
- (IN t_ab8500_codec_da_channel_number channel_number,
- IN t_ab8500_codec_cr51_to_cr58_sltoda slot ) {
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- t_ab8500_codec_cr0_powerup ab8500_codec_cr0_powerup;
- DBGENTER2(" (%lx %lx)", channel_number, slot);
- p_ab8500_codec_configuration->cr51_da12_voice =
- AB8500_CODEC_CR51_DA12_VOICE_LOWLATENCYFILTER;
- switch (channel_number)
- {
- case AB8500_CODEC_DA_CHANNEL_NUMBER_1:
- p_ab8500_codec_configuration->cr51_sltoda1 = slot;
- break;
- case AB8500_CODEC_DA_CHANNEL_NUMBER_2:
- p_ab8500_codec_configuration->cr52_sltoda2 = slot;
- break;
- case AB8500_CODEC_DA_CHANNEL_NUMBER_3:
- p_ab8500_codec_configuration->cr53_sltoda3 = slot;
- break;
- case AB8500_CODEC_DA_CHANNEL_NUMBER_4:
- p_ab8500_codec_configuration->cr54_sltoda4 = slot;
- break;
- case AB8500_CODEC_DA_CHANNEL_NUMBER_5:
- p_ab8500_codec_configuration->cr55_sltoda5 = slot;
- break;
- case AB8500_CODEC_DA_CHANNEL_NUMBER_6:
- p_ab8500_codec_configuration->cr56_sltoda6 = slot;
- break;
- case AB8500_CODEC_DA_CHANNEL_NUMBER_7:
- p_ab8500_codec_configuration->cr57_sltoda7 = slot;
- break;
- case AB8500_CODEC_DA_CHANNEL_NUMBER_8:
- p_ab8500_codec_configuration->cr58_sltoda8 = slot;
- break;
- default:
- ab8500_codec_error = AB8500_CODEC_INVALID_PARAMETER;
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- ab8500_codec_cr0_powerup = p_ab8500_codec_configuration->cr0_powerup;
- p_ab8500_codec_configuration->cr0_powerup =
- AB8500_CODEC_CR0_POWERUP_OFF;
- ab8500_codec_error = ab8500_codec_UpdateCR0();
- if (AB8500_CODEC_OK != ab8500_codec_error)
- {
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR51();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR52();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR53();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR54();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR55();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR56();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR57();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR58();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- p_ab8500_codec_configuration->cr0_powerup = ab8500_codec_cr0_powerup;
- ab8500_codec_error = ab8500_codec_UpdateCR0();
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-/****************************************************************************/
-/* NAME: AB8500_CODEC_ConfigureBurstFifo */
-/*--------------------------------------------------------------------------*/
-/* DESCRIPTION: */
-/* Configuration for Burst FIFO control */
-/* */
-/* ARGUMENTS */
-/* IN: t_ab8500_codec_burst_fifo_config: structure for configuration of */
-/* burst FIFO */
-/* OUT: */
-/* None */
-/* RETURN: */
-/* AB8500_CODEC_INVALID_PARAMETER: If invalid parameter */
-/* AB8500_CODEC_UNSUPPORTED_FEATURE: If interface 1 selected */
-/* AB8500_CODEC_OK: if successful. */
-/* REMARK: */
-/*--------------------------------------------------------------------------*/
-/* REENTRANCY: Non Re-Entrant */
-
-/****************************************************************************/
-t_ab8500_codec_error AB8500_CODEC_ConfigureBurstFifo(IN
- t_ab8500_codec_burst_fifo_config
- const *const
- p_burst_fifo_config)
-{
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
- DBGENTER1(" (%lx)", p_burst_fifo_config);
- if (AB8500_CODEC_AUDIO_INTERFACE_0 ==
- g_ab8500_codec_system_context.audio_interface)
- {
- if (AB8500_CODEC_CR27_EN_MASTGEN_ENABLED ==
- p_ab8500_codec_configuration->cr27_en_mastgen)
- {
- p_ab8500_codec_configuration->cr105_bfifomsk =
- p_burst_fifo_config->cr105_bfifomsk;
- p_ab8500_codec_configuration->cr105_bfifoint =
- p_burst_fifo_config->cr105_bfifoint;
- p_ab8500_codec_configuration->cr106_bfifotx =
- p_burst_fifo_config->cr106_bfifotx;
- p_ab8500_codec_configuration->cr107_bfifoexsl =
- p_burst_fifo_config->cr107_bfifoexsl;
- p_ab8500_codec_configuration->cr107_bfifomast =
- p_burst_fifo_config->cr107_bfifomast;
- p_ab8500_codec_configuration->cr107_bfiforun =
- p_burst_fifo_config->cr107_bfiforun;
- p_ab8500_codec_configuration->cr108_bfifoframsw =
- p_burst_fifo_config->cr108_bfifoframsw;
- p_ab8500_codec_configuration->cr109_bfifowakeup =
- p_burst_fifo_config->cr109_bfifowakeup;
- ab8500_codec_error = ab8500_codec_UpdateCR105();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR106();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR107();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR108();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR109();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- }
-
- else
- {
- ab8500_codec_error = AB8500_CODEC_INVALID_PARAMETER;
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- }
-
- else
- {
- ab8500_codec_error = AB8500_CODEC_UNSUPPORTED_FEATURE;
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-/****************************************************************************/
-/* NAME: AB8500_CODEC_EnableBurstFifo */
-/*--------------------------------------------------------------------------*/
-/* DESCRIPTION: */
-/* Enable the Burst FIFO for Interface 0 */
-/* */
-/* ARGUMENTS */
-/* IN: */
-/* None */
-/* OUT: */
-/* None */
-/* RETURN: */
-/* AB8500_CODEC_UNSUPPORTED_FEATURE: If Interface 1 is selected */
-/* AB8500_CODEC_OK: if successful. */
-/* REMARK: */
-/*--------------------------------------------------------------------------*/
-/* REENTRANCY: Non Re-Entrant */
-
-/****************************************************************************/
-PUBLIC t_ab8500_codec_error AB8500_CODEC_EnableBurstFifo(void)
-{
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
- DBGENTER0();
- if (AB8500_CODEC_AUDIO_INTERFACE_0 ==
- g_ab8500_codec_system_context.audio_interface)
- {
- p_ab8500_codec_configuration->cr29_if0bfifoen =
- AB8500_CODEC_CR29_IF0BFIFOEN_BURST_MODE;
- ab8500_codec_error = ab8500_codec_UpdateCR29();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- }
-
- else
- {
- ab8500_codec_error = AB8500_CODEC_UNSUPPORTED_FEATURE;
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-/****************************************************************************/
-/* NAME: AB8500_CODEC_DisableBurstFifo */
-/*--------------------------------------------------------------------------*/
-/* DESCRIPTION: */
-/* Disable the Burst FIFO for Interface 0 */
-/* */
-/* ARGUMENTS */
-/* IN: */
-/* None */
-/* OUT: */
-/* None */
-/* RETURN: */
-/* AB8500_CODEC_UNSUPPORTED_FEATURE: If Interface 1 is selected */
-/* AB8500_CODEC_OK: if successful. */
-/* REMARK: */
-/*--------------------------------------------------------------------------*/
-/* REENTRANCY: Non Re-Entrant */
-
-/****************************************************************************/
-PUBLIC t_ab8500_codec_error AB8500_CODEC_DisableBurstFifo(void)
-{
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
- DBGENTER0();
- if (AB8500_CODEC_AUDIO_INTERFACE_0 ==
- g_ab8500_codec_system_context.audio_interface)
- {
- p_ab8500_codec_configuration->cr29_if0bfifoen =
- AB8500_CODEC_CR29_IF0BFIFOEN_NORMAL_MODE;
- ab8500_codec_error = ab8500_codec_UpdateCR29();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- }
-
- else
- {
- ab8500_codec_error = AB8500_CODEC_UNSUPPORTED_FEATURE;
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-PRIVATE t_ab8500_codec_error ab8500_codec_ADSlotAllocationSwitch1
- (IN t_ab8500_codec_slot ad_slot,
- IN t_ab8500_codec_cr31_to_cr46_ad_data_allocation value ) {
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- switch (ad_slot)
- {
- case AB8500_CODEC_SLOT0:
- p_ab8500_codec_configuration->cr31_adotoslot0 = value;
- ab8500_codec_error = ab8500_codec_UpdateCR31();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
- case AB8500_CODEC_SLOT1:
- p_ab8500_codec_configuration->cr31_adotoslot1 = value;
- ab8500_codec_error = ab8500_codec_UpdateCR31();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
- case AB8500_CODEC_SLOT2:
- p_ab8500_codec_configuration->cr32_adotoslot2 = value;
- ab8500_codec_error = ab8500_codec_UpdateCR32();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
- case AB8500_CODEC_SLOT3:
- p_ab8500_codec_configuration->cr32_adotoslot3 = value;
- ab8500_codec_error = ab8500_codec_UpdateCR32();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
- case AB8500_CODEC_SLOT4:
- p_ab8500_codec_configuration->cr33_adotoslot4 = value;
- ab8500_codec_error = ab8500_codec_UpdateCR33();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
- case AB8500_CODEC_SLOT5:
- p_ab8500_codec_configuration->cr33_adotoslot5 = value;
- ab8500_codec_error = ab8500_codec_UpdateCR33();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
- case AB8500_CODEC_SLOT6:
- p_ab8500_codec_configuration->cr34_adotoslot6 = value;
- ab8500_codec_error = ab8500_codec_UpdateCR34();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
- case AB8500_CODEC_SLOT7:
- p_ab8500_codec_configuration->cr34_adotoslot7 = value;
- ab8500_codec_error = ab8500_codec_UpdateCR34();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
- default:
- ab8500_codec_error = AB8500_CODEC_INVALID_PARAMETER;
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-PRIVATE t_ab8500_codec_error ab8500_codec_ADSlotAllocationSwitch2
- (IN t_ab8500_codec_slot ad_slot,
- IN t_ab8500_codec_cr31_to_cr46_ad_data_allocation value ) {
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- switch (ad_slot)
- {
- case AB8500_CODEC_SLOT8:
- p_ab8500_codec_configuration->cr35_adotoslot8 = value;
- ab8500_codec_error = ab8500_codec_UpdateCR35();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
- case AB8500_CODEC_SLOT9:
- p_ab8500_codec_configuration->cr35_adotoslot9 = value;
- ab8500_codec_error = ab8500_codec_UpdateCR35();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
- case AB8500_CODEC_SLOT10:
- p_ab8500_codec_configuration->cr36_adotoslot10 = value;
- ab8500_codec_error = ab8500_codec_UpdateCR36();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
- case AB8500_CODEC_SLOT11:
- p_ab8500_codec_configuration->cr36_adotoslot11 = value;
- ab8500_codec_error = ab8500_codec_UpdateCR36();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
- case AB8500_CODEC_SLOT12:
- p_ab8500_codec_configuration->cr37_adotoslot12 = value;
- ab8500_codec_error = ab8500_codec_UpdateCR37();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
- case AB8500_CODEC_SLOT13:
- p_ab8500_codec_configuration->cr37_adotoslot13 = value;
- ab8500_codec_error = ab8500_codec_UpdateCR37();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
- case AB8500_CODEC_SLOT14:
- p_ab8500_codec_configuration->cr38_adotoslot14 = value;
- ab8500_codec_error = ab8500_codec_UpdateCR38();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
- case AB8500_CODEC_SLOT15:
- p_ab8500_codec_configuration->cr38_adotoslot15 = value;
- ab8500_codec_error = ab8500_codec_UpdateCR38();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
- default:
- ab8500_codec_error = AB8500_CODEC_INVALID_PARAMETER;
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-PRIVATE t_ab8500_codec_error ab8500_codec_ADSlotAllocationSwitch3
- (IN t_ab8500_codec_slot ad_slot,
- IN t_ab8500_codec_cr31_to_cr46_ad_data_allocation value ) {
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- switch (ad_slot)
- {
- case AB8500_CODEC_SLOT16:
- p_ab8500_codec_configuration->cr39_adotoslot16 = value;
- ab8500_codec_error = ab8500_codec_UpdateCR39();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
- case AB8500_CODEC_SLOT17:
- p_ab8500_codec_configuration->cr39_adotoslot17 = value;
- ab8500_codec_error = ab8500_codec_UpdateCR39();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
- case AB8500_CODEC_SLOT18:
- p_ab8500_codec_configuration->cr40_adotoslot18 = value;
- ab8500_codec_error = ab8500_codec_UpdateCR40();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
- case AB8500_CODEC_SLOT19:
- p_ab8500_codec_configuration->cr40_adotoslot19 = value;
- ab8500_codec_error = ab8500_codec_UpdateCR40();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
- case AB8500_CODEC_SLOT20:
- p_ab8500_codec_configuration->cr41_adotoslot20 = value;
- ab8500_codec_error = ab8500_codec_UpdateCR41();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
- case AB8500_CODEC_SLOT21:
- p_ab8500_codec_configuration->cr41_adotoslot21 = value;
- ab8500_codec_error = ab8500_codec_UpdateCR41();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
- case AB8500_CODEC_SLOT22:
- p_ab8500_codec_configuration->cr42_adotoslot22 = value;
- ab8500_codec_error = ab8500_codec_UpdateCR42();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
- case AB8500_CODEC_SLOT23:
- p_ab8500_codec_configuration->cr42_adotoslot23 = value;
- ab8500_codec_error = ab8500_codec_UpdateCR42();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
- default:
- ab8500_codec_error = AB8500_CODEC_INVALID_PARAMETER;
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-PRIVATE t_ab8500_codec_error ab8500_codec_ADSlotAllocationSwitch4
- (IN t_ab8500_codec_slot ad_slot,
- IN t_ab8500_codec_cr31_to_cr46_ad_data_allocation value ) {
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- switch (ad_slot)
- {
- case AB8500_CODEC_SLOT24:
- p_ab8500_codec_configuration->cr43_adotoslot24 = value;
- ab8500_codec_error = ab8500_codec_UpdateCR43();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
- case AB8500_CODEC_SLOT25:
- p_ab8500_codec_configuration->cr43_adotoslot25 = value;
- ab8500_codec_error = ab8500_codec_UpdateCR43();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
- case AB8500_CODEC_SLOT26:
- p_ab8500_codec_configuration->cr44_adotoslot26 = value;
- ab8500_codec_error = ab8500_codec_UpdateCR44();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
- case AB8500_CODEC_SLOT27:
- p_ab8500_codec_configuration->cr44_adotoslot27 = value;
- ab8500_codec_error = ab8500_codec_UpdateCR44();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
- case AB8500_CODEC_SLOT28:
- p_ab8500_codec_configuration->cr45_adotoslot28 = value;
- ab8500_codec_error = ab8500_codec_UpdateCR45();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
- case AB8500_CODEC_SLOT29:
- p_ab8500_codec_configuration->cr45_adotoslot29 = value;
- ab8500_codec_error = ab8500_codec_UpdateCR45();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
- case AB8500_CODEC_SLOT30:
- p_ab8500_codec_configuration->cr46_adotoslot30 = value;
- ab8500_codec_error = ab8500_codec_UpdateCR46();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
- case AB8500_CODEC_SLOT31:
- p_ab8500_codec_configuration->cr46_adotoslot31 = value;
- ab8500_codec_error = ab8500_codec_UpdateCR46();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- break;
- default:
- ab8500_codec_error = AB8500_CODEC_INVALID_PARAMETER;
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-PRIVATE t_ab8500_codec_error ab8500_codec_SrcPowerControlSwitch1(IN
- t_ab8500_codec_src
- src_device,
- t_ab8500_codec_src_state
- state)
-{
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- switch (src_device)
- {
- case AB8500_CODEC_SRC_LINEIN:
- if (AB8500_CODEC_SRC_STATE_ENABLE == state)
- {
- p_ab8500_codec_configuration->cr5_enlinl =
- AB8500_CODEC_CR5_ENLINL_ENABLED;
- p_ab8500_codec_configuration->cr5_enlinr =
- AB8500_CODEC_CR5_ENLINR_ENABLED;
- p_ab8500_codec_configuration->cr5_mutlinl =
- AB8500_CODEC_CR5_MUTLINL_DISABLED;
- p_ab8500_codec_configuration->cr5_mutlinr =
- AB8500_CODEC_CR5_MUTLINR_DISABLED;
- p_ab8500_codec_configuration->cr7_linrsel =
- AB8500_CODEC_CR7_LINRSEL_LINR;
- p_ab8500_codec_configuration->cr7_enadclinl =
- AB8500_CODEC_CR7_ENADCLINL_ENABLED;
- p_ab8500_codec_configuration->cr7_enadclinr =
- AB8500_CODEC_CR7_ENADCLINR_ENABLED;
- }
-
- else
- {
- p_ab8500_codec_configuration->cr5_enlinl =
- AB8500_CODEC_CR5_ENLINL_DISABLED;
- p_ab8500_codec_configuration->cr5_enlinr =
- AB8500_CODEC_CR5_ENLINR_DISABLED;
- p_ab8500_codec_configuration->cr5_mutlinl =
- AB8500_CODEC_CR5_MUTLINL_ENABLED;
- p_ab8500_codec_configuration->cr5_mutlinr =
- AB8500_CODEC_CR5_MUTLINR_ENABLED;
- p_ab8500_codec_configuration->cr7_linrsel =
- AB8500_CODEC_CR7_LINRSEL_MIC2;
- p_ab8500_codec_configuration->cr7_enadclinl =
- AB8500_CODEC_CR7_ENADCLINL_DISABLED;
- p_ab8500_codec_configuration->cr7_enadclinr =
- AB8500_CODEC_CR7_ENADCLINR_DISABLED;
- }
- break;
- case AB8500_CODEC_SRC_MICROPHONE_1A:
- if (AB8500_CODEC_SRC_STATE_ENABLE == state)
- {
- p_ab8500_codec_configuration->cr5_enmic1 =
- AB8500_CODEC_CR5_ENMIC1_ENABLED;
- p_ab8500_codec_configuration->cr5_mutmic1 =
- AB8500_CODEC_CR5_MUTMIC1_DISABLED;
- p_ab8500_codec_configuration->cr7_mic1sel =
- AB8500_CODEC_CR7_MIC1SEL_MIC1A;
- p_ab8500_codec_configuration->cr7_enadcmic =
- AB8500_CODEC_CR7_ENADCMIC_ENABLED;
- }
-
- else
- {
- p_ab8500_codec_configuration->cr5_enmic1 =
- AB8500_CODEC_CR5_ENMIC1_DISABLED;
- p_ab8500_codec_configuration->cr5_mutmic1 =
- AB8500_CODEC_CR5_MUTMIC1_ENABLED;
- p_ab8500_codec_configuration->cr7_enadcmic =
- AB8500_CODEC_CR7_ENADCMIC_DISABLED;
- }
- break;
- case AB8500_CODEC_SRC_MICROPHONE_1B:
- if (AB8500_CODEC_SRC_STATE_ENABLE == state)
- {
- p_ab8500_codec_configuration->cr5_enmic1 =
- AB8500_CODEC_CR5_ENMIC1_ENABLED;
- p_ab8500_codec_configuration->cr5_mutmic1 =
- AB8500_CODEC_CR5_MUTMIC1_DISABLED;
- p_ab8500_codec_configuration->cr7_mic1sel =
- AB8500_CODEC_CR7_MIC1SEL_MIC1B;
- p_ab8500_codec_configuration->cr7_enadcmic =
- AB8500_CODEC_CR7_ENADCMIC_ENABLED;
- }
-
- else
- {
- p_ab8500_codec_configuration->cr5_enmic1 =
- AB8500_CODEC_CR5_ENMIC1_DISABLED;
- p_ab8500_codec_configuration->cr5_mutmic1 =
- AB8500_CODEC_CR5_MUTMIC1_ENABLED;
- p_ab8500_codec_configuration->cr7_enadcmic =
- AB8500_CODEC_CR7_ENADCMIC_DISABLED;
- }
- break;
- case AB8500_CODEC_SRC_MICROPHONE_2:
- if (AB8500_CODEC_SRC_STATE_ENABLE == state)
- {
- p_ab8500_codec_configuration->cr5_enmic2 =
- AB8500_CODEC_CR5_ENMIC2_ENABLED;
- p_ab8500_codec_configuration->cr5_mutmic2 =
- AB8500_CODEC_CR5_MUTMIC2_DISABLED;
- p_ab8500_codec_configuration->cr7_linrsel =
- AB8500_CODEC_CR7_LINRSEL_MIC2;
- p_ab8500_codec_configuration->cr7_enadclinr =
- AB8500_CODEC_CR7_ENADCLINR_ENABLED;
- }
-
- else
- {
- p_ab8500_codec_configuration->cr5_enmic2 =
- AB8500_CODEC_CR5_ENMIC2_DISABLED;
- p_ab8500_codec_configuration->cr5_mutmic2 =
- AB8500_CODEC_CR5_MUTMIC2_ENABLED;
- p_ab8500_codec_configuration->cr7_linrsel =
- AB8500_CODEC_CR7_LINRSEL_LINR;
- p_ab8500_codec_configuration->cr7_enadclinr =
- AB8500_CODEC_CR7_ENADCLINR_DISABLED;
- }
- break;
- case AB8500_CODEC_SRC_D_MICROPHONE_1:
- if (AB8500_CODEC_SRC_STATE_ENABLE == state)
- {
- p_ab8500_codec_configuration->cr6_endmic1 =
- AB8500_CODEC_CR6_ENDMIC1_ENABLED;
- p_ab8500_codec_configuration->cr63_ad1sel =
- AB8500_CODEC_CR63_AD1SEL_DMIC1_SELECTED;
- }
-
- else
- {
- p_ab8500_codec_configuration->cr6_endmic1 =
- AB8500_CODEC_CR6_ENDMIC1_DISABLED;
- p_ab8500_codec_configuration->cr63_ad1sel =
- AB8500_CODEC_CR63_AD1SEL_LINLADL_SELECTED;
- }
- break;
- case AB8500_CODEC_SRC_D_MICROPHONE_2:
- if (AB8500_CODEC_SRC_STATE_ENABLE == state)
- {
- p_ab8500_codec_configuration->cr6_endmic2 =
- AB8500_CODEC_CR6_ENDMIC2_ENABLED;
- p_ab8500_codec_configuration->cr63_ad2sel =
- AB8500_CODEC_CR63_AD2SEL_DMIC2_SELECTED;
- }
-
- else
- {
- p_ab8500_codec_configuration->cr6_endmic2 =
- AB8500_CODEC_CR6_ENDMIC2_DISABLED;
- p_ab8500_codec_configuration->cr63_ad2sel =
- AB8500_CODEC_CR63_AD2SEL_LINRADR_SELECTED;
- }
- break;
- default:
- ab8500_codec_error = AB8500_CODEC_INVALID_PARAMETER;
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-PRIVATE t_ab8500_codec_error ab8500_codec_SrcPowerControlSwitch2(IN
- t_ab8500_codec_src
- src_device,
- t_ab8500_codec_src_state
- state)
-{
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- switch (src_device)
- {
- case AB8500_CODEC_SRC_D_MICROPHONE_3:
- if (AB8500_CODEC_SRC_STATE_ENABLE == state)
- {
- p_ab8500_codec_configuration->cr6_endmic3 =
- AB8500_CODEC_CR6_ENDMIC3_ENABLED;
- p_ab8500_codec_configuration->cr63_ad3sel =
- AB8500_CODEC_CR63_AD3SEL_DMIC3_SELECTED;
- }
-
- else
- {
- p_ab8500_codec_configuration->cr6_endmic3 =
- AB8500_CODEC_CR6_ENDMIC3_DISABLED;
- p_ab8500_codec_configuration->cr63_ad3sel =
- AB8500_CODEC_CR63_AD3SEL_ADMO_SELECTED;
- }
- break;
- case AB8500_CODEC_SRC_D_MICROPHONE_4:
- if (AB8500_CODEC_SRC_STATE_ENABLE == state)
- {
- p_ab8500_codec_configuration->cr6_endmic4 =
- AB8500_CODEC_CR6_ENDMIC4_ENABLED;
- }
-
- else
- {
- p_ab8500_codec_configuration->cr6_endmic4 =
- AB8500_CODEC_CR6_ENDMIC4_DISABLED;
- }
- break;
- case AB8500_CODEC_SRC_D_MICROPHONE_5:
- if (AB8500_CODEC_SRC_STATE_ENABLE == state)
- {
- p_ab8500_codec_configuration->cr6_endmic5 =
- AB8500_CODEC_CR6_ENDMIC5_ENABLED;
- p_ab8500_codec_configuration->cr63_ad5sel =
- AB8500_CODEC_CR63_AD5SEL_DMIC5_SELECTED;
- }
-
- else
- {
- p_ab8500_codec_configuration->cr6_endmic5 =
- AB8500_CODEC_CR6_ENDMIC5_DISABLED;
- p_ab8500_codec_configuration->cr63_ad5sel =
- AB8500_CODEC_CR63_AD5SEL_AMADR_SELECTED;
- }
- break;
- case AB8500_CODEC_SRC_D_MICROPHONE_6:
- if (AB8500_CODEC_SRC_STATE_ENABLE == state)
- {
- p_ab8500_codec_configuration->cr6_endmic6 =
- AB8500_CODEC_CR6_ENDMIC6_ENABLED;
- p_ab8500_codec_configuration->cr63_ad6sel =
- AB8500_CODEC_CR63_AD6SEL_DMIC6_SELECTED;
- }
-
- else
- {
- p_ab8500_codec_configuration->cr6_endmic6 =
- AB8500_CODEC_CR6_ENDMIC6_DISABLED;
- p_ab8500_codec_configuration->cr63_ad6sel =
- AB8500_CODEC_CR63_AD6SEL_ADMO_SELECTED;
- }
- break;
- case AB8500_CODEC_SRC_ALL:
- if (AB8500_CODEC_SRC_STATE_ENABLE == state)
- {
- p_ab8500_codec_configuration->cr5_enlinl =
- AB8500_CODEC_CR5_ENLINL_ENABLED;
- p_ab8500_codec_configuration->cr5_enlinr =
- AB8500_CODEC_CR5_ENLINR_ENABLED;
- p_ab8500_codec_configuration->cr5_enmic1 =
- AB8500_CODEC_CR5_ENMIC1_ENABLED;
- p_ab8500_codec_configuration->cr5_enmic2 =
- AB8500_CODEC_CR5_ENMIC2_ENABLED;
- p_ab8500_codec_configuration->cr6_endmic1 =
- AB8500_CODEC_CR6_ENDMIC1_ENABLED;
- p_ab8500_codec_configuration->cr6_endmic2 =
- AB8500_CODEC_CR6_ENDMIC2_ENABLED;
- p_ab8500_codec_configuration->cr6_endmic3 =
- AB8500_CODEC_CR6_ENDMIC3_ENABLED;
- p_ab8500_codec_configuration->cr6_endmic4 =
- AB8500_CODEC_CR6_ENDMIC4_ENABLED;
- p_ab8500_codec_configuration->cr6_endmic5 =
- AB8500_CODEC_CR6_ENDMIC5_ENABLED;
- p_ab8500_codec_configuration->cr6_endmic6 =
- AB8500_CODEC_CR6_ENDMIC6_ENABLED;
- p_ab8500_codec_configuration->cr7_enadcmic =
- AB8500_CODEC_CR7_ENADCMIC_ENABLED;
- p_ab8500_codec_configuration->cr5_mutlinl =
- AB8500_CODEC_CR5_MUTLINL_DISABLED;
- p_ab8500_codec_configuration->cr5_mutlinr =
- AB8500_CODEC_CR5_MUTLINR_DISABLED;
- p_ab8500_codec_configuration->cr5_mutmic1 =
- AB8500_CODEC_CR5_MUTMIC1_DISABLED;
- p_ab8500_codec_configuration->cr5_mutmic2 =
- AB8500_CODEC_CR5_MUTMIC2_DISABLED;
- }
-
- else
- {
- p_ab8500_codec_configuration->cr5_enlinl =
- AB8500_CODEC_CR5_ENLINL_DISABLED;
- p_ab8500_codec_configuration->cr5_enlinr =
- AB8500_CODEC_CR5_ENLINR_DISABLED;
- p_ab8500_codec_configuration->cr5_enmic1 =
- AB8500_CODEC_CR5_ENMIC1_DISABLED;
- p_ab8500_codec_configuration->cr5_enmic2 =
- AB8500_CODEC_CR5_ENMIC2_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic1 =
- AB8500_CODEC_CR6_ENDMIC1_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic2 =
- AB8500_CODEC_CR6_ENDMIC2_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic3 =
- AB8500_CODEC_CR6_ENDMIC3_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic4 =
- AB8500_CODEC_CR6_ENDMIC4_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic5 =
- AB8500_CODEC_CR6_ENDMIC5_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic6 =
- AB8500_CODEC_CR6_ENDMIC6_DISABLED;
- p_ab8500_codec_configuration->cr7_enadcmic =
- AB8500_CODEC_CR7_ENADCMIC_DISABLED;
- p_ab8500_codec_configuration->cr5_mutlinl =
- AB8500_CODEC_CR5_MUTLINL_ENABLED;
- p_ab8500_codec_configuration->cr5_mutlinr =
- AB8500_CODEC_CR5_MUTLINR_ENABLED;
- p_ab8500_codec_configuration->cr5_mutmic1 =
- AB8500_CODEC_CR5_MUTMIC1_ENABLED;
- p_ab8500_codec_configuration->cr5_mutmic2 =
- AB8500_CODEC_CR5_MUTMIC2_ENABLED;
- }
- break;
- case AB8500_CODEC_SRC_FM_RX:
- break;
- default:
- ab8500_codec_error = AB8500_CODEC_INVALID_PARAMETER;
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-PRIVATE t_ab8500_codec_error ab8500_codec_SetModeAndDirectionUpdateCR(void)
-{
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- t_ab8500_codec_cr0_powerup ab8500_codec_cr0_powerup;
- ab8500_codec_cr0_powerup = p_ab8500_codec_configuration->cr0_powerup;
- p_ab8500_codec_configuration->cr0_powerup =
- AB8500_CODEC_CR0_POWERUP_OFF;
- ab8500_codec_error = ab8500_codec_UpdateCR0();
- if (AB8500_CODEC_OK != ab8500_codec_error)
- {
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR2();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR3();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR26();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR27();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR28();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR30();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR63();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- p_ab8500_codec_configuration->cr0_powerup = ab8500_codec_cr0_powerup;
- ab8500_codec_error = ab8500_codec_UpdateCR0();
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-PRIVATE t_ab8500_codec_error ab8500_codec_SetSrcVolumeUpdateCR(void)
-{
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
- ab8500_codec_error = ab8500_codec_UpdateCR20();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR21();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR23();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR65();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR66();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR67();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR68();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR69();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR70();
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-PRIVATE t_ab8500_codec_error ab8500_codec_SetDestVolumeUpdateCR(void)
-{
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
- ab8500_codec_error = ab8500_codec_UpdateCR16();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR17();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR18();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR19();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR22();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR71();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR72();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR73();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR74();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR75();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR76();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR79();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR80();
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-PRIVATE t_ab8500_codec_error ab8500_codec_ProgramDirectionIN(void)
-{
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- switch (g_ab8500_codec_system_context.ab8500_codec_src)
- {
- case AB8500_CODEC_SRC_LINEIN:
- p_ab8500_codec_configuration->cr5_enlinl =
- AB8500_CODEC_CR5_ENLINL_ENABLED;
- p_ab8500_codec_configuration->cr5_enlinr =
- AB8500_CODEC_CR5_ENLINR_ENABLED;
- p_ab8500_codec_configuration->cr6_endmic1 =
- AB8500_CODEC_CR6_ENDMIC1_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic2 =
- AB8500_CODEC_CR6_ENDMIC2_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic3 =
- AB8500_CODEC_CR6_ENDMIC3_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic4 =
- AB8500_CODEC_CR6_ENDMIC4_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic5 =
- AB8500_CODEC_CR6_ENDMIC5_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic6 =
- AB8500_CODEC_CR6_ENDMIC6_DISABLED;
- p_ab8500_codec_configuration->cr5_enmic1 =
- AB8500_CODEC_CR5_ENMIC1_DISABLED;
- p_ab8500_codec_configuration->cr5_enmic2 =
- AB8500_CODEC_CR5_ENMIC2_DISABLED;
- p_ab8500_codec_configuration->cr7_linrsel =
- AB8500_CODEC_CR7_LINRSEL_LINR;
- p_ab8500_codec_configuration->cr7_enadclinl =
- AB8500_CODEC_CR7_ENADCLINL_ENABLED;
- p_ab8500_codec_configuration->cr7_enadclinr =
- AB8500_CODEC_CR7_ENADCLINR_ENABLED;
- p_ab8500_codec_configuration->cr5_mutlinl =
- AB8500_CODEC_CR5_MUTLINL_DISABLED;
- p_ab8500_codec_configuration->cr5_mutlinr =
- AB8500_CODEC_CR5_MUTLINR_DISABLED;
- p_ab8500_codec_configuration->cr5_mutmic1 =
- AB8500_CODEC_CR5_MUTMIC1_ENABLED;
- p_ab8500_codec_configuration->cr5_mutmic2 =
- AB8500_CODEC_CR5_MUTMIC2_ENABLED;
- break;
- case AB8500_CODEC_SRC_MICROPHONE_1A:
- p_ab8500_codec_configuration->cr5_enlinl =
- AB8500_CODEC_CR5_ENLINL_DISABLED;
- p_ab8500_codec_configuration->cr5_enlinr =
- AB8500_CODEC_CR5_ENLINR_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic1 =
- AB8500_CODEC_CR6_ENDMIC1_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic2 =
- AB8500_CODEC_CR6_ENDMIC2_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic3 =
- AB8500_CODEC_CR6_ENDMIC3_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic4 =
- AB8500_CODEC_CR6_ENDMIC4_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic5 =
- AB8500_CODEC_CR6_ENDMIC5_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic6 =
- AB8500_CODEC_CR6_ENDMIC6_DISABLED;
- p_ab8500_codec_configuration->cr5_enmic1 =
- AB8500_CODEC_CR5_ENMIC1_ENABLED;
- p_ab8500_codec_configuration->cr5_enmic2 =
- AB8500_CODEC_CR5_ENMIC2_DISABLED;
- p_ab8500_codec_configuration->cr7_mic1sel =
- AB8500_CODEC_CR7_MIC1SEL_MIC1A;
- p_ab8500_codec_configuration->cr7_enadcmic =
- AB8500_CODEC_CR7_ENADCMIC_ENABLED;
- p_ab8500_codec_configuration->cr7_enadclinl =
- AB8500_CODEC_CR7_ENADCLINL_DISABLED;
- p_ab8500_codec_configuration->cr7_enadclinr =
- AB8500_CODEC_CR7_ENADCLINR_DISABLED;
- p_ab8500_codec_configuration->cr5_mutlinl =
- AB8500_CODEC_CR5_MUTLINL_ENABLED;
- p_ab8500_codec_configuration->cr5_mutlinr =
- AB8500_CODEC_CR5_MUTLINR_ENABLED;
- p_ab8500_codec_configuration->cr5_mutmic1 =
- AB8500_CODEC_CR5_MUTMIC1_DISABLED;
- p_ab8500_codec_configuration->cr5_mutmic2 =
- AB8500_CODEC_CR5_MUTMIC2_ENABLED;
- break;
- case AB8500_CODEC_SRC_MICROPHONE_1B:
- p_ab8500_codec_configuration->cr5_enlinl =
- AB8500_CODEC_CR5_ENLINL_DISABLED;
- p_ab8500_codec_configuration->cr5_enlinr =
- AB8500_CODEC_CR5_ENLINR_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic1 =
- AB8500_CODEC_CR6_ENDMIC1_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic2 =
- AB8500_CODEC_CR6_ENDMIC2_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic3 =
- AB8500_CODEC_CR6_ENDMIC3_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic4 =
- AB8500_CODEC_CR6_ENDMIC4_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic5 =
- AB8500_CODEC_CR6_ENDMIC5_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic6 =
- AB8500_CODEC_CR6_ENDMIC6_DISABLED;
- p_ab8500_codec_configuration->cr5_enmic1 =
- AB8500_CODEC_CR5_ENMIC1_ENABLED;
- p_ab8500_codec_configuration->cr5_enmic2 =
- AB8500_CODEC_CR5_ENMIC2_DISABLED;
- p_ab8500_codec_configuration->cr7_mic1sel =
- AB8500_CODEC_CR7_MIC1SEL_MIC1B;
- p_ab8500_codec_configuration->cr7_enadcmic =
- AB8500_CODEC_CR7_ENADCMIC_ENABLED;
- p_ab8500_codec_configuration->cr7_enadclinl =
- AB8500_CODEC_CR7_ENADCLINL_DISABLED;
- p_ab8500_codec_configuration->cr7_enadclinr =
- AB8500_CODEC_CR7_ENADCLINR_DISABLED;
- p_ab8500_codec_configuration->cr5_mutlinl =
- AB8500_CODEC_CR5_MUTLINL_ENABLED;
- p_ab8500_codec_configuration->cr5_mutlinr =
- AB8500_CODEC_CR5_MUTLINR_ENABLED;
- p_ab8500_codec_configuration->cr5_mutmic1 =
- AB8500_CODEC_CR5_MUTMIC1_DISABLED;
- p_ab8500_codec_configuration->cr5_mutmic2 =
- AB8500_CODEC_CR5_MUTMIC2_ENABLED;
- break;
- case AB8500_CODEC_SRC_MICROPHONE_2:
- p_ab8500_codec_configuration->cr5_enlinl =
- AB8500_CODEC_CR5_ENLINL_DISABLED;
- p_ab8500_codec_configuration->cr5_enlinr =
- AB8500_CODEC_CR5_ENLINR_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic1 =
- AB8500_CODEC_CR6_ENDMIC1_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic2 =
- AB8500_CODEC_CR6_ENDMIC2_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic3 =
- AB8500_CODEC_CR6_ENDMIC3_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic4 =
- AB8500_CODEC_CR6_ENDMIC4_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic5 =
- AB8500_CODEC_CR6_ENDMIC5_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic6 =
- AB8500_CODEC_CR6_ENDMIC6_DISABLED;
- p_ab8500_codec_configuration->cr5_enmic1 =
- AB8500_CODEC_CR5_ENMIC1_DISABLED;
- p_ab8500_codec_configuration->cr5_enmic2 =
- AB8500_CODEC_CR5_ENMIC2_ENABLED;
- p_ab8500_codec_configuration->cr7_enadcmic =
- AB8500_CODEC_CR7_ENADCMIC_ENABLED;
- p_ab8500_codec_configuration->cr7_linrsel =
- AB8500_CODEC_CR7_LINRSEL_MIC2;
- p_ab8500_codec_configuration->cr7_enadclinl =
- AB8500_CODEC_CR7_ENADCLINL_DISABLED;
- p_ab8500_codec_configuration->cr7_enadclinr =
- AB8500_CODEC_CR7_ENADCLINR_ENABLED;
- p_ab8500_codec_configuration->cr5_mutlinl =
- AB8500_CODEC_CR5_MUTLINL_ENABLED;
- p_ab8500_codec_configuration->cr5_mutlinr =
- AB8500_CODEC_CR5_MUTLINR_ENABLED;
- p_ab8500_codec_configuration->cr5_mutmic1 =
- AB8500_CODEC_CR5_MUTMIC1_ENABLED;
- p_ab8500_codec_configuration->cr5_mutmic2 =
- AB8500_CODEC_CR5_MUTMIC2_DISABLED;
- break;
- case AB8500_CODEC_SRC_D_MICROPHONE_1:
- p_ab8500_codec_configuration->cr5_enlinl =
- AB8500_CODEC_CR5_ENLINL_DISABLED;
- p_ab8500_codec_configuration->cr5_enlinr =
- AB8500_CODEC_CR5_ENLINR_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic1 =
- AB8500_CODEC_CR6_ENDMIC1_ENABLED;
- p_ab8500_codec_configuration->cr6_endmic2 =
- AB8500_CODEC_CR6_ENDMIC2_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic3 =
- AB8500_CODEC_CR6_ENDMIC3_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic4 =
- AB8500_CODEC_CR6_ENDMIC4_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic5 =
- AB8500_CODEC_CR6_ENDMIC5_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic6 =
- AB8500_CODEC_CR6_ENDMIC6_DISABLED;
- p_ab8500_codec_configuration->cr5_enmic1 =
- AB8500_CODEC_CR5_ENMIC1_DISABLED;
- p_ab8500_codec_configuration->cr5_enmic2 =
- AB8500_CODEC_CR5_ENMIC2_DISABLED;
- p_ab8500_codec_configuration->cr7_enadclinl =
- AB8500_CODEC_CR7_ENADCLINL_DISABLED;
- p_ab8500_codec_configuration->cr7_enadclinr =
- AB8500_CODEC_CR7_ENADCLINR_DISABLED;
- p_ab8500_codec_configuration->cr63_ad1sel =
- AB8500_CODEC_CR63_AD1SEL_DMIC1_SELECTED;
- p_ab8500_codec_configuration->cr5_mutlinl =
- AB8500_CODEC_CR5_MUTLINL_ENABLED;
- p_ab8500_codec_configuration->cr5_mutlinr =
- AB8500_CODEC_CR5_MUTLINR_ENABLED;
- p_ab8500_codec_configuration->cr5_mutmic1 =
- AB8500_CODEC_CR5_MUTMIC1_ENABLED;
- p_ab8500_codec_configuration->cr5_mutmic2 =
- AB8500_CODEC_CR5_MUTMIC2_ENABLED;
- break;
- case AB8500_CODEC_SRC_D_MICROPHONE_2:
- p_ab8500_codec_configuration->cr5_enlinl =
- AB8500_CODEC_CR5_ENLINL_DISABLED;
- p_ab8500_codec_configuration->cr5_enlinr =
- AB8500_CODEC_CR5_ENLINR_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic1 =
- AB8500_CODEC_CR6_ENDMIC1_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic2 =
- AB8500_CODEC_CR6_ENDMIC2_ENABLED;
- p_ab8500_codec_configuration->cr6_endmic3 =
- AB8500_CODEC_CR6_ENDMIC3_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic4 =
- AB8500_CODEC_CR6_ENDMIC4_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic5 =
- AB8500_CODEC_CR6_ENDMIC5_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic6 =
- AB8500_CODEC_CR6_ENDMIC6_DISABLED;
- p_ab8500_codec_configuration->cr5_enmic1 =
- AB8500_CODEC_CR5_ENMIC1_DISABLED;
- p_ab8500_codec_configuration->cr5_enmic2 =
- AB8500_CODEC_CR5_ENMIC2_DISABLED;
- p_ab8500_codec_configuration->cr7_enadclinl =
- AB8500_CODEC_CR7_ENADCLINL_DISABLED;
- p_ab8500_codec_configuration->cr7_enadclinr =
- AB8500_CODEC_CR7_ENADCLINR_DISABLED;
- p_ab8500_codec_configuration->cr63_ad2sel =
- AB8500_CODEC_CR63_AD2SEL_DMIC2_SELECTED;
- p_ab8500_codec_configuration->cr5_mutlinl =
- AB8500_CODEC_CR5_MUTLINL_ENABLED;
- p_ab8500_codec_configuration->cr5_mutlinr =
- AB8500_CODEC_CR5_MUTLINR_ENABLED;
- p_ab8500_codec_configuration->cr5_mutmic1 =
- AB8500_CODEC_CR5_MUTMIC1_ENABLED;
- p_ab8500_codec_configuration->cr5_mutmic2 =
- AB8500_CODEC_CR5_MUTMIC2_ENABLED;
- break;
- case AB8500_CODEC_SRC_D_MICROPHONE_3:
- p_ab8500_codec_configuration->cr5_enlinl =
- AB8500_CODEC_CR5_ENLINL_DISABLED;
- p_ab8500_codec_configuration->cr5_enlinr =
- AB8500_CODEC_CR5_ENLINR_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic1 =
- AB8500_CODEC_CR6_ENDMIC1_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic2 =
- AB8500_CODEC_CR6_ENDMIC2_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic3 =
- AB8500_CODEC_CR6_ENDMIC3_ENABLED;
- p_ab8500_codec_configuration->cr6_endmic4 =
- AB8500_CODEC_CR6_ENDMIC4_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic5 =
- AB8500_CODEC_CR6_ENDMIC5_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic6 =
- AB8500_CODEC_CR6_ENDMIC6_DISABLED;
- p_ab8500_codec_configuration->cr5_enmic1 =
- AB8500_CODEC_CR5_ENMIC1_DISABLED;
- p_ab8500_codec_configuration->cr5_enmic2 =
- AB8500_CODEC_CR5_ENMIC2_DISABLED;
- p_ab8500_codec_configuration->cr7_enadclinl =
- AB8500_CODEC_CR7_ENADCLINL_DISABLED;
- p_ab8500_codec_configuration->cr7_enadclinr =
- AB8500_CODEC_CR7_ENADCLINR_DISABLED;
- p_ab8500_codec_configuration->cr63_ad3sel =
- AB8500_CODEC_CR63_AD3SEL_DMIC3_SELECTED;
- p_ab8500_codec_configuration->cr5_mutlinl =
- AB8500_CODEC_CR5_MUTLINL_ENABLED;
- p_ab8500_codec_configuration->cr5_mutlinr =
- AB8500_CODEC_CR5_MUTLINR_ENABLED;
- p_ab8500_codec_configuration->cr5_mutmic1 =
- AB8500_CODEC_CR5_MUTMIC1_ENABLED;
- p_ab8500_codec_configuration->cr5_mutmic2 =
- AB8500_CODEC_CR5_MUTMIC2_ENABLED;
- break;
- case AB8500_CODEC_SRC_D_MICROPHONE_4:
- p_ab8500_codec_configuration->cr5_enlinl =
- AB8500_CODEC_CR5_ENLINL_DISABLED;
- p_ab8500_codec_configuration->cr5_enlinr =
- AB8500_CODEC_CR5_ENLINR_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic1 =
- AB8500_CODEC_CR6_ENDMIC1_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic2 =
- AB8500_CODEC_CR6_ENDMIC2_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic3 =
- AB8500_CODEC_CR6_ENDMIC3_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic4 =
- AB8500_CODEC_CR6_ENDMIC4_ENABLED;
- p_ab8500_codec_configuration->cr6_endmic5 =
- AB8500_CODEC_CR6_ENDMIC5_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic6 =
- AB8500_CODEC_CR6_ENDMIC6_DISABLED;
- p_ab8500_codec_configuration->cr5_enmic1 =
- AB8500_CODEC_CR5_ENMIC1_DISABLED;
- p_ab8500_codec_configuration->cr5_enmic2 =
- AB8500_CODEC_CR5_ENMIC2_DISABLED;
- p_ab8500_codec_configuration->cr7_enadclinl =
- AB8500_CODEC_CR7_ENADCLINL_DISABLED;
- p_ab8500_codec_configuration->cr7_enadclinr =
- AB8500_CODEC_CR7_ENADCLINR_DISABLED;
- p_ab8500_codec_configuration->cr5_mutlinl =
- AB8500_CODEC_CR5_MUTLINL_ENABLED;
- p_ab8500_codec_configuration->cr5_mutlinr =
- AB8500_CODEC_CR5_MUTLINR_ENABLED;
- p_ab8500_codec_configuration->cr5_mutmic1 =
- AB8500_CODEC_CR5_MUTMIC1_ENABLED;
- p_ab8500_codec_configuration->cr5_mutmic2 =
- AB8500_CODEC_CR5_MUTMIC2_ENABLED;
- break;
- case AB8500_CODEC_SRC_D_MICROPHONE_5:
- p_ab8500_codec_configuration->cr5_enlinl =
- AB8500_CODEC_CR5_ENLINL_DISABLED;
- p_ab8500_codec_configuration->cr5_enlinr =
- AB8500_CODEC_CR5_ENLINR_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic1 =
- AB8500_CODEC_CR6_ENDMIC1_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic2 =
- AB8500_CODEC_CR6_ENDMIC2_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic3 =
- AB8500_CODEC_CR6_ENDMIC3_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic4 =
- AB8500_CODEC_CR6_ENDMIC4_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic5 =
- AB8500_CODEC_CR6_ENDMIC5_ENABLED;
- p_ab8500_codec_configuration->cr6_endmic6 =
- AB8500_CODEC_CR6_ENDMIC6_DISABLED;
- p_ab8500_codec_configuration->cr5_enmic1 =
- AB8500_CODEC_CR5_ENMIC1_DISABLED;
- p_ab8500_codec_configuration->cr5_enmic2 =
- AB8500_CODEC_CR5_ENMIC2_DISABLED;
- p_ab8500_codec_configuration->cr7_enadclinl =
- AB8500_CODEC_CR7_ENADCLINL_DISABLED;
- p_ab8500_codec_configuration->cr7_enadclinr =
- AB8500_CODEC_CR7_ENADCLINR_DISABLED;
- p_ab8500_codec_configuration->cr63_ad5sel =
- AB8500_CODEC_CR63_AD5SEL_DMIC5_SELECTED;
- p_ab8500_codec_configuration->cr5_mutlinl =
- AB8500_CODEC_CR5_MUTLINL_ENABLED;
- p_ab8500_codec_configuration->cr5_mutlinr =
- AB8500_CODEC_CR5_MUTLINR_ENABLED;
- p_ab8500_codec_configuration->cr5_mutmic1 =
- AB8500_CODEC_CR5_MUTMIC1_ENABLED;
- p_ab8500_codec_configuration->cr5_mutmic2 =
- AB8500_CODEC_CR5_MUTMIC2_ENABLED;
- break;
- case AB8500_CODEC_SRC_D_MICROPHONE_6:
- p_ab8500_codec_configuration->cr5_enlinl =
- AB8500_CODEC_CR5_ENLINL_DISABLED;
- p_ab8500_codec_configuration->cr5_enlinr =
- AB8500_CODEC_CR5_ENLINR_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic1 =
- AB8500_CODEC_CR6_ENDMIC1_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic2 =
- AB8500_CODEC_CR6_ENDMIC2_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic3 =
- AB8500_CODEC_CR6_ENDMIC3_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic4 =
- AB8500_CODEC_CR6_ENDMIC4_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic5 =
- AB8500_CODEC_CR6_ENDMIC5_DISABLED;
- p_ab8500_codec_configuration->cr6_endmic6 =
- AB8500_CODEC_CR6_ENDMIC6_ENABLED;
- p_ab8500_codec_configuration->cr5_enmic1 =
- AB8500_CODEC_CR5_ENMIC1_DISABLED;
- p_ab8500_codec_configuration->cr5_enmic2 =
- AB8500_CODEC_CR5_ENMIC2_DISABLED;
- p_ab8500_codec_configuration->cr7_enadclinl =
- AB8500_CODEC_CR7_ENADCLINL_DISABLED;
- p_ab8500_codec_configuration->cr7_enadclinr =
- AB8500_CODEC_CR7_ENADCLINR_DISABLED;
- p_ab8500_codec_configuration->cr63_ad6sel =
- AB8500_CODEC_CR63_AD6SEL_DMIC6_SELECTED;
- p_ab8500_codec_configuration->cr5_mutlinl =
- AB8500_CODEC_CR5_MUTLINL_ENABLED;
- p_ab8500_codec_configuration->cr5_mutlinr =
- AB8500_CODEC_CR5_MUTLINR_ENABLED;
- p_ab8500_codec_configuration->cr5_mutmic1 =
- AB8500_CODEC_CR5_MUTMIC1_ENABLED;
- p_ab8500_codec_configuration->cr5_mutmic2 =
- AB8500_CODEC_CR5_MUTMIC2_ENABLED;
- break;
- case AB8500_CODEC_SRC_ALL:
- p_ab8500_codec_configuration->cr5_enlinl =
- AB8500_CODEC_CR5_ENLINL_ENABLED;
- p_ab8500_codec_configuration->cr5_enlinr =
- AB8500_CODEC_CR5_ENLINR_ENABLED;
- p_ab8500_codec_configuration->cr5_enmic1 =
- AB8500_CODEC_CR5_ENMIC1_ENABLED;
- p_ab8500_codec_configuration->cr5_enmic2 =
- AB8500_CODEC_CR5_ENMIC2_ENABLED;
- p_ab8500_codec_configuration->cr6_endmic1 =
- AB8500_CODEC_CR6_ENDMIC1_ENABLED;
- p_ab8500_codec_configuration->cr6_endmic2 =
- AB8500_CODEC_CR6_ENDMIC2_ENABLED;
- p_ab8500_codec_configuration->cr6_endmic3 =
- AB8500_CODEC_CR6_ENDMIC3_ENABLED;
- p_ab8500_codec_configuration->cr6_endmic4 =
- AB8500_CODEC_CR6_ENDMIC4_ENABLED;
- p_ab8500_codec_configuration->cr6_endmic5 =
- AB8500_CODEC_CR6_ENDMIC5_ENABLED;
- p_ab8500_codec_configuration->cr6_endmic6 =
- AB8500_CODEC_CR6_ENDMIC6_ENABLED;
- p_ab8500_codec_configuration->cr7_enadcmic =
- AB8500_CODEC_CR7_ENADCMIC_ENABLED;
- p_ab8500_codec_configuration->cr7_enadclinl =
- AB8500_CODEC_CR7_ENADCLINL_ENABLED;
- p_ab8500_codec_configuration->cr7_enadclinr =
- AB8500_CODEC_CR7_ENADCLINR_ENABLED;
- p_ab8500_codec_configuration->cr5_mutlinl =
- AB8500_CODEC_CR5_MUTLINL_DISABLED;
- p_ab8500_codec_configuration->cr5_mutlinr =
- AB8500_CODEC_CR5_MUTLINR_DISABLED;
- p_ab8500_codec_configuration->cr5_mutmic1 =
- AB8500_CODEC_CR5_MUTMIC1_DISABLED;
- p_ab8500_codec_configuration->cr5_mutmic2 =
- AB8500_CODEC_CR5_MUTMIC2_DISABLED;
- break;
- case AB8500_CODEC_SRC_D_MICROPHONE_12:
- case AB8500_CODEC_SRC_D_MICROPHONE_34:
- case AB8500_CODEC_SRC_D_MICROPHONE_56:
- break;
- default:
- ab8500_codec_error = AB8500_CODEC_INVALID_PARAMETER;
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-PRIVATE t_ab8500_codec_error ab8500_codec_ProgramDirectionOUT(void)
-{
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
- t_ab8500_codec_configuration * p_ab8500_codec_configuration =
- &g_ab8500_codec_system_context. ab8500_codec_configuration;
- switch (g_ab8500_codec_system_context.ab8500_codec_dest)
- {
- case AB8500_CODEC_DEST_HEADSET:
- p_ab8500_codec_configuration->cr7_endrvhsl =
- AB8500_CODEC_CR7_ENDRVHSL_ENABLED;
- p_ab8500_codec_configuration->cr7_endrvhsr =
- AB8500_CODEC_CR7_ENDRVHSR_ENABLED;
- p_ab8500_codec_configuration->cr8_enear =
- AB8500_CODEC_CR8_ENEAR_DISABLED;
- p_ab8500_codec_configuration->cr8_enhsl =
- AB8500_CODEC_CR8_ENHSL_ENABLED;
- p_ab8500_codec_configuration->cr8_enhsr =
- AB8500_CODEC_CR8_ENHSR_ENABLED;
- p_ab8500_codec_configuration->cr8_enhfl =
- AB8500_CODEC_CR8_ENHFL_DISABLED;
- p_ab8500_codec_configuration->cr8_enhfr =
- AB8500_CODEC_CR8_ENHFR_DISABLED;
- p_ab8500_codec_configuration->cr8_envibl =
- AB8500_CODEC_CR8_ENVIBL_DISABLED;
- p_ab8500_codec_configuration->cr8_envibr =
- AB8500_CODEC_CR8_ENVIBR_DISABLED;
- p_ab8500_codec_configuration->cr9_endachsl =
- AB8500_CODEC_CR9_ENDACHSL_ENABLED;
- p_ab8500_codec_configuration->cr9_endachsr =
- AB8500_CODEC_CR9_ENDACHSR_ENABLED;
- p_ab8500_codec_configuration->cr10_muteear =
- AB8500_CODEC_CR10_MUTEEAR_ENABLED;
- p_ab8500_codec_configuration->cr10_mutehsl =
- AB8500_CODEC_CR10_MUTEHSL_DISABLED;
- p_ab8500_codec_configuration->cr10_mutehsr =
- AB8500_CODEC_CR10_MUTEHSR_DISABLED;
- p_ab8500_codec_configuration->cr12_encphs =
- AB8500_CODEC_CR12_ENCPHS_ENABLED;
- break;
- case AB8500_CODEC_DEST_EARPIECE:
- p_ab8500_codec_configuration->cr8_enear =
- AB8500_CODEC_CR8_ENEAR_ENABLED;
- p_ab8500_codec_configuration->cr8_enhsl =
- AB8500_CODEC_CR8_ENHSL_DISABLED;
- p_ab8500_codec_configuration->cr8_enhsr =
- AB8500_CODEC_CR8_ENHSR_DISABLED;
- p_ab8500_codec_configuration->cr8_enhfl =
- AB8500_CODEC_CR8_ENHFL_DISABLED;
- p_ab8500_codec_configuration->cr8_enhfr =
- AB8500_CODEC_CR8_ENHFR_DISABLED;
- p_ab8500_codec_configuration->cr8_envibl =
- AB8500_CODEC_CR8_ENVIBL_DISABLED;
- p_ab8500_codec_configuration->cr8_envibr =
- AB8500_CODEC_CR8_ENVIBR_DISABLED;
- p_ab8500_codec_configuration->cr9_endacear =
- AB8500_CODEC_CR9_ENDACEAR_ENABLED;
- p_ab8500_codec_configuration->cr10_muteear =
- AB8500_CODEC_CR10_MUTEEAR_DISABLED;
- p_ab8500_codec_configuration->cr10_mutehsl =
- AB8500_CODEC_CR10_MUTEHSL_ENABLED;
- p_ab8500_codec_configuration->cr10_mutehsr =
- AB8500_CODEC_CR10_MUTEHSR_ENABLED;
- break;
- case AB8500_CODEC_DEST_HANDSFREE:
- p_ab8500_codec_configuration->cr8_enear =
- AB8500_CODEC_CR8_ENEAR_DISABLED;
- p_ab8500_codec_configuration->cr8_enhsl =
- AB8500_CODEC_CR8_ENHSL_DISABLED;
- p_ab8500_codec_configuration->cr8_enhsr =
- AB8500_CODEC_CR8_ENHSR_DISABLED;
- p_ab8500_codec_configuration->cr8_enhfl =
- AB8500_CODEC_CR8_ENHFL_ENABLED;
- p_ab8500_codec_configuration->cr8_enhfr =
- AB8500_CODEC_CR8_ENHFR_ENABLED;
- p_ab8500_codec_configuration->cr8_envibl =
- AB8500_CODEC_CR8_ENVIBL_DISABLED;
- p_ab8500_codec_configuration->cr8_envibr =
- AB8500_CODEC_CR8_ENVIBR_DISABLED;
- p_ab8500_codec_configuration->cr9_endachfl =
- AB8500_CODEC_CR9_ENDACHFL_ENABLED;
- p_ab8500_codec_configuration->cr9_endachfr =
- AB8500_CODEC_CR9_ENDACHFR_ENABLED;
- p_ab8500_codec_configuration->cr10_muteear =
- AB8500_CODEC_CR10_MUTEEAR_ENABLED;
- p_ab8500_codec_configuration->cr10_mutehsl =
- AB8500_CODEC_CR10_MUTEHSL_ENABLED;
- p_ab8500_codec_configuration->cr10_mutehsr =
- AB8500_CODEC_CR10_MUTEHSR_ENABLED;
- break;
- case AB8500_CODEC_DEST_VIBRATOR_L:
- p_ab8500_codec_configuration->cr8_enear =
- AB8500_CODEC_CR8_ENEAR_DISABLED;
- p_ab8500_codec_configuration->cr8_enhsl =
- AB8500_CODEC_CR8_ENHSL_DISABLED;
- p_ab8500_codec_configuration->cr8_enhsr =
- AB8500_CODEC_CR8_ENHSR_DISABLED;
- p_ab8500_codec_configuration->cr8_enhfl =
- AB8500_CODEC_CR8_ENHFL_DISABLED;
- p_ab8500_codec_configuration->cr8_enhfr =
- AB8500_CODEC_CR8_ENHFR_DISABLED;
- p_ab8500_codec_configuration->cr8_envibl =
- AB8500_CODEC_CR8_ENVIBL_ENABLED;
- p_ab8500_codec_configuration->cr8_envibr =
- AB8500_CODEC_CR8_ENVIBR_DISABLED;
- p_ab8500_codec_configuration->cr9_endacvibl =
- AB8500_CODEC_CR9_ENDACVIBL_ENABLED;
- p_ab8500_codec_configuration->cr10_muteear =
- AB8500_CODEC_CR10_MUTEEAR_ENABLED;
- p_ab8500_codec_configuration->cr10_mutehsl =
- AB8500_CODEC_CR10_MUTEHSL_ENABLED;
- p_ab8500_codec_configuration->cr10_mutehsr =
- AB8500_CODEC_CR10_MUTEHSR_ENABLED;
- p_ab8500_codec_configuration->cr15_pwmtovibl =
- AB8500_CODEC_CR15_PWMTOVIBL_PWM;
- p_ab8500_codec_configuration->cr15_pwmlctrl =
- AB8500_CODEC_CR15_PWMLCTRL_PWMNPLDUTYCYCLE;
- p_ab8500_codec_configuration->cr15_pwmnlctrl =
- AB8500_CODEC_CR15_PWMNLCTRL_PWMNLDUTYCYCLE;
- p_ab8500_codec_configuration->cr15_pwmplctrl =
- AB8500_CODEC_CR15_PWMPLCTRL_PWMPLDUTYCYCLE;
- break;
- case AB8500_CODEC_DEST_VIBRATOR_R:
- p_ab8500_codec_configuration->cr8_enear =
- AB8500_CODEC_CR8_ENEAR_DISABLED;
- p_ab8500_codec_configuration->cr8_enhsl =
- AB8500_CODEC_CR8_ENHSL_DISABLED;
- p_ab8500_codec_configuration->cr8_enhsr =
- AB8500_CODEC_CR8_ENHSR_DISABLED;
- p_ab8500_codec_configuration->cr8_enhfl =
- AB8500_CODEC_CR8_ENHFL_DISABLED;
- p_ab8500_codec_configuration->cr8_enhfr =
- AB8500_CODEC_CR8_ENHFR_DISABLED;
- p_ab8500_codec_configuration->cr8_envibl =
- AB8500_CODEC_CR8_ENVIBL_DISABLED;
- p_ab8500_codec_configuration->cr8_envibr =
- AB8500_CODEC_CR8_ENVIBR_ENABLED;
- p_ab8500_codec_configuration->cr9_endacvibr =
- AB8500_CODEC_CR9_ENDACVIBR_ENABLED;
- p_ab8500_codec_configuration->cr10_muteear =
- AB8500_CODEC_CR10_MUTEEAR_ENABLED;
- p_ab8500_codec_configuration->cr10_mutehsl =
- AB8500_CODEC_CR10_MUTEHSL_ENABLED;
- p_ab8500_codec_configuration->cr10_mutehsr =
- AB8500_CODEC_CR10_MUTEHSR_ENABLED;
- p_ab8500_codec_configuration->cr15_pwmtovibr =
- AB8500_CODEC_CR15_PWMTOVIBR_PWM;
- p_ab8500_codec_configuration->cr15_pwmrctrl =
- AB8500_CODEC_CR15_PWMRCTRL_PWMNPRDUTYCYCLE;
- p_ab8500_codec_configuration->cr15_pwmnrctrl =
- AB8500_CODEC_CR15_PWMNRCTRL_PWMNRDUTYCYCLE;
- p_ab8500_codec_configuration->cr15_pwmprctrl =
- AB8500_CODEC_CR15_PWMPRCTRL_PWMPRDUTYCYCLE;
- break;
- case AB8500_CODEC_DEST_ALL:
- p_ab8500_codec_configuration->cr8_enhsl =
- AB8500_CODEC_CR8_ENHSL_ENABLED;
- p_ab8500_codec_configuration->cr8_enhsr =
- AB8500_CODEC_CR8_ENHSR_ENABLED;
- p_ab8500_codec_configuration->cr8_enear =
- AB8500_CODEC_CR8_ENEAR_ENABLED;
- p_ab8500_codec_configuration->cr8_enhfl =
- AB8500_CODEC_CR8_ENHFL_ENABLED;
- p_ab8500_codec_configuration->cr8_enhfr =
- AB8500_CODEC_CR8_ENHFR_ENABLED;
- p_ab8500_codec_configuration->cr8_envibl =
- AB8500_CODEC_CR8_ENVIBL_ENABLED;
- p_ab8500_codec_configuration->cr8_envibr =
- AB8500_CODEC_CR8_ENVIBR_ENABLED;
- p_ab8500_codec_configuration->cr9_endacear =
- AB8500_CODEC_CR9_ENDACEAR_ENABLED;
- p_ab8500_codec_configuration->cr9_endachfl =
- AB8500_CODEC_CR9_ENDACHFL_ENABLED;
- p_ab8500_codec_configuration->cr9_endachfr =
- AB8500_CODEC_CR9_ENDACHFR_ENABLED;
- p_ab8500_codec_configuration->cr9_endacvibl =
- AB8500_CODEC_CR9_ENDACVIBL_ENABLED;
- p_ab8500_codec_configuration->cr9_endacvibr =
- AB8500_CODEC_CR9_ENDACVIBR_ENABLED;
- p_ab8500_codec_configuration->cr10_mutehsl =
- AB8500_CODEC_CR10_MUTEHSL_DISABLED;
- p_ab8500_codec_configuration->cr10_mutehsr =
- AB8500_CODEC_CR10_MUTEHSR_DISABLED;
- p_ab8500_codec_configuration->cr10_muteear =
- AB8500_CODEC_CR10_MUTEEAR_DISABLED;
- p_ab8500_codec_configuration->cr15_pwmtovibl =
- AB8500_CODEC_CR15_PWMTOVIBL_PWM;
- p_ab8500_codec_configuration->cr15_pwmlctrl =
- AB8500_CODEC_CR15_PWMLCTRL_PWMNPLDUTYCYCLE;
- p_ab8500_codec_configuration->cr15_pwmnlctrl =
- AB8500_CODEC_CR15_PWMNLCTRL_PWMNLDUTYCYCLE;
- p_ab8500_codec_configuration->cr15_pwmplctrl =
- AB8500_CODEC_CR15_PWMPLCTRL_PWMPLDUTYCYCLE;
- p_ab8500_codec_configuration->cr15_pwmtovibr =
- AB8500_CODEC_CR15_PWMTOVIBR_PWM;
- p_ab8500_codec_configuration->cr15_pwmrctrl =
- AB8500_CODEC_CR15_PWMRCTRL_PWMNPRDUTYCYCLE;
- p_ab8500_codec_configuration->cr15_pwmnrctrl =
- AB8500_CODEC_CR15_PWMNRCTRL_PWMNRDUTYCYCLE;
- p_ab8500_codec_configuration->cr15_pwmprctrl =
- AB8500_CODEC_CR15_PWMPRCTRL_PWMPRDUTYCYCLE;
- break;
- default:
- ab8500_codec_error = AB8500_CODEC_INVALID_PARAMETER;
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
-
-PRIVATE t_ab8500_codec_error ab8500_codec_DestPowerControlUpdateCR(void)
-{
- t_ab8500_codec_error ab8500_codec_error = AB8500_CODEC_OK;
- ab8500_codec_error = ab8500_codec_UpdateCR8();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR9();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR10();
- if (ab8500_codec_error != AB8500_CODEC_OK)
- {
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
- }
- ab8500_codec_error = ab8500_codec_UpdateCR15();
- DBGEXIT(ab8500_codec_error);
- return (ab8500_codec_error);
-}
diff --git a/sound/u8500_acodec_ab8500.c b/sound/u8500_acodec_ab8500.c
deleted file mode 100644
index c75da368832..00000000000
--- a/sound/u8500_acodec_ab8500.c
+++ /dev/null
@@ -1,2523 +0,0 @@
-/*
- * Copyright (C) ST-Ericsson SA 2010
- *
- * Author: Deepak Karda
- * for ST-Ericsson.
- *
- * License terms:
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as published
- * by the Free Software Foundation.
- */
-
-/*-----------------------------------------------------------------------------
-* Common Includes
-*---------------------------------------------------------------------------*/
-
-#include <linux/module.h>
-#include <linux/types.h>
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/slab.h>
-#include <asm/uaccess.h>
-#include <asm/io.h>
-#include <linux/interrupt.h>
-#include <linux/errno.h>
-#include <linux/interrupt.h>
-#include <linux/spinlock.h>
-#include <linux/soundcard.h>
-#include <linux/sound.h>
-#include <linux/delay.h>
-#include <linux/dma-mapping.h>
-#include <linux/i2s/i2s.h>
-#include <mach/msp.h>
-#include <linux/gpio.h>
-/*#include <mach/i2c.h>*/
-#include <mach/debug.h>
-#include <mach/u8500_acodec_ab8500.h>
-#include <mach/ab8500.h>
-
-#ifdef CONFIG_U8500_AB8500_CUT10
-#include <mach/ab8500_codec_v1_0.h>
-#endif
-#ifdef CONFIG_U8500_AB8500_ED
-#include <mach/ab8500_codec.h>
-#endif
-
-#define ELEMENT_SIZE 0
-#define FRAME_SIZE -1
-#define MSP_NUM 0
-
-/* Debugging stuff */
-
-#define ACODEC_NAME "DRIVER ACODEC"
-#define DRIVER_DEBUG CONFIG_STM_ACODEC_DEBUG /* enables/disables debug msgs */
-#define DRIVER_DEBUG_PFX ACODEC_NAME /* msg header represents this module */
-#define DRIVER_DBG KERN_ERR /* message level */
-#define NMDK_DEBUG CONFIG_STM_ACODEC_DEBUG
-extern struct driver_debug_st DBG_ST;
-
-#if NMDK_DEBUG > 0
-t_ab8500_codec_error dump_acodec_registers(void);
-t_ab8500_codec_error dump_msp_registers(void);
-#endif
-
-#ifdef CONFIG_U8500_ACODEC_DMA
-static void u8500_digital_lpbk_tx_dma_start(void);
-static void u8500_digital_lpbk_rx_dma_start(void);
-#endif
-
-int second_config;
-/*----------------------------------------------------------------------------
-* global declarations
-*---------------------------------------------------------------------------*/
-t_u8500_codec_system_context g_codec_system_context;
-
-int u8500_acodec_rates[MAX_NO_OF_RATES] = { 48000 };
-
-char *codec_dest_texts[NUMBER_OUTPUT_DEVICE] = {
- "CODEC_DEST_HEADSET", "CODEC_DEST_EARPIECE", "CODEC_DEST_HANDSFREE",
- "CODEC_DEST_VIBRATOR1", "CODEC_DEST_VIBRATOR2"
-};
-
-char *codec_in_texts[NUMBER_INPUT_DEVICE] = {
- "CODEC_SRC_LINEIN", "CODEC_SRC_MICROPHONE_1A",
- "CODEC_SRC_MICROPHONE_1B",
- "CODEC_SRC_MICROPHONE_2", "CODEC_SRC_D_MICROPHONE_1",
- "CODEC_SRC_D_MICROPHONE_2",
- "CODEC_SRC_D_MICROPHONE_3", "CODEC_SRC_D_MICROPHONE_4",
- "CODEC_SRC_D_MICROPHONE_5",
- "CODEC_SRC_D_MICROPHONE_6", "CODEC_SRC_D_MICROPHONE_12",
- "CODEC_SRC_D_MICROPHONE_34",
- "CODEC_SRC_D_MICROPHONE_56"
-};
-
-char *lpbk_state_in_texts[NUMBER_LOOPBACK_STATE] = { "DISABLE", "ENABLE" };
-char *switch_state_in_texts[NUMBER_SWITCH_STATE] = { "DISABLE", "ENABLE" };
-char *power_state_in_texts[NUMBER_POWER_STATE] = { "DISABLE", "ENABLE" };
-char *tdm_mode_state_in_texts[NUMBER_POWER_STATE] = { "DISABLE", "ENABLE" };
-char *direct_rendering_state_in_texts[NUMBER_DIRECT_RENDERING_STATE] =
- { "DISABLE", "ENABLE" };
-char *pcm_rendering_state_in_texts[NUMBER_PCM_RENDERING_STATE] =
- { "DISABLE", "ENABLE", "PENDING" };
-
-EXPORT_SYMBOL(codec_dest_texts);
-EXPORT_SYMBOL(codec_in_texts);
-
-static void ab8500_codec_power_init(void);
-static int check_device_id();
-t_ab8500_codec_error perform_src_routing(t_ab8500_codec_src input_device);
-t_ab8500_codec_error
- u8500_acodec_allocate_all_mono_slots
- (t_ab8500_codec_cr31_to_cr46_ad_data_allocation ad_data_line1);
-t_ab8500_codec_error
- u8500_acodec_allocate_all_stereo_slots
- (t_ab8500_codec_cr31_to_cr46_ad_data_allocation ad_data_line1,
- t_ab8500_codec_cr31_to_cr46_ad_data_allocation ad_data_line2);
-
-#if 0 //from Arnaud
-/* For Codec in Master mode for recording*/
-struct msp_protocol_desc protocol_desc_tdm_mode = {
- MSP_DATA_TRANSFER_WIDTH_HALFWORD, /*rx_data_transfer_width */
- MSP_DATA_TRANSFER_WIDTH_HALFWORD, /*tx_data_transfer_width */
- MSP_SINGLE_PHASE, /*rx_phase_mode */
- MSP_SINGLE_PHASE, /*tx_phase_mode */
- MSP_PHASE2_START_MODE_IMEDIATE, /*rx_phase2_start_mode */
- MSP_PHASE2_START_MODE_IMEDIATE, /*tx_phase2_start_mode */
- MSP_BTF_MS_BIT_FIRST, /*rx_endianess */
- MSP_BTF_MS_BIT_FIRST, /*tx_endianess */
- MSP_FRAME_LENGTH_2, /*rx_frame_length_1 */
- MSP_FRAME_LENGTH_2, /*rx_frame_length_2 */
- MSP_FRAME_LENGTH_2, /*tx_frame_length_1 */
- MSP_FRAME_LENGTH_2, /*tx_frame_length_2 */
- MSP_ELEM_LENGTH_16, /*rx_element_length_1 */
- MSP_ELEM_LENGTH_16, /*rx_element_length_2 */
- MSP_ELEM_LENGTH_16, /*tx_element_length_1 */
- MSP_ELEM_LENGTH_16, /*tx_element_length_2 */
- MSP_DELAY_0, /*rx_data_delay */
- MSP_DELAY_0, /*tx_data_delay */
- MSP_FALLING_EDGE, /*rx_clock_pol */
- MSP_RISING_EDGE, /*tx_clock_pol */
- MSP_FRAME_SYNC_POL_ACTIVE_HIGH, /*rx_msp_frame_pol */
- MSP_FRAME_SYNC_POL_ACTIVE_HIGH, /*tx_msp_frame_pol */
- MSP_HWS_NO_SWAP, /*rx_half_word_swap */
- MSP_HWS_NO_SWAP, /*tx_half_word_swap */
- MSP_COMPRESS_MODE_LINEAR, /*compression_mode */
- MSP_EXPAND_MODE_LINEAR, /*expansion_mode */
- MSP_SPI_CLOCK_MODE_NON_SPI, /*spi_clk_mode */
- MSP_SPI_BURST_MODE_DISABLE, /*spi_burst_mode */
- 63, /*frame_period */
- 31, /*frame_width */
- 64, /*total_clocks_for_one_frame */
-};
-#endif
-
-#if 0 //from HCL
-/* For Codec in Master mode for recording*/
-struct msp_protocol_desc protocol_desc_tdm_mode = {
- MSP_DATA_TRANSFER_WIDTH_WORD, /*rx_data_transfer_width */
- MSP_DATA_TRANSFER_WIDTH_WORD, /*tx_data_transfer_width */
- MSP_DUAL_PHASE, /*rx_phase_mode */
- MSP_DUAL_PHASE, /*tx_phase_mode */
- MSP_PHASE2_START_MODE_FRAME_SYNC, /*rx_phase2_start_mode */
- MSP_PHASE2_START_MODE_FRAME_SYNC, /*tx_phase2_start_mode */
- MSP_BTF_MS_BIT_FIRST, /*rx_endianess */
- MSP_BTF_MS_BIT_FIRST, /*tx_endianess */
- MSP_FRAME_LENGTH_1, /*rx_frame_length_1 */
- MSP_FRAME_LENGTH_1, /*rx_frame_length_2 */
- MSP_FRAME_LENGTH_1, /*tx_frame_length_1 */
- MSP_FRAME_LENGTH_1, /*tx_frame_length_2 */
- MSP_ELEM_LENGTH_16, /*rx_element_length_1 */
- MSP_ELEM_LENGTH_16, /*rx_element_length_2 */
- MSP_ELEM_LENGTH_16, /*tx_element_length_1 */
- MSP_ELEM_LENGTH_16, /*tx_element_length_2 */
- MSP_DELAY_0, /*rx_data_delay */
- MSP_DELAY_0, /*tx_data_delay */
- MSP_RISING_EDGE, /*rx_clock_pol */
- MSP_RISING_EDGE, /*tx_clock_pol */
- MSP_FRAME_SYNC_POL_ACTIVE_HIGH, /*rx_msp_frame_pol */
- MSP_FRAME_SYNC_POL_ACTIVE_HIGH, /*tx_msp_frame_pol */
- MSP_HWS_NO_SWAP, /*rx_half_word_swap */
- MSP_HWS_NO_SWAP, /*tx_half_word_swap */
- MSP_COMPRESS_MODE_LINEAR, /*compression_mode */
- MSP_EXPAND_MODE_LINEAR, /*expansion_mode */
- MSP_SPI_CLOCK_MODE_NON_SPI, /*spi_clk_mode */
- MSP_SPI_BURST_MODE_DISABLE, /*spi_burst_mode */
- 255, /*frame_period */
- 0, /*frame_width */
- 256, /*total_clocks_for_one_frame */
-};
-
-#endif
-
-#if 0 //from STS
-struct msp_protocol_desc protocol_desc_tdm_mode = {
- MSP_DATA_TRANSFER_WIDTH_HALFWORD, /*rx_data_transfer_width */
- MSP_DATA_TRANSFER_WIDTH_HALFWORD, /*tx_data_transfer_width */
- MSP_SINGLE_PHASE, /*rx_phase_mode */
- MSP_SINGLE_PHASE, /*tx_phase_mode */
- MSP_PHASE2_START_MODE_IMEDIATE, /*rx_phase2_start_mode */
- MSP_PHASE2_START_MODE_IMEDIATE, /*tx_phase2_start_mode */
- MSP_BTF_MS_BIT_FIRST, /*rx_endianess */
- MSP_BTF_MS_BIT_FIRST, /*tx_endianess */
- MSP_FRAME_LENGTH_2, /*rx_frame_length_1 */
- MSP_FRAME_LENGTH_1, /*rx_frame_length_2 */
- MSP_FRAME_LENGTH_2, /*tx_frame_length_1 */
- MSP_FRAME_LENGTH_1, /*tx_frame_length_2 */
- MSP_ELEM_LENGTH_16, /*rx_element_length_1 */
- MSP_ELEM_LENGTH_16, /*rx_element_length_2 */
- MSP_ELEM_LENGTH_16, /*tx_element_length_1 */
- MSP_ELEM_LENGTH_16, /*tx_element_length_2 */
- MSP_DELAY_0, /*rx_data_delay */
- MSP_DELAY_0, /*tx_data_delay */
- MSP_FALLING_EDGE, /*rx_clock_pol */
- MSP_RISING_EDGE, /*tx_clock_pol */
- MSP_FRAME_SYNC_POL_ACTIVE_HIGH, /*rx_msp_frame_pol */
- MSP_FRAME_SYNC_POL_ACTIVE_HIGH, /*tx_msp_frame_pol */
- MSP_HWS_NO_SWAP, /*rx_half_word_swap */
- MSP_HWS_NO_SWAP, /*tx_half_word_swap */
- MSP_COMPRESS_MODE_LINEAR, /*compression_mode */
- MSP_EXPAND_MODE_LINEAR, /*expansion_mode */
- MSP_SPI_CLOCK_MODE_NON_SPI, /*spi_clk_mode */
- MSP_SPI_BURST_MODE_DISABLE, /*spi_burst_mode */
- 25, /*frame_period */
- 32, /*frame_width */
- 32, /*total_clocks_for_one_frame */
-};
-#endif
-
-#define DIGITAL_LPBK_MAX_BIFFERS 3
-
-#ifdef CONFIG_U8500_AB8500_CUT10
-#define NB_OF_CHANNEL_USED 8
-#else
-#define NB_OF_CHANNEL_USED 6
-#endif
-
-#define MONO_SRC 1
-#define STEREO_SRC 2
-
-typedef struct {
- unsigned char *area; /* virtual pointer */
- dma_addr_t addr; /* physical address */
-} t_dma_buffer;
-
-typedef struct {
- struct completion tx_dma_com;
- struct completion rx_dma_com;
- volatile int rx_active;
- volatile int tx_active;
- t_dma_buffer buffer;
- int data_size;
- int rx_index;
- int tx_index;
-} t_digital_lpbk_cnxt;
-
-const int play_flag = 1;
-const int capture_flag = 2;
-
-t_digital_lpbk_cnxt digital_lpbk_cnxt;
-
-void u8500_set_defaults()
-{
- int i;
-
- for (i = 0; i < NUMBER_INPUT_DEVICE; i++) {
- g_codec_system_context.input_config[i].left_volume = 0;
- g_codec_system_context.input_config[i].right_volume = 0;
- g_codec_system_context.input_config[i].mute_state = DISABLE;
- g_codec_system_context.input_config[i].power_state = DISABLE;
- }
-
- for (i = 0; i < NUMBER_OUTPUT_DEVICE; i++) {
- g_codec_system_context.output_config[i].left_volume = 0;
- g_codec_system_context.output_config[i].right_volume = 0;
- g_codec_system_context.output_config[i].mute_state = DISABLE;
- g_codec_system_context.output_config[i].power_state = DISABLE;
- }
-
-} //END OF FUNCTION
-
-struct i2sdrv_data *i2sdrv[MAX_I2S_CLIENTS];
-
-t_ab8500_codec_error u8500_acodec_open(int client_id, int stream_id)
-{
- struct i2sdrv_data *p_i2sdrv_data = NULL;
- struct i2s_device *i2s;
-
- p_i2sdrv_data = i2sdrv[client_id];
-
- if (!p_i2sdrv_data)
- return (-1);
-
- i2s = p_i2sdrv_data->i2s;
-
- if (stream_id == 0) //PLAYBACK
- {
- if (p_i2sdrv_data->tx_status)
- return -1;
- else {
- p_i2sdrv_data->tx_status = 1;
- }
- } else if (stream_id == 1) //CAPTURE
- {
- if (p_i2sdrv_data->rx_status)
- return -1;
- else {
- p_i2sdrv_data->rx_status = 1;
- }
- }
-
- p_i2sdrv_data->flag = 0;
-
- return 0;
-}
-
-t_ab8500_codec_error u8500_acodec_send_data(int client_id, void *data,
- size_t bytes, int dma_flag)
-{
- struct i2sdrv_data *p_i2sdrv_data = NULL;
- struct i2s_device *i2s_dev = NULL;
- int bytes_transmit;
- struct i2s_message message;
-
- p_i2sdrv_data = i2sdrv[client_id];
-
- if (!p_i2sdrv_data)
- return (-1);
-
- i2s_dev = p_i2sdrv_data->i2s;
-
- if (p_i2sdrv_data->flag) {
- stm_dbg(DBG_ST.acodec, " I2S controller not available\n");
- return -1;
- }
-
- message.i2s_transfer_mode = I2S_TRANSFER_MODE_SINGLE_DMA;
- message.i2s_direction = I2S_DIRECTION_TX;
- message.txbytes = bytes;
- message.txdata = data;
- message.dma_flag = dma_flag;
-
- bytes_transmit = i2s_transfer(i2s_dev->controller, &message);
-
- if (bytes_transmit < 0) {
- printk("error in transfer\n");
- return -1;
- }
- return bytes_transmit;
-
-}
-
-t_ab8500_codec_error u8500_acodec_loopback_configure(int client_id, void *data,
- size_t bytes, int dma_flag)
-{
- struct i2sdrv_data *p_i2sdrv_data = NULL;
- struct i2s_device *i2s_dev = NULL;
- int bytes_receive;
- struct i2s_message message;
-
- p_i2sdrv_data = i2sdrv[client_id];
-
- if (!p_i2sdrv_data)
- return (-1);
-
- i2s_dev = p_i2sdrv_data->i2s;
-
- if (p_i2sdrv_data->flag) {
- stm_dbg(DBG_ST.acodec, " I2S controller not available\n");
- return -1;
- }
-
- message.i2s_transfer_mode = I2S_TRANSFER_MODE_INF_LOOPBACK;
- message.rxbytes = bytes;
- message.rxdata = data;
- message.txbytes = bytes;
- message.txdata = data;
- message.dma_flag = dma_flag;
-
- bytes_receive = i2s_transfer(i2s_dev->controller, &message);
-
- if (bytes_receive < 0) {
- printk(" not get\n");
- return -1;
- }
- return bytes_receive;
-
-}
-
-t_ab8500_codec_error u8500_acodec_receive_data(int client_id, void *data,
- size_t bytes, int dma_flag)
-{
- struct i2sdrv_data *p_i2sdrv_data = NULL;
- struct i2s_device *i2s_dev = NULL;
- int bytes_receive;
- struct i2s_message message;
-
- p_i2sdrv_data = i2sdrv[client_id];
-
- if (!p_i2sdrv_data)
- return (-1);
-
- i2s_dev = p_i2sdrv_data->i2s;
-
- if (p_i2sdrv_data->flag) {
- stm_dbg(DBG_ST.acodec, " I2S controller not available\n");
- return -1;
- }
-
- message.i2s_transfer_mode = I2S_TRANSFER_MODE_SINGLE_DMA;
- message.i2s_direction = I2S_DIRECTION_RX;
- message.rxbytes = bytes;
- message.rxdata = data;
- message.dma_flag = dma_flag;
-
- bytes_receive = i2s_transfer(i2s_dev->controller, &message);
-
- if (bytes_receive < 0) {
- printk(" not get\n");
- return -1;
- }
- return bytes_receive;
-
-}
-
-t_ab8500_codec_error u8500_acodec_close(int client_id, t_acodec_disable flag)
-{
- struct i2sdrv_data *p_i2sdrv_data = NULL;
- struct i2s_device *i2s_dev = NULL;
- int status = 0;
-
- p_i2sdrv_data = i2sdrv[client_id];
-
- if (!p_i2sdrv_data)
- return (-1);
-
- i2s_dev = p_i2sdrv_data->i2s;
-
- if (p_i2sdrv_data->flag) {
- stm_dbg(DBG_ST.acodec, " I2S controller not available\n");
- return -1;
- }
-
- if (flag == DISABLE_ALL) {
- p_i2sdrv_data->flag = -1;
- p_i2sdrv_data->tx_status = 0;
- p_i2sdrv_data->rx_status = 0;
- } else if (flag == DISABLE_TRANSMIT) {
- p_i2sdrv_data->tx_status = 0;
- } else if (flag == DISABLE_RECEIVE) {
- p_i2sdrv_data->rx_status = 0;
- }
- status = i2s_cleanup(i2s_dev->controller, flag);
- if (status) {
- return -1;
- }
-
- return 0;
-}
-
-/**
-* u8500_acodec_enable_audio_mode
-*
-* @direction - direction of data flow (from/to) audiocode
-* @mspClockSel - clock for MSP
-* @mspInClockFreq - input clock for MSP
-* @channels - number of channel, 1 for mono and 2 for stereo
-*
-* It configures the audiocodec in audio mode. In this case,the I2S
-* protocol is used for data exchanges.
-*/
-
-t_ab8500_codec_error u8500_acodec_enable_audio_mode(struct acodec_configuration
- * acodec_config)
-{
- struct i2s_device *i2s_dev = NULL;
- t_ab8500_codec_error error_status = AB8500_CODEC_OK;
- struct msp_config msp_config;
- t_ab8500_codec_error codec_error;
- t_ab8500_codec_mode codec_in_mode = AB8500_CODEC_MODE_MANUAL_SETTING;
- t_ab8500_codec_mode codec_out_mode = AB8500_CODEC_MODE_MANUAL_SETTING;
- t_ab8500_codec_direction codec_direction;
-/*#ifdef CONFIG_U8500_AB8500_CUT10*/
-#if 1
- t_ab8500_codec_tdm_config tdm_config;
-#endif
-
- memset(&msp_config, 0, sizeof(msp_config));
-
- FUNC_ENTER();
- stm_dbg(DBG_ST.acodec,
- " Entering in u8500_acodec_enable_audio_mode()\n");
-
- if (i2sdrv[I2S_CLIENT_MSP1]->flag) {
- stm_dbg(DBG_ST.acodec, " I2S controller not available\n");
- return -1;
- }
-
- i2s_dev = i2sdrv[I2S_CLIENT_MSP1]->i2s;
-
- if (g_codec_system_context.cur_user == NO_USER) {
- stm_error("Audiocodec not yet configured by any user\n");
- return (AB8500_CODEC_ERROR);
- } else if (g_codec_system_context.cur_user != acodec_config->user) {
- stm_error
- (" Trying to acces audiocodec already in use by user %d\n",
- g_codec_system_context.cur_user);
- return (AB8500_CODEC_ERROR);
- }
-
- switch (acodec_config->direction) {
- case AB8500_CODEC_DIRECTION_INOUT:
- codec_direction = AB8500_CODEC_DIRECTION_INOUT;
- codec_in_mode = AB8500_CODEC_MODE_VOICE; //HIFI
- codec_out_mode = AB8500_CODEC_MODE_VOICE; //VOICE
- break;
- case AB8500_CODEC_DIRECTION_IN:
- codec_direction = AB8500_CODEC_DIRECTION_IN;
- codec_in_mode = AB8500_CODEC_MODE_VOICE; //HIFI
- break;
- case AB8500_CODEC_DIRECTION_OUT:
- codec_direction = AB8500_CODEC_DIRECTION_OUT;
- codec_out_mode = AB8500_CODEC_MODE_VOICE; //HIFI
- break;
- default:
- stm_error("Invalid direction\n");
- return AB8500_CODEC_ERROR;
- }
-
- /* MSP configuration */
-
- msp_config.tx_clock_sel = 0; //TX_CLK_SEL_SRG;
- msp_config.rx_clock_sel = 0; //RX_CLK_SEL_SRG;
-
- msp_config.tx_frame_sync_sel = 0; //0x00000400; Frame synchronization signal is provided by an external source. MSPTFS is an input pin
- msp_config.rx_frame_sync_sel = 0; //0: Rx Frame synchronization signal is provided by an external source. MSPRFS is an input pin
-
- msp_config.input_clock_freq = MSP_INPUT_FREQ_48MHZ;
-
- msp_config.srg_clock_sel = 0; //0x000C0000
-
- //msp_config.rx_endianess = MSP_BIG_ENDIAN;
- //msp_config.tx_endianess = MSP_BIG_ENDIAN;
-
- msp_config.rx_frame_sync_pol = RX_FIFO_SYNC_HI;
- msp_config.tx_frame_sync_pol = TX_FIFO_SYNC_HI;
-
- //msp_config.rx_unexpect_frame_sync = MSP_UNEXPECTED_FS_IGNORE;
- //msp_config.tx_unexpect_frame_sync = MSP_UNEXPECTED_FS_IGNORE;
-
- msp_config.rx_fifo_config = RX_FIFO_ENABLE;
- msp_config.tx_fifo_config = TX_FIFO_ENABLE;
-
- msp_config.spi_clk_mode = SPI_CLK_MODE_NORMAL;
- msp_config.spi_burst_mode = 0;
-
- msp_config.handler = acodec_config->handler;
- msp_config.tx_callback_data = acodec_config->tx_callback_data;
- msp_config.tx_data_enable = 0;
- msp_config.rx_callback_data = acodec_config->rx_callback_data;
-
- msp_config.loopback_enable = 0;
- msp_config.multichannel_configured = 0;
-
- msp_config.def_elem_len = 0;
- //msp_config.loopback_enable = g_codec_system_context.msp_loopback;
-
- stm_dbg(DBG_ST.acodec, " msp_config.loopback_enable = 0x%x \n",
- msp_config.loopback_enable);
-
-#if 0
- msp_config.default_protocol_desc = 1;
-#else
- msp_config.default_protocol_desc = 0;
- msp_config.protocol_desc.rx_phase_mode = MSP_SINGLE_PHASE;
- msp_config.protocol_desc.tx_phase_mode = MSP_SINGLE_PHASE;
- msp_config.protocol_desc.rx_phase2_start_mode =
- MSP_PHASE2_START_MODE_IMEDIATE;
- msp_config.protocol_desc.tx_phase2_start_mode =
- MSP_PHASE2_START_MODE_IMEDIATE;
- msp_config.protocol_desc.rx_bit_transfer_format = MSP_BTF_MS_BIT_FIRST;
- msp_config.protocol_desc.tx_bit_transfer_format = MSP_BTF_MS_BIT_FIRST;
- msp_config.protocol_desc.rx_frame_length_1 = MSP_FRAME_LENGTH_1;
- msp_config.protocol_desc.rx_frame_length_2 = MSP_FRAME_LENGTH_1;
- msp_config.protocol_desc.tx_frame_length_1 = MSP_FRAME_LENGTH_1;
- msp_config.protocol_desc.tx_frame_length_2 = MSP_FRAME_LENGTH_1;
- msp_config.protocol_desc.rx_element_length_1 = MSP_ELEM_LENGTH_32;
- msp_config.protocol_desc.rx_element_length_2 = MSP_ELEM_LENGTH_32;
- msp_config.protocol_desc.tx_element_length_1 = MSP_ELEM_LENGTH_32;
- msp_config.protocol_desc.tx_element_length_2 = MSP_ELEM_LENGTH_32;
- msp_config.protocol_desc.rx_data_delay = MSP_DELAY_0;
- msp_config.protocol_desc.tx_data_delay = MSP_DELAY_0;
- msp_config.protocol_desc.rx_clock_pol = MSP_RISING_EDGE;
- msp_config.protocol_desc.tx_clock_pol = MSP_FALLING_EDGE;
- msp_config.protocol_desc.rx_frame_sync_pol =
- MSP_FRAME_SYNC_POL_ACTIVE_HIGH;
- msp_config.protocol_desc.tx_frame_sync_pol =
- MSP_FRAME_SYNC_POL_ACTIVE_HIGH;
- msp_config.protocol_desc.rx_half_word_swap = MSP_HWS_NO_SWAP;
- msp_config.protocol_desc.tx_half_word_swap = MSP_HWS_NO_SWAP;
- msp_config.protocol_desc.compression_mode = MSP_COMPRESS_MODE_LINEAR;
- msp_config.protocol_desc.expansion_mode = MSP_EXPAND_MODE_LINEAR;
- msp_config.protocol_desc.spi_clk_mode = MSP_SPI_CLOCK_MODE_NON_SPI;
- msp_config.protocol_desc.spi_burst_mode = MSP_SPI_BURST_MODE_DISABLE;
- msp_config.protocol_desc.frame_sync_ignore = MSP_FRAME_SYNC_IGNORE;
- msp_config.protocol_desc.frame_period = 63;
- msp_config.protocol_desc.frame_width = 31;
- msp_config.protocol_desc.total_clocks_for_one_frame = 64;
-
-#endif
-
- msp_config.direction = MSP_BOTH_T_R_MODE;
- msp_config.protocol = MSP_PCM_PROTOCOL; //MSP_I2S_PROTOCOL
- msp_config.frame_size = ELEMENT_SIZE;
- // msp_config.frame_freq = freq; $kardad$
- msp_config.frame_freq = CODEC_SAMPLING_FREQ_48KHZ;
-
- /* enable msp for both tr and rx mode with dma data transfer. THIS IS NOW DONE SEPARATELY from SAA. */
-
- if (acodec_config->channels == 1)
- msp_config.data_size = MSP_DATA_SIZE_16BIT;
- else
- msp_config.data_size = MSP_DATA_SIZE_32BIT;
-
-#ifdef CONFIG_U8500_ACODEC_DMA
- msp_config.work_mode = MSP_DMA_MODE;
-#elif defined(CONFIG_U8500_ACODEC_POLL)
- msp_config.work_mode = MSP_POLLING_MODE;
-#else
- msp_config.work_mode = MSP_INTERRUPT_MODE;
-#endif
-
- if (DISABLE == acodec_config->direct_rendering_mode) {
- msp_config.multichannel_configured = 1;
- msp_config.multichannel_config.tx_multichannel_enable = 1;
- if (acodec_config->channels == 1) {
- msp_config.multichannel_config.tx_channel_0_enable =
- 0x0000001;
- } else {
- msp_config.multichannel_config.tx_channel_0_enable =
- 0x0000003;
- }
- msp_config.multichannel_config.tx_channel_1_enable = 0x0000000;
- msp_config.multichannel_config.tx_channel_2_enable = 0x0000000;
- msp_config.multichannel_config.tx_channel_3_enable = 0x0000000;
-
- msp_config.multichannel_config.rx_multichannel_enable = 1;
-
- if (acodec_config->channels == 1) {
- msp_config.multichannel_config.rx_channel_0_enable =
- 0x0000001;
- } else {
- msp_config.multichannel_config.rx_channel_0_enable =
- 0x0000003;
- }
- msp_config.multichannel_config.rx_channel_1_enable = 0x0000000;
- msp_config.multichannel_config.rx_channel_2_enable = 0x0000000;
- msp_config.multichannel_config.rx_channel_3_enable = 0x0000000;
-
- if (acodec_config->tdm8_ch_mode == ENABLE) {
- msp_config.def_elem_len = 1;
-
- msp_config.protocol_desc.tx_element_length_1 =
- MSP_ELEM_LENGTH_20;
- msp_config.protocol_desc.tx_frame_length_1 =
- MSP_FRAME_LENGTH_8;
- msp_config.protocol_desc.tx_data_delay = MSP_DELAY_1;
-
- msp_config.protocol_desc.tx_element_length_2 =
- MSP_ELEM_LENGTH_8;
- msp_config.protocol_desc.tx_frame_length_2 =
- MSP_FRAME_LENGTH_1;
-
- msp_config.protocol_desc.rx_element_length_1 =
- MSP_ELEM_LENGTH_20;
- msp_config.protocol_desc.rx_frame_length_1 =
- MSP_FRAME_LENGTH_8;
- msp_config.protocol_desc.rx_data_delay = MSP_DELAY_1;
-
- msp_config.protocol_desc.rx_element_length_2 =
- MSP_ELEM_LENGTH_8;
- msp_config.protocol_desc.rx_frame_length_2 =
- MSP_FRAME_LENGTH_1;
-
- msp_config.protocol_desc.frame_sync_ignore =
- MSP_FRAME_SYNC_UNIGNORE;
- msp_config.protocol_desc.rx_clock_pol = MSP_RISING_EDGE;
-
- //if(acodec_config->digital_loopback == ENABLE) {
- if (1) {
- msp_config.multichannel_config.
- tx_channel_0_enable =
- (1 << NB_OF_CHANNEL_USED) - 1;
- msp_config.multichannel_config.
- rx_channel_0_enable =
- (1 << NB_OF_CHANNEL_USED) - 1;
- } else {
- msp_config.multichannel_config.
- tx_channel_0_enable = 0x3;
- msp_config.multichannel_config.
- rx_channel_0_enable = 0x3;
- }
- }
-
- if (acodec_config->tdm8_ch_mode == ENABLE) {
- /* TFSDLY = 2 delay units */
- msp_config.iodelay = 0x20;
- }
-
- error_status = i2s_setup(i2s_dev->controller, &msp_config);
- if (error_status < 0) {
- stm_error("error in msp enable, error_status is %d\n",
- error_status);
- return error_status;
- }
- } else if (ENABLE == acodec_config->direct_rendering_mode) {
- writel(0x00, ((char *)(IO_ADDRESS(U8500_MSP1_BASE) + 0x04))); //MSP_GCR
- }
-
- if (ACODEC_CONFIG_REQUIRED == acodec_config->acodec_config_need) {
- AB8500_CODEC_SelectInterface(AB8500_CODEC_AUDIO_INTERFACE_0);
-
- codec_error = AB8500_CODEC_PowerUp();
- if (AB8500_CODEC_OK != codec_error) {
- stm_error("AB8500_CODEC_PowerUp failed\n");
- return AB8500_CODEC_ERROR;
- }
-
-/*#ifdef CONFIG_U8500_AB8500_CUT10*/
-#if 1
- tdm_config.cr27_if1_bitclk_osr =
- AB8500_CODEC_CR27_IF1_BITCLK_OSR_32;
- tdm_config.cr27_if0_bitclk_osr =
- AB8500_CODEC_CR27_IF0_BITCLK_OSR_32;
- tdm_config.cr28_if0wl = AB8500_CODEC_CR28_IF0WL_16BITS;
- tdm_config.cr30_if1wl = AB8500_CODEC_CR30_IF1WL_16BITS;
-
- switch (acodec_config->direction) {
- case AB8500_CODEC_DIRECTION_INOUT:
- tdm_config.cr28_bitclk0p =
- AB8500_CODEC_CR28_BITCLK0P_FALLING_EDGE;
- tdm_config.cr28_if0del =
- AB8500_CODEC_CR28_IF0DEL_DELAYED;
- break;
- case AB8500_CODEC_DIRECTION_IN:
- tdm_config.cr28_bitclk0p =
- AB8500_CODEC_CR28_BITCLK0P_RISING_EDGE;
- tdm_config.cr28_if0del =
- AB8500_CODEC_CR28_IF0DEL_NOT_DELAYED;
- break;
- case AB8500_CODEC_DIRECTION_OUT:
- tdm_config.cr28_bitclk0p =
- AB8500_CODEC_CR28_BITCLK0P_FALLING_EDGE;
- tdm_config.cr28_if0del =
- AB8500_CODEC_CR28_IF0DEL_DELAYED;
- break;
- default:
- stm_error("Invalid direction\n");
- return AB8500_CODEC_ERROR;
- }
-
- if (acodec_config->tdm8_ch_mode == ENABLE) {
- tdm_config.cr27_if0_bitclk_osr =
- AB8500_CODEC_CR27_IF0_BITCLK_OSR_256;
- tdm_config.cr28_if0wl = AB8500_CODEC_CR28_IF0WL_20BITS;
- tdm_config.cr28_bitclk0p =
- AB8500_CODEC_CR28_BITCLK0P_RISING_EDGE;
- tdm_config.cr28_if0del =
- AB8500_CODEC_CR28_IF0DEL_DELAYED;
- codec_in_mode = AB8500_CODEC_MODE_VOICE;
- codec_out_mode = AB8500_CODEC_MODE_VOICE;
- acodec_config->direction = AB8500_CODEC_DIRECTION_INOUT;
- }
-
- codec_error =
- AB8500_CODEC_SetModeAndDirection(acodec_config->direction,
- codec_in_mode,
- codec_out_mode,
- &tdm_config);
-#else
- codec_error =
- AB8500_CODEC_SetModeAndDirection(acodec_config->direction,
- codec_in_mode,
- codec_out_mode);
-#endif
- if (AB8500_CODEC_OK != codec_error) {
- stm_error("set mode and direction failed\n");
- return AB8500_CODEC_ERROR;
- }
-
- codec_error =
- AB8500_CODEC_SetMasterMode(AB8500_CODEC_MASTER_MODE_ENABLE);
-
- if (AB8500_CODEC_OK != codec_error) {
- stm_error("set mode and direction failed\n");
- return AB8500_CODEC_ERROR;
- }
-
- /*codec_error = trg_codec_set_sample_frequency(0); */
-
- /*u8500_acodec_set_volume(g_codec_system_context.in_left_volume,
- g_codec_system_context.in_right_volume,
- g_codec_system_context.out_left_volume,
- g_codec_system_context.out_right_volume,
- user); */
-#if 0
- if (AB8500_CODEC_DIRECTION_IN == acodec_config->direction
- || AB8500_CODEC_DIRECTION_INOUT ==
- acodec_config->direction) {
-
- u8500_acodec_allocate_ad_slot
- (AB8500_CODEC_SRC_D_MICROPHONE_1, TDM_8_CH_MODE);
- u8500_acodec_allocate_ad_slot
- (AB8500_CODEC_SRC_D_MICROPHONE_2, TDM_8_CH_MODE);
-
- /*codec_error = AB8500_CODEC_ADSlotAllocation (AB8500_CODEC_SLOT0,
- AB8500_CODEC_CR31_TO_CR46_SLOT_OUTPUTS_DATA_FROM_AD_OUT3);
- if (AB8500_CODEC_OK != codec_error) {
- stm_error("ab8500_codec_adslot_allocation failed\n");
- return AB8500_CODEC_ERROR;
- }
- codec_error = AB8500_CODEC_ADSlotAllocation (AB8500_CODEC_SLOT1,
- AB8500_CODEC_CR31_TO_CR46_SLOT_IS_TRISTATE);
- if (AB8500_CODEC_OK != codec_error) {
- stm_error("ab8500_codec_adslot_allocation failed\n");
- return AB8500_CODEC_ERROR;
- } */
-
- }
-
- if (AB8500_CODEC_DIRECTION_OUT == acodec_config->direction
- || AB8500_CODEC_DIRECTION_INOUT ==
- acodec_config->direction) {
- u8500_acodec_allocate_da_slot(AB8500_CODEC_DEST_HEADSET,
- TDM_8_CH_MODE);
- /*codec_error = AB8500_CODEC_DASlotAllocation (AB8500_CODEC_DA_CHANNEL_NUMBER_1,
- AB8500_CODEC_CR51_TO_CR56_SLTODA_SLOT08);
- if (AB8500_CODEC_OK != codec_error) {
- stm_error
- ("ab8500_codec_daslot_allocation failed\n");
- return AB8500_CODEC_ERROR;
- }
- codec_error = AB8500_CODEC_DASlotAllocation (AB8500_CODEC_DA_CHANNEL_NUMBER_2,
- AB8500_CODEC_CR51_TO_CR56_SLTODA_SLOT09);
- if (AB8500_CODEC_OK != codec_error) {
- stm_error
- ("ab8500_codec_daslot_allocation failed\n");
- return AB8500_CODEC_ERROR;
- } */
-
- }
-#endif
-
- } //END of if acodec_config_need
-
-/*#if DRIVER_DEBUG > 0
- {
- dump_msp_registers();
- dump_acodec_registers();
- }
-#endif*/
-
- stm_dbg(DBG_ST.acodec,
- "leaving in u8500_acodec_enable_audio_mode() \n");
-
- FUNC_EXIT();
- return AB8500_CODEC_OK;
-}
-
-/**
-* u8500_acodec_set_output_volume - configures the volume level for both speakers
-* @in_left_volume - volume for left channel of mic
-* @in_right_volume - volume for right channel of mic
-* @out_left_volume - volume for left speaker
-* @out_right_volume - volume for right speaker
-*/
-t_ab8500_codec_error u8500_acodec_set_output_volume(t_ab8500_codec_dest
- dest_device,
- int left_volume,
- int right_volume,
- t_acodec_user user)
-{
- t_ab8500_codec_error codec_error = AB8500_CODEC_OK;
-
- stm_dbg(DBG_ST.acodec,
- " Entering in u8500_acodec_set_output_volume()\n");
-
- FUNC_ENTER();
-
- user = user; //keep compiler happy
-
- g_codec_system_context.output_config[dest_device].left_volume =
- left_volume;
- g_codec_system_context.output_config[dest_device].right_volume =
- right_volume;
-
- AB8500_CODEC_SetDestVolume(dest_device, left_volume, right_volume);
-
- FUNC_EXIT();
- return codec_error;
-}
-
-/*u8500_acodec_get_output_volume*/
-
-t_ab8500_codec_error u8500_acodec_get_output_volume(t_ab8500_codec_dest
- dest_device,
- int *p_left_volume,
- int *p_right_volume,
- t_acodec_user user)
-{
- t_ab8500_codec_error codec_error = AB8500_CODEC_OK;
-
- stm_dbg(DBG_ST.acodec,
- " Entering in u8500_acodec_set_output_volume()\n");
-
- user = user; //keep compiler happy
-
- *p_left_volume =
- g_codec_system_context.output_config[dest_device].left_volume;
- *p_right_volume =
- g_codec_system_context.output_config[dest_device].right_volume;
-
- return codec_error;
-}
-
-/**
-* u8500_acodec_set_input_volume - configures the volume level for both speakers
-* @in_left_volume - volume for left channel of mic
-* @in_right_volume - volume for right channel of mic
-* @out_left_volume - volume for left speaker
-* @out_right_volume - volume for right speaker
-*/
-t_ab8500_codec_error u8500_acodec_set_input_volume(t_ab8500_codec_src
- src_device, int left_volume,
- int right_volume,
- t_acodec_user user)
-{
- t_ab8500_codec_error codec_error = AB8500_CODEC_OK;
-
- stm_dbg(DBG_ST.acodec,
- " Entering in u8500_acodec_set_input_volume()\n");
-
- user = user; //keep compiler happy
-
- g_codec_system_context.input_config[src_device].left_volume =
- left_volume;
- g_codec_system_context.input_config[src_device].right_volume =
- right_volume;
-
- AB8500_CODEC_SetSrcVolume(src_device, left_volume, right_volume);
-
- return codec_error;
-}
-
-/**
-* u8500_acodec_get_input_volume - configures the volume level for both speakers
-* @in_left_volume - volume for left channel of mic
-* @in_right_volume - volume for right channel of mic
-* @out_left_volume - volume for left speaker
-* @out_right_volume - volume for right speaker
-*/
-t_ab8500_codec_error u8500_acodec_get_input_volume(t_ab8500_codec_src
- src_device,
- int *p_left_volume,
- int *p_right_volume,
- t_acodec_user user)
-{
- t_ab8500_codec_error codec_error = AB8500_CODEC_OK;
-
- stm_dbg(DBG_ST.acodec,
- " Entering in u8500_acodec_get_input_volume()\n");
-
- user = user; //keep compiler happy
-
- *p_left_volume =
- g_codec_system_context.input_config[src_device].left_volume;
- *p_right_volume =
- g_codec_system_context.input_config[src_device].right_volume;
-
- return codec_error;
-}
-
-/**
-* u8500_acodec_toggle_playback_mute_control - configures the mute for both speakers
-* @in_left_volume - volume for left channel of mic
-* @in_right_volume - volume for right channel of mic
-* @out_left_volume - volume for left speaker
-* @out_right_volume - volume for right speaker
-*/
-t_ab8500_codec_error
-u8500_acodec_toggle_playback_mute_control(t_ab8500_codec_dest dest_device,
- t_u8500_bool_state mute_state,
- t_acodec_user user)
-{
- t_ab8500_codec_error codec_error = AB8500_CODEC_OK;
-
- stm_dbg(DBG_ST.acodec,
- " Entering in u8500_acodec_toggle_playback_mute_control \n");
-
- user = user; //keep compiler happy
-
- g_codec_system_context.output_config[dest_device].mute_state =
- mute_state;
-
- if (ENABLE == mute_state) {
- AB8500_CODEC_DestPowerControl(dest_device,
- AB8500_CODEC_SRC_STATE_ENABLE);
- } else {
- AB8500_CODEC_DestPowerControl(dest_device,
- AB8500_CODEC_SRC_STATE_DISABLE);
- }
-
- return codec_error;
-}
-
-/**
-* u8500_acodec_toggle_capture_mute_control - configures the mute for both speakers
-* @in_left_volume - volume for left channel of mic
-* @in_right_volume - volume for right channel of mic
-* @out_left_volume - volume for left speaker
-* @out_right_volume - volume for right speaker
-*/
-t_ab8500_codec_error u8500_acodec_toggle_capture_mute_control(t_ab8500_codec_src
- src_device,
- t_u8500_bool_state
- mute_state,
- t_acodec_user
- user)
-{
- t_ab8500_codec_error codec_error = AB8500_CODEC_OK;
-
- stm_dbg(DBG_ST.acodec,
- " Entering in u8500_acodec_toggle_capture_mute_control \n");
-
- user = user; //keep compiler happy
-
- g_codec_system_context.input_config[src_device].mute_state = mute_state;
-
- if (ENABLE == mute_state) {
- AB8500_CODEC_SrcPowerControl(src_device,
- AB8500_CODEC_SRC_STATE_ENABLE);
- } else {
- AB8500_CODEC_SrcPowerControl(src_device,
- AB8500_CODEC_SRC_STATE_DISABLE);
- }
-
- return codec_error;
-}
-
-/**
-* u8500_acodec_select_input
-* @input_device: MIC or linein.
-*
-* This routine selects the input device mic or linein.
-*/
-
-t_ab8500_codec_error u8500_acodec_select_input(t_ab8500_codec_src
- input_device,
- t_acodec_user user,
- t_u8500_mode mode)
-{
-
- t_ab8500_codec_error codec_error = AB8500_CODEC_OK;
-
- stm_dbg(DBG_ST.acodec, " Entering u8500_acodec_select_input\n");
-
- if (TDM_8_CH_MODE == mode)
- u8500_acodec_allocate_ad_slot(input_device, TDM_8_CH_MODE);
- else
- u8500_acodec_allocate_ad_slot(input_device, CLASSICAL_MODE);
-
- codec_error = AB8500_CODEC_SelectInput(input_device);
-
- stm_dbg(DBG_ST.acodec, " leaving u8500_acodec_select_input\n");
- return codec_error;
-}
-
-/**
-* u8500_acodec_select_output
-* @output_device: output device HP/LSP
-*
-* This routine selects the output device Headphone or loud speaker
-*/
-
-t_ab8500_codec_error u8500_acodec_select_output(t_ab8500_codec_dest
- output_device,
- t_acodec_user user,
- t_u8500_mode mode)
-{
-
- t_ab8500_codec_error codec_error = AB8500_CODEC_OK;
-
- FUNC_ENTER();
- stm_dbg(DBG_ST.acodec, " Entering u8500_acodec_select_output()\n");
-
- if (TDM_8_CH_MODE == mode)
- u8500_acodec_allocate_da_slot(output_device, TDM_8_CH_MODE);
- else
- u8500_acodec_allocate_da_slot(output_device, CLASSICAL_MODE);
-
- codec_error = AB8500_CODEC_SelectOutput(output_device);
-
- stm_dbg(DBG_ST.acodec, " leaving u8500_acodec_select_output()\n");
- FUNC_EXIT();
- return codec_error;
-}
-
-t_ab8500_codec_error u8500_acodec_allocate_ad_slot(t_ab8500_codec_src
- input_device,
- t_u8500_mode mode)
-{
- t_ab8500_codec_cr31_to_cr46_ad_data_allocation ad_data_line1,
- ad_data_line2;
- t_ab8500_codec_slot slot1, slot2;
- t_ab8500_codec_error codec_error = AB8500_CODEC_OK;
-
- slot1 = AB8500_CODEC_SLOT_UNDEFINED;
- slot2 = AB8500_CODEC_SLOT_UNDEFINED;
-
- ad_data_line1 =
- AB8500_CODEC_CR31_TO_CR46_SLOT_OUTPUTS_DATA_FROM_AD_UNDEFINED;
- ad_data_line2 =
- AB8500_CODEC_CR31_TO_CR46_SLOT_OUTPUTS_DATA_FROM_AD_UNDEFINED;
-
- switch (input_device) {
- case AB8500_CODEC_SRC_D_MICROPHONE_1:
- {
- slot1 = AB8500_CODEC_SLOT0;
- ad_data_line1 =
- AB8500_CODEC_CR31_TO_CR46_SLOT_OUTPUTS_DATA_FROM_AD_OUT1;
- }
- break;
- case AB8500_CODEC_SRC_MICROPHONE_2:
- case AB8500_CODEC_SRC_D_MICROPHONE_2:
- {
- slot1 = AB8500_CODEC_SLOT1;
- ad_data_line1 =
- AB8500_CODEC_CR31_TO_CR46_SLOT_OUTPUTS_DATA_FROM_AD_OUT2;
- }
- break;
- case AB8500_CODEC_SRC_D_MICROPHONE_3:
- case AB8500_CODEC_SRC_MICROPHONE_1A:
- case AB8500_CODEC_SRC_MICROPHONE_1B:
- {
- slot1 = AB8500_CODEC_SLOT2;
- ad_data_line1 =
- AB8500_CODEC_CR31_TO_CR46_SLOT_OUTPUTS_DATA_FROM_AD_OUT3;
- }
- break;
- case AB8500_CODEC_SRC_D_MICROPHONE_4:
- {
- slot1 = AB8500_CODEC_SLOT3;
- ad_data_line1 =
- AB8500_CODEC_CR31_TO_CR46_SLOT_OUTPUTS_DATA_FROM_AD_OUT4;
- }
- break;
- case AB8500_CODEC_SRC_D_MICROPHONE_5:
- {
- slot1 = AB8500_CODEC_SLOT4;
- ad_data_line1 =
- AB8500_CODEC_CR31_TO_CR46_SLOT_OUTPUTS_DATA_FROM_AD_OUT5;
- }
- break;
- case AB8500_CODEC_SRC_D_MICROPHONE_6:
- {
- slot1 = AB8500_CODEC_SLOT5;
- ad_data_line1 =
- AB8500_CODEC_CR31_TO_CR46_SLOT_OUTPUTS_DATA_FROM_AD_OUT6;
- }
- break;
- case AB8500_CODEC_SRC_LINEIN:
- {
- slot1 = AB8500_CODEC_SLOT0;
- ad_data_line1 =
- AB8500_CODEC_CR31_TO_CR46_SLOT_OUTPUTS_DATA_FROM_AD_OUT1;
-
- slot2 = AB8500_CODEC_SLOT1;
- ad_data_line2 =
- AB8500_CODEC_CR31_TO_CR46_SLOT_OUTPUTS_DATA_FROM_AD_OUT2;
- }
- case AB8500_CODEC_SRC_FM_RX:
- {
- slot1 = AB8500_CODEC_SLOT6;
- ad_data_line1 =
- AB8500_CODEC_CR31_TO_CR46_SLOT_OUTPUTS_DATA_FROM_AD_OUT7;
-
- slot2 = AB8500_CODEC_SLOT7;
- ad_data_line2 =
- AB8500_CODEC_CR31_TO_CR46_SLOT_OUTPUTS_DATA_FROM_AD_OUT8;
- }
- break;
- case AB8500_CODEC_SRC_ALL:
- break;
- }
-
- if ((AB8500_CODEC_SLOT_UNDEFINED != slot1)
- && (AB8500_CODEC_CR31_TO_CR46_SLOT_OUTPUTS_DATA_FROM_AD_UNDEFINED !=
- ad_data_line1)) {
- if (CLASSICAL_MODE == mode) {
- slot1 = AB8500_CODEC_SLOT0;
- }
- codec_error =
- AB8500_CODEC_ADSlotAllocation(slot1, ad_data_line1);
- if (AB8500_CODEC_OK != codec_error) {
- stm_error("ab8500_codec_adslot_allocation failed\n");
- return AB8500_CODEC_ERROR;
- }
- }
-
- if ((AB8500_CODEC_SLOT_UNDEFINED != slot2)
- && (AB8500_CODEC_CR31_TO_CR46_SLOT_OUTPUTS_DATA_FROM_AD_UNDEFINED !=
- ad_data_line2)) {
- if (CLASSICAL_MODE == mode) {
- slot2 = AB8500_CODEC_SLOT1;
- }
- codec_error =
- AB8500_CODEC_ADSlotAllocation(slot2, ad_data_line2);
- if (AB8500_CODEC_OK != codec_error) {
- stm_error("ab8500_codec_adslot_allocation failed\n");
- return AB8500_CODEC_ERROR;
- }
- }
-
- return AB8500_CODEC_OK;
-}
-
-t_ab8500_codec_error u8500_acodec_unallocate_ad_slot(t_ab8500_codec_src
- input_device,
- t_u8500_mode mode)
-{
- t_ab8500_codec_slot slot1, slot2;
- t_ab8500_codec_error codec_error = AB8500_CODEC_OK;
-
- slot1 = AB8500_CODEC_SLOT_UNDEFINED;
- slot2 = AB8500_CODEC_SLOT_UNDEFINED;
-
- switch (input_device) {
- case AB8500_CODEC_SRC_D_MICROPHONE_1:
- {
- slot1 = AB8500_CODEC_SLOT0;
- }
- break;
- case AB8500_CODEC_SRC_MICROPHONE_2:
- case AB8500_CODEC_SRC_D_MICROPHONE_2:
- {
- slot1 = AB8500_CODEC_SLOT1;
- }
- break;
- case AB8500_CODEC_SRC_D_MICROPHONE_3:
- case AB8500_CODEC_SRC_MICROPHONE_1A:
- case AB8500_CODEC_SRC_MICROPHONE_1B:
- {
- slot1 = AB8500_CODEC_SLOT2;
- }
- break;
- case AB8500_CODEC_SRC_D_MICROPHONE_4:
- {
- slot1 = AB8500_CODEC_SLOT3;
- }
- break;
- case AB8500_CODEC_SRC_D_MICROPHONE_5:
- {
- slot1 = AB8500_CODEC_SLOT4;
- }
- break;
- case AB8500_CODEC_SRC_D_MICROPHONE_6:
- {
- slot1 = AB8500_CODEC_SLOT5;
- }
- break;
- case AB8500_CODEC_SRC_LINEIN:
- {
- slot1 = AB8500_CODEC_SLOT0;
- slot2 = AB8500_CODEC_SLOT1;
- }
- break;
- case AB8500_CODEC_SRC_ALL:
- break;
- }
-
- if (AB8500_CODEC_SLOT_UNDEFINED != slot1) {
- if (CLASSICAL_MODE == mode) {
- slot1 = AB8500_CODEC_SLOT0;
- }
- codec_error =
- AB8500_CODEC_ADSlotAllocation(slot1,
- AB8500_CODEC_CR31_TO_CR46_SLOT_IS_TRISTATE);
- if (AB8500_CODEC_OK != codec_error) {
- stm_error("ab8500_codec_adslot_allocation failed\n");
- return AB8500_CODEC_ERROR;
- }
- }
-
- if (AB8500_CODEC_SLOT_UNDEFINED != slot2) {
- if (CLASSICAL_MODE == mode) {
- slot2 = AB8500_CODEC_SLOT1;
- }
- codec_error =
- AB8500_CODEC_ADSlotAllocation(slot2,
- AB8500_CODEC_CR31_TO_CR46_SLOT_IS_TRISTATE);
- if (AB8500_CODEC_OK != codec_error) {
- stm_error("ab8500_codec_adslot_allocation failed\n");
- return AB8500_CODEC_ERROR;
- }
- }
-
- return AB8500_CODEC_OK;
-}
-
-#ifdef CONFIG_U8500_AB8500_CUT10
-t_ab8500_codec_error u8500_acodec_allocate_da_slot(t_ab8500_codec_dest
- output_device,
- t_u8500_mode mode)
-{
- t_ab8500_codec_da_channel_number da_ch_no1, da_ch_no2;
- t_ab8500_codec_cr51_to_cr58_sltoda da_slot1, da_slot2;
- t_ab8500_codec_error codec_error = AB8500_CODEC_OK;
-
- da_ch_no1 = AB8500_CODEC_DA_CHANNEL_NUMBER_UNDEFINED;
- da_ch_no2 = AB8500_CODEC_DA_CHANNEL_NUMBER_UNDEFINED;
-
- da_slot1 = AB8500_CODEC_CR51_TO_CR58_SLTODA_SLOT_UNDEFINED;
- da_slot2 = AB8500_CODEC_CR51_TO_CR58_SLTODA_SLOT_UNDEFINED;
-
- switch (output_device) {
- case AB8500_CODEC_DEST_HEADSET:
- {
- da_ch_no1 = AB8500_CODEC_DA_CHANNEL_NUMBER_1;
- da_slot1 = AB8500_CODEC_CR51_TO_CR58_SLTODA_SLOT08;
-
- da_ch_no2 = AB8500_CODEC_DA_CHANNEL_NUMBER_2;
- da_slot2 = AB8500_CODEC_CR51_TO_CR58_SLTODA_SLOT09;
- }
- break;
- case AB8500_CODEC_DEST_EARPIECE:
- {
- da_ch_no1 = AB8500_CODEC_DA_CHANNEL_NUMBER_1;
- da_slot1 = AB8500_CODEC_CR51_TO_CR58_SLTODA_SLOT08;
- }
- break;
- case AB8500_CODEC_DEST_HANDSFREE:
- {
- da_ch_no1 = AB8500_CODEC_DA_CHANNEL_NUMBER_3;
- da_slot1 = AB8500_CODEC_CR51_TO_CR58_SLTODA_SLOT10;
-
- da_ch_no2 = AB8500_CODEC_DA_CHANNEL_NUMBER_4;
- da_slot2 = AB8500_CODEC_CR51_TO_CR58_SLTODA_SLOT11;
- }
- break;
- case AB8500_CODEC_DEST_VIBRATOR_L:
- {
- da_ch_no1 = AB8500_CODEC_DA_CHANNEL_NUMBER_5;
- da_slot1 = AB8500_CODEC_CR51_TO_CR58_SLTODA_SLOT12;
- }
- break;
- case AB8500_CODEC_DEST_VIBRATOR_R:
- {
- da_ch_no1 = AB8500_CODEC_DA_CHANNEL_NUMBER_6;
- da_slot1 = AB8500_CODEC_CR51_TO_CR58_SLTODA_SLOT13;
- }
- break;
-
- case AB8500_CODEC_DEST_FM_TX:
- {
- da_ch_no1 = AB8500_CODEC_DA_CHANNEL_NUMBER_7;
- da_slot1 = AB8500_CODEC_CR51_TO_CR58_SLTODA_SLOT14;
-
- da_ch_no2 = AB8500_CODEC_DA_CHANNEL_NUMBER_8;
- da_slot2 = AB8500_CODEC_CR51_TO_CR58_SLTODA_SLOT15;
- }
-
- case AB8500_CODEC_DEST_ALL:
- break;
- }
-
- if ((AB8500_CODEC_DA_CHANNEL_NUMBER_UNDEFINED != da_ch_no1)
- && (AB8500_CODEC_CR51_TO_CR58_SLTODA_SLOT_UNDEFINED != da_slot1)) {
- if (CLASSICAL_MODE == mode) {
- da_slot1 = AB8500_CODEC_CR51_TO_CR58_SLTODA_SLOT08;
- }
- codec_error =
- AB8500_CODEC_DASlotAllocation(da_ch_no1, da_slot1);
- if (AB8500_CODEC_OK != codec_error) {
- stm_error("ab8500_codec_daslot_allocation failed\n");
- return AB8500_CODEC_ERROR;
- }
- }
-
- if ((AB8500_CODEC_DA_CHANNEL_NUMBER_UNDEFINED != da_ch_no2)
- && (AB8500_CODEC_CR51_TO_CR58_SLTODA_SLOT_UNDEFINED != da_slot2)) {
- if (CLASSICAL_MODE == mode) {
- da_slot1 = AB8500_CODEC_CR51_TO_CR58_SLTODA_SLOT09;
- }
- codec_error =
- AB8500_CODEC_DASlotAllocation(da_ch_no2, da_slot2);
- if (AB8500_CODEC_OK != codec_error) {
- stm_error("ab8500_codec_daslot_allocation failed\n");
- return AB8500_CODEC_ERROR;
- }
- }
-
- return AB8500_CODEC_OK;
-}
-
-#else
-t_ab8500_codec_error u8500_acodec_allocate_da_slot(t_ab8500_codec_dest
- output_device,
- t_u8500_mode mode)
-{
- t_ab8500_codec_da_channel_number da_ch_no1, da_ch_no2;
- t_ab8500_codec_cr51_to_cr56_sltoda da_slot1, da_slot2;
- t_ab8500_codec_error codec_error = AB8500_CODEC_OK;
-
- da_ch_no1 = AB8500_CODEC_DA_CHANNEL_NUMBER_UNDEFINED;
- da_ch_no2 = AB8500_CODEC_DA_CHANNEL_NUMBER_UNDEFINED;
-
- da_slot1 = AB8500_CODEC_CR51_TO_CR56_SLTODA_SLOT_UNDEFINED;
- da_slot2 = AB8500_CODEC_CR51_TO_CR56_SLTODA_SLOT_UNDEFINED;
-
- switch (output_device) {
- case AB8500_CODEC_DEST_HEADSET:
- {
- da_ch_no1 = AB8500_CODEC_DA_CHANNEL_NUMBER_1;
- da_slot1 = AB8500_CODEC_CR51_TO_CR56_SLTODA_SLOT08;
-
- da_ch_no2 = AB8500_CODEC_DA_CHANNEL_NUMBER_2;
- da_slot2 = AB8500_CODEC_CR51_TO_CR56_SLTODA_SLOT09;
- }
- break;
- case AB8500_CODEC_DEST_EARPIECE:
- {
- da_ch_no1 = AB8500_CODEC_DA_CHANNEL_NUMBER_1;
- da_slot1 = AB8500_CODEC_CR51_TO_CR56_SLTODA_SLOT08;
- }
- break;
- case AB8500_CODEC_DEST_HANDSFREE:
- {
- da_ch_no1 = AB8500_CODEC_DA_CHANNEL_NUMBER_3;
- da_slot1 = AB8500_CODEC_CR51_TO_CR56_SLTODA_SLOT10;
-
- da_ch_no2 = AB8500_CODEC_DA_CHANNEL_NUMBER_4;
- da_slot2 = AB8500_CODEC_CR51_TO_CR56_SLTODA_SLOT11;
- }
- break;
- case AB8500_CODEC_DEST_VIBRATOR_L:
- {
- da_ch_no1 = AB8500_CODEC_DA_CHANNEL_NUMBER_5;
- da_slot1 = AB8500_CODEC_CR51_TO_CR56_SLTODA_SLOT12;
- }
- break;
- case AB8500_CODEC_DEST_VIBRATOR_R:
- {
- da_ch_no1 = AB8500_CODEC_DA_CHANNEL_NUMBER_6;
- da_slot1 = AB8500_CODEC_CR51_TO_CR56_SLTODA_SLOT13;
- }
- break;
-
- case AB8500_CODEC_DEST_ALL:
- break;
- }
-
- if ((AB8500_CODEC_DA_CHANNEL_NUMBER_UNDEFINED != da_ch_no1)
- && (AB8500_CODEC_CR51_TO_CR56_SLTODA_SLOT_UNDEFINED != da_slot1)) {
- if (CLASSICAL_MODE == mode) {
- da_slot1 = AB8500_CODEC_CR51_TO_CR56_SLTODA_SLOT08;
- }
- codec_error =
- AB8500_CODEC_DASlotAllocation(da_ch_no1, da_slot1);
- if (AB8500_CODEC_OK != codec_error) {
- stm_error("ab8500_codec_daslot_allocation failed\n");
- return AB8500_CODEC_ERROR;
- }
- }
-
- if ((AB8500_CODEC_DA_CHANNEL_NUMBER_UNDEFINED != da_ch_no2)
- && (AB8500_CODEC_CR51_TO_CR56_SLTODA_SLOT_UNDEFINED != da_slot2)) {
- if (CLASSICAL_MODE == mode) {
- da_slot1 = AB8500_CODEC_CR51_TO_CR56_SLTODA_SLOT09;
- }
- codec_error =
- AB8500_CODEC_DASlotAllocation(da_ch_no2, da_slot2);
- if (AB8500_CODEC_OK != codec_error) {
- stm_error("ab8500_codec_daslot_allocation failed\n");
- return AB8500_CODEC_ERROR;
- }
- }
-
- return AB8500_CODEC_OK;
-}
-#endif
-
-t_ab8500_codec_error u8500_acodec_unallocate_da_slot(t_ab8500_codec_dest
- output_device,
- t_u8500_mode mode)
-{
- return AB8500_CODEC_OK;
-}
-
-t_ab8500_codec_error u8500_acodec_set_src_power_cntrl(t_ab8500_codec_src
- input_device,
- t_u8500_bool_state
- pwr_state)
-{
- t_ab8500_codec_error codec_error = AB8500_CODEC_OK;
-
- if (ENABLE == pwr_state) {
- u8500_acodec_allocate_ad_slot(input_device, TDM_8_CH_MODE);
- codec_error =
- AB8500_CODEC_SrcPowerControl(input_device,
- AB8500_CODEC_SRC_STATE_ENABLE);
- if (AB8500_CODEC_OK != codec_error) {
- stm_error("AB8500_CODEC_SrcPowerControl failed\n");
- return AB8500_CODEC_ERROR;
- }
- g_codec_system_context.input_config[input_device].power_state =
- ENABLE;
- } else {
- u8500_acodec_unallocate_ad_slot(input_device, TDM_8_CH_MODE);
- codec_error =
- AB8500_CODEC_SrcPowerControl(input_device,
- AB8500_CODEC_SRC_STATE_DISABLE);
- if (AB8500_CODEC_OK != codec_error) {
- stm_error("AB8500_CODEC_SrcPowerControl failed\n");
- return AB8500_CODEC_ERROR;
- }
- g_codec_system_context.input_config[input_device].power_state =
- DISABLE;
- }
-
- return AB8500_CODEC_OK;
-}
-
-t_u8500_bool_state u8500_acodec_get_src_power_state(t_ab8500_codec_src
- input_device)
-{
- return (g_codec_system_context.input_config[input_device].power_state);
-}
-
-t_ab8500_codec_error u8500_acodec_set_dest_power_cntrl(t_ab8500_codec_dest
- output_device,
- t_u8500_bool_state
- pwr_state)
-{
- t_ab8500_codec_error codec_error = AB8500_CODEC_OK;
-
- if (ENABLE == pwr_state) {
- AB8500_CODEC_SelectInterface(AB8500_CODEC_AUDIO_INTERFACE_0);
-
- codec_error = AB8500_CODEC_PowerUp();
- if (AB8500_CODEC_OK != codec_error) {
- stm_error("AB8500_CODEC_PowerUp failed\n");
- return AB8500_CODEC_ERROR;
- }
-
- u8500_acodec_allocate_da_slot(output_device, TDM_8_CH_MODE);
-
- codec_error =
- AB8500_CODEC_DestPowerControl(output_device,
- AB8500_CODEC_DEST_STATE_ENABLE);
- if (AB8500_CODEC_OK != codec_error) {
- stm_error("AB8500_CODEC_DestPowerControl failed\n");
- return AB8500_CODEC_ERROR;
- }
- g_codec_system_context.output_config[output_device].
- power_state = ENABLE;
- } else {
- u8500_acodec_unallocate_da_slot(output_device, TDM_8_CH_MODE);
- codec_error =
- AB8500_CODEC_DestPowerControl(output_device,
- AB8500_CODEC_DEST_STATE_DISABLE);
- if (AB8500_CODEC_OK != codec_error) {
- stm_error("AB8500_CODEC_DestPowerControl failed\n");
- return AB8500_CODEC_ERROR;
- }
- g_codec_system_context.output_config[output_device].
- power_state = DISABLE;
- }
-
- return AB8500_CODEC_OK;
-}
-
-t_u8500_bool_state u8500_acodec_get_dest_power_state(t_ab8500_codec_dest
- output_device)
-{
- return (g_codec_system_context.output_config[output_device].
- power_state);
-}
-
-/**
-* u8500_acodec_toggle_analog_lpbk
-* @output_device: output device HP/LSP
-*
-* This routine selects the output device Headphone or loud speaker
-*/
-t_ab8500_codec_error u8500_acodec_toggle_analog_lpbk(t_u8500_bool_state
- lpbk_state,
- t_acodec_user user)
-{
- t_ab8500_codec_error codec_error = AB8500_CODEC_OK;
-
- stm_dbg(DBG_ST.acodec,
- " Entering inu8500_acodec_toggle_analog_lpbk() \n");
-
- user = user; //keep compiler happy
-
- if (ENABLE == lpbk_state) {
- /* Reset CODEC */
- codec_error = AB8500_CODEC_Reset();
-
- AB8500_CODEC_SelectInterface(AB8500_CODEC_AUDIO_INTERFACE_0);
-
- codec_error = AB8500_CODEC_PowerUp();
- if (AB8500_CODEC_OK != codec_error) {
- stm_error("AB8500_CODEC_PowerUp failed\n");
- return AB8500_CODEC_ERROR;
- }
-
- codec_error = AB8500_CODEC_SelectInput(AB8500_CODEC_SRC_LINEIN);
-
- codec_error =
- AB8500_CODEC_SrcPowerControl(AB8500_CODEC_SRC_LINEIN,
- AB8500_CODEC_SRC_STATE_ENABLE);
-
- //codec_error = AB8500_CODEC_SetSrcVolume(AB8500_CODEC_SRC_LINEIN,VOL_MAX,VOL_MAX);
-
- codec_error =
- AB8500_CODEC_SelectOutput(AB8500_CODEC_DEST_HEADSET);
-
- codec_error =
- AB8500_CODEC_DestPowerControl(AB8500_CODEC_DEST_HEADSET,
- AB8500_CODEC_DEST_STATE_ENABLE);
-
- //codec_error = AB8500_CODEC_SetDestVolume(AB8500_CODEC_DEST_HEADSET,0,0);
-
- codec_error = AB8500_CODEC_SetAnalogLoopback(VOL_MAX, VOL_MAX);
-
- ab8500_write(AB8500_AUDIO, 0xd05, 0x30);
- ab8500_write(AB8500_AUDIO, 0xd07, 0xf3);
- ab8500_write(AB8500_AUDIO, 0xd16, 0xdd);
- ab8500_write(AB8500_AUDIO, 0xd17, 0x55);
- ab8500_write(AB8500_AUDIO, 0xd3f, 0xc0);
-
- } else {
- codec_error = AB8500_CODEC_RemoveAnalogLoopback();
- }
-
-#if DRIVER_DEBUG > 0
- {
- dump_acodec_registers();
- }
-#endif
-
- return codec_error;
-}
-
-#ifdef CONFIG_U8500_ACODEC_POLL
-
-static int digital_lpbk_msp_rx_tx_thread(void *data)
-{
- t_digital_lpbk_cnxt *p_cnxt = (t_digital_lpbk_cnxt *) data;
- unsigned int sample[8], count = 32;
-
- daemonize("digital_lpbk_msp_rx_tx_thread");
- allow_signal(SIGKILL);
-
- printk("\n Rx-Tx : digital_lpbk_msp_rx_tx_thread started \n");
-
- while ((!signal_pending(current)) && (p_cnxt->rx_active)) {
-
-// ret_val = u8500_msp_receive_data(alsa_msp_adev,p_cnxt->buffer[p_cnxt->rx_index],p_cnxt->data_size);
-
- //u8500_msp_transceive_data(alsa_msp_adev,p_cnxt->buffer[0], p_cnxt->data_size,p_cnxt->buffer[1], p_cnxt->data_size);
-
- //u8500_msp_transceive_data(alsa_msp_adev,p_cnxt->buffer[1], p_cnxt->data_size,p_cnxt->buffer[0], p_cnxt->data_size);
-
-#if DRIVER_DEBUG > 1
- stm_dbg(DBG_ST.alsa, " Receiving \n");
-#endif
- u8500_acodec_receive_data(I2S_CLIENT_MSP1, (void *)sample,
- count, 0);
-
-#if DRIVER_DEBUG > 1
- stm_dbg(DBG_ST.alsa, " Transmitting \n");
-#endif
- u8500_acodec_send_data(I2S_CLIENT_MSP1, (void *)sample, count,
- 0);
-
- }
- printk("\n Rx-Tx : digital_lpbk_msp_rx_tx_thread ended \n");
- return 0;
-}
-
-#endif
-
-#ifdef CONFIG_U8500_ACODEC_DMA
-
-static void u8500_digital_lpbk_dma_start()
-{
- u8500_acodec_loopback_configure(I2S_CLIENT_MSP1,
- (void *)digital_lpbk_cnxt.buffer.addr,
- digital_lpbk_cnxt.data_size, 1);
-
- stm_dbg(DBG_ST.alsa, " Rx DMA Transfer started\n");
- stm_dbg(DBG_ST.alsa, " Rx : add = %x size=%d\n",
- (int)(digital_lpbk_cnxt.buffer.addr),
- digital_lpbk_cnxt.data_size);
-
-}
-#endif
-
-/**
-* u8500_acodec_toggle_digital_lpbk
-* @output_device: output device HP/LSP
-*
-* This routine selects the output device Headphone or loud speaker
-*/
-
-t_ab8500_codec_error u8500_acodec_toggle_digital_lpbk(t_u8500_bool_state
- lpbk_state,
- t_ab8500_codec_dest
- dest_device,
- t_ab8500_codec_src
- src_device,
- t_acodec_user user,
- t_u8500_bool_state
- tdm8_ch_mode)
-{
- t_ab8500_codec_error codec_error = AB8500_CODEC_OK;
- struct acodec_configuration acodec_config;
- int status = 0;
-
- stm_dbg(DBG_ST.acodec,
- " Entering u8500_acodec_toggle_digital_lpbk() \n");
-
- user = user; //keep compiler happy
-
- if (ENABLE == lpbk_state) {
- //data_size = 1024*100;
-
- //data[0] = (unsigned char *)kmalloc(data_size, GFP_KERNEL);
-
- codec_error = AB8500_CODEC_Reset();
-
- //AB8500_CODEC_SelectInterface(AB8500_CODEC_AUDIO_INTERFACE_0);
-
- //codec_error = AB8500_CODEC_PowerUp();
- if (AB8500_CODEC_OK != codec_error) {
- stm_error("AB8500_CODEC_PowerUp failed\n");
- return AB8500_CODEC_ERROR;
- }
-
- status = u8500_acodec_open(I2S_CLIENT_MSP1, 0);
- if (status) {
- printk("failed in getting acodec playback open\n");
- return -1;
- }
- status = u8500_acodec_open(I2S_CLIENT_MSP1, 1);
- if (status) {
- printk("failed in getting acdoec capture open\n");
- return -1;
- }
-
- u8500_acodec_setuser(USER_ALSA);
-
- if (ENABLE == tdm8_ch_mode) {
- printk("\n 20 bit 8 ch Digital Loopback");
- printk("\n DMIC1 -> HS-L");
- printk("\n DMIC2 -> HS-R");
- printk("\n DMIC3 -> IHF-L");
- printk("\n DMIC5 -> Vibra-L\n");
- printk("\n DMIC6 -> Vibra-R\n");
- printk("\n FM -> FM Tx\n");
- } else {
- printk("\n 16 bit 2 ch Digital Loopback");
- printk("\n DMIC1 -> HS-L");
- printk("\n DMIC2 -> HS-R");
- }
-
- stm_dbg(DBG_ST.alsa, "enabling audiocodec audio mode\n");
- acodec_config.direction = AB8500_CODEC_DIRECTION_INOUT;
- acodec_config.input_frequency = T_CODEC_SAMPLING_FREQ_48KHZ;
- acodec_config.output_frequency = T_CODEC_SAMPLING_FREQ_48KHZ;
- acodec_config.mspClockSel = CODEC_MSP_APB_CLOCK;
- acodec_config.mspInClockFreq = CODEC_MSP_INPUT_FREQ_48MHZ;
- acodec_config.channels = 2;
- acodec_config.user = 2;
- acodec_config.acodec_config_need = ACODEC_CONFIG_REQUIRED;
- acodec_config.direct_rendering_mode = DISABLE;
- acodec_config.tdm8_ch_mode = tdm8_ch_mode;
- acodec_config.digital_loopback = ENABLE;
-#ifdef CONFIG_U8500_ACODEC_POLL
- acodec_config.handler = NULL;
- acodec_config.tx_callback_data = NULL;
- acodec_config.rx_callback_data = NULL;
-#endif
- u8500_acodec_enable_audio_mode(&acodec_config);
-
- /*turn on src devices */
-
- perform_src_routing(src_device);
-
-/* u8500_acodec_set_src_power_cntrl(src_device,ENABLE);
- u8500_acodec_set_input_volume(src_device,50,50,USER_ALSA);
-
- u8500_acodec_set_src_power_cntrl(AB8500_CODEC_SRC_D_MICROPHONE_2,ENABLE);
- u8500_acodec_set_input_volume(AB8500_CODEC_SRC_D_MICROPHONE_2,50,50,USER_ALSA);
-
- u8500_acodec_set_src_power_cntrl(AB8500_CODEC_SRC_D_MICROPHONE_3,ENABLE);
- u8500_acodec_set_input_volume(AB8500_CODEC_SRC_D_MICROPHONE_3,50,50,USER_ALSA);
-
- u8500_acodec_set_src_power_cntrl(AB8500_CODEC_SRC_D_MICROPHONE_4,ENABLE);
- u8500_acodec_set_input_volume(AB8500_CODEC_SRC_D_MICROPHONE_4,50,50,USER_ALSA);
-
- u8500_acodec_set_src_power_cntrl(AB8500_CODEC_SRC_D_MICROPHONE_5,ENABLE);
- u8500_acodec_set_input_volume(AB8500_CODEC_SRC_D_MICROPHONE_5,50,50,USER_ALSA);
-
- u8500_acodec_set_src_power_cntrl(AB8500_CODEC_SRC_D_MICROPHONE_6,ENABLE);
- u8500_acodec_set_input_volume(AB8500_CODEC_SRC_D_MICROPHONE_6,50,50,USER_ALSA);
-
- u8500_acodec_set_src_power_cntrl(AB8500_CODEC_SRC_D_MICROPHONE_6,ENABLE);
- u8500_acodec_set_input_volume(AB8500_CODEC_SRC_D_MICROPHONE_6,50,50,USER_ALSA);
-
- u8500_acodec_set_src_power_cntrl(AB8500_CODEC_SRC_FM_RX,ENABLE); */
-
- /*turn on dest devices */
-
- //u8500_acodec_set_dest_power_cntrl(dest_device,ENABLE);
- u8500_acodec_allocate_da_slot(dest_device, TDM_8_CH_MODE);
- codec_error = AB8500_CODEC_SelectOutput(dest_device);
- u8500_acodec_set_output_volume(dest_device, 100, 100,
- USER_ALSA);
-
- /*u8500_acodec_set_dest_power_cntrl(AB8500_CODEC_DEST_HEADSET,ENABLE);
- u8500_acodec_set_output_volume(AB8500_CODEC_DEST_HEADSET,100,100,USER_ALSA); */
-
- /*u8500_acodec_set_dest_power_cntrl(AB8500_CODEC_DEST_HANDSFREE,ENABLE);
- u8500_acodec_set_output_volume(AB8500_CODEC_DEST_HANDSFREE,100,100,USER_ALSA); */
-
-#ifdef CONFIG_U8500_AB8500_CUT10
- codec_error =
- AB8500_CODEC_DASlotAllocation
- (AB8500_CODEC_DA_CHANNEL_NUMBER_5,
- AB8500_CODEC_CR51_TO_CR58_SLTODA_SLOT12);
- if (AB8500_CODEC_OK != codec_error) {
- stm_error("ab8500_codec_daslot_allocation failed\n");
- return AB8500_CODEC_ERROR;
- }
-
- codec_error =
- AB8500_CODEC_DASlotAllocation
- (AB8500_CODEC_DA_CHANNEL_NUMBER_6,
- AB8500_CODEC_CR51_TO_CR58_SLTODA_SLOT13);
- if (AB8500_CODEC_OK != codec_error) {
- stm_error("ab8500_codec_daslot_allocation failed\n");
- return AB8500_CODEC_ERROR;
- }
-
- codec_error =
- AB8500_CODEC_DASlotAllocation
- (AB8500_CODEC_DA_CHANNEL_NUMBER_7,
- AB8500_CODEC_CR51_TO_CR58_SLTODA_SLOT14);
- if (AB8500_CODEC_OK != codec_error) {
- stm_error("ab8500_codec_daslot_allocation failed\n");
- return AB8500_CODEC_ERROR;
- }
-
- codec_error =
- AB8500_CODEC_DASlotAllocation
- (AB8500_CODEC_DA_CHANNEL_NUMBER_8,
- AB8500_CODEC_CR51_TO_CR58_SLTODA_SLOT15);
- if (AB8500_CODEC_OK != codec_error) {
- stm_error("ab8500_codec_daslot_allocation failed\n");
- return AB8500_CODEC_ERROR;
- }
-#else
- codec_error =
- AB8500_CODEC_DASlotAllocation
- (AB8500_CODEC_DA_CHANNEL_NUMBER_5,
- AB8500_CODEC_CR51_TO_CR56_SLTODA_SLOT12);
- if (AB8500_CODEC_OK != codec_error) {
- stm_error("ab8500_codec_daslot_allocation failed\n");
- return AB8500_CODEC_ERROR;
- }
-
- codec_error =
- AB8500_CODEC_DASlotAllocation
- (AB8500_CODEC_DA_CHANNEL_NUMBER_6,
- AB8500_CODEC_CR51_TO_CR56_SLTODA_SLOT13);
- if (AB8500_CODEC_OK != codec_error) {
- stm_error("ab8500_codec_daslot_allocation failed\n");
- return AB8500_CODEC_ERROR;
- }
-#endif
-
- digital_lpbk_cnxt.data_size = 2048;
-
- digital_lpbk_cnxt.rx_active = 1;
- digital_lpbk_cnxt.tx_active = 1;
-
- digital_lpbk_cnxt.rx_index = 0;
- digital_lpbk_cnxt.tx_index = 2;
-
- digital_lpbk_cnxt.buffer.area =
- dma_alloc_coherent(NULL, digital_lpbk_cnxt.data_size,
- &digital_lpbk_cnxt.buffer.addr,
- GFP_KERNEL);
- if (NULL == digital_lpbk_cnxt.buffer.area) {
- printk("\n dma_alloc_coherent failed \n");
- }
-#if DRIVER_DEBUG > 0
- {
- dump_msp_registers();
- dump_acodec_registers();
- }
-#endif
-
-#ifdef CONFIG_U8500_ACODEC_POLL
- {
- pid_t pid_rx_tx;
- pid_rx_tx =
- kernel_thread(digital_lpbk_msp_rx_tx_thread,
- &digital_lpbk_cnxt,
- CLONE_FS | CLONE_SIGHAND);
- }
-#elif defined(CONFIG_U8500_ACODEC_DMA)
- {
- u8500_digital_lpbk_dma_start();
- }
-#endif
- } else //lpbk is disable
- {
-
- digital_lpbk_cnxt.rx_active = 0;
- digital_lpbk_cnxt.tx_active = 0;
-
- dma_free_coherent(NULL, digital_lpbk_cnxt.data_size,
- digital_lpbk_cnxt.buffer.area,
- digital_lpbk_cnxt.buffer.addr);
-
- u8500_acodec_set_src_power_cntrl
- (AB8500_CODEC_SRC_D_MICROPHONE_1, DISABLE);
- u8500_acodec_set_src_power_cntrl
- (AB8500_CODEC_SRC_D_MICROPHONE_2, DISABLE);
- u8500_acodec_set_src_power_cntrl
- (AB8500_CODEC_SRC_D_MICROPHONE_3, DISABLE);
- u8500_acodec_set_src_power_cntrl
- (AB8500_CODEC_SRC_D_MICROPHONE_4, DISABLE);
-
- u8500_acodec_set_dest_power_cntrl(AB8500_CODEC_DEST_HEADSET,
- DISABLE);
- u8500_acodec_set_dest_power_cntrl(AB8500_CODEC_DEST_HANDSFREE,
- DISABLE);
-
- u8500_acodec_unsetuser(USER_ALSA);
- u8500_acodec_close(I2S_CLIENT_MSP1, ACODEC_DISABLE_ALL);
- }
- return codec_error;
-}
-
-t_ab8500_codec_error perform_src_routing(t_ab8500_codec_src input_device)
-{
- int src_type = 0;
- t_ab8500_codec_cr31_to_cr46_ad_data_allocation ad_data_line1;
- t_ab8500_codec_cr31_to_cr46_ad_data_allocation ad_data_line2;
- t_ab8500_codec_src input_device1;
- t_ab8500_codec_src input_device2;
- t_ab8500_codec_error codec_error = AB8500_CODEC_OK;
-
- switch (input_device) {
- case AB8500_CODEC_SRC_D_MICROPHONE_1:
- {
- src_type = MONO_SRC;
- ad_data_line1 =
- AB8500_CODEC_CR31_TO_CR46_SLOT_OUTPUTS_DATA_FROM_AD_OUT1;
- }
- break;
- case AB8500_CODEC_SRC_MICROPHONE_2:
- case AB8500_CODEC_SRC_D_MICROPHONE_2:
- {
- src_type = MONO_SRC;
- ad_data_line1 =
- AB8500_CODEC_CR31_TO_CR46_SLOT_OUTPUTS_DATA_FROM_AD_OUT2;
- }
- break;
- case AB8500_CODEC_SRC_D_MICROPHONE_3:
- case AB8500_CODEC_SRC_MICROPHONE_1A:
- case AB8500_CODEC_SRC_MICROPHONE_1B:
- {
- src_type = MONO_SRC;
- ad_data_line1 =
- AB8500_CODEC_CR31_TO_CR46_SLOT_OUTPUTS_DATA_FROM_AD_OUT3;
- }
- break;
- case AB8500_CODEC_SRC_D_MICROPHONE_4:
- {
- src_type = MONO_SRC;
- ad_data_line1 =
- AB8500_CODEC_CR31_TO_CR46_SLOT_OUTPUTS_DATA_FROM_AD_OUT4;
- }
- break;
- case AB8500_CODEC_SRC_D_MICROPHONE_5:
- {
- src_type = MONO_SRC;
- ad_data_line1 =
- AB8500_CODEC_CR31_TO_CR46_SLOT_OUTPUTS_DATA_FROM_AD_OUT5;
- }
- break;
- case AB8500_CODEC_SRC_D_MICROPHONE_6:
- {
- src_type = MONO_SRC;
- ad_data_line1 =
- AB8500_CODEC_CR31_TO_CR46_SLOT_OUTPUTS_DATA_FROM_AD_OUT6;
- }
- break;
- case AB8500_CODEC_SRC_LINEIN:
- {
- src_type = STEREO_SRC;
- ad_data_line1 =
- AB8500_CODEC_CR31_TO_CR46_SLOT_OUTPUTS_DATA_FROM_AD_OUT1;
- ad_data_line2 =
- AB8500_CODEC_CR31_TO_CR46_SLOT_OUTPUTS_DATA_FROM_AD_OUT2;
- input_device1 = AB8500_CODEC_SRC_LINEIN;
- input_device2 = AB8500_CODEC_SRC_LINEIN;
- }
- break;
-#ifdef CONFIG_U8500_AB8500_CUT10
- case AB8500_CODEC_SRC_D_MICROPHONE_12:
- {
- src_type = STEREO_SRC;
- ad_data_line1 =
- AB8500_CODEC_CR31_TO_CR46_SLOT_OUTPUTS_DATA_FROM_AD_OUT1;
- ad_data_line2 =
- AB8500_CODEC_CR31_TO_CR46_SLOT_OUTPUTS_DATA_FROM_AD_OUT2;
- input_device1 = AB8500_CODEC_SRC_D_MICROPHONE_1;
- input_device2 = AB8500_CODEC_SRC_D_MICROPHONE_2;
- }
- break;
- case AB8500_CODEC_SRC_D_MICROPHONE_34:
- {
- src_type = STEREO_SRC;
- ad_data_line1 =
- AB8500_CODEC_CR31_TO_CR46_SLOT_OUTPUTS_DATA_FROM_AD_OUT3;
- ad_data_line2 =
- AB8500_CODEC_CR31_TO_CR46_SLOT_OUTPUTS_DATA_FROM_AD_OUT4;
- input_device1 = AB8500_CODEC_SRC_D_MICROPHONE_3;
- input_device2 = AB8500_CODEC_SRC_D_MICROPHONE_4;
- }
- break;
- case AB8500_CODEC_SRC_D_MICROPHONE_56:
- {
- src_type = STEREO_SRC;
- ad_data_line1 =
- AB8500_CODEC_CR31_TO_CR46_SLOT_OUTPUTS_DATA_FROM_AD_OUT5;
- ad_data_line2 =
- AB8500_CODEC_CR31_TO_CR46_SLOT_OUTPUTS_DATA_FROM_AD_OUT6;
- input_device1 = AB8500_CODEC_SRC_D_MICROPHONE_5;
- input_device2 = AB8500_CODEC_SRC_D_MICROPHONE_6;
- }
- break;
-#endif /* #ifdef CONFIG_U8500_AB8500_CUT10 */
- }
- if (STEREO_SRC == src_type) {
- u8500_acodec_allocate_all_stereo_slots(ad_data_line1,
- ad_data_line2);
- codec_error =
- AB8500_CODEC_SrcPowerControl(input_device1,
- AB8500_CODEC_SRC_STATE_ENABLE);
- if (AB8500_CODEC_OK != codec_error) {
- stm_error("AB8500_CODEC_SrcPowerControl failed\n");
- return AB8500_CODEC_ERROR;
- }
- g_codec_system_context.input_config[input_device1].power_state =
- ENABLE;
-
- u8500_acodec_set_input_volume(input_device1, 50, 50, USER_ALSA);
-
- codec_error =
- AB8500_CODEC_SrcPowerControl(input_device2,
- AB8500_CODEC_SRC_STATE_ENABLE);
- if (AB8500_CODEC_OK != codec_error) {
- stm_error("AB8500_CODEC_SrcPowerControl failed\n");
- return AB8500_CODEC_ERROR;
- }
- g_codec_system_context.input_config[input_device2].power_state =
- ENABLE;
-
- u8500_acodec_set_input_volume(input_device2, 50, 50, USER_ALSA);
- } else {
- u8500_acodec_allocate_all_mono_slots(ad_data_line1);
- codec_error =
- AB8500_CODEC_SrcPowerControl(input_device,
- AB8500_CODEC_SRC_STATE_ENABLE);
- if (AB8500_CODEC_OK != codec_error) {
- stm_error("AB8500_CODEC_SrcPowerControl failed\n");
- return AB8500_CODEC_ERROR;
- }
- g_codec_system_context.input_config[input_device].power_state =
- ENABLE;
-
- u8500_acodec_set_input_volume(input_device, 50, 50, USER_ALSA);
- }
- return AB8500_CODEC_OK;
-}
-
-t_ab8500_codec_error
- u8500_acodec_allocate_all_mono_slots
- (t_ab8500_codec_cr31_to_cr46_ad_data_allocation ad_data_line1) {
- t_ab8500_codec_error codec_error = AB8500_CODEC_OK;
- int i;
-
- for (i = AB8500_CODEC_SLOT0; i <= AB8500_CODEC_SLOT7; i++) {
- codec_error = AB8500_CODEC_ADSlotAllocation(i, ad_data_line1);
- if (AB8500_CODEC_OK != codec_error) {
- stm_error("ab8500_codec_adslot_allocation failed\n");
- return AB8500_CODEC_ERROR;
- }
- }
- return AB8500_CODEC_OK;
-}
-
-t_ab8500_codec_error
- u8500_acodec_allocate_all_stereo_slots
- (t_ab8500_codec_cr31_to_cr46_ad_data_allocation ad_data_line1,
- t_ab8500_codec_cr31_to_cr46_ad_data_allocation ad_data_line2) {
- t_ab8500_codec_error codec_error = AB8500_CODEC_OK;
- int i;
-
- for (i = AB8500_CODEC_SLOT0; i <= AB8500_CODEC_SLOT7; i += 2) {
- codec_error = AB8500_CODEC_ADSlotAllocation(i, ad_data_line1);
- if (AB8500_CODEC_OK != codec_error) {
- stm_error("ab8500_codec_adslot_allocation failed\n");
- return AB8500_CODEC_ERROR;
- }
- codec_error =
- AB8500_CODEC_ADSlotAllocation(i + 1, ad_data_line2);
- if (AB8500_CODEC_OK != codec_error) {
- stm_error("ab8500_codec_adslot_allocation failed\n");
- return AB8500_CODEC_ERROR;
- }
- }
- return AB8500_CODEC_OK;
-}
-
-#ifdef CONFIG_U8500_AB8500_CUT10
-t_ab8500_codec_error
-u8500_acodec_set_burst_mode_fifo(t_u8500_pmc_rendering_state fifo_state)
-{
-
-}
-#else
-t_ab8500_codec_error
-u8500_acodec_set_burst_mode_fifo(t_u8500_pmc_rendering_state fifo_state)
-{
- t_ab8500_codec_error ab8500_codec_error;
- t_ab8500_codec_burst_fifo_config burst_fifo_config;
-
- if (RENDERING_ENABLE == fifo_state) {
- burst_fifo_config.cr104_bfifoint = 0x1;
- burst_fifo_config.cr105_bfifotx = 0xC0;
- burst_fifo_config.cr106_bfifofsext =
- AB8500_CODEC_CR106_BFIFOFSEXT_6SLOT_EXTRA_CLK;
- burst_fifo_config.cr106_bfifomsk =
- AB8500_CODEC_CR106_BFIFOMSK_AD_DATA0_UNMASKED;
- burst_fifo_config.cr106_bfifomstr =
- AB8500_CODEC_CR106_BFIFOMSTR_MASTER_MODE;
- burst_fifo_config.cr106_bfifostrt =
- AB8500_CODEC_CR106_BFIFOSTRT_RUNNING;
- burst_fifo_config.cr107_bfifosampnr = 0x100;
- burst_fifo_config.cr108_bfifowakeup = 0x1;
-
- ab8500_codec_error =
- AB8500_CODEC_ConfigureBurstFifo(&burst_fifo_config);
- if (AB8500_CODEC_OK != ab8500_codec_error) {
- return ab8500_codec_error;
- }
-
- ab8500_codec_error = AB8500_CODEC_EnableBurstFifo();
- if (AB8500_CODEC_OK != ab8500_codec_error) {
- return ab8500_codec_error;
- }
-
- printk("\n Burst mode activated\n");
- } else if (RENDERING_DISABLE == fifo_state) {
- ab8500_codec_error = AB8500_CODEC_DisableBurstFifo();
- if (AB8500_CODEC_OK != ab8500_codec_error) {
- return ab8500_codec_error;
- }
- printk("\n Burst mode deactivated\n");
- }
- return AB8500_CODEC_OK;
-}
-#endif
-/**
-* u8500_acodec_set_user
-*
-* Set the current user for acodec.
-*/
-
-t_ab8500_codec_error u8500_acodec_setuser(t_acodec_user user)
-{
- t_ab8500_codec_error codec_error = AB8500_CODEC_OK;
-
- FUNC_ENTER();
-
- if ((g_codec_system_context.cur_user == NO_USER)
- || (g_codec_system_context.cur_user == user))
- g_codec_system_context.cur_user = user;
- else {
- stm_error
- (" Trying to acces audiocodec already in use by user %d\n",
- g_codec_system_context.cur_user);
- return AB8500_CODEC_ERROR;
- }
- FUNC_EXIT();
- return (codec_error);
-}
-
-/**
-* u8500_acodec_unset_user
-*
-* Unset the current user for acodec.
-*/
-
-t_ab8500_codec_error u8500_acodec_unsetuser(t_acodec_user user)
-{
- t_ab8500_codec_error codec_error = AB8500_CODEC_OK;
-
- if (g_codec_system_context.cur_user != user) {
- stm_error
- (" Trying to free audiocodec already in use by other user %d\n",
- g_codec_system_context.cur_user);
- return AB8500_CODEC_ERROR;
- } else
- g_codec_system_context.cur_user = NO_USER;
-
- return (codec_error);
-}
-
-#if DRIVER_DEBUG > 0
-t_ab8500_codec_error dump_acodec_registers()
-{
- u8 i;
-
- for (i = 0; i <= 0x6D; i++)
- stm_dbg(DBG_ST.acodec, "block=0x0D, adr=%x = %x\n", i,
- ab8500_read(AB8500_AUDIO, i));
-
- /*for (i = 0; i < 0x5e; i++)
- stm_dbg(DBG_ST.acodec,"\n block 1,reg =%d val %x", i, ab8500_read(AB8500_AUDIO, i));
- */
- return 0;
-}
-
-t_ab8500_codec_error dump_msp_registers()
-{
- int i;
-
- stm_dbg(DBG_ST.acodec, "\nMSP_1 base add = 0x%x\n",
- (unsigned int)U8500_MSP1_BASE);
-
- for (i = 0; i < 0x40; i += 4)
- stm_dbg(DBG_ST.acodec, "msp[0x%x]=0x%x\n", i,
- readl((char *)(IO_ADDRESS(U8500_MSP1_BASE) + i)));
-
- return 0;
-}
-
-EXPORT_SYMBOL(dump_msp_registers);
-EXPORT_SYMBOL(dump_acodec_registers);
-#endif
-
-/**
-* u8500_acodec_powerdown
-*
-* This function power off the audio codec.
-*/
-void u8500_acodec_powerdown()
-{
- AB8500_CODEC_PowerDown();
-}
-
-/**
-* u8500_acodec_init
-*
-* This is the init function for STW5098 audiocodec driver.
-*/
-
-static int i2sdrv_probe(struct i2s_device *i2s)
-{
-
- /* Allocate driver data */
- try_module_get(i2s->controller->dev.parent->driver->owner);
-
- /* Allocate memory to i2sdrv structure */
- i2sdrv[i2s->chip_select] =
- kzalloc(sizeof(*i2sdrv[i2s->chip_select]), GFP_KERNEL);
- if (!i2sdrv[i2s->chip_select])
- return -ENOMEM;
-
- /* Initialize the driver data */
- i2sdrv[i2s->chip_select]->i2s = i2s;
- i2sdrv[i2s->chip_select]->flag = -1;
- i2sdrv[i2s->chip_select]->tx_status = 0;
- i2sdrv[i2s->chip_select]->rx_status = 0;
- spin_lock_init(&i2sdrv[i2s->chip_select]->i2s_lock);
-
- i2s_set_drvdata(i2s, (void *)i2sdrv[i2s->chip_select]);
- return 0;
-}
-
-static int i2sdrv_remove(struct i2s_device *i2s)
-{
- struct i2sdrv_data *i2sdrv = i2s_get_drvdata(i2s);
-
- spin_lock_irq(&i2sdrv->i2s_lock);
- i2sdrv->i2s = NULL;
- i2s_set_drvdata(i2s, NULL);
- spin_unlock_irq(&i2sdrv->i2s_lock);
-
- stm_dbg(DBG_ST.acodec, "Entering AUDIOTRG_CODEC_DeIni\n");
- stm_dbg(DBG_ST.acodec, "leaving AUDIOTRG_CODEC_DeIni\n");
- module_put(i2s->controller->dev.parent->driver->owner);
- printk("Remove of I2S gets called\n");
- return 0;
-}
-static const struct i2s_device_id acodec_id_table[] = {
- {"i2s_device.2", 0, 0},
- {"i2s_device.1", 0, 0},
- {},
-};
-
-MODULE_DEVICE_TABLE(i2s, acodec_id_table);
-
-static struct i2s_driver i2sdrv_i2s = {
- .driver = {
- .name = "u8500_acodec",
- .owner = THIS_MODULE,
- },
- .probe = i2sdrv_probe,
- .remove = __devexit_p(i2sdrv_remove),
- .id_table = acodec_id_table,
-
-};
-
-static void ab8500_codec_power_init(void)
-{
- __u8 data, old_data;
-
- old_data =
- ab8500_read(AB8500_SYS_CTRL2_BLOCK, (AB8500_CTRL3_REG & 0xFF));
-
- data = 0xFE & old_data;
- ab8500_write(AB8500_SYS_CTRL2_BLOCK, (AB8500_CTRL3_REG & 0xFF), data); //0x0200
-
- data = 0x02 | old_data;
- ab8500_write(AB8500_SYS_CTRL2_BLOCK, (AB8500_CTRL3_REG & 0xFF), data); //0x0200
-
- old_data =
- ab8500_read(AB8500_SYS_CTRL2_BLOCK,
- (AB8500_SYSULPCLK_CTRL1_REG & 0xFF));
-#ifdef CONFIG_U8500_AB8500_CUT10
- data = 0x18 | old_data;
-#else
- data = 0x10 | old_data;
-#endif
- ab8500_write(AB8500_SYS_CTRL2_BLOCK, (AB8500_SYSULPCLK_CTRL1_REG & 0xFF), data); //0x020B
-
- old_data =
- ab8500_read(AB8500_REGU_CTRL1, (AB8500_REGU_MISC1_REG & 0xFF));
- data = 0x04 | old_data;
- ab8500_write(AB8500_REGU_CTRL1, (AB8500_REGU_MISC1_REG & 0xFF), data); //0x380
-
- old_data =
- ab8500_read(AB8500_REGU_CTRL1,
- (AB8500_REGU_VAUDIO_SUPPLY_REG & 0xFF));
- data = 0x5E | old_data;
- ab8500_write(AB8500_REGU_CTRL1, (AB8500_REGU_VAUDIO_SUPPLY_REG & 0xFF), data); //0x0383
-
-#ifdef CONFIG_U8500_AB8500_CUT10
- old_data = ab8500_read(AB8500_MISC, (AB8500_GPIO_DIR4_REG & 0xFF));
- data = 0x54 | old_data;
- ab8500_write(AB8500_MISC, (AB8500_GPIO_DIR4_REG & 0xFF), data); //0x1013
-#endif
-}
-
-/**
-* u8500_acodec_deinit
-*
-* exit function for STW5098 audiocodec driver.
-*/
-static int check_device_id()
-{
- __u8 data;
-
- data = ab8500_read(AB8500_MISC, (0x80 & 0xFF));
- if (((data & 0xF0) == 0x10) || ((data & 0xF0) == 0x11)) {
- /* V1 version */
-#ifndef CONFIG_U8500_AB8500_CUT10
- printk("ERROR: AB8500 hardware detected is CUT1x\n");
- return -ENODEV;
-#endif
- } else {
-#ifndef CONFIG_U8500_AB8500_ED
- /* ED version */
- printk("ERROR: AB8500 hardware detected is EarlyDrop\n");
- return -ENODEV;
-#endif
- }
- return 0;
-}
-
-static int __init u8500_acodec_init(void)
-{
- int status, ret_val;
- t_ab8500_codec_error error;
-
- ret_val = check_device_id();
- if (0 != ret_val)
- return ret_val;
-
- status = i2s_register_driver(&i2sdrv_i2s);
- if (status < 0) {
- printk("Unable to register i2s driver\n");
- return status;
- }
-
- /*Initialize Audiocodec */
-
- ab8500_codec_power_init();
-
- AB8500_CODEC_Init(TRG_CODEC_ADDRESS_ON_SPI_BUS);
-
- /* Reset CODEC */
- error = AB8500_CODEC_Reset();
- if (AB8500_CODEC_OK != error) {
- stm_error("Error in AB8500_CODEC_Reset\n");
- return -1;
- }
-
- stm_dbg(DBG_ST.acodec, " leaving u8500_acodec_init() \n");
- return 0;
-}
-
-static void __exit u8500_acodec_deinit(void)
-{
- stm_dbg(DBG_ST.acodec, "Entering AUDIOTRG_CODEC_DeIni\n");
- stm_dbg(DBG_ST.acodec, "leaving AUDIOTRG_CODEC_DeIni\n");
- i2s_unregister_driver(&i2sdrv_i2s);
-}
-
-module_init(u8500_acodec_init);
-module_exit(u8500_acodec_deinit);
-
-MODULE_LICENSE("GPL");
-MODULE_DESCRIPTION("AB8500 stw5098 audiocodec driver");
-
-/* exported function by audiocodec to be used by SAA driver and ALSA driver */
-
-EXPORT_SYMBOL(u8500_acodec_open);
-EXPORT_SYMBOL(u8500_acodec_close);
-EXPORT_SYMBOL(u8500_acodec_send_data);
-EXPORT_SYMBOL(u8500_acodec_receive_data);
-EXPORT_SYMBOL(u8500_acodec_rates);
-EXPORT_SYMBOL(u8500_acodec_powerdown);
-EXPORT_SYMBOL(u8500_acodec_setuser);
-EXPORT_SYMBOL(u8500_acodec_unsetuser);
-EXPORT_SYMBOL(u8500_acodec_enable_audio_mode);
-//EXPORT_SYMBOL(u8500_acodec_enable_voice_mode);
-EXPORT_SYMBOL(u8500_acodec_get_output_volume);
-EXPORT_SYMBOL(u8500_acodec_get_input_volume);
-EXPORT_SYMBOL(u8500_acodec_set_output_volume);
-EXPORT_SYMBOL(u8500_acodec_set_input_volume);
-EXPORT_SYMBOL(u8500_acodec_select_input);
-EXPORT_SYMBOL(u8500_acodec_select_output);
-
-t_ab8500_codec_error AB8500_CODEC_Write(IN t_uint8 register_offset,
- IN t_uint8 count, IN t_uint8 * ptr_data)
-{
- int i;
- u32 address;
-
- for (i = 0; i < count; i++) {
- address = (AB8500_AUDIO << 8) | (register_offset + i);
- ab8500_write(AB8500_AUDIO, address, ptr_data[i]);
- }
- return AB8500_CODEC_OK;
-}
-
-t_ab8500_codec_error AB8500_CODEC_Read(IN t_uint8 register_offset,
- IN t_uint8 count,
- IN t_uint8 * dummy_data,
- IN t_uint8 * ptr_data)
-{
- int i;
- u32 address;
-
- dummy_data = dummy_data; /*keep compiler happy */
-
- for (i = 0; i < count; i++) {
- address = (AB8500_AUDIO << 8) | (register_offset + i);
- ptr_data[i] = ab8500_read(AB8500_AUDIO, address);
- }
-
- return AB8500_CODEC_OK;
-}
-
-EXPORT_SYMBOL(u8500_acodec_set_src_power_cntrl);
-EXPORT_SYMBOL(u8500_acodec_set_burst_mode_fifo);
-EXPORT_SYMBOL(u8500_acodec_get_dest_power_state);
-EXPORT_SYMBOL(lpbk_state_in_texts);
-EXPORT_SYMBOL(u8500_acodec_toggle_playback_mute_control);
-EXPORT_SYMBOL(u8500_acodec_set_dest_power_cntrl);
-EXPORT_SYMBOL(power_state_in_texts);
-EXPORT_SYMBOL(u8500_acodec_toggle_capture_mute_control);
-EXPORT_SYMBOL(u8500_acodec_toggle_analog_lpbk);
-EXPORT_SYMBOL(u8500_acodec_toggle_digital_lpbk);
-EXPORT_SYMBOL(tdm_mode_state_in_texts);
-EXPORT_SYMBOL(switch_state_in_texts);
-EXPORT_SYMBOL(pcm_rendering_state_in_texts);
-EXPORT_SYMBOL(direct_rendering_state_in_texts);
-EXPORT_SYMBOL(u8500_acodec_get_src_power_state);
-EXPORT_SYMBOL(i2sdrv);
-EXPORT_SYMBOL(second_config);