Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Verified Commit 0c5dfcff authored by Ahmed Harhash's avatar Ahmed Harhash
Browse files

Audio: Fix soundcard detection for Fairphone 4

- Add CONFIG_SND_SOC_KONA=y to enable Kona audio driver for FP4
- Modify audio techpack Makefile to use Kona audio configs on FP4
- Patch kona.c to always use WCD938X codec functions
- Ensure MI2S interface is enabled for speaker support
parent e6b78366
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -4,6 +4,8 @@ CONFIG_LOCALVERSION_AUTO=y
# Audio
# Audio
CONFIG_SND_SMARTPA_AW882XX=y
CONFIG_SND_SMARTPA_AW882XX=y
CONFIG_T2M_SND_FP4=y
CONFIG_T2M_SND_FP4=y
CONFIG_SND_SOC_KONA=y
# CONFIG_MI2S_DISABLE is not set


# Board
# Board
CONFIG_FP4_BOARD_ID=y
CONFIG_FP4_BOARD_ID=y
+8 −0
Original line number Original line Diff line number Diff line
@@ -18,6 +18,10 @@ ifeq ($(CONFIG_ARCH_LITO), y)
include $(srctree)/techpack/audio/config/litoauto.conf
include $(srctree)/techpack/audio/config/litoauto.conf
export $(shell sed 's/=.*//' $(srctree)/techpack/audio/config/litoauto.conf)
export $(shell sed 's/=.*//' $(srctree)/techpack/audio/config/litoauto.conf)
endif
endif
ifeq ($(CONFIG_MACH_FAIRPHONE_FP4), y)
include $(srctree)/techpack/audio/config/konaauto.conf
export
endif
ifeq ($(CONFIG_ARCH_SDM660), y)
ifeq ($(CONFIG_ARCH_SDM660), y)
include $(srctree)/techpack/audio/config/sdm660auto.conf
include $(srctree)/techpack/audio/config/sdm660auto.conf
endif
endif
@@ -53,6 +57,10 @@ ifeq ($(CONFIG_ARCH_LITO), y)
LINUXINCLUDE    += \
LINUXINCLUDE    += \
                -include $(srctree)/techpack/audio/config/litoautoconf.h
                -include $(srctree)/techpack/audio/config/litoautoconf.h
endif
endif
ifeq ($(CONFIG_MACH_FAIRPHONE_FP4), y)
LINUXINCLUDE    += \
                -include $(srctree)/techpack/audio/config/konaautoconf.h
endif
ifeq ($(CONFIG_ARCH_SDM660), y)
ifeq ($(CONFIG_ARCH_SDM660), y)
LINUXINCLUDE    += \
LINUXINCLUDE    += \
                -include $(srctree)/techpack/audio/config/sdm660autoconf.h
                -include $(srctree)/techpack/audio/config/sdm660autoconf.h
+2 −2
Original line number Original line Diff line number Diff line
@@ -8044,7 +8044,7 @@ static int msm_aux_codec_init(struct snd_soc_component *component)
		}
		}
		pdata->codec_root = entry;
		pdata->codec_root = entry;
	}
	}
	if (!strncmp(component->driver->name, "wcd937x", 7)) {
	if (0 && !strncmp(component->driver->name, "wcd937x", 7)) {
		wcd937x_info_create_codec_entry(pdata->codec_root, component);
		wcd937x_info_create_codec_entry(pdata->codec_root, component);
		ret = snd_soc_add_component_controls(component,
		ret = snd_soc_add_component_controls(component,
					msm_int_wcd937x_snd_controls,
					msm_int_wcd937x_snd_controls,
@@ -8074,7 +8074,7 @@ static int msm_aux_codec_init(struct snd_soc_component *component)
	if (!mbhc_calibration)
	if (!mbhc_calibration)
		return -ENOMEM;
		return -ENOMEM;
	wcd_mbhc_cfg.calibration = mbhc_calibration;
	wcd_mbhc_cfg.calibration = mbhc_calibration;
	if (!strncmp(component->driver->name, "wcd937x", 7))
	if (0 && !strncmp(component->driver->name, "wcd937x", 7))
		ret = wcd937x_mbhc_hs_detect(component, &wcd_mbhc_cfg);
		ret = wcd937x_mbhc_hs_detect(component, &wcd_mbhc_cfg);
	else
	else
		ret = wcd938x_mbhc_hs_detect(component, &wcd_mbhc_cfg);
		ret = wcd938x_mbhc_hs_detect(component, &wcd_mbhc_cfg);