From 8cc7476735dd3f9f9e3f5b1356eadc4ef40c23b4 Mon Sep 17 00:00:00 2001 From: Dana Conrad Date: Sun, 3 Dec 2023 15:07:26 -0600 Subject: ErosQ Native ES9018K2M: Add digital filters capability Setting not yet hidden for older hardware revision. Change-Id: Iaaa5727e63c38de578a6bbc73498ae1073180e65 --- firmware/export/config/erosqnative.h | 2 ++ firmware/export/es9018k2m.h | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'firmware/export') diff --git a/firmware/export/config/erosqnative.h b/firmware/export/config/erosqnative.h index c71f7ade49..4f87282f1f 100644 --- a/firmware/export/config/erosqnative.h +++ b/firmware/export/config/erosqnative.h @@ -63,6 +63,8 @@ #define HAVE_EROS_QN_CODEC #define HAVE_SW_TONE_CONTROLS #define HAVE_SW_VOLUME_CONTROL +#define AUDIOHW_CAPS (FILTER_ROLL_OFF_CAP) +#define AUDIOHW_HAVE_SHORT_ROLL_OFF /* use high-bitdepth volume scaling */ #define PCM_NATIVE_BITDEPTH 24 diff --git a/firmware/export/es9018k2m.h b/firmware/export/es9018k2m.h index 035a607030..2824fed505 100644 --- a/firmware/export/es9018k2m.h +++ b/firmware/export/es9018k2m.h @@ -25,6 +25,13 @@ //====================================================================================== // ES9018K2M support stuff +// Implement audiohw_* functions in audiohw-*.c. These functions are utilities which +// may be used there. + +// AUDIOHW_SETTING(VOLUME, *) not set here, probably best to put it in device-specific *_codec.h +#ifdef AUDIOHW_HAVE_SHORT_ROLL_OFF +AUDIOHW_SETTING(FILTER_ROLL_OFF, "", 0, 1, 0, 3, 0) +#endif #ifndef ES9018K2M_VOLUME_MIN # define ES9018K2M_VOLUME_MIN -1270 @@ -50,8 +57,11 @@ #define ES9018K2M_REG16_VOLUME_R 16 #define ES9018K2M_REG21_GPIO_INPUT_SELECT 21 -/* writes volume levels to DAC over I2C */ -void es9018k2m_set_volume(int vol_l, int vol_r); +/* writes volume levels to DAC over I2C, asynchronously */ +void es9018k2m_set_volume_async(int vol_l, int vol_r); + +/* write filter roll-off setting to DAC over I2C, synchronously */ +void es9018k2m_set_filter_roll_off(int value); /* writes a single register */ /* returns I2C_STATUS_OK upon success, I2C_STATUS_* errors upon error */ -- cgit v1.2.3