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

Commit 539a2c97 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "asoc: Add support for rouleur codec in machine driver"

parents dfb7689c 707bf359
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -47,6 +47,11 @@ include $(MY_LOCAL_PATH)/asoc/codecs/wcd937x/Android.mk
endif
endif

ifeq ($(call is-board-platform-in-list, bengal),true)
$(shell rm -rf $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/rouleur/Module.symvers)
include $(MY_LOCAL_PATH)/asoc/codecs/rouleur/Android.mk
endif

ifeq ($(call is-board-platform-in-list, kona lito),true)
$(shell rm -rf $(PRODUCT_OUT)/obj/vendor/qcom/opensource/audio-kernel/asoc/codecs/bolero/Module.symvers)
include $(MY_LOCAL_PATH)/asoc/codecs/bolero/Android.mk
+43 −2
Original line number Diff line number Diff line
@@ -31,8 +31,10 @@
#include "asoc/msm-cdc-pinctrl.h"
#include "asoc/wcd-mbhc-v2.h"
#include "codecs/wcd937x/wcd937x-mbhc.h"
#include "codecs/rouleur/rouleur-mbhc.h"
#include "codecs/wsa881x-analog.h"
#include "codecs/wcd937x/wcd937x.h"
#include "codecs/rouleur/rouleur.h"
#include "codecs/bolero/bolero-cdc.h"
#include <dt-bindings/sound/audio-codec-port-types.h>
#include "bengal-port-config.h"
@@ -5995,9 +5997,13 @@ static int msm_aux_codec_init(struct snd_soc_component *component)
	struct snd_info_entry *entry;
	struct snd_card *card = component->card->snd_card;
	struct msm_asoc_mach_data *pdata;
	struct platform_device *pdev = NULL;
	char *data = NULL;
	int i = 0;

	snd_soc_dapm_ignore_suspend(dapm, "EAR");
	snd_soc_dapm_ignore_suspend(dapm, "AUX");
	snd_soc_dapm_ignore_suspend(dapm, "LO");
	snd_soc_dapm_ignore_suspend(dapm, "HPHL");
	snd_soc_dapm_ignore_suspend(dapm, "HPHR");
	snd_soc_dapm_ignore_suspend(dapm, "AMIC1");
@@ -6018,14 +6024,49 @@ static int msm_aux_codec_init(struct snd_soc_component *component)
		}
		pdata->codec_root = entry;
	}
	wcd937x_info_create_codec_entry(pdata->codec_root, component);

	for (i = 0; i < component->card->num_aux_devs; i++)
	{
		if (msm_aux_dev[i].name != NULL ) {
			if (strstr(msm_aux_dev[i].name, "wsa"))
				continue;
		}

		if (msm_aux_dev[i].codec_of_node) {
			pdev = of_find_device_by_node(
				msm_aux_dev[i].codec_of_node);
			if (pdev)
				data = (char*) of_device_get_match_data(
							&pdev->dev);

			if (data != NULL) {
				if (!strncmp(data, "wcd937x",
						sizeof("wcd937x"))) {
					wcd937x_info_create_codec_entry(
						pdata->codec_root, component);
					break;
				} else if (!strncmp(data, "rouleur",
						sizeof("rouleur"))) {
					rouleur_info_create_codec_entry(
						pdata->codec_root, component);
					break;
				}
			}
		}
	}

mbhc_cfg_cal:
	mbhc_calibration = def_wcd_mbhc_cal();
	if (!mbhc_calibration)
		return -ENOMEM;
	wcd_mbhc_cfg.calibration = mbhc_calibration;
        if (data != NULL) {
                if (!strncmp(data, "wcd937x", sizeof("wcd937x")))
                        ret = wcd937x_mbhc_hs_detect(component, &wcd_mbhc_cfg);
                else if (!strncmp( data, "rouleur", sizeof("rouleur")))
                        ret = rouleur_mbhc_hs_detect(component, &wcd_mbhc_cfg);
        }

	if (ret) {
		dev_err(component->dev, "%s: mbhc hs detect failed, err:%d\n",
			__func__, ret);
+1 −0
Original line number Diff line number Diff line
@@ -226,6 +226,7 @@ ifeq ($(KERNEL_BUILD), 1)
	obj-y	+= wcd937x/
	obj-y	+= wcd938x/
	obj-y	+= bolero/
	obj-y	+= rouleur/
endif
# Module information used by KBuild framework
obj-$(CONFIG_WCD9XXX_CODEC_CORE) += wcd_core_dlkm.o
+2 −2
Original line number Diff line number Diff line
@@ -291,14 +291,14 @@ static void rouleur_mbhc_hph_l_pull_up_control(
	/* Default pull up current to 2uA */
	if (pull_up_cur < I_OFF || pull_up_cur > I_3P0_UA ||
	    pull_up_cur == I_DEFAULT)
		pull_up_cur = I_2P0_UA;
		pull_up_cur = I_3P0_UA;

	dev_dbg(component->dev, "%s: HS pull up current:%d\n",
		__func__, pull_up_cur);

	snd_soc_component_update_bits(component,
				ROULEUR_ANA_MBHC_PLUG_DETECT_CTL,
				0xC0, pull_up_cur);
				0xC0, pull_up_cur << 6);
}

static int rouleur_mbhc_request_micbias(struct snd_soc_component *component,
+0 −2
Original line number Diff line number Diff line
@@ -134,13 +134,11 @@ static bool rouleur_volatile_register(struct device *dev, unsigned int reg)
		if ((rouleur_reg_access_analog[ROULEUR_REG(reg)] & RD_REG)
		    && !(rouleur_reg_access_analog[ROULEUR_REG(reg)] & WR_REG))
			return true;
		return false;
	if (reg > ROULEUR_DIG_BASE_ADDR && reg <
					ROULEUR_DIGITAL_REGISTERS_MAX_SIZE)
		if ((rouleur_reg_access_digital[ROULEUR_REG(reg)] & RD_REG)
		    && !(rouleur_reg_access_digital[ROULEUR_REG(reg)] & WR_REG))
			return true;
		return false;
	return 0;
}

Loading