mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 23:24:22 -04:00
Channel row : audio: add TI smartpa algorithm
channel: support two tas2560 bin files -tas2560_TI_row.bin for Channel ROW with smart pa; -tas2560_TI_na.bin for Channel NA; -add ti,spk_type_id to distinguish row and na bin files; -close debug log. Change-Id: I8ae7805db2e92c807b34f841dd1268db96ba6163 Signed-off-by: Wen Xie <xiewen3@motorola.com> Reviewed-on: https://gerrit.mot.com/1274052 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Zhengming Yao <yaozm1@lenovo.com> Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
a788daec12
commit
ac89b6f56d
5 changed files with 22 additions and 6 deletions
|
|
@ -106,6 +106,7 @@
|
|||
/*Set Profile(Music(0),Ringtone(1)...etc)*/
|
||||
#define TAS2560_ALGO_PROFILE 3819
|
||||
|
||||
#define AFE_PARAM_ID_TAS2560_SPEAKER_ID 3820
|
||||
|
||||
struct afe_tas2560_algo_params_t {
|
||||
uint32_t payload[TAS2560_ALGO_PAYLOAD_SIZE];
|
||||
|
|
|
|||
|
|
@ -26,6 +26,8 @@ static struct mutex routing_lock;
|
|||
/*Port IDs to be read from dts*/
|
||||
static uint32_t tx_port_id = TAS2560_ALGO_TX_PORT_ID;
|
||||
static uint32_t rx_port_id = TAS2560_ALGO_RX_PORT_ID;
|
||||
/*SPK IDs to be read from dts*/
|
||||
static uint32_t spk_id = 0;
|
||||
/*Not much significance and can be removed in future*/
|
||||
static uint8_t calib_status;
|
||||
static int32_t force_algo_disable;
|
||||
|
|
@ -483,6 +485,13 @@ static int tas2560_algo_set_cal(struct snd_kcontrol *kcontrol,
|
|||
ret = afe_tas2560_algo_ctrl(ptr, paramid, moduleid,
|
||||
TAS2560_ALGO_SET_PARAM, sizeof(u32));
|
||||
if (!ret) {
|
||||
pr_err("TAS2560_ALGO:%s Sending Speaker ID : %d",__func__,spk_id);
|
||||
paramid = TAS2560_ALGO_CALC_PIDX(0,
|
||||
AFE_PARAM_ID_TAS2560_SPEAKER_ID, 1,SLAVE1);
|
||||
((int32_t *)buff)[0] = spk_id;
|
||||
ret = afe_tas2560_algo_ctrl(ptr, paramid, moduleid,
|
||||
TAS2560_ALGO_SET_PARAM, sizeof(u32));
|
||||
|
||||
pr_err("TAS2560_ALGO:%s Sending Rx-Cfg", __func__);
|
||||
paramid = AFE_PARAM_ID_TAS2560_ALGO_RX_CFG;
|
||||
((int32_t *)buff)[0] = 1;
|
||||
|
|
@ -769,6 +778,12 @@ static int tas2560_algo_probe(struct platform_device *pdev)
|
|||
|
||||
ret = of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev);
|
||||
|
||||
ret = of_property_read_u32(pdev->dev.of_node, "ti,spk_type_id", &spk_id);
|
||||
if (ret < 0) {
|
||||
pr_err("ti,spk_type_id read error,use default spk id.\n");
|
||||
}
|
||||
pr_err("TAS2560_ALGO:%s spk_id = 0x%x",__func__, spk_id);
|
||||
|
||||
num_entries = of_property_count_u32_elems(pdev->dev.of_node,
|
||||
"ti,tas2560-port-id");
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
#ifdef CONFIG_TAS2560_CODEC
|
||||
|
||||
#define DEBUG
|
||||
/* #define DEBUG */
|
||||
#include <linux/module.h>
|
||||
#include <linux/moduleparam.h>
|
||||
#include <linux/init.h>
|
||||
|
|
@ -158,7 +158,7 @@ static int tas2560_mute(struct snd_soc_dai *dai, int mute)
|
|||
struct tas2560_priv *pTAS2560 = snd_soc_codec_get_drvdata(codec);
|
||||
|
||||
mutex_lock(&pTAS2560->codec_lock);
|
||||
dev_dbg(pTAS2560->dev, "%s, %d\n", __func__, mute);
|
||||
dev_info(pTAS2560->dev, "%s, %d\n", __func__, mute);
|
||||
tas2560_enable(pTAS2560, !mute);
|
||||
mutex_unlock(&pTAS2560->codec_lock);
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
**
|
||||
** =============================================================================
|
||||
*/
|
||||
#define DEBUG
|
||||
/* #define DEBUG */
|
||||
#include <linux/module.h>
|
||||
#include <linux/moduleparam.h>
|
||||
#include <linux/init.h>
|
||||
|
|
@ -1019,7 +1019,7 @@ int tas2560_enable(struct tas2560_priv *pTAS2560, bool bEnable)
|
|||
|
||||
if (bEnable) {
|
||||
if (!pTAS2560->mbPowerUp) {
|
||||
dev_dbg(pTAS2560->dev, "%s power up\n", __func__);
|
||||
dev_info(pTAS2560->dev, "%s power up\n", __func__);
|
||||
pTAS2560->clearIRQ(pTAS2560);
|
||||
nResult = tas2560_i2c_load_data(pTAS2560, p_tas2560_startup_data);
|
||||
if (nResult < 0)
|
||||
|
|
@ -1035,7 +1035,7 @@ int tas2560_enable(struct tas2560_priv *pTAS2560, bool bEnable)
|
|||
}
|
||||
} else {
|
||||
if (pTAS2560->mbPowerUp) {
|
||||
dev_dbg(pTAS2560->dev, "%s power down\n", __func__);
|
||||
dev_info(pTAS2560->dev, "%s power down\n", __func__);
|
||||
if (hrtimer_active(&pTAS2560->mtimer))
|
||||
hrtimer_cancel(&pTAS2560->mtimer);
|
||||
pTAS2560->enableIRQ(pTAS2560, false);
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
#ifdef CONFIG_TAS2560_MISC
|
||||
|
||||
#define DEBUG
|
||||
/* #define DEBUG */
|
||||
#include <linux/module.h>
|
||||
#include <linux/moduleparam.h>
|
||||
#include <linux/init.h>
|
||||
|
|
|
|||
Loading…
Reference in a new issue