diff --git a/include/sound/tas2560_algo.h b/include/sound/tas2560_algo.h index cc32681ad37f..92c65d8f9653 100644 --- a/include/sound/tas2560_algo.h +++ b/include/sound/tas2560_algo.h @@ -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]; diff --git a/sound/soc/codecs/tas2560-algo.c b/sound/soc/codecs/tas2560-algo.c index e4824abaa9af..cbc28a854d20 100644 --- a/sound/soc/codecs/tas2560-algo.c +++ b/sound/soc/codecs/tas2560-algo.c @@ -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"); diff --git a/sound/soc/codecs/tas2560-codec.c b/sound/soc/codecs/tas2560-codec.c index bbb51825ddfe..e8c29c6118ac 100644 --- a/sound/soc/codecs/tas2560-codec.c +++ b/sound/soc/codecs/tas2560-codec.c @@ -21,7 +21,7 @@ #ifdef CONFIG_TAS2560_CODEC -#define DEBUG +/* #define DEBUG */ #include #include #include @@ -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; diff --git a/sound/soc/codecs/tas2560-core.c b/sound/soc/codecs/tas2560-core.c index 737af6abb444..f60c3a2d6cf2 100644 --- a/sound/soc/codecs/tas2560-core.c +++ b/sound/soc/codecs/tas2560-core.c @@ -18,7 +18,7 @@ ** ** ============================================================================= */ -#define DEBUG +/* #define DEBUG */ #include #include #include @@ -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); diff --git a/sound/soc/codecs/tas2560-misc.c b/sound/soc/codecs/tas2560-misc.c index d5d3ba7a4ead..a929ab1a49bc 100644 --- a/sound/soc/codecs/tas2560-misc.c +++ b/sound/soc/codecs/tas2560-misc.c @@ -20,7 +20,7 @@ #ifdef CONFIG_TAS2560_MISC -#define DEBUG +/* #define DEBUG */ #include #include #include