summaryrefslogtreecommitdiff
path: root/sound/soc/mediatek/mt2701/mt2701-afe-pcm.c
AgeCommit message (Collapse)Author
2018-01-22ASoC: mediatek: fix double free in mt2701_afe_pcm_dev_probe()Ryder Lee
The commit dfa3cbb8(ASoC: mediatek: modify MT2701 AFE driver to adapt mfd device) leads to the following static checker warning: sound/soc/mediatek/mt2701/mt2701-afe-pcm.c:1535 mt2701_afe_pcm_dev_probe() error: double free of 'component' This patch fixes that and adds a helper mt2701_afe_add_component() to setup component. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-01-08ASoC: mediatek: mt2701: fix return value check in mt2701_afe_pcm_dev_probe()Wei Yongjun
In case of error, the function syscon_node_to_regmap() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Fixes: dfa3cbb83e09 ("ASoC: mediatek: modify MT2701 AFE driver to adapt mfd device") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-01-04ASoC: mediatek: modify MT2701 AFE driver to adapt mfd deviceRyder Lee
As the new MFD parent is in place, modify MT2701 AFE driver to adapt it. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-01-03ASoC: mediatek: cleanup audio driver for MT2701Ryder Lee
Cleanup unused code such as 'i2s_num' guard, headers, indentation and some defines. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-01-03ASoC: mediatek: rework clock functions for MT2701Ryder Lee
Reworks clock part to make it more reasonable. The current changes are: - Replace regmap operations by CCF APIs. Doing so, we just need to handle the element clocks and can also get accurate information via CCF. - Rename clocks to make them more generic so that the future revisions of the IP can adapt gracefully. - Regroup 'aud_clks[]' by usage - the basic needs and I2S parts: The new code just keep the common clocks in array and let SoC self decide I2S numbers - If future chips have different sets of channels we will add a little more abstract here. Moreover, this patch moves I2S clocks to the struct mt2701_i2s_data so that we can easily manage them when calls .prepare() and .shutdown(). Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Tested-by: Garlic Tseng <garlic.tseng@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-01-03ASoC: mediatek: fix error handling in mt2701_afe_pcm_dev_probe()Ryder Lee
Fix unbalanced error handling path which will get incorrect counts if probe failed. The .remove() should be adjusted accordingly. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Tested-by: Garlic Tseng <garlic.tseng@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-08-18ASoC: mediatek: switch to use platform_get_irq_byname()Ryder Lee
Switch to use platform_get_irq_byname() so that binding can be agnostic of the IRQ order. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> CC: Garlic Tseng <garlic.tseng@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-07-17ASoC: mediatek: mt2701: constify snd_soc_dai_ops structureGustavo A. R. Silva
This structure is only stored in the ops field of a snd_soc_dai_driver structure. That field is declared const, so snd_soc_dai_ops structures that have this property can be declared as const also. Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-29ASoC: mediatek: Add mt2701-wm8960 machine driverRyder Lee
Add wm8960 machine driver and config option for MT2701. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-02-16ASoC: mediatek: add power-domain get/put ctrl for mt2701Garlic Tseng
add power-domain ctrl for audio driver Signed-off-by: Garlic Tseng <garlic.tseng@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-07-14ASoC: mediatek: mt2701: fix non static symbol warningWei Yongjun
Fixes the following sparse warning: sound/soc/mediatek/mt2701/mt2701-afe-pcm.c:72:5: warning: symbol 'mt2701_dai_num_to_i2s' was not declared. Should it be static? Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Acked-by: Garlic Tseng <garlic.tseng@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-07-07ASoC: mediatek: mt2701: fix some error handling in probeDan Carpenter
The check for if the "afe" allocation failed was too late and there wasn't a check for "afe->platform_priv". Fixes: 43a6a7e71063 ('ASoC: mediatek: add mt2701 platform driver implementation.') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Garlic Tseng <garlic.tseng@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-07-05ASoC: mediatek: add BT implementationGarlic Tseng
Add BT implementation for mt2701 platform driver. Signed-off-by: Garlic Tseng <garlic.tseng@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-07-04ASoC: mediatek: add mt2701 platform driver implementation.Garlic Tseng
Add mt2701 platform driver implementation for playback and capture. The implement follow DAPM structure (memory interface as FE and I2S as BE). Because of the hardware design, i2s out required to be enabled when we need to enable i2s in. This patch includes the implementation. Signed-off-by: Garlic Tseng <garlic.tseng@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>