summaryrefslogtreecommitdiffstats
path: root/sound/soc/mediatek/mt2701
Commit message (Collapse)AuthorAgeFilesLines
* ASoC: mediatek: fix double free in mt2701_afe_pcm_dev_probe()Ryder Lee2018-01-221-14/+18
| | | | | | | | | | | | | | | 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>
* ASoC: mediatek: mt2701: fix return value check in mt2701_afe_pcm_dev_probe()Wei Yongjun2018-01-081-2/+2
| | | | | | | | | | 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>
* ASoC: mediatek: modify MT2701 AFE driver to adapt mfd deviceRyder Lee2018-01-042-26/+20
| | | | | | | 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>
* ASoC: mediatek: add some core clocks for MT2701 AFERyder Lee2018-01-042-1/+32
| | | | | | | Add three core clocks for MT2701 AFE. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: mediatek: cleanup audio driver for MT2701Ryder Lee2018-01-034-145/+24
| | | | | | | | 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>
* ASoC: mediatek: rework clock functions for MT2701Ryder Lee2018-01-034-442/+200
| | | | | | | | | | | | | | | | | | | | | | | 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>
* ASoC: mediatek: fix error handling in mt2701_afe_pcm_dev_probe()Ryder Lee2018-01-031-17/+14
| | | | | | | | | 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>
*-. Merge remote-tracking branches 'asoc/topic/mtk', 'asoc/topic/mxs', ↵Mark Brown2017-09-011-8/+7
|\ \ | | | | | | | | | 'asoc/topic/nau8825', 'asoc/topic/nuc900' and 'asoc/topic/of-graph' into asoc-next
| * | ASoC: mediatek: switch to use platform_get_irq_byname()Ryder Lee2017-08-181-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | ASoC: mediatek: mt2701: constify snd_soc_dai_ops structureGustavo A. R. Silva2017-07-171-1/+1
| |/ | | | | | | | | | | | | | | | | 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>
* / ASoC: mediatek: Fix an error checking codeChristophe Jaillet2017-08-071-1/+1
|/ | | | | | | | | Check the value returned by 'devm_clk_get()' instead of the clock identifier which can never be an ERR code. Fixes: d6f3710a56e1 ("ASoC: mediatek: add structure define and clock control for 2701") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: mediatek: Constify hw_constraintsTakashi Iwai2017-06-131-1/+1
| | | | | | | | | | snd_pcm_hw_constraint_list(), *_ratnums() and *_ratdens() receive the const pointers. Constify the corresponding static objects for better hardening. Signed-off-by: Takashi Iwai <tiwai@suse.de> Acked-By: Matthias Brugger <matthias.bgg@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: mediatek: Add mt2701-wm8960 machine driverRyder Lee2017-03-293-0/+193
| | | | | | | 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>
* ASoC: mediatek: constify snd_soc_ops structuresBhumika Goyal2017-03-201-1/+1
| | | | | | | | | | Declare snd_soc_ops structures as const as they are only stored in the ops field of a snd_soc_dai_link structure. This field is of type const, so snd_soc_ops structures having this property can be made const too. Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: mediatek: add power-domain get/put ctrl for mt2701Garlic Tseng2017-02-161-0/+2
| | | | | | | add power-domain ctrl for audio driver Signed-off-by: Garlic Tseng <garlic.tseng@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: mediatek: mt2701: fix non static symbol warningWei Yongjun2016-07-141-1/+1
| | | | | | | | | | | 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>
* ASoC: mediatek: mt2701: fix some error handling in probeDan Carpenter2016-07-071-2/+4
| | | | | | | | | | 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>
* ASoC: mediatek: add BT implementationGarlic Tseng2016-07-051-0/+139
| | | | | | | Add BT implementation for mt2701 platform driver. Signed-off-by: Garlic Tseng <garlic.tseng@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: mediatek: Add mt2701-cs42448 driver and config option.Garlic Tseng2016-07-042-0/+431
| | | | | | | Add machine driver and config option for MT2701. Signed-off-by: Garlic Tseng <garlic.tseng@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: mediatek: add mt2701 platform driver implementation.Garlic Tseng2016-07-042-9/+1515
| | | | | | | | | | | 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>
* ASoC: mediatek: add structure define and clock control for 2701Garlic Tseng2016-06-294-0/+869
add structure define and clock control function for 2701. Signed-off-by: Garlic Tseng <garlic.tseng@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>