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

Commit fc7d3f47 authored by Sudheer Papothi's avatar Sudheer Papothi Committed by Banajit Goswami
Browse files

ASoC: wcd: Add support for MBHC ADC on WCD9340 codec



MBHC(Multi Button Headset Controller)
ADC(Analog to Digital conversion) method is used
for plug type detection. Add support for MBHC ADC on
WCD9340 codec.

Change-Id: I07d98ec8a4096dfd050535e382db7deca3d23d9b
Signed-off-by: default avatarSudheer Papothi <spapothi@codeaurora.org>
Signed-off-by: default avatarBanajit Goswami <bgoswami@codeaurora.org>
parent 79d42bd7
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -932,6 +932,13 @@ config AUDIO_EXT_CLK
config SND_SOC_WCD_MBHC
	tristate
	default y if (SND_SOC_MSM8909_WCD=y || SND_SOC_SDM660_CDC=y || SND_SOC_WCD9335=y) && SND_SOC_MDMCALIFORNIUM!=y
	select SND_SOC_WCD_MBHC_LEGACY

config SND_SOC_WCD_MBHC_LEGACY
	tristate

config SND_SOC_WCD_MBHC_ADC
	tristate

config SND_SOC_WCD_DSP_MGR
	tristate
+5 −1
Original line number Diff line number Diff line
@@ -173,7 +173,11 @@ ifeq ($(CONFIG_COMMON_CLK_QCOM), y)
endif
snd-soc-wcd-cpe-objs := wcd_cpe_services.o wcd_cpe_core.o
snd-soc-wsa881x-objs := wsa881x.o wsa881x-tables.o wsa881x-regmap.o wsa881x-temp-sensor.o
snd-soc-wcd-mbhc-objs := wcd-mbhc-v2.o
ifeq ($(CONFIG_SND_SOC_WCD_MBHC_LEGACY), y)
	snd-soc-wcd-mbhc-objs := wcd-mbhc-v2.o wcd-mbhc-legacy.o
else ifeq ($(CONFIG_SND_SOC_WCD_MBHC_ADC), y)
	snd-soc-wcd-mbhc-objs := wcd-mbhc-v2.o wcd-mbhc-adc.o
endif
snd-soc-wsa881x-analog-objs := wsa881x-analog.o wsa881x-tables-analog.o
snd-soc-wsa881x-analog-objs += wsa881x-regmap-analog.o wsa881x-irq.o
snd-soc-wcd-dsp-utils-objs := wcd-dsp-utils.o
+1 −1
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@
#include "sdm660-cdc-registers.h"
#include "msm-cdc-common.h"
#include "../../msm/sdm660-common.h"
#include "../wcd-mbhc-v2.h"
#include "../wcd-mbhc-v2-api.h"

#define DRV_NAME "pmic_analog_codec"
#define SDM660_CDC_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 |\
+832 −0

File added.

Preview size limit exceeded, changes collapsed.

+35 −0
Original line number Diff line number Diff line
/* Copyright (c) 2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * only version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */
#ifndef __WCD_MBHC_ADC_H__
#define __WCD_MBHC_ADC_H__

#include "wcd-mbhc-v2.h"

enum wcd_mbhc_adc_mux_ctl {
	MUX_CTL_AUTO = 0,
	MUX_CTL_IN2P,
	MUX_CTL_IN3P,
	MUX_CTL_IN4P,
	MUX_CTL_HPH_L,
	MUX_CTL_HPH_R,
	MUX_CTL_NONE,
};

#ifdef CONFIG_SND_SOC_WCD_MBHC_ADC
void wcd_mbhc_adc_init(struct wcd_mbhc *mbhc);
#else
static inline void wcd_mbhc_adc_init(struct wcd_mbhc *mbhc)
{

}
#endif
#endif /* __WCD_MBHC_ADC_H__ */
Loading