From b030bf5885dc5e018dd38eacbb294f1321f2b400 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Thu, 1 Oct 2020 14:06:48 -0400 Subject: xduoox3ii/x20: Proper lineout detection and volume mangling. hotplugging hp and lineout works, without blowing out eardrums. Change-Id: I2df5c7a618bb2d1d77d416548d45dff9cfc619db --- firmware/export/audiohw.h | 4 ---- firmware/export/config/xduoox20.h | 2 +- firmware/export/config/xduoox3.h | 3 --- firmware/export/config/xduoox3ii.h | 2 +- firmware/export/xduoolinux_codec.h | 5 +++-- 5 files changed, 5 insertions(+), 11 deletions(-) (limited to 'firmware/export') diff --git a/firmware/export/audiohw.h b/firmware/export/audiohw.h index 34a253e893..31be0555f8 100644 --- a/firmware/export/audiohw.h +++ b/firmware/export/audiohw.h @@ -452,10 +452,6 @@ void audiohw_set_volume(int vol_l, int vol_r); void audiohw_set_lineout_volume(int vol_l, int vol_r); #endif -#ifdef AUDIOHW_HAVE_SET_OUTPUT -void audiohw_set_output(void); -#endif - #ifndef AUDIOHW_HAVE_CLIPPING #if defined(AUDIOHW_HAVE_BASS) || defined(AUDIOHW_HAVE_TREBLE) \ || defined(AUDIOHW_HAVE_EQ) diff --git a/firmware/export/config/xduoox20.h b/firmware/export/config/xduoox20.h index 28a19baaae..b90ebceb04 100644 --- a/firmware/export/config/xduoox20.h +++ b/firmware/export/config/xduoox20.h @@ -67,6 +67,7 @@ #define PLUGIN_BUFFER_SIZE 0x100000 #define HAVE_HEADPHONE_DETECTION +#define HAVE_LINEOUT_DETECTION /* KeyPad configuration for plugins */ #define CONFIG_KEYPAD XDUOO_X20_PAD @@ -81,7 +82,6 @@ /* We have usb power and can detect usb but it is handled by Linux */ #define HAVE_USB_POWER -#define AUDIOHW_HAVE_SET_OUTPUT #endif #define CONFIG_BATTERY_MEASURE PERCENTAGE_MEASURE diff --git a/firmware/export/config/xduoox3.h b/firmware/export/config/xduoox3.h index 4c2cc47fc9..484e52d151 100644 --- a/firmware/export/config/xduoox3.h +++ b/firmware/export/config/xduoox3.h @@ -85,9 +85,6 @@ /* Define this if a programmable hotkey is mapped */ #define HAVE_HOTKEY - - - #ifndef BOOTLOADER /* define this if you have a real-time clock */ #define CONFIG_RTC RTC_JZ4760 diff --git a/firmware/export/config/xduoox3ii.h b/firmware/export/config/xduoox3ii.h index 02e8a57909..9ad7b5884b 100644 --- a/firmware/export/config/xduoox3ii.h +++ b/firmware/export/config/xduoox3ii.h @@ -67,6 +67,7 @@ #define PLUGIN_BUFFER_SIZE 0x100000 #define HAVE_HEADPHONE_DETECTION +#define HAVE_LINEOUT_DETECTION /* KeyPad configuration for plugins */ #define CONFIG_KEYPAD XDUOO_X3II_PAD @@ -81,7 +82,6 @@ /* We have usb power and can detect usb but it is handled by Linux */ #define HAVE_USB_POWER -#define AUDIOHW_HAVE_SET_OUTPUT #endif #define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE diff --git a/firmware/export/xduoolinux_codec.h b/firmware/export/xduoolinux_codec.h index ea0b2988f1..a46976d386 100644 --- a/firmware/export/xduoolinux_codec.h +++ b/firmware/export/xduoolinux_codec.h @@ -1,10 +1,11 @@ #ifndef __XDUOOLINUX_CODEC__ #define __XDUOOLINUX_CODEC__ -#define AUDIOHW_CAPS (FILTER_ROLL_OFF_CAP) +#define AUDIOHW_CAPS (LINEOUT_CAP | FILTER_ROLL_OFF_CAP) AUDIOHW_SETTING(VOLUME, "dB", 0, 1, -127, 0, -30) AUDIOHW_SETTING(FILTER_ROLL_OFF, "", 0, 1, 0, 4, 0) #endif void audiohw_mute(int mute); -void audiohw_set_output(void); +void xduoo_set_output(int ps); +int xduoo_get_outputs(void); -- cgit v1.2.3