Merge 0a93a99156
on remote branch
Change-Id: I51281dc30ac598af34cdfa8d71538884b4943e46
This commit is contained in:
@@ -11,6 +11,7 @@ audio_headers_out = [
|
||||
"sound/msmcal-hwdep.h",
|
||||
"sound/voice_params.h",
|
||||
"sound/wcd-dsp-glink.h",
|
||||
"linux/msm_audio_calibration.h",
|
||||
]
|
||||
|
||||
audio_kernel_headers_verbose = "--verbose "
|
||||
|
35
Android.mk
35
Android.mk
@@ -24,12 +24,11 @@ endif
|
||||
|
||||
ifeq ($(ENABLE_AUDIO_LEGACY_TECHPACK),true)
|
||||
include $(call all-subdir-makefiles)
|
||||
LOCAL_PATH := vendor/qcom/opensource/audio-kernel
|
||||
endif
|
||||
|
||||
# Build/Package only in case of supported target
|
||||
ifeq ($(call is-board-platform-in-list,taro kalama bengal pineapple holi blair), true)
|
||||
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
ifeq ($(call is-board-platform-in-list,taro kalama bengal pineapple holi blair gen4 msmnile), true)
|
||||
|
||||
# This makefile is only for DLKM
|
||||
ifneq ($(findstring vendor,$(LOCAL_PATH)),)
|
||||
@@ -54,16 +53,43 @@ KBUILD_OPTIONS += MODNAME=audio_dlkm
|
||||
KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM)
|
||||
KBUILD_OPTIONS += $(AUDIO_SELECT)
|
||||
|
||||
ifneq ($(call is-board-platform-in-list, bengal holi blair),true)
|
||||
ifneq ($(call is-board-platform-in-list, bengal holi blair msmnile gen4),true)
|
||||
KBUILD_OPTIONS += KBUILD_EXTRA_SYMBOLS=$(PWD)/$(call intermediates-dir-for,DLKM,msm-ext-disp-module-symvers)/Module.symvers
|
||||
endif
|
||||
|
||||
ifeq ($(call is-board-platform-in-list, gen4 msmnile),true)
|
||||
KBUILD_OPTIONS += CONFIG_SND_SOC_AUTO=y
|
||||
ifneq (,$(filter $(TARGET_BOARD_PLATFORM)$(TARGET_BOARD_SUFFIX), gen4_gvm msmnile_gvmq))
|
||||
KBUILD_OPTIONS +=CONFIG_SND_SOC_GVM=y
|
||||
endif
|
||||
endif
|
||||
|
||||
AUDIO_SRC_FILES := \
|
||||
$(wildcard $(LOCAL_PATH)/*) \
|
||||
$(wildcard $(LOCAL_PATH)/*/*) \
|
||||
$(wildcard $(LOCAL_PATH)/*/*/*) \
|
||||
$(wildcard $(LOCAL_PATH)/*/*/*/*)
|
||||
|
||||
ifneq (,$(filter $(TARGET_BOARD_PLATFORM)$(TARGET_BOARD_SUFFIX), gen4_gvm msmnile_gvmq))
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_SRC_FILES := $(AUDIO_SRC_FILES)
|
||||
LOCAL_MODULE := stub_dlkm.ko
|
||||
LOCAL_MODULE_KBUILD_NAME := asoc/codecs/stub_dlkm.ko
|
||||
LOCAL_MODULE_TAGS := optional
|
||||
LOCAL_MODULE_DEBUG_ENABLE := true
|
||||
LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
|
||||
include $(DLKM_DIR)/Build_external_kernelmodule.mk
|
||||
########################### ASOC MACHINE ################################
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_SRC_FILES := $(AUDIO_SRC_FILES)
|
||||
LOCAL_MODULE := machine_dlkm.ko
|
||||
LOCAL_MODULE_KBUILD_NAME := asoc/spf_machine_dlkm.ko
|
||||
LOCAL_MODULE_TAGS := optional
|
||||
LOCAL_MODULE_DEBUG_ENABLE := true
|
||||
LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
|
||||
include $(DLKM_DIR)/Build_external_kernelmodule.mk
|
||||
########################### LPASS-CDC CODEC ###########################
|
||||
else
|
||||
########################### dsp ################################
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
@@ -466,3 +492,4 @@ endif
|
||||
##########################################################
|
||||
endif # DLKM check
|
||||
endif # supported target check
|
||||
endif
|
||||
|
14
asoc/Kbuild
14
asoc/Kbuild
@@ -24,6 +24,12 @@ ifeq ($(CONFIG_SND_SOC_AUTO), y)
|
||||
export
|
||||
INCS += -include $(AUDIO_ROOT)/config/sa6155autoconf.h
|
||||
endif
|
||||
ifdef CONFIG_SND_SOC_GVM
|
||||
include $(AUDIO_ROOT)/config/gvmauto.conf
|
||||
export
|
||||
INCS += -include $(AUDIO_ROOT)/config/gvmautoconf.h
|
||||
endif
|
||||
|
||||
else
|
||||
ifeq ($(KERNEL_BUILD), 0)
|
||||
ifeq ($(CONFIG_ARCH_SM8150), y)
|
||||
@@ -218,6 +224,10 @@ ifdef CONFIG_SND_SOC_SDX
|
||||
MACHINE_OBJS += sdx-target.o
|
||||
endif
|
||||
|
||||
ifdef CONFIG_SND_SOC_GVM_AUTO_SPF
|
||||
SPF_MACHINE_OBJS += gvm_auto_spf_dummy.o
|
||||
endif
|
||||
|
||||
LINUX_INC += -Iinclude/linux
|
||||
|
||||
INCS += $(COMMON_INC) \
|
||||
@@ -299,5 +309,9 @@ machine_dlkm-y := $(MACHINE_OBJS)
|
||||
obj-$(CONFIG_SND_SOC_SDX) += machine_dlkm.o
|
||||
machine_dlkm-y := $(MACHINE_OBJS)
|
||||
|
||||
obj-$(CONFIG_SND_SOC_GVM_AUTO_SPF) += spf_machine_dlkm.o
|
||||
spf_machine_dlkm-y := $(SPF_MACHINE_OBJS)
|
||||
|
||||
|
||||
# inject some build related information
|
||||
DEFINES += -DBUILD_TIMESTAMP=\"$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')\"
|
||||
|
@@ -24,6 +24,11 @@ ifeq ($(CONFIG_SND_SOC_AUTO), y)
|
||||
export
|
||||
INCS += -include $(AUDIO_ROOT)/config/sa6155autoconf.h
|
||||
endif
|
||||
ifdef CONFIG_SND_SOC_GVM
|
||||
include $(AUDIO_ROOT)/config/gvmauto.conf
|
||||
export
|
||||
INCS += -include $(AUDIO_ROOT)/config/gvmautoconf.h
|
||||
endif
|
||||
else
|
||||
ifeq ($(KERNEL_BUILD), 0)
|
||||
ifeq ($(CONFIG_ARCH_SM8150), y)
|
||||
|
@@ -73,6 +73,7 @@ struct lpass_cdc_priv {
|
||||
struct clk *lpass_audio_hw_vote;
|
||||
int core_hw_vote_count;
|
||||
int core_audio_vote_count;
|
||||
int core_clk_vote_count;
|
||||
|
||||
/* Entry for version info */
|
||||
struct snd_info_entry *entry;
|
||||
|
@@ -1442,18 +1442,31 @@ audio_vote:
|
||||
if (ret < 0) {
|
||||
dev_err_ratelimited(dev, "%s:lpass audio hw enable failed\n",
|
||||
__func__);
|
||||
goto done;
|
||||
goto core_clk_vote;
|
||||
}
|
||||
}
|
||||
priv->core_audio_vote_count++;
|
||||
trace_printk("%s: audio vote count %d\n",
|
||||
__func__, priv->core_audio_vote_count);
|
||||
|
||||
core_clk_vote:
|
||||
if (priv->core_clk_vote_count == 0) {
|
||||
ret = lpass_cdc_clk_rsc_request_clock(dev, TX_CORE_CLK,
|
||||
TX_CORE_CLK, true);
|
||||
if (ret < 0) {
|
||||
dev_err_ratelimited(dev, "%s:lpass Tx core clk enable failed\n",
|
||||
__func__);
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
priv->core_clk_vote_count++;
|
||||
|
||||
done:
|
||||
mutex_unlock(&priv->vote_lock);
|
||||
trace_printk("%s, leave\n", __func__);
|
||||
dev_dbg(dev,"%s, leave, hw_vote %d, audio_vote %d\n", __func__,
|
||||
priv->core_hw_vote_count, priv->core_audio_vote_count);
|
||||
dev_dbg(dev, "%s, leave, hw_vote %d, audio_vote %d, core_clk_vote %d\n",
|
||||
__func__, priv->core_hw_vote_count,
|
||||
priv->core_audio_vote_count, priv->core_clk_vote_count);
|
||||
pm_runtime_set_autosuspend_delay(priv->dev, LPASS_CDC_AUTO_SUSPEND_DELAY);
|
||||
return 0;
|
||||
}
|
||||
@@ -1492,10 +1505,18 @@ int lpass_cdc_runtime_suspend(struct device *dev)
|
||||
trace_printk("%s: audio vote count %d\n",
|
||||
__func__, priv->core_audio_vote_count);
|
||||
|
||||
if (--priv->core_clk_vote_count == 0) {
|
||||
lpass_cdc_clk_rsc_request_clock(dev, TX_CORE_CLK,
|
||||
TX_CORE_CLK, false);
|
||||
}
|
||||
if (priv->core_clk_vote_count < 0)
|
||||
priv->core_clk_vote_count = 0;
|
||||
|
||||
mutex_unlock(&priv->vote_lock);
|
||||
trace_printk("%s, leave\n", __func__);
|
||||
dev_dbg(dev,"%s, leave, hw_vote %d, audio_vote %d\n", __func__,
|
||||
priv->core_hw_vote_count, priv->core_audio_vote_count);
|
||||
dev_dbg(dev, "%s, leave, hw_vote %d, audio_vote %d, core_clk_vote %d\n",
|
||||
__func__, priv->core_hw_vote_count,
|
||||
priv->core_audio_vote_count, priv->core_clk_vote_count);
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(lpass_cdc_runtime_suspend);
|
||||
|
@@ -1,6 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2023, Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
@@ -72,10 +73,22 @@ static int msm_cdc_dt_parse_vreg_info(struct device *dev,
|
||||
cdc_vreg->lpm_supported = prop_val;
|
||||
}
|
||||
|
||||
dev_info(dev, "%s: %s: vol=[%d %d]uV, curr=[%d]uA, ond %d lpm %d\n",
|
||||
/* Parse supply - retention mode */
|
||||
snprintf(prop_name, CODEC_DT_MAX_PROP_SIZE, "qcom,%s-rem-supported", name);
|
||||
rc = of_property_read_u32(dev->of_node, prop_name, &prop_val);
|
||||
if (rc) {
|
||||
dev_dbg(dev, "%s: Looking up %s property in node %s failed",
|
||||
__func__, prop_name, dev->of_node->full_name);
|
||||
cdc_vreg->rem_supported = 0;
|
||||
rc = 0;
|
||||
} else {
|
||||
cdc_vreg->rem_supported = prop_val;
|
||||
}
|
||||
|
||||
dev_info(dev, "%s: %s: vol=[%d %d]uV, curr=[%d]uA, ond %d lpm %d rem %d\n",
|
||||
__func__, cdc_vreg->name, cdc_vreg->min_uV, cdc_vreg->max_uV,
|
||||
cdc_vreg->optimum_uA, cdc_vreg->ondemand,
|
||||
cdc_vreg->lpm_supported);
|
||||
cdc_vreg->lpm_supported, cdc_vreg->rem_supported);
|
||||
|
||||
done:
|
||||
return rc;
|
||||
@@ -173,6 +186,94 @@ bool msm_cdc_is_ondemand_supply(struct device *dev,
|
||||
}
|
||||
EXPORT_SYMBOL(msm_cdc_is_ondemand_supply);
|
||||
|
||||
/*
|
||||
* msm_cdc_supply_supports_retention_mode:
|
||||
* On certain hardware configurations, This means that the
|
||||
* PM will disable the supply and remove its power vote
|
||||
* if the PM enters into a suspended state.
|
||||
*
|
||||
* return if supply supports retention mode or not
|
||||
*
|
||||
* @dev: pointer to codec device
|
||||
* @supplies: pointer to regulator bulk data
|
||||
* @cdc_vreg: pointer to platform regulator data
|
||||
* @num_supplies: number of supplies
|
||||
* @supply_name: supply name to be checked
|
||||
*
|
||||
* Return true/false
|
||||
*/
|
||||
bool msm_cdc_supply_supports_retention_mode(struct device *dev,
|
||||
struct regulator_bulk_data *supplies,
|
||||
struct cdc_regulator *cdc_vreg,
|
||||
int num_supplies, char *supply_name)
|
||||
{
|
||||
bool rc = false;
|
||||
int ret, i;
|
||||
|
||||
if ((!supply_name) || (!supplies)) {
|
||||
pr_err_ratelimited("%s: either dev or supplies or cdc_vreg is NULL\n",
|
||||
__func__);
|
||||
return rc;
|
||||
}
|
||||
/* input parameter validation */
|
||||
ret = msm_cdc_check_supply_param(dev, cdc_vreg, num_supplies);
|
||||
if (ret)
|
||||
return rc;
|
||||
|
||||
for (i = 0; i < num_supplies; i++) {
|
||||
if (cdc_vreg[i].rem_supported &&
|
||||
!strcmp(cdc_vreg[i].name, supply_name))
|
||||
return true;
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
EXPORT_SYMBOL(msm_cdc_supply_supports_retention_mode);
|
||||
|
||||
/*
|
||||
* msm_cdc_check_supply_vote:
|
||||
*
|
||||
* return true if supply has voted for regulator enable
|
||||
*
|
||||
* @dev: pointer to codec device
|
||||
* @supplies: pointer to regulator bulk data
|
||||
* @cdc_vreg: pointer to platform regulator data
|
||||
* @num_supplies: number of supplies
|
||||
* @supply_name: supply name to be checked
|
||||
*
|
||||
* Return true/false
|
||||
*/
|
||||
bool msm_cdc_check_supply_vote(struct device *dev,
|
||||
struct regulator_bulk_data *supplies,
|
||||
struct cdc_regulator *cdc_vreg,
|
||||
int num_supplies,
|
||||
char *supply_name)
|
||||
{
|
||||
bool rc = false;
|
||||
int ret, i;
|
||||
|
||||
if ((!supply_name) || (!supplies)) {
|
||||
pr_err_ratelimited("%s: either dev or supplies or cdc_vreg is NULL\n",
|
||||
__func__);
|
||||
return rc;
|
||||
}
|
||||
|
||||
/* input parameter validation */
|
||||
ret = msm_cdc_check_supply_param(dev, cdc_vreg, num_supplies);
|
||||
if (ret)
|
||||
return rc;
|
||||
|
||||
for (i = 0; i < num_supplies; i++) {
|
||||
if (strcmp(cdc_vreg[i].name, supply_name) != 0)
|
||||
continue;
|
||||
|
||||
return cdc_vreg[i].vote;
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
EXPORT_SYMBOL(msm_cdc_check_supply_vote);
|
||||
|
||||
/*
|
||||
* msm_cdc_set_supply_min_voltage:
|
||||
* Set min supply voltage for particular supply
|
||||
@@ -257,6 +358,7 @@ int msm_cdc_disable_ondemand_supply(struct device *dev,
|
||||
dev_err_ratelimited(dev,
|
||||
"%s: failed to disable supply %s, err:%d\n",
|
||||
__func__, supplies[i].supply, rc);
|
||||
cdc_vreg[i].vote = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -307,6 +409,7 @@ int msm_cdc_enable_ondemand_supply(struct device *dev,
|
||||
if (rc)
|
||||
dev_err_ratelimited(dev, "%s: failed to enable supply %s, rc: %d\n",
|
||||
__func__, supplies[i].supply, rc);
|
||||
cdc_vreg[i].vote = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -409,9 +512,11 @@ int msm_cdc_disable_static_supplies(struct device *dev,
|
||||
if (rc)
|
||||
dev_err(dev, "%s: failed to disable supply %s, err:%d\n",
|
||||
__func__, supplies[i].supply, rc);
|
||||
else
|
||||
else {
|
||||
cdc_vreg[i].vote = false;
|
||||
dev_dbg(dev, "%s: disabled regulator %s\n",
|
||||
__func__, supplies[i].supply);
|
||||
}
|
||||
}
|
||||
|
||||
return rc;
|
||||
@@ -500,11 +605,21 @@ int msm_cdc_enable_static_supplies(struct device *dev,
|
||||
__func__, supplies[i].supply, rc);
|
||||
break;
|
||||
}
|
||||
cdc_vreg[i].vote = true;
|
||||
}
|
||||
|
||||
while (rc && i--)
|
||||
if (!cdc_vreg[i].ondemand)
|
||||
regulator_disable(supplies[i].consumer);
|
||||
if (rc) {
|
||||
while (i--) {
|
||||
if (cdc_vreg[i].ondemand)
|
||||
continue;
|
||||
|
||||
if (regulator_disable(supplies[i].consumer) == 0)
|
||||
cdc_vreg[i].vote = false;
|
||||
else
|
||||
dev_err(dev, "%s: failed to disable supply %s during unwind\n",
|
||||
__func__, supplies[i].supply);
|
||||
}
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
@@ -594,6 +709,8 @@ int msm_cdc_init_supplies_v2(struct device *dev,
|
||||
if (cdc_vreg[i].ondemand && vote_regulator_on_demand)
|
||||
continue;
|
||||
|
||||
cdc_vreg[i].regulator = vsup[i].consumer;
|
||||
|
||||
rc = regulator_set_voltage(vsup[i].consumer,
|
||||
cdc_vreg[i].min_uV,
|
||||
cdc_vreg[i].max_uV);
|
||||
|
@@ -1050,7 +1050,7 @@ static void wcd939x_wcd_mbhc_calc_impedance(struct wcd_mbhc *mbhc, uint32_t *zl,
|
||||
*zr = WCD939X_ZDET_FLOATING_IMPEDANCE;
|
||||
} else {
|
||||
*zr = z1R;
|
||||
wcd939x_wcd_mbhc_qfuse_cal(component, zr, 1);
|
||||
wcd939x_wcd_mbhc_qfuse_cal(component, zr, 4);
|
||||
}
|
||||
dev_dbg(component->dev, "%s: impedance on HPH_R = %d(mohms)\n",
|
||||
__func__, *zr);
|
||||
|
@@ -12,6 +12,7 @@
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/component.h>
|
||||
#include <linux/stringify.h>
|
||||
#include <linux/regulator/consumer.h>
|
||||
#include <sound/soc.h>
|
||||
#include <sound/tlv.h>
|
||||
#include <soc/soundwire.h>
|
||||
@@ -5316,6 +5317,18 @@ static int wcd939x_probe(struct platform_device *pdev)
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (msm_cdc_is_ondemand_supply(wcd939x->dev, wcd939x->supplies,
|
||||
pdata->regulator, pdata->num_supplies, "cdc-vdd-px")) {
|
||||
ret = msm_cdc_enable_ondemand_supply(wcd939x->dev,
|
||||
wcd939x->supplies, pdata->regulator,
|
||||
pdata->num_supplies, "cdc-vdd-px");
|
||||
if (ret) {
|
||||
dev_err(dev, "%s: vdd px supply enable failed!\n",
|
||||
__func__);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
ret = wcd939x_parse_port_mapping(dev, "qcom,rx_swr_ch_map",
|
||||
CODEC_RX);
|
||||
ret |= wcd939x_parse_port_mapping(dev, "qcom,tx_swr_ch_map",
|
||||
@@ -5409,12 +5422,30 @@ static int wcd939x_suspend(struct device *dev)
|
||||
pdata->num_supplies,
|
||||
true);
|
||||
set_bit(WCD_SUPPLIES_LPM_MODE, &wcd939x->status_mask);
|
||||
if (msm_cdc_is_ondemand_supply(wcd939x->dev, wcd939x->supplies, pdata->regulator,
|
||||
pdata->num_supplies, "cdc-vdd-px")) {
|
||||
|
||||
if (msm_cdc_supply_supports_retention_mode(wcd939x->dev, wcd939x->supplies,
|
||||
pdata->regulator, pdata->num_supplies, "cdc-vdd-px") &&
|
||||
msm_cdc_check_supply_vote(wcd939x->dev, wcd939x->supplies,
|
||||
pdata->regulator, pdata->num_supplies, "cdc-vdd-px")) {
|
||||
ret = msm_cdc_disable_ondemand_supply(wcd939x->dev,
|
||||
wcd939x->supplies, pdata->regulator,
|
||||
pdata->num_supplies, "cdc-vdd-px");
|
||||
if (ret) {
|
||||
dev_dbg(dev, "%s: vdd px supply suspend failed!\n",
|
||||
__func__);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int wcd939x_resume(struct device *dev)
|
||||
{
|
||||
int ret = 0;
|
||||
struct wcd939x_priv *wcd939x = NULL;
|
||||
struct wcd939x_pdata *pdata = NULL;
|
||||
|
||||
@@ -5432,6 +5463,21 @@ static int wcd939x_resume(struct device *dev)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (msm_cdc_is_ondemand_supply(wcd939x->dev, wcd939x->supplies, pdata->regulator,
|
||||
pdata->num_supplies, "cdc-vdd-px")) {
|
||||
if (msm_cdc_supply_supports_retention_mode(wcd939x->dev, wcd939x->supplies,
|
||||
pdata->regulator, pdata->num_supplies, "cdc-vdd-px") &&
|
||||
!msm_cdc_check_supply_vote(wcd939x->dev, wcd939x->supplies,
|
||||
pdata->regulator, pdata->num_supplies, "cdc-vdd-px")) {
|
||||
ret = msm_cdc_enable_ondemand_supply(wcd939x->dev, wcd939x->supplies,
|
||||
pdata->regulator, pdata->num_supplies, "cdc-vdd-px");
|
||||
if (ret) {
|
||||
dev_dbg(dev, "%s: vdd px supply resume failed!\n",
|
||||
__func__);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (test_bit(WCD_SUPPLIES_LPM_MODE, &wcd939x->status_mask)) {
|
||||
msm_cdc_set_supplies_lpm_mode(wcd939x->dev,
|
||||
wcd939x->supplies,
|
||||
|
@@ -146,9 +146,10 @@ static const struct wsa_reg_mask_val reg_init_2S[] = {
|
||||
};
|
||||
|
||||
static const struct wsa_reg_mask_val reg_init_uvlo[] = {
|
||||
{WSA884X_UVLO_PROG, 0xFF, 0x77},
|
||||
{WSA884X_UVLO_DEGLITCH_CTL, 0xFF, 0x1B},
|
||||
{WSA884X_UVLO_PROG1, 0xFF, 0x40},
|
||||
{WSA884X_UVLO_PROG, 0xFF, 0x77},
|
||||
{WSA884X_PA_FSM_TIMER0, 0xFF, 0xC0},
|
||||
{WSA884X_UVLO_DEGLITCH_CTL, 0xFF, 0x1D},
|
||||
{WSA884X_UVLO_PROG1, 0xFF, 0x40},
|
||||
};
|
||||
|
||||
static int wsa884x_handle_post_irq(void *data);
|
||||
|
803
asoc/gvm_auto_spf_dummy.c
Normal file
803
asoc/gvm_auto_spf_dummy.c
Normal file
@@ -0,0 +1,803 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/* Copyright (c) 2014-2021, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/clk.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/gpio.h>
|
||||
#include <linux/of_gpio.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/input.h>
|
||||
#include <linux/of_device.h>
|
||||
#include <linux/pm_qos.h>
|
||||
#include <sound/core.h>
|
||||
#include <sound/soc.h>
|
||||
#include <sound/soc-dapm.h>
|
||||
#include <sound/pcm.h>
|
||||
#include <sound/pcm_params.h>
|
||||
#include <sound/info.h>
|
||||
#include <dsp/audio_notifier.h>
|
||||
#include "msm_dailink.h"
|
||||
#include <soc/qcom/boot_stats.h>
|
||||
#include "msm_common.h"
|
||||
|
||||
|
||||
#define DRV_NAME "spf-asoc-snd"
|
||||
|
||||
#define __CHIPSET__ "SA8xx5 "
|
||||
#define MSM_DAILINK_NAME(name) (__CHIPSET__#name)
|
||||
|
||||
#define DEV_NAME_STR_LEN 32
|
||||
|
||||
#define SAMPLING_RATE_8KHZ 8000
|
||||
#define SAMPLING_RATE_11P025KHZ 11025
|
||||
#define SAMPLING_RATE_16KHZ 16000
|
||||
#define SAMPLING_RATE_22P05KHZ 22050
|
||||
#define SAMPLING_RATE_32KHZ 32000
|
||||
#define SAMPLING_RATE_44P1KHZ 44100
|
||||
#define SAMPLING_RATE_48KHZ 48000
|
||||
#define SAMPLING_RATE_88P2KHZ 88200
|
||||
#define SAMPLING_RATE_96KHZ 96000
|
||||
#define SAMPLING_RATE_176P4KHZ 176400
|
||||
#define SAMPLING_RATE_192KHZ 192000
|
||||
#define SAMPLING_RATE_352P8KHZ 352800
|
||||
#define SAMPLING_RATE_384KHZ 384000
|
||||
|
||||
#define WCD9XXX_MBHC_DEF_RLOADS 5
|
||||
|
||||
#define WSA8810_NAME_1 "wsa881x.20170211"
|
||||
#define WSA8810_NAME_2 "wsa881x.20170212"
|
||||
#define WCN_CDC_SLIM_RX_CH_MAX 2
|
||||
#define WCN_CDC_SLIM_TX_CH_MAX 3
|
||||
#define TDM_CHANNEL_MAX 8
|
||||
|
||||
#define ADSP_STATE_READY_TIMEOUT_MS 3000
|
||||
#define MSM_LL_QOS_VALUE 300 /* time in us to ensure LPM doesn't go in C3/C4 */
|
||||
#define MSM_HIFI_ON 1
|
||||
#define DIR_SZ 10
|
||||
|
||||
struct snd_card_pdata {
|
||||
struct kobject snd_card_kobj;
|
||||
int card_status;
|
||||
} *snd_card_pdata;
|
||||
|
||||
static struct attribute card_state_attr = {
|
||||
.name = "card_state",
|
||||
.mode = 0666,
|
||||
};
|
||||
|
||||
enum {
|
||||
SLIM_RX_0 = 0,
|
||||
SLIM_RX_1,
|
||||
SLIM_RX_2,
|
||||
SLIM_RX_3,
|
||||
SLIM_RX_4,
|
||||
SLIM_RX_5,
|
||||
SLIM_RX_6,
|
||||
SLIM_RX_7,
|
||||
SLIM_RX_MAX,
|
||||
};
|
||||
enum {
|
||||
SLIM_TX_0 = 0,
|
||||
SLIM_TX_1,
|
||||
SLIM_TX_2,
|
||||
SLIM_TX_3,
|
||||
SLIM_TX_4,
|
||||
SLIM_TX_5,
|
||||
SLIM_TX_6,
|
||||
SLIM_TX_7,
|
||||
SLIM_TX_8,
|
||||
SLIM_TX_MAX,
|
||||
};
|
||||
|
||||
enum {
|
||||
PRIM_MI2S = 0,
|
||||
SEC_MI2S,
|
||||
TERT_MI2S,
|
||||
QUAT_MI2S,
|
||||
QUIN_MI2S,
|
||||
MI2S_MAX,
|
||||
};
|
||||
|
||||
enum {
|
||||
PRIM_AUX_PCM = 0,
|
||||
SEC_AUX_PCM,
|
||||
TERT_AUX_PCM,
|
||||
QUAT_AUX_PCM,
|
||||
QUIN_AUX_PCM,
|
||||
AUX_PCM_MAX,
|
||||
};
|
||||
|
||||
struct mi2s_conf {
|
||||
struct mutex lock;
|
||||
u32 ref_cnt;
|
||||
u32 msm_is_mi2s_master;
|
||||
};
|
||||
|
||||
struct dev_config {
|
||||
u32 sample_rate;
|
||||
u32 bit_format;
|
||||
u32 channels;
|
||||
};
|
||||
|
||||
enum {
|
||||
DP_RX_IDX = 0,
|
||||
EXT_DISP_RX_IDX_MAX,
|
||||
};
|
||||
|
||||
struct msm_wsa881x_dev_info {
|
||||
struct device_node *of_node;
|
||||
u32 index;
|
||||
};
|
||||
|
||||
enum pinctrl_pin_state {
|
||||
STATE_DISABLE = 0, /* All pins are in sleep state */
|
||||
STATE_MI2S_ACTIVE, /* IS2 = active, TDM = sleep */
|
||||
STATE_TDM_ACTIVE, /* IS2 = sleep, TDM = active */
|
||||
};
|
||||
|
||||
struct msm_pinctrl_info {
|
||||
struct pinctrl *pinctrl;
|
||||
struct pinctrl_state *mi2s_disable;
|
||||
struct pinctrl_state *tdm_disable;
|
||||
struct pinctrl_state *mi2s_active;
|
||||
struct pinctrl_state *tdm_active;
|
||||
enum pinctrl_pin_state curr_state;
|
||||
};
|
||||
|
||||
enum {
|
||||
TDM_0 = 0,
|
||||
TDM_1,
|
||||
TDM_2,
|
||||
TDM_3,
|
||||
TDM_4,
|
||||
TDM_5,
|
||||
TDM_6,
|
||||
TDM_7,
|
||||
TDM_PORT_MAX,
|
||||
};
|
||||
|
||||
enum {
|
||||
TDM_PRI = 0,
|
||||
TDM_SEC,
|
||||
TDM_TERT,
|
||||
TDM_QUAT,
|
||||
TDM_QUIN,
|
||||
TDM_INTERFACE_MAX,
|
||||
};
|
||||
|
||||
struct tdm_port {
|
||||
u32 mode;
|
||||
u32 channel;
|
||||
};
|
||||
|
||||
struct tdm_conf {
|
||||
struct mutex lock;
|
||||
u32 ref_cnt;
|
||||
};
|
||||
|
||||
struct msm_asoc_mach_data {
|
||||
struct snd_info_entry *codec_root;
|
||||
struct msm_common_pdata *common_pdata;
|
||||
struct msm_pinctrl_info pinctrl_info;
|
||||
struct device_node *us_euro_gpio_p; /* used by pinctrl API */
|
||||
struct device_node *hph_en1_gpio_p; /* used by pinctrl API */
|
||||
struct device_node *hph_en0_gpio_p; /* used by pinctrl API */
|
||||
struct device_node *fsa_handle;
|
||||
struct snd_soc_codec *codec;
|
||||
struct work_struct adsp_power_up_work;
|
||||
struct tdm_conf tdm_intf_conf[TDM_INTERFACE_MAX];
|
||||
};
|
||||
|
||||
static const char *const pin_states[] = {"sleep", "i2s-active",
|
||||
"tdm-active"};
|
||||
|
||||
static struct platform_device *spdev;
|
||||
|
||||
static bool codec_reg_done;
|
||||
|
||||
/*
|
||||
* Need to report LINEIN
|
||||
* if R/L channel impedance is larger than 5K ohm
|
||||
*/
|
||||
|
||||
static const struct snd_soc_dapm_widget msm_dapm_widgets[] = {
|
||||
|
||||
SND_SOC_DAPM_MIC("Handset Mic", NULL),
|
||||
SND_SOC_DAPM_MIC("Analog Mic3", NULL),
|
||||
SND_SOC_DAPM_MIC("Analog Mic4", NULL),
|
||||
|
||||
SND_SOC_DAPM_MIC("Digital Mic0", NULL),
|
||||
SND_SOC_DAPM_MIC("Digital Mic1", NULL),
|
||||
SND_SOC_DAPM_MIC("Digital Mic2", NULL),
|
||||
SND_SOC_DAPM_MIC("Digital Mic3", NULL),
|
||||
SND_SOC_DAPM_MIC("Digital Mic4", NULL),
|
||||
SND_SOC_DAPM_MIC("Digital Mic5", NULL),
|
||||
SND_SOC_DAPM_MIC("Digital Mic6", NULL),
|
||||
SND_SOC_DAPM_MIC("Digital Mic7", NULL),
|
||||
};
|
||||
|
||||
static struct snd_soc_dai_link msm_gvm_auto_dai_links[] = {
|
||||
/* BackEnd DAI Links */
|
||||
{
|
||||
.name = "PRI_TDM_RX_0_DUMMY",
|
||||
.stream_name = "TDM-LPAIF-RX-PRIMARY",
|
||||
.dpcm_playback = 1,
|
||||
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
|
||||
SND_SOC_DPCM_TRIGGER_POST},
|
||||
.ignore_suspend = 1,
|
||||
.ignore_pmdown_time = 1,
|
||||
SND_SOC_DAILINK_REG(primary_tdm_rx_0_dummy),
|
||||
},
|
||||
{
|
||||
.name = "PRI_TDM_TX_0_DUMMY",
|
||||
.stream_name = "TDM-LPAIF-TX-PRIMARY",
|
||||
.dpcm_capture = 1,
|
||||
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
|
||||
SND_SOC_DPCM_TRIGGER_POST},
|
||||
.ignore_suspend = 1,
|
||||
.ignore_pmdown_time = 1,
|
||||
SND_SOC_DAILINK_REG(primary_tdm_tx_0_dummy),
|
||||
},
|
||||
{
|
||||
.name = "SEC_TDM_RX_0_DUMMY",
|
||||
.stream_name = "TDM-LPAIF-RX-SECONDARY",
|
||||
.dpcm_playback = 1,
|
||||
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
|
||||
SND_SOC_DPCM_TRIGGER_POST},
|
||||
.ignore_suspend = 1,
|
||||
.ignore_pmdown_time = 1,
|
||||
SND_SOC_DAILINK_REG(secondary_tdm_rx_0_dummy),
|
||||
},
|
||||
{
|
||||
.name = "SEC_TDM_TX_0_DUMMY",
|
||||
.stream_name = "TDM-LPAIF-TX-SECONDARY",
|
||||
.dpcm_capture = 1,
|
||||
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
|
||||
SND_SOC_DPCM_TRIGGER_POST},
|
||||
.ignore_suspend = 1,
|
||||
.ignore_pmdown_time = 1,
|
||||
SND_SOC_DAILINK_REG(secondary_tdm_tx_0_dummy),
|
||||
},
|
||||
{
|
||||
.name = "TERT_TDM_RX_0_DUMMY",
|
||||
.stream_name = "TDM-LPAIF-RX-TERTIARY",
|
||||
.dpcm_playback = 1,
|
||||
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
|
||||
SND_SOC_DPCM_TRIGGER_POST},
|
||||
.ignore_suspend = 1,
|
||||
.ignore_pmdown_time = 1,
|
||||
SND_SOC_DAILINK_REG(tert_tdm_rx_0_dummy),
|
||||
},
|
||||
{
|
||||
.name = "TERT_TDM_TX_0_DUMMY",
|
||||
.stream_name = "TDM-LPAIF-TX-TERTIARY",
|
||||
.dpcm_capture = 1,
|
||||
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
|
||||
SND_SOC_DPCM_TRIGGER_POST},
|
||||
.ignore_suspend = 1,
|
||||
.ignore_pmdown_time = 1,
|
||||
SND_SOC_DAILINK_REG(tert_tdm_tx_0_dummy),
|
||||
},
|
||||
{
|
||||
.name = "QUAT_TDM_RX_0_DUMMY",
|
||||
.stream_name = "TDM-LPAIF_RXTX-RX-PRIMARY",
|
||||
.dpcm_playback = 1,
|
||||
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
|
||||
SND_SOC_DPCM_TRIGGER_POST},
|
||||
.ignore_suspend = 1,
|
||||
.ignore_pmdown_time = 1,
|
||||
SND_SOC_DAILINK_REG(quat_tdm_rx_0_dummy),
|
||||
},
|
||||
{
|
||||
.name = "QUAT_TDM_TX_0_DUMMY",
|
||||
.stream_name = "TDM-LPAIF_RXTX-TX-PRIMARY",
|
||||
.dpcm_capture = 1,
|
||||
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
|
||||
SND_SOC_DPCM_TRIGGER_POST},
|
||||
.ignore_suspend = 1,
|
||||
.ignore_pmdown_time = 1,
|
||||
SND_SOC_DAILINK_REG(quat_tdm_tx_0_dummy),
|
||||
},
|
||||
{
|
||||
.name = "QUIN_TDM_RX_0_DUMMY",
|
||||
.stream_name = "TDM-LPAIF_VA-RX-PRIMARY",
|
||||
.dpcm_playback = 1,
|
||||
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
|
||||
SND_SOC_DPCM_TRIGGER_POST},
|
||||
.ignore_suspend = 1,
|
||||
.ignore_pmdown_time = 1,
|
||||
SND_SOC_DAILINK_REG(quin_tdm_rx_0_dummy),
|
||||
},
|
||||
{
|
||||
.name = "QUIN_TDM_TX_0_DUMMY",
|
||||
.stream_name = "TDM-LPAIF_VA-TX-PRIMARY",
|
||||
.dpcm_capture = 1,
|
||||
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
|
||||
SND_SOC_DPCM_TRIGGER_POST},
|
||||
.ignore_suspend = 1,
|
||||
.ignore_pmdown_time = 1,
|
||||
SND_SOC_DAILINK_REG(quin_tdm_tx_0_dummy),
|
||||
},
|
||||
{
|
||||
.name = "SEN_TDM_RX_0_DUMMY",
|
||||
.stream_name = "TDM-LPAIF_WSA-RX-PRIMARY",
|
||||
.dpcm_playback = 1,
|
||||
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
|
||||
SND_SOC_DPCM_TRIGGER_POST},
|
||||
.ignore_suspend = 1,
|
||||
.ignore_pmdown_time = 1,
|
||||
SND_SOC_DAILINK_REG(sen_tdm_rx_0_dummy),
|
||||
},
|
||||
{
|
||||
.name = "SEN_TDM_TX_0_DUMMY",
|
||||
.stream_name = "TDM-LPAIF_WSA-TX-PRIMARY",
|
||||
.dpcm_capture = 1,
|
||||
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
|
||||
SND_SOC_DPCM_TRIGGER_POST},
|
||||
.ignore_suspend = 1,
|
||||
.ignore_pmdown_time = 1,
|
||||
SND_SOC_DAILINK_REG(sen_tdm_tx_0_dummy),
|
||||
},
|
||||
{
|
||||
.name = "SEP_TDM_RX_0_DUMMY",
|
||||
.stream_name = "TDM-LPAIF_AUD-RX-PRIMARY",
|
||||
.dpcm_playback = 1,
|
||||
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
|
||||
SND_SOC_DPCM_TRIGGER_POST},
|
||||
.ignore_suspend = 1,
|
||||
.ignore_pmdown_time = 1,
|
||||
SND_SOC_DAILINK_REG(sep_tdm_rx_0_dummy),
|
||||
},
|
||||
{
|
||||
.name = "SEP_TDM_TX_0_DUMMY",
|
||||
.stream_name = "TDM-LPAIF_AUD-TX-PRIMARY",
|
||||
.dpcm_capture = 1,
|
||||
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
|
||||
SND_SOC_DPCM_TRIGGER_POST},
|
||||
.ignore_suspend = 1,
|
||||
.ignore_pmdown_time = 1,
|
||||
SND_SOC_DAILINK_REG(sep_tdm_tx_0_dummy),
|
||||
},
|
||||
{
|
||||
.name = "OCT_TDM_RX_0_DUMMY",
|
||||
.stream_name = "TDM-LPAIF_WSA2-RX-PRIMARY",
|
||||
.dpcm_playback = 1,
|
||||
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
|
||||
SND_SOC_DPCM_TRIGGER_POST},
|
||||
.ignore_suspend = 1,
|
||||
.ignore_pmdown_time = 1,
|
||||
SND_SOC_DAILINK_REG(oct_tdm_rx_0_dummy),
|
||||
},
|
||||
{
|
||||
.name = "OCT_TDM_TX_0_DUMMY",
|
||||
.stream_name = "TDM-LPAIF_WSA2-TX-PRIMARY",
|
||||
.dpcm_capture = 1,
|
||||
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
|
||||
SND_SOC_DPCM_TRIGGER_POST},
|
||||
.ignore_suspend = 1,
|
||||
.ignore_pmdown_time = 1,
|
||||
SND_SOC_DAILINK_REG(oct_tdm_tx_0_dummy),
|
||||
},
|
||||
{
|
||||
.name = "HS_IF0_TDM_RX_0_DUMMY",
|
||||
.stream_name = "TDM-LPAIF_SDR-RX-PRIMARY",
|
||||
.dpcm_playback = 1,
|
||||
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
|
||||
SND_SOC_DPCM_TRIGGER_POST},
|
||||
.ignore_suspend = 1,
|
||||
.ignore_pmdown_time = 1,
|
||||
SND_SOC_DAILINK_REG(hs_if0_tdm_rx_0_dummy),
|
||||
},
|
||||
{
|
||||
.name = "HS_IF0_TDM_TX_0_DUMMY",
|
||||
.stream_name = "TDM-LPAIF_SDR-TX-PRIMARY",
|
||||
.dpcm_capture = 1,
|
||||
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
|
||||
SND_SOC_DPCM_TRIGGER_POST},
|
||||
.ignore_suspend = 1,
|
||||
.ignore_pmdown_time = 1,
|
||||
SND_SOC_DAILINK_REG(hs_if0_tdm_tx_0_dummy),
|
||||
},
|
||||
{
|
||||
.name = "HS_IF1_TDM_RX_0_DUMMY",
|
||||
.stream_name = "TDM-LPAIF_SDR-RX-SECONDARY",
|
||||
.dpcm_playback = 1,
|
||||
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
|
||||
SND_SOC_DPCM_TRIGGER_POST},
|
||||
.ignore_suspend = 1,
|
||||
.ignore_pmdown_time = 1,
|
||||
SND_SOC_DAILINK_REG(hs_if1_tdm_rx_0_dummy),
|
||||
},
|
||||
{
|
||||
.name = "HS_IF1_TDM_TX_0_DUMMY",
|
||||
.stream_name = "TDM-LPAIF_SDR-TX-SECONDARY",
|
||||
.dpcm_capture = 1,
|
||||
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
|
||||
SND_SOC_DPCM_TRIGGER_POST},
|
||||
.ignore_suspend = 1,
|
||||
.ignore_pmdown_time = 1,
|
||||
SND_SOC_DAILINK_REG(hs_if1_tdm_tx_0_dummy),
|
||||
},
|
||||
{
|
||||
.name = "HS_IF2_TDM_RX_0_DUMMY",
|
||||
.stream_name = "TDM-LPAIF_SDR-RX-TERTIARY",
|
||||
.dpcm_playback = 1,
|
||||
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
|
||||
SND_SOC_DPCM_TRIGGER_POST},
|
||||
.ignore_suspend = 1,
|
||||
.ignore_pmdown_time = 1,
|
||||
SND_SOC_DAILINK_REG(hs_if2_tdm_rx_0_dummy),
|
||||
},
|
||||
{
|
||||
.name = "HS_IF2_TDM_TX_0_DUMMY",
|
||||
.stream_name = "TDM-LPAIF_SDR-TX-TERTIARY",
|
||||
.dpcm_capture = 1,
|
||||
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
|
||||
SND_SOC_DPCM_TRIGGER_POST},
|
||||
.ignore_suspend = 1,
|
||||
.ignore_pmdown_time = 1,
|
||||
SND_SOC_DAILINK_REG(hs_if2_tdm_tx_0_dummy),
|
||||
},
|
||||
{
|
||||
.name = "HS_IF3_TDM_RX_0",
|
||||
.stream_name = "TDM-LPAIF_SDR-RX-QUATERNARY",
|
||||
.dpcm_playback = 1,
|
||||
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
|
||||
SND_SOC_DPCM_TRIGGER_POST},
|
||||
.ignore_suspend = 1,
|
||||
.ignore_pmdown_time = 1,
|
||||
SND_SOC_DAILINK_REG(hs_if3_tdm_rx_0_dummy),
|
||||
},
|
||||
{
|
||||
.name = "HS_IF3_TDM_TX_0",
|
||||
.stream_name = "TDM-LPAIF_SDR-TX-QUATERNARY",
|
||||
.dpcm_capture = 1,
|
||||
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
|
||||
SND_SOC_DPCM_TRIGGER_POST},
|
||||
.ignore_suspend = 1,
|
||||
.ignore_pmdown_time = 1,
|
||||
SND_SOC_DAILINK_REG(hs_if3_tdm_tx_0_dummy),
|
||||
},
|
||||
{
|
||||
.name = "HS_IF4_TDM_RX_0",
|
||||
.stream_name = "TDM-LPAIF_SDR-RX-QUINARY",
|
||||
.dpcm_playback = 1,
|
||||
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
|
||||
SND_SOC_DPCM_TRIGGER_POST},
|
||||
.ignore_suspend = 1,
|
||||
.ignore_pmdown_time = 1,
|
||||
SND_SOC_DAILINK_REG(hs_if4_tdm_rx_0_dummy),
|
||||
},
|
||||
{
|
||||
.name = "HS_IF4_TDM_TX_0",
|
||||
.stream_name = "TDM-LPAIF_SDR-TX-QUINARY",
|
||||
.dpcm_capture = 1,
|
||||
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
|
||||
SND_SOC_DPCM_TRIGGER_POST},
|
||||
.ignore_suspend = 1,
|
||||
.ignore_pmdown_time = 1,
|
||||
SND_SOC_DAILINK_REG(hs_if4_tdm_tx_0_dummy),
|
||||
},
|
||||
};
|
||||
|
||||
int snd_card_notify_user(snd_card_status_t card_status)
|
||||
{
|
||||
snd_card_pdata->card_status = card_status;
|
||||
sysfs_notify(&snd_card_pdata->snd_card_kobj, NULL, "card_state");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int snd_card_set_card_status(snd_card_status_t card_status)
|
||||
{
|
||||
snd_card_pdata->card_status = card_status;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static ssize_t snd_card_sysfs_show(struct kobject *kobj,
|
||||
struct attribute *attr, char *buf)
|
||||
{
|
||||
/* Max length of buf is PAGE_SIZE */
|
||||
return sysfs_emit(buf, "%d\n", snd_card_pdata->card_status);
|
||||
}
|
||||
|
||||
static ssize_t snd_card_sysfs_store(struct kobject *kobj,
|
||||
struct attribute *attr, const char *buf, size_t count)
|
||||
{
|
||||
int result;
|
||||
|
||||
result = kstrtoint (buf, 0, &snd_card_pdata->card_status);
|
||||
if (result)
|
||||
pr_err("%s: Failed to read buf result=%d\n", __func__, result);
|
||||
|
||||
sysfs_notify(kobj, NULL, "card_state");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct sysfs_ops snd_card_sysfs_ops = {
|
||||
.show = snd_card_sysfs_show,
|
||||
.store = snd_card_sysfs_store,
|
||||
};
|
||||
|
||||
static void snd_card_sysfs_release(struct kobject *kobj)
|
||||
{
|
||||
kfree(snd_card_pdata); /* Free the memory */
|
||||
}
|
||||
|
||||
static struct kobj_type snd_card_ktype = {
|
||||
.release = snd_card_sysfs_release,
|
||||
.sysfs_ops = &snd_card_sysfs_ops,
|
||||
};
|
||||
|
||||
int snd_card_sysfs_init(void)
|
||||
{
|
||||
int ret = 0;
|
||||
char dir[DIR_SZ] = "snd_card";
|
||||
|
||||
snd_card_pdata = kcalloc(1, sizeof(struct snd_card_pdata), GFP_KERNEL);
|
||||
if (!snd_card_pdata)
|
||||
return -ENOMEM;
|
||||
|
||||
/* kernel_kobj is the kobject of /sys/kernel/ */
|
||||
ret = kobject_init_and_add(&snd_card_pdata->snd_card_kobj, &snd_card_ktype,
|
||||
kernel_kobj, dir);
|
||||
|
||||
if (ret < 0) {
|
||||
pr_err("%s: Failed to init and add kobject %s, err = %d\n",
|
||||
__func__, dir, ret);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
ret = sysfs_create_file(&snd_card_pdata->snd_card_kobj, &card_state_attr);
|
||||
if (ret < 0) {
|
||||
pr_err("%s: Failed to add snd_card sysfs entry to %s\n",
|
||||
__func__, dir);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
fail:
|
||||
kobject_put(&snd_card_pdata->snd_card_kobj);
|
||||
return ret;
|
||||
}
|
||||
|
||||
struct snd_soc_card snd_soc_card_gvm_auto_dummy_msm;
|
||||
|
||||
static int msm_populate_dai_link_component_of_node(
|
||||
struct snd_soc_card *card)
|
||||
{
|
||||
int i, j, index, ret = 0;
|
||||
struct device *cdev = card->dev;
|
||||
struct snd_soc_dai_link *dai_link = card->dai_link;
|
||||
struct device_node *np;
|
||||
|
||||
if (!cdev) {
|
||||
pr_err("%s: Sound card device memory NULL\n", __func__);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
for (i = 0; i < card->num_links; i++) {
|
||||
if (dai_link[i].platforms->of_node && dai_link[i].cpus->of_node)
|
||||
continue;
|
||||
|
||||
/* populate cpu_of_node for snd card dai links */
|
||||
if (dai_link[i].cpus->dai_name && !dai_link[i].cpus->of_node) {
|
||||
index = of_property_match_string(cdev->of_node,
|
||||
"asoc-cpu-names",
|
||||
dai_link[i].cpus->dai_name);
|
||||
pr_err("%s: retrieving cpu_of_node for %s\n",
|
||||
__func__,
|
||||
dai_link[i].cpus->dai_name);
|
||||
if (index >= 0) {
|
||||
np = of_parse_phandle(cdev->of_node, "asoc-cpu",
|
||||
index);
|
||||
if (!np) {
|
||||
pr_err("%s: retrieving phandle for cpu dai %s failed\n",
|
||||
__func__,
|
||||
dai_link[i].cpus->dai_name);
|
||||
ret = -ENODEV;
|
||||
goto err;
|
||||
}
|
||||
dai_link[i].cpus->of_node = np;
|
||||
dai_link[i].cpus->dai_name = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* populate codec_of_node for snd card dai links */
|
||||
if (dai_link[i].num_codecs > 0) {
|
||||
for (j = 0; j < dai_link[i].num_codecs; j++) {
|
||||
if (dai_link[i].codecs[j].of_node ||
|
||||
!dai_link[i].codecs[j].name)
|
||||
continue;
|
||||
|
||||
index = of_property_match_string(cdev->of_node,
|
||||
"asoc-codec-names",
|
||||
dai_link[i].codecs[j].name);
|
||||
if (index < 0)
|
||||
continue;
|
||||
np = of_parse_phandle(cdev->of_node,
|
||||
"asoc-codec",
|
||||
index);
|
||||
if (!np) {
|
||||
pr_err("%s: retrieving phandle for codec %s failed\n",
|
||||
__func__, dai_link[i].codecs[j].name);
|
||||
ret = -ENODEV;
|
||||
goto err;
|
||||
}
|
||||
dai_link[i].codecs[j].of_node = np;
|
||||
dai_link[i].codecs[j].name = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
err:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static const struct of_device_id gvm_asoc_machine_of_match[] = {
|
||||
{ .compatible = "qcom,8155-spf-asoc-snd-adp-star",
|
||||
.data = "adp_star_codec"},
|
||||
{ .compatible = "qcom,6155-spf-asoc-snd-adp-star",
|
||||
.data = "adp_star_codec"},
|
||||
{ .compatible = "qcom,gvm-auto-spf-asoc-snd-adp-star",
|
||||
.data = "adp_star_codec"},
|
||||
{},
|
||||
};
|
||||
|
||||
static struct snd_soc_card *populate_snd_card_dailinks(struct device *dev)
|
||||
{
|
||||
struct snd_soc_card *card = NULL;
|
||||
const struct of_device_id *match = NULL;
|
||||
|
||||
match = of_match_node(gvm_asoc_machine_of_match, dev->of_node);
|
||||
if (!match) {
|
||||
dev_err(dev, "%s: No DT match found for sound card\n",
|
||||
__func__);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
card = &snd_soc_card_gvm_auto_dummy_msm;
|
||||
|
||||
if (!strcmp(match->compatible, "qcom,gvm-auto-spf-asoc-snd-adp-star")) {
|
||||
card->dai_link = msm_gvm_auto_dai_links;
|
||||
card->num_links = ARRAY_SIZE(msm_gvm_auto_dai_links);
|
||||
}
|
||||
|
||||
return card;
|
||||
}
|
||||
|
||||
struct msm_common_pdata *msm_common_get_pdata(struct snd_soc_card *card)
|
||||
{
|
||||
struct msm_asoc_mach_data *pdata = snd_soc_card_get_drvdata(card);
|
||||
|
||||
if (!pdata)
|
||||
return NULL;
|
||||
|
||||
return pdata->common_pdata;
|
||||
}
|
||||
|
||||
void msm_common_set_pdata(struct snd_soc_card *card,
|
||||
struct msm_common_pdata *common_pdata)
|
||||
{
|
||||
struct msm_asoc_mach_data *pdata = snd_soc_card_get_drvdata(card);
|
||||
|
||||
if (!pdata)
|
||||
return;
|
||||
|
||||
pdata->common_pdata = common_pdata;
|
||||
}
|
||||
|
||||
static int msm_asoc_machine_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct snd_soc_card *card;
|
||||
struct msm_asoc_mach_data *pdata;
|
||||
int ret;
|
||||
|
||||
pr_debug("%s: DRIVER Audio Init\n", __func__);
|
||||
|
||||
if (!pdev->dev.of_node) {
|
||||
dev_err(&pdev->dev, "No platform supplied from device tree\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
pdata = devm_kzalloc(&pdev->dev,
|
||||
sizeof(struct msm_asoc_mach_data), GFP_KERNEL);
|
||||
if (!pdata)
|
||||
return -ENOMEM;
|
||||
|
||||
card = populate_snd_card_dailinks(&pdev->dev);
|
||||
if (!card) {
|
||||
dev_err(&pdev->dev, "%s: Card uninitialized\n", __func__);
|
||||
ret = -EINVAL;
|
||||
return ret;
|
||||
}
|
||||
card->dev = &pdev->dev;
|
||||
platform_set_drvdata(pdev, card);
|
||||
snd_soc_card_set_drvdata(card, pdata);
|
||||
|
||||
ret = snd_soc_of_parse_card_name(card, "qcom,model");
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "parse card name failed, err:%d\n",
|
||||
ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = msm_populate_dai_link_component_of_node(card);
|
||||
if (ret) {
|
||||
ret = -EPROBE_DEFER;
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = devm_snd_soc_register_card(&pdev->dev, card);
|
||||
|
||||
if (ret == -EPROBE_DEFER) {
|
||||
if (codec_reg_done)
|
||||
ret = -EINVAL;
|
||||
return ret;
|
||||
} else if (ret) {
|
||||
dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n",
|
||||
ret);
|
||||
pr_err("snd_soc_register_card failed (%d)\n",
|
||||
ret);
|
||||
return ret;
|
||||
}
|
||||
dev_info(&pdev->dev, "Sound card %s registered\n", card->name);
|
||||
pr_err("Sound card %s registered\n", card->name);
|
||||
|
||||
pr_debug("%s: DRIVER Audio Ready\n", __func__);
|
||||
|
||||
spdev = pdev;
|
||||
|
||||
ret = snd_card_sysfs_init();
|
||||
if (ret)
|
||||
pr_err("snd_card_sysfs_init fail, ret=%d\n", ret);
|
||||
|
||||
ret = snd_card_set_card_status(SND_CARD_STATUS_ONLINE);
|
||||
if (ret)
|
||||
pr_err("snd_card_set_card_status fail, ret=%d\n", ret);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int msm_asoc_machine_remove(struct platform_device *pdev)
|
||||
{
|
||||
/* kobject_put decrease the kref count, once the count reaches 0.
|
||||
* Kobject core will automatically clean up the memory allocated by kobject.
|
||||
* The snd_card_sysfs_release release will help clean up memory allocated by us
|
||||
*/
|
||||
kobject_put(&snd_card_pdata->snd_card_kobj);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct platform_driver gvm_asoc_machine_driver = {
|
||||
.driver = {
|
||||
.name = DRV_NAME,
|
||||
.pm = &snd_soc_pm_ops,
|
||||
.of_match_table = gvm_asoc_machine_of_match,
|
||||
},
|
||||
.probe = msm_asoc_machine_probe,
|
||||
.remove = msm_asoc_machine_remove,
|
||||
};
|
||||
|
||||
int __init gvm_auto_spf_init(void)
|
||||
{
|
||||
return platform_driver_register(&gvm_asoc_machine_driver);
|
||||
}
|
||||
|
||||
void gvm_auto_spf_exit(void)
|
||||
{
|
||||
platform_driver_unregister(&gvm_asoc_machine_driver);
|
||||
}
|
||||
|
||||
module_init(gvm_auto_spf_init);
|
||||
module_exit(gvm_auto_spf_exit);
|
||||
|
||||
MODULE_DESCRIPTION("ALSA SoC Machine Driver for SPF");
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_ALIAS("platform:" DRV_NAME);
|
||||
MODULE_DEVICE_TABLE(of, gvm_asoc_machine_of_match);
|
@@ -409,3 +409,134 @@ SND_SOC_DAILINK_DEFS(pcm_dummy_tx1,
|
||||
DAILINK_COMP_ARRAY(COMP_CPU("snd-soc-dummy-dai")),
|
||||
DAILINK_COMP_ARRAY(COMP_DUMMY()),
|
||||
DAILINK_COMP_ARRAY(COMP_PLATFORM("snd-soc-dummy")));
|
||||
|
||||
SND_SOC_DAILINK_DEFS(primary_tdm_rx_0_dummy,
|
||||
DAILINK_COMP_ARRAY(COMP_CPU("snd-soc-dummy-dai")),
|
||||
DAILINK_COMP_ARRAY(COMP_CODEC("msm-stub-codec.1", "msm-stub-rx")),
|
||||
DAILINK_COMP_ARRAY(COMP_PLATFORM("snd-soc-dummy")));
|
||||
|
||||
SND_SOC_DAILINK_DEFS(primary_tdm_tx_0_dummy,
|
||||
DAILINK_COMP_ARRAY(COMP_CPU("snd-soc-dummy-dai")),
|
||||
DAILINK_COMP_ARRAY(COMP_CODEC("msm-stub-codec.1", "msm-stub-tx")),
|
||||
DAILINK_COMP_ARRAY(COMP_PLATFORM("snd-soc-dummy")));
|
||||
|
||||
SND_SOC_DAILINK_DEFS(secondary_tdm_rx_0_dummy,
|
||||
DAILINK_COMP_ARRAY(COMP_CPU("snd-soc-dummy-dai")),
|
||||
DAILINK_COMP_ARRAY(COMP_CODEC("msm-stub-codec.1", "msm-stub-rx")),
|
||||
DAILINK_COMP_ARRAY(COMP_PLATFORM("snd-soc-dummy")));
|
||||
|
||||
SND_SOC_DAILINK_DEFS(secondary_tdm_tx_0_dummy,
|
||||
DAILINK_COMP_ARRAY(COMP_CPU("snd-soc-dummy-dai")),
|
||||
DAILINK_COMP_ARRAY(COMP_CODEC("msm-stub-codec.1", "msm-stub-tx")),
|
||||
DAILINK_COMP_ARRAY(COMP_PLATFORM("snd-soc-dummy")));
|
||||
|
||||
SND_SOC_DAILINK_DEFS(tert_tdm_rx_0_dummy,
|
||||
DAILINK_COMP_ARRAY(COMP_CPU("snd-soc-dummy-dai")),
|
||||
DAILINK_COMP_ARRAY(COMP_CODEC("msm-stub-codec.1", "msm-stub-rx")),
|
||||
DAILINK_COMP_ARRAY(COMP_PLATFORM("snd-soc-dummy")));
|
||||
|
||||
SND_SOC_DAILINK_DEFS(tert_tdm_tx_0_dummy,
|
||||
DAILINK_COMP_ARRAY(COMP_CPU("snd-soc-dummy-dai")),
|
||||
DAILINK_COMP_ARRAY(COMP_CODEC("msm-stub-codec.1", "msm-stub-tx")),
|
||||
DAILINK_COMP_ARRAY(COMP_PLATFORM("snd-soc-dummy")));
|
||||
|
||||
SND_SOC_DAILINK_DEFS(quat_tdm_rx_0_dummy,
|
||||
DAILINK_COMP_ARRAY(COMP_CPU("snd-soc-dummy-dai")),
|
||||
DAILINK_COMP_ARRAY(COMP_CODEC("msm-stub-codec.1", "msm-stub-rx")),
|
||||
DAILINK_COMP_ARRAY(COMP_PLATFORM("snd-soc-dummy")));
|
||||
|
||||
SND_SOC_DAILINK_DEFS(quat_tdm_tx_0_dummy,
|
||||
DAILINK_COMP_ARRAY(COMP_CPU("snd-soc-dummy-dai")),
|
||||
DAILINK_COMP_ARRAY(COMP_CODEC("msm-stub-codec.1", "msm-stub-tx")),
|
||||
DAILINK_COMP_ARRAY(COMP_PLATFORM("snd-soc-dummy")));
|
||||
|
||||
SND_SOC_DAILINK_DEFS(quin_tdm_rx_0_dummy,
|
||||
DAILINK_COMP_ARRAY(COMP_CPU("snd-soc-dummy-dai")),
|
||||
DAILINK_COMP_ARRAY(COMP_CODEC("msm-stub-codec.1", "msm-stub-rx")),
|
||||
DAILINK_COMP_ARRAY(COMP_PLATFORM("snd-soc-dummy")));
|
||||
|
||||
SND_SOC_DAILINK_DEFS(quin_tdm_tx_0_dummy,
|
||||
DAILINK_COMP_ARRAY(COMP_CPU("snd-soc-dummy-dai")),
|
||||
DAILINK_COMP_ARRAY(COMP_CODEC("msm-stub-codec.1", "msm-stub-tx")),
|
||||
DAILINK_COMP_ARRAY(COMP_PLATFORM("snd-soc-dummy")));
|
||||
|
||||
SND_SOC_DAILINK_DEFS(sen_tdm_rx_0_dummy,
|
||||
DAILINK_COMP_ARRAY(COMP_CPU("snd-soc-dummy-dai")),
|
||||
DAILINK_COMP_ARRAY(COMP_CODEC("msm-stub-codec.1", "msm-stub-rx")),
|
||||
DAILINK_COMP_ARRAY(COMP_PLATFORM("snd-soc-dummy")));
|
||||
|
||||
SND_SOC_DAILINK_DEFS(sen_tdm_tx_0_dummy,
|
||||
DAILINK_COMP_ARRAY(COMP_CPU("snd-soc-dummy-dai")),
|
||||
DAILINK_COMP_ARRAY(COMP_CODEC("msm-stub-codec.1", "msm-stub-tx")),
|
||||
DAILINK_COMP_ARRAY(COMP_PLATFORM("snd-soc-dummy")));
|
||||
|
||||
SND_SOC_DAILINK_DEFS(sep_tdm_rx_0_dummy,
|
||||
DAILINK_COMP_ARRAY(COMP_CPU("snd-soc-dummy-dai")),
|
||||
DAILINK_COMP_ARRAY(COMP_CODEC("msm-stub-codec.1", "msm-stub-rx")),
|
||||
DAILINK_COMP_ARRAY(COMP_PLATFORM("snd-soc-dummy")));
|
||||
|
||||
SND_SOC_DAILINK_DEFS(sep_tdm_tx_0_dummy,
|
||||
DAILINK_COMP_ARRAY(COMP_CPU("snd-soc-dummy-dai")),
|
||||
DAILINK_COMP_ARRAY(COMP_CODEC("msm-stub-codec.1", "msm-stub-tx")),
|
||||
DAILINK_COMP_ARRAY(COMP_PLATFORM("snd-soc-dummy")));
|
||||
|
||||
SND_SOC_DAILINK_DEFS(oct_tdm_rx_0_dummy,
|
||||
DAILINK_COMP_ARRAY(COMP_CPU("snd-soc-dummy-dai")),
|
||||
DAILINK_COMP_ARRAY(COMP_CODEC("msm-stub-codec.1", "msm-stub-rx")),
|
||||
DAILINK_COMP_ARRAY(COMP_PLATFORM("snd-soc-dummy")));
|
||||
|
||||
SND_SOC_DAILINK_DEFS(oct_tdm_tx_0_dummy,
|
||||
DAILINK_COMP_ARRAY(COMP_CPU("snd-soc-dummy-dai")),
|
||||
DAILINK_COMP_ARRAY(COMP_CODEC("msm-stub-codec.1", "msm-stub-tx")),
|
||||
DAILINK_COMP_ARRAY(COMP_PLATFORM("snd-soc-dummy")));
|
||||
|
||||
SND_SOC_DAILINK_DEFS(hs_if0_tdm_rx_0_dummy,
|
||||
DAILINK_COMP_ARRAY(COMP_CPU("snd-soc-dummy-dai")),
|
||||
DAILINK_COMP_ARRAY(COMP_CODEC("msm-stub-codec.1", "msm-stub-rx")),
|
||||
DAILINK_COMP_ARRAY(COMP_PLATFORM("snd-soc-dummy")));
|
||||
|
||||
SND_SOC_DAILINK_DEFS(hs_if0_tdm_tx_0_dummy,
|
||||
DAILINK_COMP_ARRAY(COMP_CPU("snd-soc-dummy-dai")),
|
||||
DAILINK_COMP_ARRAY(COMP_CODEC("msm-stub-codec.1", "msm-stub-tx")),
|
||||
DAILINK_COMP_ARRAY(COMP_PLATFORM("snd-soc-dummy")));
|
||||
|
||||
SND_SOC_DAILINK_DEFS(hs_if1_tdm_rx_0_dummy,
|
||||
DAILINK_COMP_ARRAY(COMP_CPU("snd-soc-dummy-dai")),
|
||||
DAILINK_COMP_ARRAY(COMP_CODEC("msm-stub-codec.1", "msm-stub-rx")),
|
||||
DAILINK_COMP_ARRAY(COMP_PLATFORM("snd-soc-dummy")));
|
||||
|
||||
SND_SOC_DAILINK_DEFS(hs_if1_tdm_tx_0_dummy,
|
||||
DAILINK_COMP_ARRAY(COMP_CPU("snd-soc-dummy-dai")),
|
||||
DAILINK_COMP_ARRAY(COMP_CODEC("msm-stub-codec.1", "msm-stub-tx")),
|
||||
DAILINK_COMP_ARRAY(COMP_PLATFORM("snd-soc-dummy")));
|
||||
|
||||
SND_SOC_DAILINK_DEFS(hs_if2_tdm_rx_0_dummy,
|
||||
DAILINK_COMP_ARRAY(COMP_CPU("snd-soc-dummy-dai")),
|
||||
DAILINK_COMP_ARRAY(COMP_CODEC("msm-stub-codec.1", "msm-stub-rx")),
|
||||
DAILINK_COMP_ARRAY(COMP_PLATFORM("snd-soc-dummy")));
|
||||
|
||||
SND_SOC_DAILINK_DEFS(hs_if2_tdm_tx_0_dummy,
|
||||
DAILINK_COMP_ARRAY(COMP_CPU("snd-soc-dummy-dai")),
|
||||
DAILINK_COMP_ARRAY(COMP_CODEC("msm-stub-codec.1", "msm-stub-tx")),
|
||||
DAILINK_COMP_ARRAY(COMP_PLATFORM("snd-soc-dummy")));
|
||||
|
||||
SND_SOC_DAILINK_DEFS(hs_if3_tdm_rx_0_dummy,
|
||||
DAILINK_COMP_ARRAY(COMP_CPU("snd-soc-dummy-dai")),
|
||||
DAILINK_COMP_ARRAY(COMP_CODEC("msm-stub-codec.1", "msm-stub-rx")),
|
||||
DAILINK_COMP_ARRAY(COMP_PLATFORM("snd-soc-dummy")));
|
||||
|
||||
SND_SOC_DAILINK_DEFS(hs_if3_tdm_tx_0_dummy,
|
||||
DAILINK_COMP_ARRAY(COMP_CPU("snd-soc-dummy-dai")),
|
||||
DAILINK_COMP_ARRAY(COMP_CODEC("msm-stub-codec.1", "msm-stub-tx")),
|
||||
DAILINK_COMP_ARRAY(COMP_PLATFORM("snd-soc-dummy")));
|
||||
|
||||
SND_SOC_DAILINK_DEFS(hs_if4_tdm_rx_0_dummy,
|
||||
DAILINK_COMP_ARRAY(COMP_CPU("snd-soc-dummy-dai")),
|
||||
DAILINK_COMP_ARRAY(COMP_CODEC("msm-stub-codec.1", "msm-stub-rx")),
|
||||
DAILINK_COMP_ARRAY(COMP_PLATFORM("snd-soc-dummy")));
|
||||
|
||||
SND_SOC_DAILINK_DEFS(hs_if4_tdm_tx_0_dummy,
|
||||
DAILINK_COMP_ARRAY(COMP_CPU("snd-soc-dummy-dai")),
|
||||
DAILINK_COMP_ARRAY(COMP_CODEC("msm-stub-codec.1", "msm-stub-tx")),
|
||||
DAILINK_COMP_ARRAY(COMP_PLATFORM("snd-soc-dummy")));
|
||||
|
||||
|
@@ -36,7 +36,7 @@ SND_SOC_DAILINK_DEFS(slimbus_7_tx,
|
||||
SND_SOC_DAILINK_DEFS(slimbus_8_tx,
|
||||
DAILINK_COMP_ARRAY(COMP_CPU("snd-soc-dummy-dai")),
|
||||
DAILINK_COMP_ARRAY(COMP_CODEC("btfmslim_slave",
|
||||
"btfm_bt_sco_slim_tx")),
|
||||
"btfm_fm_slim_tx")),
|
||||
DAILINK_COMP_ARRAY(COMP_PLATFORM("snd-soc-dummy")));
|
||||
|
||||
SND_SOC_DAILINK_DEFS(display_port,
|
||||
|
@@ -61,5 +61,12 @@ AUDIO_KERNEL_MODULES += $(KERNEL_MODULES_OUT)/wcd938x_dlkm.ko \
|
||||
$(KERNEL_MODULES_OUT)/wcd938x_slave_dlkm.ko
|
||||
endif
|
||||
endif
|
||||
else
|
||||
ifeq ($(call is-board-platform-in-list, gen4 msmnile), true)
|
||||
ifneq (,$(filter $(TARGET_BOARD_PLATFORM)$(TARGET_BOARD_SUFFIX), gen4_gvm msmnile_gvmq))
|
||||
AUDIO_KERNEL_MODULES += $(KERNEL_MODULES_OUT)/machine_dlkm.ko\
|
||||
$(KERNEL_MODULES_OUT)/stub_dlkm.ko
|
||||
endif #msmnile
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
@@ -47,3 +47,10 @@ ifeq ($(call is-board-platform-in-list, holi blair), true)
|
||||
PRODUCT_PACKAGES += $(KERNEL_MODULES_OUT)/wcd938x_dlkm.ko \
|
||||
$(KERNEL_MODULES_OUT)/wcd938x_slave_dlkm.ko
|
||||
endif
|
||||
|
||||
ifeq ($(call is-board-platform-in-list, gen4 msmnile), true)
|
||||
ifneq (,$(filter $(TARGET_BOARD_PLATFORM)$(TARGET_BOARD_SUFFIX), gen4_gvm msmnile_gvmq))
|
||||
PRODUCT_PACKAGES += $(KERNEL_MODULES_OUT)/machine_dlkm.ko \
|
||||
$(KERNEL_MODULES_OUT)/stub_dlkm.ko
|
||||
endif #msmnile
|
||||
endif
|
||||
|
@@ -1,16 +1,2 @@
|
||||
CONFIG_MSM_QDSP6_APRV2_VM=m
|
||||
CONFIG_MSM_QDSP6_SSR=m
|
||||
CONFIG_MSM_ADSP_LOADER=m
|
||||
CONFIG_MSM_QDSP6_NOTIFIER=m
|
||||
CONFIG_SND_SOC_MSM_QDSP6V2_VM=m
|
||||
CONFIG_SND_SOC_QDSP6V2=m
|
||||
CONFIG_QTI_PP=m
|
||||
CONFIG_SND_HWDEP_ROUTING=m
|
||||
CONFIG_DTS_EAGLE=m
|
||||
CONFIG_DOLBY_DS2=m
|
||||
CONFIG_DOLBY_LICENSE=m
|
||||
CONFIG_SND_SOC_MSM_STUB=m
|
||||
CONFIG_SND_SOC_MSM_HDMI_CODEC_RX=m
|
||||
CONFIG_MSM_QDSP6V2_CODECS=m
|
||||
CONFIG_SND_EVENT=m
|
||||
CONFIG_SND_SOC_SA8155=m
|
||||
CONFIG_SND_SOC_GVM_AUTO_SPF=m
|
@@ -10,19 +10,5 @@
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#define CONFIG_MSM_QDSP6_APRV2_VM 1
|
||||
#define CONFIG_MSM_ADSP_LOADER 1
|
||||
#define CONFIG_MSM_QDSP6_SSR 1
|
||||
#define CONFIG_MSM_QDSP6_NOTIFIER 1
|
||||
#define CONFIG_SND_SOC_MSM_QDSP6V2_VM 1
|
||||
#define CONFIG_SND_SOC_QDSP6V2 1
|
||||
#define CONFIG_QTI_PP 1
|
||||
#define CONFIG_SND_HWDEP_ROUTING 1
|
||||
#define CONFIG_DTS_EAGLE 1
|
||||
#define CONFIG_DOLBY_DS2 1
|
||||
#define CONFIG_DOLBY_LICENSE 1
|
||||
#define CONFIG_SND_SOC_GVM_AUTO_SPF 1
|
||||
#define CONFIG_SND_SOC_MSM_STUB 1
|
||||
#define CONFIG_SND_SOC_MSM_HDMI_CODEC_RX 1
|
||||
#define CONFIG_MSM_QDSP6V2_CODECS 1
|
||||
#define CONFIG_SND_EVENT 1
|
||||
#define CONFIG_SND_SOC_SA8155 1
|
||||
|
@@ -1,5 +1,6 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/* Copyright (c) 2016, 2018-2020 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2023, Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef __CODEC_POWER_SUPPLY_H__
|
||||
@@ -16,6 +17,8 @@ struct cdc_regulator {
|
||||
int optimum_uA;
|
||||
bool ondemand;
|
||||
bool lpm_supported;
|
||||
bool rem_supported;
|
||||
bool vote;
|
||||
struct regulator *regulator;
|
||||
};
|
||||
|
||||
@@ -32,6 +35,14 @@ extern bool msm_cdc_is_ondemand_supply(struct device *dev,
|
||||
struct regulator_bulk_data *supplies,
|
||||
struct cdc_regulator *cdc_vreg,
|
||||
int num_supplies, char *supply_name);
|
||||
extern bool msm_cdc_supply_supports_retention_mode(struct device *dev,
|
||||
struct regulator_bulk_data *supplies,
|
||||
struct cdc_regulator *cdc_vreg,
|
||||
int num_supplies, char *supply_name);
|
||||
extern bool msm_cdc_check_supply_vote(struct device *dev,
|
||||
struct regulator_bulk_data *supplies,
|
||||
struct cdc_regulator *cdc_vreg,
|
||||
int num_supplies, char *supply_name);
|
||||
extern int msm_cdc_disable_ondemand_supply(struct device *dev,
|
||||
struct regulator_bulk_data *supplies,
|
||||
struct cdc_regulator *cdc_vreg,
|
||||
|
843
include/uapi/audio/linux/msm_audio_calibration.h
Normal file
843
include/uapi/audio/linux/msm_audio_calibration.h
Normal file
@@ -0,0 +1,843 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
|
||||
/* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved. */
|
||||
|
||||
#ifndef _UAPI_MSM_AUDIO_CALIBRATION_H
|
||||
#define _UAPI_MSM_AUDIO_CALIBRATION_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/ioctl.h>
|
||||
|
||||
#define CAL_IOCTL_MAGIC 'a'
|
||||
|
||||
#define AUDIO_ALLOCATE_CALIBRATION _IOWR(CAL_IOCTL_MAGIC, \
|
||||
200, void *)
|
||||
#define AUDIO_DEALLOCATE_CALIBRATION _IOWR(CAL_IOCTL_MAGIC, \
|
||||
201, void *)
|
||||
#define AUDIO_PREPARE_CALIBRATION _IOWR(CAL_IOCTL_MAGIC, \
|
||||
202, void *)
|
||||
#define AUDIO_SET_CALIBRATION _IOWR(CAL_IOCTL_MAGIC, \
|
||||
203, void *)
|
||||
#define AUDIO_GET_CALIBRATION _IOWR(CAL_IOCTL_MAGIC, \
|
||||
204, void *)
|
||||
#define AUDIO_POST_CALIBRATION _IOWR(CAL_IOCTL_MAGIC, \
|
||||
205, void *)
|
||||
|
||||
/* For Real-Time Audio Calibration */
|
||||
#define AUDIO_GET_RTAC_ADM_INFO _IOR(CAL_IOCTL_MAGIC, \
|
||||
207, void *)
|
||||
#define AUDIO_GET_RTAC_VOICE_INFO _IOR(CAL_IOCTL_MAGIC, \
|
||||
208, void *)
|
||||
#define AUDIO_GET_RTAC_ADM_CAL _IOWR(CAL_IOCTL_MAGIC, \
|
||||
209, void *)
|
||||
#define AUDIO_SET_RTAC_ADM_CAL _IOWR(CAL_IOCTL_MAGIC, \
|
||||
210, void *)
|
||||
#define AUDIO_GET_RTAC_ASM_CAL _IOWR(CAL_IOCTL_MAGIC, \
|
||||
211, void *)
|
||||
#define AUDIO_SET_RTAC_ASM_CAL _IOWR(CAL_IOCTL_MAGIC, \
|
||||
212, void *)
|
||||
#define AUDIO_GET_RTAC_CVS_CAL _IOWR(CAL_IOCTL_MAGIC, \
|
||||
213, void *)
|
||||
#define AUDIO_SET_RTAC_CVS_CAL _IOWR(CAL_IOCTL_MAGIC, \
|
||||
214, void *)
|
||||
#define AUDIO_GET_RTAC_CVP_CAL _IOWR(CAL_IOCTL_MAGIC, \
|
||||
215, void *)
|
||||
#define AUDIO_SET_RTAC_CVP_CAL _IOWR(CAL_IOCTL_MAGIC, \
|
||||
216, void *)
|
||||
#define AUDIO_GET_RTAC_AFE_CAL _IOWR(CAL_IOCTL_MAGIC, \
|
||||
217, void *)
|
||||
#define AUDIO_SET_RTAC_AFE_CAL _IOWR(CAL_IOCTL_MAGIC, \
|
||||
218, void *)
|
||||
enum {
|
||||
CVP_VOC_RX_TOPOLOGY_CAL_TYPE = 0,
|
||||
CVP_VOC_TX_TOPOLOGY_CAL_TYPE,
|
||||
CVP_VOCPROC_STATIC_CAL_TYPE,
|
||||
CVP_VOCPROC_DYNAMIC_CAL_TYPE,
|
||||
CVS_VOCSTRM_STATIC_CAL_TYPE,
|
||||
CVP_VOCDEV_CFG_CAL_TYPE,
|
||||
CVP_VOCPROC_STATIC_COL_CAL_TYPE,
|
||||
CVP_VOCPROC_DYNAMIC_COL_CAL_TYPE,
|
||||
CVS_VOCSTRM_STATIC_COL_CAL_TYPE,
|
||||
|
||||
ADM_TOPOLOGY_CAL_TYPE,
|
||||
ADM_CUST_TOPOLOGY_CAL_TYPE,
|
||||
ADM_AUDPROC_CAL_TYPE,
|
||||
ADM_AUDVOL_CAL_TYPE,
|
||||
|
||||
ASM_TOPOLOGY_CAL_TYPE,
|
||||
ASM_CUST_TOPOLOGY_CAL_TYPE,
|
||||
ASM_AUDSTRM_CAL_TYPE,
|
||||
|
||||
AFE_COMMON_RX_CAL_TYPE,
|
||||
AFE_COMMON_TX_CAL_TYPE,
|
||||
AFE_ANC_CAL_TYPE,
|
||||
AFE_AANC_CAL_TYPE,
|
||||
AFE_FB_SPKR_PROT_CAL_TYPE,
|
||||
AFE_HW_DELAY_CAL_TYPE,
|
||||
AFE_SIDETONE_CAL_TYPE,
|
||||
AFE_TOPOLOGY_CAL_TYPE,
|
||||
AFE_CUST_TOPOLOGY_CAL_TYPE,
|
||||
|
||||
LSM_CUST_TOPOLOGY_CAL_TYPE,
|
||||
LSM_TOPOLOGY_CAL_TYPE,
|
||||
LSM_CAL_TYPE,
|
||||
|
||||
ADM_RTAC_INFO_CAL_TYPE,
|
||||
VOICE_RTAC_INFO_CAL_TYPE,
|
||||
ADM_RTAC_APR_CAL_TYPE,
|
||||
ASM_RTAC_APR_CAL_TYPE,
|
||||
VOICE_RTAC_APR_CAL_TYPE,
|
||||
|
||||
MAD_CAL_TYPE,
|
||||
ULP_AFE_CAL_TYPE,
|
||||
ULP_LSM_CAL_TYPE,
|
||||
|
||||
DTS_EAGLE_CAL_TYPE,
|
||||
AUDIO_CORE_METAINFO_CAL_TYPE,
|
||||
SRS_TRUMEDIA_CAL_TYPE,
|
||||
|
||||
CORE_CUSTOM_TOPOLOGIES_CAL_TYPE,
|
||||
ADM_RTAC_AUDVOL_CAL_TYPE,
|
||||
|
||||
ULP_LSM_TOPOLOGY_ID_CAL_TYPE,
|
||||
AFE_FB_SPKR_PROT_TH_VI_CAL_TYPE,
|
||||
AFE_FB_SPKR_PROT_EX_VI_CAL_TYPE,
|
||||
AFE_SIDETONE_IIR_CAL_TYPE,
|
||||
AFE_LSM_TOPOLOGY_CAL_TYPE,
|
||||
AFE_LSM_TX_CAL_TYPE,
|
||||
ADM_LSM_TOPOLOGY_CAL_TYPE,
|
||||
ADM_LSM_AUDPROC_CAL_TYPE,
|
||||
ADM_LSM_AUDPROC_PERSISTENT_CAL_TYPE,
|
||||
ADM_AUDPROC_PERSISTENT_CAL_TYPE,
|
||||
AFE_FB_SPKR_PROT_V4_EX_VI_CAL_TYPE,
|
||||
MAX_CAL_TYPES,
|
||||
};
|
||||
|
||||
#define AFE_FB_SPKR_PROT_TH_VI_CAL_TYPE AFE_FB_SPKR_PROT_TH_VI_CAL_TYPE
|
||||
#define AFE_FB_SPKR_PROT_EX_VI_CAL_TYPE AFE_FB_SPKR_PROT_EX_VI_CAL_TYPE
|
||||
#define AFE_FB_SPKR_PROT_V4_EX_VI_CAL_TYPE AFE_FB_SPKR_PROT_V4_EX_VI_CAL_TYPE
|
||||
|
||||
#define AFE_SIDETONE_IIR_CAL_TYPE AFE_SIDETONE_IIR_CAL_TYPE
|
||||
|
||||
#define AFE_LSM_TOPOLOGY_CAL_TYPE AFE_LSM_TOPOLOGY_CAL_TYPE
|
||||
#define AFE_LSM_TX_CAL_TYPE AFE_LSM_TX_CAL_TYPE
|
||||
#define ADM_LSM_TOPOLOGY_CAL_TYPE ADM_LSM_TOPOLOGY_CAL_TYPE
|
||||
#define ADM_LSM_AUDPROC_CAL_TYPE ADM_LSM_AUDPROC_CAL_TYPE
|
||||
#define ADM_LSM_AUDPROC_PERSISTENT_CAL_TYPE ADM_LSM_AUDPROC_PERSISTENT_CAL_TYPE
|
||||
#define ADM_AUDPROC_PERSISTENT_CAL_TYPE ADM_AUDPROC_PERSISTENT_CAL_TYPE
|
||||
#define LSM_CAL_TYPES
|
||||
|
||||
#define TOPOLOGY_SPECIFIC_CHANNEL_INFO
|
||||
#define MSM_SPKR_PROT_SPV3
|
||||
#define MSM_SPKR_PROT_SPV4
|
||||
#define MSM_CMA_MEM_ALLOC
|
||||
|
||||
enum {
|
||||
VERSION_0_0,
|
||||
};
|
||||
|
||||
enum {
|
||||
PER_VOCODER_CAL_BIT_MASK = 0x10000,
|
||||
};
|
||||
|
||||
#define MAX_IOCTL_CMD_SIZE 512
|
||||
|
||||
/* common structures */
|
||||
|
||||
struct audio_cal_header {
|
||||
__s32 data_size;
|
||||
__s32 version;
|
||||
__s32 cal_type;
|
||||
__s32 cal_type_size;
|
||||
};
|
||||
|
||||
struct audio_cal_type_header {
|
||||
__s32 version;
|
||||
__s32 buffer_number;
|
||||
};
|
||||
|
||||
struct audio_cal_data {
|
||||
/* Size of cal data at mem_handle allocation or at vaddr */
|
||||
__s32 cal_size;
|
||||
/* If mem_handle if shared memory is used*/
|
||||
__s32 mem_handle;
|
||||
#ifdef MSM_CMA_MEM_ALLOC
|
||||
/* cma allocation flag if cma heap memory is used */
|
||||
__u32 cma_mem;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
/* AUDIO_ALLOCATE_CALIBRATION */
|
||||
struct audio_cal_type_alloc {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
};
|
||||
|
||||
struct audio_cal_alloc {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_alloc cal_type;
|
||||
};
|
||||
|
||||
|
||||
/* AUDIO_DEALLOCATE_CALIBRATION */
|
||||
struct audio_cal_type_dealloc {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
};
|
||||
|
||||
struct audio_cal_dealloc {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_dealloc cal_type;
|
||||
};
|
||||
|
||||
|
||||
/* AUDIO_PREPARE_CALIBRATION */
|
||||
struct audio_cal_type_prepare {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
};
|
||||
|
||||
struct audio_cal_prepare {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_prepare cal_type;
|
||||
};
|
||||
|
||||
|
||||
/* AUDIO_POST_CALIBRATION */
|
||||
struct audio_cal_type_post {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
};
|
||||
|
||||
struct audio_cal_post {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_post cal_type;
|
||||
};
|
||||
|
||||
/*AUDIO_CORE_META_INFO */
|
||||
|
||||
struct audio_cal_info_metainfo {
|
||||
__u32 nKey;
|
||||
};
|
||||
|
||||
/* Cal info types */
|
||||
enum {
|
||||
RX_DEVICE,
|
||||
TX_DEVICE,
|
||||
MAX_PATH_TYPE
|
||||
};
|
||||
|
||||
struct audio_cal_info_adm_top {
|
||||
__s32 topology;
|
||||
__s32 acdb_id;
|
||||
/* RX_DEVICE or TX_DEVICE */
|
||||
__s32 path;
|
||||
__s32 app_type;
|
||||
__s32 sample_rate;
|
||||
};
|
||||
|
||||
struct audio_cal_info_audproc {
|
||||
__s32 acdb_id;
|
||||
/* RX_DEVICE or TX_DEVICE */
|
||||
__s32 path;
|
||||
__s32 app_type;
|
||||
__s32 sample_rate;
|
||||
};
|
||||
|
||||
struct audio_cal_info_audvol {
|
||||
__s32 acdb_id;
|
||||
/* RX_DEVICE or TX_DEVICE */
|
||||
__s32 path;
|
||||
__s32 app_type;
|
||||
__s32 vol_index;
|
||||
};
|
||||
|
||||
struct audio_cal_info_afe {
|
||||
__s32 acdb_id;
|
||||
/* RX_DEVICE or TX_DEVICE */
|
||||
__s32 path;
|
||||
__s32 sample_rate;
|
||||
};
|
||||
|
||||
struct audio_cal_info_afe_top {
|
||||
__s32 topology;
|
||||
__s32 acdb_id;
|
||||
/* RX_DEVICE or TX_DEVICE */
|
||||
__s32 path;
|
||||
__s32 sample_rate;
|
||||
};
|
||||
|
||||
struct audio_cal_info_asm_top {
|
||||
__s32 topology;
|
||||
__s32 app_type;
|
||||
};
|
||||
|
||||
struct audio_cal_info_audstrm {
|
||||
__s32 app_type;
|
||||
};
|
||||
|
||||
struct audio_cal_info_aanc {
|
||||
__s32 acdb_id;
|
||||
};
|
||||
|
||||
#define MAX_HW_DELAY_ENTRIES 25
|
||||
|
||||
struct audio_cal_hw_delay_entry {
|
||||
__u32 sample_rate;
|
||||
__u32 delay_usec;
|
||||
};
|
||||
|
||||
struct audio_cal_hw_delay_data {
|
||||
__u32 num_entries;
|
||||
struct audio_cal_hw_delay_entry entry[MAX_HW_DELAY_ENTRIES];
|
||||
};
|
||||
|
||||
struct audio_cal_info_hw_delay {
|
||||
__s32 acdb_id;
|
||||
/* RX_DEVICE or TX_DEVICE */
|
||||
__s32 path;
|
||||
__s32 property_type;
|
||||
struct audio_cal_hw_delay_data data;
|
||||
};
|
||||
|
||||
enum msm_spkr_prot_states {
|
||||
MSM_SPKR_PROT_CALIBRATED,
|
||||
MSM_SPKR_PROT_CALIBRATION_IN_PROGRESS,
|
||||
MSM_SPKR_PROT_DISABLED,
|
||||
MSM_SPKR_PROT_NOT_CALIBRATED,
|
||||
MSM_SPKR_PROT_PRE_CALIBRATED,
|
||||
MSM_SPKR_PROT_IN_FTM_MODE,
|
||||
MSM_SPKR_PROT_IN_V_VALI_MODE
|
||||
};
|
||||
#define MSM_SPKR_PROT_IN_FTM_MODE MSM_SPKR_PROT_IN_FTM_MODE
|
||||
#define MSM_SPKR_PROT_IN_V_VALI_MODE MSM_SPKR_PROT_IN_V_VALI_MODE
|
||||
|
||||
enum msm_spkr_count {
|
||||
SP_V2_SPKR_1,
|
||||
SP_V2_SPKR_2,
|
||||
SP_V2_NUM_MAX_SPKRS
|
||||
};
|
||||
|
||||
struct audio_cal_info_spk_prot_cfg {
|
||||
__s32 r0[SP_V2_NUM_MAX_SPKRS];
|
||||
__s32 t0[SP_V2_NUM_MAX_SPKRS];
|
||||
__u32 quick_calib_flag;
|
||||
__u32 mode;
|
||||
/*
|
||||
* 0 - Start spk prot
|
||||
* 1 - Start calib
|
||||
* 2 - Disable spk prot
|
||||
*/
|
||||
#ifdef MSM_SPKR_PROT_SPV3
|
||||
__u32 sp_version;
|
||||
__s32 limiter_th[SP_V2_NUM_MAX_SPKRS];
|
||||
#endif
|
||||
};
|
||||
|
||||
struct audio_cal_info_sp_th_vi_ftm_cfg {
|
||||
/*
|
||||
* mode should be first param, add new params later to this.
|
||||
* we use this mode(first 4 bytes) to differentiate
|
||||
* whether it is TH_VI FTM or v-validation.
|
||||
*/
|
||||
__u32 mode;
|
||||
/*
|
||||
* 0 - normal running mode
|
||||
* 1 - Calibration
|
||||
* 2 - FTM mode
|
||||
*/
|
||||
__u32 wait_time[SP_V2_NUM_MAX_SPKRS];
|
||||
__u32 ftm_time[SP_V2_NUM_MAX_SPKRS];
|
||||
};
|
||||
|
||||
struct audio_cal_info_sp_th_vi_v_vali_cfg {
|
||||
/*
|
||||
* mode should be first param, add new params later to this.
|
||||
* we use this mode(first 4 bytes) to differentiate
|
||||
* whether it is TH_VI FTM or v-validation.
|
||||
*/
|
||||
__u32 mode;
|
||||
/*
|
||||
* 0 - normal running mode
|
||||
* 1 - Calibration
|
||||
* 2 - FTM mode
|
||||
* 3 - V-Validation mode
|
||||
*/
|
||||
__u32 wait_time[SP_V2_NUM_MAX_SPKRS];
|
||||
__u32 vali_time[SP_V2_NUM_MAX_SPKRS];
|
||||
|
||||
};
|
||||
|
||||
struct audio_cal_info_sp_ex_vi_ftm_cfg {
|
||||
__u32 wait_time[SP_V2_NUM_MAX_SPKRS];
|
||||
__u32 ftm_time[SP_V2_NUM_MAX_SPKRS];
|
||||
__u32 mode;
|
||||
/*
|
||||
* 0 - normal running mode
|
||||
* 2 - FTM mode
|
||||
*/
|
||||
};
|
||||
|
||||
struct audio_cal_info_sp_ex_vi_param {
|
||||
__s32 freq_q20[SP_V2_NUM_MAX_SPKRS];
|
||||
__s32 resis_q24[SP_V2_NUM_MAX_SPKRS];
|
||||
__s32 qmct_q24[SP_V2_NUM_MAX_SPKRS];
|
||||
__s32 status[SP_V2_NUM_MAX_SPKRS];
|
||||
};
|
||||
|
||||
struct audio_cal_info_sp_v4_ex_vi_param {
|
||||
__s32 ftm_re_q24[SP_V2_NUM_MAX_SPKRS];
|
||||
__s32 ftm_Bl_q24[SP_V2_NUM_MAX_SPKRS];
|
||||
__s32 ftm_Rms_q24[SP_V2_NUM_MAX_SPKRS];
|
||||
__s32 ftm_Kms_q24[SP_V2_NUM_MAX_SPKRS];
|
||||
__s32 ftm_freq_q20[SP_V2_NUM_MAX_SPKRS];
|
||||
__s32 ftm_Qms_q24[SP_V2_NUM_MAX_SPKRS];
|
||||
__u32 status[SP_V2_NUM_MAX_SPKRS];
|
||||
};
|
||||
|
||||
struct audio_cal_info_sp_th_vi_param {
|
||||
/*
|
||||
* mode should be first param, add new params later to this.
|
||||
* we use this mode(first 4 bytes) to differentiate
|
||||
* whether it is TH_VI FTM or v-validation.
|
||||
*/
|
||||
__u32 mode;
|
||||
__s32 r_dc_q24[SP_V2_NUM_MAX_SPKRS];
|
||||
__s32 temp_q22[SP_V2_NUM_MAX_SPKRS];
|
||||
__s32 status[SP_V2_NUM_MAX_SPKRS];
|
||||
};
|
||||
|
||||
struct audio_cal_info_sp_th_vi_v_vali_param {
|
||||
/*
|
||||
* mode should be first param, add new params later to this.
|
||||
* we use this mode(first 4 bytes) to differentiate
|
||||
* whether it is TH_VI FTM or v-validation.
|
||||
*/
|
||||
__u32 mode;
|
||||
__u32 vrms_q24[SP_V2_NUM_MAX_SPKRS];
|
||||
__s32 status[SP_V2_NUM_MAX_SPKRS];
|
||||
};
|
||||
|
||||
struct audio_cal_info_msm_spk_prot_status {
|
||||
__s32 r0[SP_V2_NUM_MAX_SPKRS];
|
||||
__s32 status;
|
||||
};
|
||||
|
||||
struct audio_cal_info_sidetone {
|
||||
__u16 enable;
|
||||
__u16 gain;
|
||||
__s32 tx_acdb_id;
|
||||
__s32 rx_acdb_id;
|
||||
__s32 mid;
|
||||
__s32 pid;
|
||||
};
|
||||
|
||||
#define MAX_SIDETONE_IIR_DATA_SIZE 224
|
||||
#define MAX_NO_IIR_FILTER_STAGE 10
|
||||
|
||||
struct audio_cal_info_sidetone_iir {
|
||||
__u16 iir_enable;
|
||||
__u16 num_biquad_stages;
|
||||
__u16 pregain;
|
||||
__s32 tx_acdb_id;
|
||||
__s32 rx_acdb_id;
|
||||
__s32 mid;
|
||||
__s32 pid;
|
||||
__u8 iir_config[MAX_SIDETONE_IIR_DATA_SIZE];
|
||||
};
|
||||
struct audio_cal_info_lsm_top {
|
||||
__s32 topology;
|
||||
__s32 acdb_id;
|
||||
__s32 app_type;
|
||||
};
|
||||
|
||||
|
||||
struct audio_cal_info_lsm {
|
||||
__s32 acdb_id;
|
||||
/* RX_DEVICE or TX_DEVICE */
|
||||
__s32 path;
|
||||
__s32 app_type;
|
||||
};
|
||||
|
||||
#define VSS_NUM_CHANNELS_MAX 32
|
||||
|
||||
struct audio_cal_info_voc_top {
|
||||
__s32 topology;
|
||||
__s32 acdb_id;
|
||||
#ifdef TOPOLOGY_SPECIFIC_CHANNEL_INFO
|
||||
__u32 num_channels;
|
||||
__u8 channel_mapping[VSS_NUM_CHANNELS_MAX];
|
||||
#endif
|
||||
};
|
||||
|
||||
struct audio_cal_info_vocproc {
|
||||
__s32 tx_acdb_id;
|
||||
__s32 rx_acdb_id;
|
||||
__s32 tx_sample_rate;
|
||||
__s32 rx_sample_rate;
|
||||
};
|
||||
|
||||
enum {
|
||||
DEFAULT_FEATURE_SET,
|
||||
VOL_BOOST_FEATURE_SET,
|
||||
};
|
||||
|
||||
struct audio_cal_info_vocvol {
|
||||
__s32 tx_acdb_id;
|
||||
__s32 rx_acdb_id;
|
||||
/* DEFAULT_ or VOL_BOOST_FEATURE_SET */
|
||||
__s32 feature_set;
|
||||
};
|
||||
|
||||
struct audio_cal_info_vocdev_cfg {
|
||||
__s32 tx_acdb_id;
|
||||
__s32 rx_acdb_id;
|
||||
};
|
||||
|
||||
#define MAX_VOICE_COLUMNS 20
|
||||
|
||||
union audio_cal_col_na {
|
||||
__u8 val8;
|
||||
__u16 val16;
|
||||
__u32 val32;
|
||||
__u64 val64;
|
||||
} __packed;
|
||||
|
||||
struct audio_cal_col {
|
||||
__u32 id;
|
||||
__u32 type;
|
||||
union audio_cal_col_na na_value;
|
||||
} __packed;
|
||||
|
||||
struct audio_cal_col_data {
|
||||
__u32 num_columns;
|
||||
struct audio_cal_col column[MAX_VOICE_COLUMNS];
|
||||
} __packed;
|
||||
|
||||
struct audio_cal_info_voc_col {
|
||||
__s32 table_id;
|
||||
__s32 tx_acdb_id;
|
||||
__s32 rx_acdb_id;
|
||||
struct audio_cal_col_data data;
|
||||
};
|
||||
|
||||
/* AUDIO_SET_CALIBRATION & */
|
||||
struct audio_cal_type_basic {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
};
|
||||
|
||||
struct audio_cal_basic {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_basic cal_type;
|
||||
};
|
||||
|
||||
struct audio_cal_type_adm_top {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
struct audio_cal_info_adm_top cal_info;
|
||||
};
|
||||
|
||||
struct audio_cal_adm_top {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_adm_top cal_type;
|
||||
};
|
||||
|
||||
struct audio_cal_type_metainfo {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
struct audio_cal_info_metainfo cal_info;
|
||||
};
|
||||
|
||||
struct audio_core_metainfo {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_metainfo cal_type;
|
||||
};
|
||||
|
||||
struct audio_cal_type_audproc {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
struct audio_cal_info_audproc cal_info;
|
||||
};
|
||||
|
||||
struct audio_cal_audproc {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_audproc cal_type;
|
||||
};
|
||||
|
||||
struct audio_cal_type_audvol {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
struct audio_cal_info_audvol cal_info;
|
||||
};
|
||||
|
||||
struct audio_cal_audvol {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_audvol cal_type;
|
||||
};
|
||||
|
||||
struct audio_cal_type_asm_top {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
struct audio_cal_info_asm_top cal_info;
|
||||
};
|
||||
|
||||
struct audio_cal_asm_top {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_asm_top cal_type;
|
||||
};
|
||||
|
||||
struct audio_cal_type_audstrm {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
struct audio_cal_info_audstrm cal_info;
|
||||
};
|
||||
|
||||
struct audio_cal_audstrm {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_audstrm cal_type;
|
||||
};
|
||||
|
||||
struct audio_cal_type_afe {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
struct audio_cal_info_afe cal_info;
|
||||
};
|
||||
|
||||
struct audio_cal_afe {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_afe cal_type;
|
||||
};
|
||||
|
||||
struct audio_cal_type_afe_top {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
struct audio_cal_info_afe_top cal_info;
|
||||
};
|
||||
|
||||
struct audio_cal_afe_top {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_afe_top cal_type;
|
||||
};
|
||||
|
||||
struct audio_cal_type_aanc {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
struct audio_cal_info_aanc cal_info;
|
||||
};
|
||||
|
||||
struct audio_cal_aanc {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_aanc cal_type;
|
||||
};
|
||||
|
||||
struct audio_cal_type_fb_spk_prot_cfg {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
struct audio_cal_info_spk_prot_cfg cal_info;
|
||||
};
|
||||
|
||||
struct audio_cal_fb_spk_prot_cfg {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_fb_spk_prot_cfg cal_type;
|
||||
};
|
||||
|
||||
struct audio_cal_type_sp_th_vi_ftm_cfg {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
struct audio_cal_info_sp_th_vi_ftm_cfg cal_info;
|
||||
};
|
||||
|
||||
struct audio_cal_sp_th_vi_ftm_cfg {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_sp_th_vi_ftm_cfg cal_type;
|
||||
};
|
||||
|
||||
struct audio_cal_type_sp_th_vi_v_vali_cfg {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
struct audio_cal_info_sp_th_vi_v_vali_cfg cal_info;
|
||||
};
|
||||
|
||||
struct audio_cal_sp_th_vi_v_vali_cfg {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_sp_th_vi_v_vali_cfg cal_type;
|
||||
};
|
||||
|
||||
struct audio_cal_type_sp_ex_vi_ftm_cfg {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
struct audio_cal_info_sp_ex_vi_ftm_cfg cal_info;
|
||||
};
|
||||
|
||||
struct audio_cal_sp_ex_vi_ftm_cfg {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_sp_ex_vi_ftm_cfg cal_type;
|
||||
};
|
||||
struct audio_cal_type_hw_delay {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
struct audio_cal_info_hw_delay cal_info;
|
||||
};
|
||||
|
||||
struct audio_cal_hw_delay {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_hw_delay cal_type;
|
||||
};
|
||||
|
||||
struct audio_cal_type_sidetone {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
struct audio_cal_info_sidetone cal_info;
|
||||
};
|
||||
|
||||
struct audio_cal_sidetone {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_sidetone cal_type;
|
||||
};
|
||||
|
||||
struct audio_cal_type_sidetone_iir {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
struct audio_cal_info_sidetone_iir cal_info;
|
||||
};
|
||||
|
||||
struct audio_cal_sidetone_iir {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_sidetone_iir cal_type;
|
||||
};
|
||||
|
||||
struct audio_cal_type_lsm_top {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
struct audio_cal_info_lsm_top cal_info;
|
||||
};
|
||||
|
||||
struct audio_cal_lsm_top {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_lsm_top cal_type;
|
||||
};
|
||||
|
||||
struct audio_cal_type_lsm {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
struct audio_cal_info_lsm cal_info;
|
||||
};
|
||||
|
||||
struct audio_cal_lsm {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_lsm cal_type;
|
||||
};
|
||||
|
||||
struct audio_cal_type_voc_top {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
struct audio_cal_info_voc_top cal_info;
|
||||
};
|
||||
|
||||
struct audio_cal_voc_top {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_voc_top cal_type;
|
||||
};
|
||||
|
||||
struct audio_cal_type_vocproc {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
struct audio_cal_info_vocproc cal_info;
|
||||
};
|
||||
|
||||
struct audio_cal_vocproc {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_vocproc cal_type;
|
||||
};
|
||||
|
||||
struct audio_cal_type_vocvol {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
struct audio_cal_info_vocvol cal_info;
|
||||
};
|
||||
|
||||
struct audio_cal_vocvol {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_vocvol cal_type;
|
||||
};
|
||||
|
||||
struct audio_cal_type_vocdev_cfg {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
struct audio_cal_info_vocdev_cfg cal_info;
|
||||
};
|
||||
|
||||
struct audio_cal_vocdev_cfg {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_vocdev_cfg cal_type;
|
||||
};
|
||||
|
||||
struct audio_cal_type_voc_col {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
struct audio_cal_info_voc_col cal_info;
|
||||
};
|
||||
|
||||
struct audio_cal_voc_col {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_voc_col cal_type;
|
||||
};
|
||||
|
||||
/* AUDIO_GET_CALIBRATION */
|
||||
struct audio_cal_type_fb_spk_prot_status {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
struct audio_cal_info_msm_spk_prot_status cal_info;
|
||||
};
|
||||
|
||||
struct audio_cal_fb_spk_prot_status {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_fb_spk_prot_status cal_type;
|
||||
};
|
||||
|
||||
struct audio_cal_type_sp_th_vi_param {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
struct audio_cal_info_sp_th_vi_param cal_info;
|
||||
};
|
||||
|
||||
struct audio_cal_sp_th_vi_param {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_sp_th_vi_param cal_type;
|
||||
};
|
||||
|
||||
struct audio_cal_type_sp_th_vi_v_vali_param {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
struct audio_cal_info_sp_th_vi_v_vali_param cal_info;
|
||||
};
|
||||
|
||||
struct audio_cal_sp_th_vi_v_vali_param {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_sp_th_vi_v_vali_param cal_type;
|
||||
};
|
||||
|
||||
struct audio_cal_type_sp_ex_vi_param {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
struct audio_cal_info_sp_ex_vi_param cal_info;
|
||||
};
|
||||
|
||||
struct audio_cal_sp_ex_vi_param {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_sp_ex_vi_param cal_type;
|
||||
};
|
||||
|
||||
struct audio_cal_type_sp_v4_ex_vi_param {
|
||||
struct audio_cal_type_header cal_hdr;
|
||||
struct audio_cal_data cal_data;
|
||||
struct audio_cal_info_sp_v4_ex_vi_param cal_info;
|
||||
};
|
||||
|
||||
struct audio_cal_sp_v4_ex_vi_param {
|
||||
struct audio_cal_header hdr;
|
||||
struct audio_cal_type_sp_v4_ex_vi_param cal_type;
|
||||
};
|
||||
|
||||
#endif /* _UAPI_MSM_AUDIO_CALIBRATION_H */
|
Fai riferimento in un nuovo problema
Block a user