summaryrefslogtreecommitdiff
path: root/sound/soc/mediatek
Commit message (Collapse)AuthorAgeFilesLines
*-. Merge remote-tracking branches 'asoc/topic/mtk', 'asoc/topic/mxs', ↵Mark Brown2017-09-014-11/+7
|\ \ | | | | | | | | | 'asoc/topic/nau8825', 'asoc/topic/nuc900' and 'asoc/topic/of-graph' into asoc-next
| * | ASoC: mediatek: Remove unnecessary function callDonglin Peng2017-08-213-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | First of all,the address of pdev->dev is assigned to card->dev,then the function platform_set_drvdata copies the value the variable card to pdev->dev.driver_data, but when calling snd_soc_register_card,the function dev_set_drvdata(card->dev, card) will also do the same copy operation,so i think that the former copy operation can be removed. Signed-off-by: Peng Donglin <dolinux.peng@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | 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 I2C dependency for CS42XX8Arnd Bergmann2017-04-211-1/+1
| | | | | | | | | | | | | | We should not select drivers that depend on I2C when that is disabled, as it results in a build error: warning: (SND_SOC_MT2701_WM8960) selects SND_SOC_WM8960 which has unmet direct dependencies (SOUND && !M68K && !UML && SND && SND_SOC && I2C) sound/soc/codecs/wm8960.c:1469:1: error: data definition has no type or storage class [-Werror] sound/soc/codecs/wm8960.c:1469:1: error: type defaults to 'int' in declaration of 'module_i2c_driver' [-Werror=implicit-int] Fixes: 8625c1dbd876 ("ASoC: mediatek: Add mt2701-wm8960 machine driver") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: mediatek: Add mt2701-wm8960 machine driverRyder Lee2017-03-294-0/+203
| | | | | | | 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-205-5/+5
| | | | | | | | | | 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 I2C dependency for CS42XX8Arnd Bergmann2017-02-211-1/+1
| | | | | | | | | | | | | | We should not select drivers that depend on I2C when that is disabled, as it results in a build error: warning: (SND_SOC_MT2701_CS42448) selects SND_SOC_CS42XX8_I2C which has unmet direct dependencies (SOUND && !M68K && !UML && SND && SND_SOC && I2C) sound/soc/codecs/cs42xx8-i2c.c:60:1: warning: data definition has no type or storage class module_i2c_driver(cs42xx8_i2c_driver); sound/soc/codecs/cs42xx8-i2c.c:60:1: error: type defaults to 'int' in declaration of 'module_i2c_driver' [-Werror=implicit-int] Fixes: 1f458d53f76c ("ASoC: mediatek: Add mt2701-cs42448 driver and config option.") Signed-off-by: Arnd Bergmann <arnd@arndb.de> 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: mt8173-max98090: remove the call to snd_soc_jack_add_pins.Enric Balletbo i Serra2017-01-311-10/+4
| | | | | | | | The snd_soc_card_jack_new function can call snd_soc_jack_add_pins for you, so pass directly the pins struct when you create the new jack. Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: mediatek: mark symbols static where possibleBaoyou Xie2016-08-111-2/+3
| | | | | | | | | | | | | | | | | | | We get 2 warnings about global functions without a declaration in the ASoC mediatek module when building with W=1: sound/soc/mediatek/common/mtk-afe-fe-dai.c:26:5: warning: no previous prototype for 'mtk_regmap_update_bits' [-Wmissing-prototypes] int mtk_regmap_update_bits(struct regmap *map, int reg, unsigned int mask, ^ sound/soc/mediatek/common/mtk-afe-fe-dai.c:34:5: warning: no previous prototype for 'mtk_regmap_write' [-Wmissing-prototypes] int mtk_regmap_write(struct regmap *map, int reg, unsigned int val) In fact, all of those functions are only used in the file in which they are declared and don't need a declaration, but can be made static. so this patch marks it 'static'. Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: mediatek: Add HDMI dai-links to the mt8173-rt5650 machine driverPC Liao2016-07-142-0/+27
| | | | | | | | | This patch adds HDMI audio output support to the MT8173 RT5650 machine driver. Signed-off-by: PC Liao <pc.liao@mediatek.com> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> 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-044-0/+453
| | | | | | | 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>
* ASoC: mediatek: let mt8173 use mediatek common structureGarlic Tseng2016-06-295-425/+318
| | | | | | | Modify mt8173 driver implementation to use common structure. Signed-off-by: Garlic Tseng <garlic.tseng@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: mediatek: implement mediatek common structureGarlic Tseng2016-06-295-0/+641
| | | | | | | | implement mediatek basic structure, include common private data, afe fe dai operator and afe platform driver. Signed-off-by: Garlic Tseng <garlic.tseng@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: mediatek: Refine mt8173 driver and change config optionGarlic Tseng2016-06-2910-369/+367
| | | | | | | | move mt8173 driver to another folder and add prefix. add config option SND_SOC_MT8173 Signed-off-by: Garlic Tseng <garlic.tseng@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: mediatek: add MCLK source selectionPC Liao2016-06-021-2/+43
| | | | | | | | The new machine's MCLK source is from mt8173 which is dynamic from sampling rate*256. This patch provides the selection for device tree. Signed-off-by: PC Liao <pc.liao@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: mediatek: Change the order of MCLK clock configurationPC Liao2016-05-301-4/+12
| | | | | | | | Because MCLK opens later and closes earlier than codec, this patch changes the order of MCLK clock configuration. Signed-off-by: PC Liao <pc.liao@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: mediatek: HDMI audio LR channel swappedPC Liao2016-04-261-0/+2
| | | | | | | | Because LRCK of TDM use High to Low as default setting, this patch changes the TDM setting to inverse LRCK. Signed-off-by: PC Liao <pc.liao@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: mediatek: Add HDMI dai-links in the mt8173-rt5650-rt5676 machine driverKoro Chen2016-04-212-0/+28
| | | | | | | | This creates pcmC0D2p for the HDMI playback in the same card. Signed-off-by: Koro Chen <koro.chen@mediatek.com> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: mediatek: Add second I2S on mt8173-rt5650 machine driverPC Liao2016-04-211-3/+47
| | | | | | | | This patch adds second I2S connection to rt5650 codec for capture path on mt8173-rt5650 machine driver. Signed-off-by: PC Liao <pc.liao@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: mediatek: address dai link array entries by enumPhilipp Zabel2016-03-051-5/+13
| | | | | | | | This should be more robust to future changes than adressing array entries by index number. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: mediatek: Add machine driver for rt5650 rt5514 codecKoro Chen2016-03-023-10/+279
| | | | | | | | This is the DPCM based machine driver with rt5650 and rt5514. Signed-off-by: Koro Chen <koro.chen@mediatek.com> Signed-off-by: PC Liao <pc.liao@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: mediatek: Add I03/I04 widgets and corresponding routesKoro Chen2016-02-261-0/+11
| | | | | | | | Add these widgets to allow another path from I2S input. Signed-off-by: Koro Chen <koro.chen@mediatek.com> Signed-off-by: PC Liao <pc.liao@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: mediatek: remove soft reset and add second I2S clockPC Liao2016-02-261-8/+6
| | | | | | | | To improve I2S flow, this patch removes soft reset and adds second I2S clock to use. Signed-off-by: PC Liao <pc.liao@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: mediatek: Add machine driver for ALC5650 codecKoro Chen2016-02-223-0/+247
| | | | | | | | | This is the DPCM based machine driver with rt5650 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Signed-off-by: Koro Chen <koro.chen@mediatek.com> Signed-off-by: PC Liao <pc.liao@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* Merge tag 'v4.5-rc5' into asoc-mtkMark Brown2016-02-221-2/+2
|\ | | | | | | Linux 4.5-rc5
| *-. Merge remote-tracking branches 'asoc/fix/imx-spdif', 'asoc/fix/mtk', ↵Mark Brown2016-02-101-2/+2
| |\ \ | | | | | | | | | | | | 'asoc/fix/mxs-saif', 'asoc/fix/qcom' and 'asoc/fix/rt286' into asoc-linus
| | * | ASoC: mediatek: add i2c dependencyArnd Bergmann2016-01-151-2/+2
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The newly added mediatek drivers for mt8173 select codes that depend on I2C, which cuases a build failure if I2C is disabled: warning: (SND_SOC_ADAU1761_I2C && SND_SOC_ADAU1781_I2C && SND_SOC_ADAU1977_I2C && SND_SOC_RT5677 && EXTCON_MAX14577 && EXTCON_MAX77693 && EXTCON_MAX77843 && BMC150_ACCEL_I2C && BMG160_I2C) selects REGMAP_I2C which has unmet direct dependencies (I2C) codecs/rt5645.c:3854:1: warning: data definition has no type or storage class codecs/rt5645.c:3854:1: error: type defaults to 'int' in declaration of 'module_i2c_driver' [-Werror=implicit-int] codecs/rt5677.c:5270:1: warning: data definition has no type or storage class 77_i2c_driver); codecs/rt5677.c:5270:1: error: type defaults to 'int' in declaration of 'module_i2c_driver' [-Werror=implicit-int] This adds an explicit dependency. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Koro Chen <koro.chen@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | | ASoC: mediatek: Enable 33bit memory address to support 4GB DRAMPC Liao2016-01-152-1/+22
|/ / | | | | | | | | | | | | | | | | | | If platform is embedded with memory more than 3GB, the address will go out of the scope that 32-bit can handle with. This patch sets the dma_mask and MSB properly to describe its address to 33-bit. Signed-off-by: Hidalgo Huang <hidalgo.huang@mediatek.com> Signed-off-by: PC Liao <pc.liao@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: mediatek: Turn AFE on/off in runtime resume/suspendKoro Chen2015-12-221-18/+6
| | | | | | | | | | | | | | | | | | | | AFE is actually allowed to be turn on before configuration of DAIs since each DAI has its own enabling control. Turn on/off AFE in runtime resume/suspend to avoid AFE being shut down when closing a DAI while other DAIs are still active. Signed-off-by: Koro Chen <koro.chen@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: mediatek: Use current HW pointer for pointer callbackKoro Chen2015-12-082-12/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously we recorded "last interrupt position" and used it in pointer callback. This is not correct implementation, and it causes underruns when user space monitors buffer level to decide when to send next data chunk in low latency application. Remove position recording in IRQ handler and also hw_ptr in struct mtk_afe_memif used to record that, and let pointer callback reports current HW pointer instead. Signed-off-by: Koro Chen <koro.chen@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: mediatek: Move 22M/24M clock control into I2S opsKoro Chen2015-11-171-7/+6
|/ | | | | | | | 22M/24M clocks are only required for I2S, so move the control to I2S DAI ops. Signed-off-by: Koro Chen <koro.chen@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
*-. Merge remote-tracking branches 'asoc/topic/jz4740', 'asoc/topic/kirkwood', ↵Mark Brown2015-09-232-20/+2
|\ \ | | | | | | | | | 'asoc/topic/mtk', 'asoc/topic/multi' and 'asoc/topic/mxs' into asoc-next
| | * ASoC: mediatek: Convert to devm_snd_soc_register_cardAxel Lin2015-08-312-20/+2
| | | | | | | | | | | | | | | | | | Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Koro Chen <koro.chen@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | | ASoC: mediatek: Increase periods_min in captureKoro Chen2015-09-141-0/+17
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In capture, there is chance that hw_ptr reported at IRQ is a little smaller than period_size due to internal AFE buffer. In the case of ping-pong buffer: |xxxxxxxxxxxxxxxxxxxxxxxxxxxx--|-----------------------------| hw_ptr < period_size This available buffer will not be read since its size is smaller than avail_min (which is period_size by default), and read thread continues to sleep. If the next hw_ptr is just a little larger than buffer_size, overrun occurs. One more period can hold the possible unread buffer. Signed-off-by: Koro Chen <koro.chen@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| |
| \
| \
| \
*---. \ Merge remote-tracking branches 'asoc/topic/mediatek', 'asoc/topic/mtk', ↵Mark Brown2015-08-304-22/+77
|\ \ \ \ | | | |/ | | |/| | | | | 'asoc/topic/nuc900', 'asoc/topic/of-name' and 'asoc/topic/omap' into asoc-next
| | * | ASoC: mediatek: Remove AIF widgets for backend DAIsKoro Chen2015-08-171-11/+0
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DAPM core already creates widgets for DAIs. It is not necessary to declare them by SND_SOC_DAPM_AIF_IN/SND_SOC_DAPM_AIF_OUT. Furthermore, original codes use backend DAI's stream name to be the AIF widget name. It causes the same widget to be created twice, and after commit 92fa12426741 ("ASoC: dapm: Add new widgets to the end of the widget list") the first created widget (by snd_soc_dapm_new_controls) is used, not the 2nd created one (by snd_soc_dapm_new_dai_widgets), so audio path is broken. Signed-off-by: Koro Chen <koro.chen@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | ASoC: mediatek: Add suspend/resume callbacksKoro Chen2015-07-222-8/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds suspend/resume callbacks, which are common for each DAI. To be able to continue the last playback/capture after resume when suspend was done during a playback/capture, in the callbacks we do backup/restore of registers which were set before prepare stage. Registers to be backup/restore are defined in a backup list array. Signed-off-by: Koro Chen <koro.chen@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | ASoC: mediatek: Drop owner assignment from platform_driverKrzysztof Kozlowski2015-07-143-3/+0
| |/ | | | | | | | | | | | | | | | | platform_driver does not need to set an owner because platform_driver_register() will set it. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Acked-by: Koro Chen <koro.chen@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| |
| \
*-. \ Merge remote-tracking branches 'asoc/topic/au1x', 'asoc/topic/bcm2835', ↵Mark Brown2015-08-302-0/+2
|\ \ \ | | |/ | |/| | | | 'asoc/topic/blackfin' and 'asoc/topic/card' into asoc-next
| | * ASoC: Set missing card owner fieldAxel Lin2015-08-212-0/+2
| |/ | | | | | | | | | | | | | | Set the card owner field to prevent the module from being removed from underneath its users. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: mediatek: Use platform_of_node for machine driversKoro Chen2015-07-092-8/+28
| | | | | | | | | | | | | | This replaces the platform_name in snd_soc_dai_link by device tree node. Signed-off-by: Koro Chen <koro.chen@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>