diff --git a/firmware/target/hosted/ibasso/dx50/audiohw-dx50.c b/firmware/target/hosted/ibasso/dx50/audiohw-dx50.c index 5e61348c8d..4ed181ede9 100644 --- a/firmware/target/hosted/ibasso/dx50/audiohw-dx50.c +++ b/firmware/target/hosted/ibasso/dx50/audiohw-dx50.c @@ -66,3 +66,14 @@ void audiohw_set_volume(int volume) DEBUGF("ERROR %s: Can not set volume.", __func__); } } + + +void audiohw_set_filter_roll_off(int val) +{ + DEBUGF("DEBUG %s: val: %d", __func__, val); + + if(! sysfs_set_char(SYSFS_ES9018_FILTER, (char) val)) + { + DEBUGF("ERROR %s: Can not set roll off filter.", __func__); + } +} diff --git a/firmware/target/hosted/ibasso/dx50/codec-dx50.h b/firmware/target/hosted/ibasso/dx50/codec-dx50.h index 89a1a3f1c4..baa5b7c3b6 100644 --- a/firmware/target/hosted/ibasso/dx50/codec-dx50.h +++ b/firmware/target/hosted/ibasso/dx50/codec-dx50.h @@ -26,7 +26,7 @@ #define _CODEC_DX50_H_ -#define AUDIOHW_CAPS MONO_VOL_CAP +#define AUDIOHW_CAPS (MONO_VOL_CAP | FILTER_ROLL_OFF_CAP) /* @@ -48,4 +48,8 @@ AUDIOHW_SETTING(VOLUME, "dB", 0, 1, -128, 0, -30) +/* 1: slow roll off, 0: sharp roll off, sharp roll off default */ +AUDIOHW_SETTING(FILTER_ROLL_OFF, "", 0, 1, 0, 1, 0) + + #endif diff --git a/firmware/target/hosted/ibasso/sysfs-ibasso.c b/firmware/target/hosted/ibasso/sysfs-ibasso.c index 8ca3edf387..5269c16704 100644 --- a/firmware/target/hosted/ibasso/sysfs-ibasso.c +++ b/firmware/target/hosted/ibasso/sysfs-ibasso.c @@ -43,6 +43,9 @@ static const char* SYSFS_PATHS[] = /* SYSFS_DX90_ES9018_VOLUME */ "/sys/class/codec/es9018_volume", + /* SYSFS_ES9018_FILTER */ + "/sys/class/codec/es9018_filter", + /* SYSFS_MUTE */ "/sys/class/codec/mute", @@ -280,6 +283,7 @@ bool sysfs_set_char(enum sys_fs_interface_id id, char value) { case SYSFS_MUTE: case SYSFS_WM8740_MUTE: + case SYSFS_ES9018_FILTER: { break; } diff --git a/firmware/target/hosted/ibasso/sysfs-ibasso.h b/firmware/target/hosted/ibasso/sysfs-ibasso.h index fec8a082f9..23e562c296 100644 --- a/firmware/target/hosted/ibasso/sysfs-ibasso.h +++ b/firmware/target/hosted/ibasso/sysfs-ibasso.h @@ -38,6 +38,7 @@ enum sys_fs_interface_id SYSFS_DX50_CODEC_VOLUME = 0, SYSFS_HOLDKEY, SYSFS_DX90_ES9018_VOLUME, + SYSFS_ES9018_FILTER, SYSFS_MUTE, SYSFS_WM8740_MUTE, SYSFS_BATTERY_CAPACITY,