summaryrefslogtreecommitdiffstats
path: root/sound/soc/mediatek
AgeCommit message (Collapse)AuthorFilesLines
2021-03-12ASoC: mediatek: mt8192: fix tdm out data is valid on rising edgeJiaxin Yu2-4/+8
This patch correct tdm out bck inverse register to AUDIO_TOP_CON3[3]. Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com> Link: https://lore.kernel.org/r/1615516005-781-1-git-send-email-jiaxin.yu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-05ASoC: mediatek: mt8183-mt6358: set playback and capture constraintsJiaxin Yu1-0/+41
Sets playback and capture constraints to S16_LE, stereo, 48kHz. Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com> Link: https://lore.kernel.org/r/1612513012-27688-1-git-send-email-jiaxin.yu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-05Merge branch 'asoc-5.11' into asoc-5.12Mark Brown3-2/+57
2021-02-04ASoC: mediatek: mt8192-mt6359: simplify ops for Capture1 DAI linkTzung-Bi Shih1-12/+8
1. Uses rtd->dev to get the device. 2. Generalizes the variable name. Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20210203032201.2882158-4-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-04ASoC: mediatek: mt8192: use asoc_substream_to_rtd()Tzung-Bi Shih1-2/+2
Uses asoc_substream_to_rtd() helper. Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20210203032201.2882158-3-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-04ASoC: mediatek: mt8192-mt6359: use asoc_substream_to_rtd()Tzung-Bi Shih1-3/+3
Uses asoc_substream_to_rtd() helper. Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20210203032201.2882158-2-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-25ASoC: mediatek: mt8192-mt6359: add format constraints for RT5682Tzung-Bi Shih1-0/+49
MT8192 determines the I2S clock rates according to the sampling rates. There is only 1 set of I2S in between MT8192 and RT5682. If playing and capturing via RT5682 in different sampling rates, the I2S data will be corrupted. Adds format constraints to the corresponding DAI links to make sure the sampling rates are symmetric. Fixes: 18b13ff23fab ("ASoC: mediatek: mt8192: add machine driver with mt6359, rt1015 and rt5682") Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20210125061453.1056535-1-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-21ASoC: mediatek: sync parameter naming (rate/sample_bits)Kuninori Morimoto5-18/+18
This patch syncs naming rule. - xxx_rates; + xxx_rate; - xxx_samplebits; + xxx_sample_bits; Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87ft32olha.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-20ASoC: mediatek: mt8192-mt6359: support audio over DPTzung-Bi Shih1-2/+37
If the DTS property is specified, the DP bridge should populate a "hdmi-codec" platform device (sound/soc/codecs/hdmi-codec.c). The "hdmi-codec" device is the communication relayer between the ASoC machine driver and the DP bridge. For example: - Notifies DP bridge when setting hw_param. - Notifies ASoC when jack detection events. Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20210120080850.699354-6-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-20ASoC: mediatek: mt8192: change mclk_multiple of TDM from 128 to 512Tzung-Bi Shih1-1/+1
mclk = rate * mclk_multiple bclk = rate * channel * sample_width If TDM outputs 8 channels and 32 bits, bclk will be greater than mclk. Changes the ratio from 128 to 512. Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20210120080850.699354-4-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-20ASoC: mediatek: mt8192-mt6359: simplify mt8192_rt5682_initTzung-Bi Shih1-7/+1
Returns snd_soc_component_set_jack() directly in mt8192_rt5682_init. No need to have another block to check the return value. Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20210120080850.699354-3-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-20ASoC: mediatek: mt8192-mt6359: move headset_jack to card specific dataTzung-Bi Shih1-2/+11
Moves headset_jack to card specific data. Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20210120080850.699354-2-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-20ASoC: mediatek: mt8183-da7219: ignore TDM DAI link by defaultTzung-Bi Shih1-1/+4
hdmi-codec is an optional property. Ignore to bind TDM DAI link if the property isn't specified. Fixes: 5bdbe9771177 ("ASoC: mediatek: mt8183-da7219: use hdmi-codec") Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20210120092237.1553938-3-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-20ASoC: mediatek: mt8183-mt6358: ignore TDM DAI link by defaultTzung-Bi Shih1-1/+4
hdmi-codec is an optional property. Ignore to bind TDM DAI link if the property isn't specified. Fixes: f2024dc55fcb ("ASoC: mediatek: mt8183: use hdmi-codec") Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20210120092237.1553938-2-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-01-05ASoC: rt1015: remove bclk_ratioTzung-Bi Shih3-18/+0
bclk_ratio is unused. Removes bclk_ratio and .set_bclk_ratio callback. Removes snd_soc_dai_set_bclk_ratio() in a few machine drivers which are obviously using rt1015. Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20201224101854.3024823-1-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-31ASoC: mediatek: add MTK_PMIC_WRAP dependencyArnd Bergmann1-1/+1
Randconfig builds often show harmless warnings like WARNING: unmet direct dependencies detected for SND_SOC_MT6359 Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && MTK_PMIC_WRAP [=n] Selected by [y]: - SND_SOC_MT8192_MT6359_RT1015_RT5682 [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && I2C [=y] && SND_SOC_MT8192 [=y] Add a dependency to avoid that. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20201230154345.639122-1-arnd@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-11ASoC: mediatek: mt8183: delete some unreachable codeDan Carpenter1-1/+0
This has a goto followed by an unreachable return statement. The goto is correct because it cleans up so the current runtime behavior is fine. Let's delete the unreachable return statement. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Link: https://lore.kernel.org/r/X9NFg3KVm16Gx6Io@mwanda Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-11ASoC: mediatek: mt8183: add PM ops to machine driversTzung-Bi Shih2-0/+2
Adds PM ops to machine drivers so that they notify components in the sound card when system suspend. Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20201211051334.2313899-1-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-02ASoC: mediatek: mt8192: support rt1015p_rt5682Tzung-Bi Shih2-0/+55
Supports machines with rt1015p and rt5682. Uses new proposed compatible string "mt8192_mt6359_rt1015p_rt5682". Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20201201132614.1691352-7-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-02ASoC: mediatek: mt8192: move rt1015_rt5682 specific dataTzung-Bi Shih1-25/+25
Moves rt1015_rt5682 specific data right before the snd_soc_card definition for neat purpose. Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20201201132614.1691352-4-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-02ASoC: mediatek: mt8192: extract rt1015_rt5682 specific DAI linkTzung-Bi Shih1-8/+31
Extracts rt1015_rt5682 specific DAI link from the common one. Fills the DAI link data according to of_match. Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20201201132614.1691352-3-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-02ASoC: mediatek: mt8192: rename common symbolsTzung-Bi Shih1-14/+14
Renames common symbols from "mt8192_mt6359_rt1015_rt5682" to "mt8192_mt6359". They will share between a few machine drivers on MT8192 and MT6359 with some different audio components. Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20201201132614.1691352-2-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-30Merge branch 'for-5.10' of ↵Mark Brown1-1/+1
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-5.11
2020-11-30ASoC: mediatek: btcvsd fix tx stream assignLumi Lee1-1/+1
Fix tx/rx stream assign in write. Write should use tx instead of rx. Signed-off-by: Lumi Lee <lumi.lee@mediatek.com> Link: https://lore.kernel.org/r/1606705875-1940-1-git-send-email-Lumi.Lee@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-11ASoC: mediatek: mt8192: skip first time data at the beginning of DMIC recordingJiaxin Yu2-1/+4
We can choose to drop away any length of data from the beginning according to project needs. Some projects don't want to throw away any data, because they want to use recorded data to do echo cancellation, so they have to make sure that they are aligned with the reference data as much as possible. Or there are other algorithms in the upper layer to eliminate this noise. Or some projects want to eliminate this noise form the kernel layer. However, the minimum recommended value is 50ms to skip pop noise. Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com> Link: https://lore.kernel.org/r/1605062722-8711-1-git-send-email-jiaxin.yu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-05ASoC: mediatek: mt8192: Make some symbols staticZou Wei3-5/+5
Fix the following sparse warnings: ./mt8192-dai-i2s.c:2040:5: warning: symbol 'mt8192_dai_i2s_get_share' was not declared. Should it be static? ./mt8192-dai-i2s.c:2060:5: warning: symbol 'mt8192_dai_i2s_set_priv' was not declared. Should it be static? ./mt8192-afe-gpio.c:15:16: warning: symbol 'aud_pinctrl' was not declared. Should it be static? ./mt8192-afe-pcm.c:70:5: warning: symbol 'mt8192_get_memif_pbuf_size' was not declared. Should it be static? ./mt8192-afe-pcm.c:2137:39: warning: symbol 'mt8192_afe_component' was not declared. Should it be static? Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Zou Wei <zou_wei@huawei.com> Acked-by: Jiaxin Yu <jiaxin.yu@mediatek.com> Link: https://lore.kernel.org/r/1604579287-25251-1-git-send-email-zou_wei@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-05ASoC: mediatek: mt8192: Fix build failureSudip Mukherjee1-0/+2
A build of arm64 allmodconfig with next-20201105 fails with the error: ERROR: modpost: "mt8192_afe_gpio_request" undefined! ERROR: modpost: "mt8192_afe_gpio_init" undefined! Export the symbols so that mt8192-mt6359-rt1015-rt5682.ko finds it. Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com> Link: https://lore.kernel.org/r/20201105124747.18383-1-sudipm.mukherjee@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-04ASoC: mediatek: mt8192: add machine driver with mt6359, rt1015 and rt5682Jiaxin Yu3-0/+1073
This patch adds support for the machine board with mt6359, rt1015 and rt5682. Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com> Link: https://lore.kernel.org/r/1604390378-23993-9-git-send-email-jiaxin.yu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-04ASoC: mediatek: mt8192: support tdm in platform driverJiaxin Yu1-0/+778
This patch adds mt8192 tdm dai driver. Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com> Link: https://lore.kernel.org/r/1604390378-23993-7-git-send-email-jiaxin.yu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-04ASoC: mediatek: mt8192: support pcm in platform driverJiaxin Yu1-0/+409
This patch adds mt8192 pcm dai driver. Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com> Link: https://lore.kernel.org/r/1604390378-23993-6-git-send-email-jiaxin.yu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-04ASoC: mediatek: mt8192: support adda in platform driverJiaxin Yu1-0/+1471
This patch adds mt8192 adda dai driver. Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com> Link: https://lore.kernel.org/r/1604390378-23993-5-git-send-email-jiaxin.yu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-04ASoC: mediatek: mt8192: support i2s in platform driverJiaxin Yu1-0/+2110
This patch adds mt8192 i2s dai driver. Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com> Link: https://lore.kernel.org/r/1604390378-23993-4-git-send-email-jiaxin.yu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-04ASoC: mediatek: mt8192: add platform driverJiaxin Yu14-4/+7191
This patch adds mt8192 platform and affiliated drivers. Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com> Link: https://lore.kernel.org/r/1604390378-23993-3-git-send-email-jiaxin.yu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-10-28Merge tag 'v5.10-rc1' into asoc-5.10Mark Brown1-1/+1
Linux 5.10-rc1
2020-10-26Merge existing fixes from asoc/for-5.10Mark Brown1-6/+25
2020-10-19ASoC: mediatek: mt8183-da7219: fix DAPM paths for rt1015Tzung-Bi Shih1-6/+25
RT1015's output widget name is "SPO" instead of "Speaker". Fixes it to use the correct names. Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20201019044724.1601476-1-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-10-09Merge remote-tracking branch 'asoc/for-5.10' into asoc-nextMark Brown4-10/+49
2020-10-06ASoC: mediatek: mt8183-da7219: fix wrong ops for I2S3Tzung-Bi Shih1-1/+1
DA7219 uses I2S2 and I2S3 for input and output respectively. Commit 9e30251fb22e ("ASoC: mediatek: mt8183-da7219: support machine driver with rt1015") introduces a bug that: - If using I2S2 solely, MCLK to DA7219 is 256FS. - If using I2S3 solely, MCLK to DA7219 is 128FS. - If using I2S3 first and then I2S2, the MCLK changes from 128FS to 256FS. As a result, no sound output to the headset. Also no sound input from the headset microphone. Both I2S2 and I2S3 should set MCLK to 256FS. Fixes the wrong ops for I2S3. Fixes: 9e30251fb22e ("ASoC: mediatek: mt8183-da7219: support machine driver with rt1015") Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20201006101252.1890385-1-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-10-05ASoC: mediatek: mt8183-da7219: support jack detection for LINEOUTTzung-Bi Shih1-1/+2
Supports jack detection for LINEOUT. Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20201005074748.3394630-1-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-22ASoC: hdmi-codec: Use set_jack ops to set jackCheng-Yi Chiang3-9/+6
Use set_jack ops to set jack so machine drivers do not need to include hdmi-codec.h explicitly. Signed-off-by: Cheng-Yi Chiang <cychiang@chromium.org> Reviewed-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20200922062316.1172935-1-cychiang@chromium.org Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-11ASoC: mediatek: mt8183-da7219: support machine driver with rt1015pTzung-Bi Shih2-0/+41
Supports machine driver with rt1015p ("mt8183_da7219_rt1015p"). Embeds in the existing mt8183-da7219-max98357.c because they share most of the code. Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20200911024833.1673961-3-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-23ASoC: mediatek: use asoc_substream_to_rtd()Kuninori Morimoto14-29/+29
Now we can use asoc_substream_to_rtd() macro, let's use it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87d04r0yth.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-22ASoC: mediatek: mt8183: support machine driver with max98357bTzung-Bi Shih1-1/+21
Supports machine driver with max98357b ("mt8183-mt6358-ts3a227-max98357b"). The key difference from max98357a: max98357b needs to use left justified format. Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20200720012559.906088-4-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-22ASoC: mediatek: mt8183: support left justified format for I2STzung-Bi Shih1-8/+51
MT8183 audio platform supports EIAJ and I2S formats. The code fixed to use I2S format in the past. Supports EIAJ mode via set_fmt ops and preserves to use I2S format as the default format intentionally. Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20200720012559.906088-2-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-10ASoC: mediatek: mt8183-da7219: support HDMI jack reportingTzung-Bi Shih2-1/+19
Supports HDMI jack reporting. Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20200710052505.3664118-7-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-10ASoC: mediatek: mt8183-da7219: use hdmi-codecTzung-Bi Shih1-2/+8
Adds DAI link to use hdmi-codec. Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20200710052505.3664118-6-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-10ASoC: mediatek: mt8183: support HDMI jack reportingTzung-Bi Shih2-1/+20
Supports HDMI jack reporting. Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20200710052505.3664118-4-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-10ASoC: mediatek: mt8183: use hdmi-codecTzung-Bi Shih1-2/+7
Adds DAI link to use hdmi-codec. Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20200710052505.3664118-3-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-09ASoC: mediatek: mt8183-da7219: support machine driver with rt1015Tzung-Bi Shih2-17/+158
Supports machine driver with rt1015 ("mt8183-da7219-rt1015"). Embeds in existing mt8183-da7219-max98357.c because they share most of the code. Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20200709122445.1584497-6-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-07-09ASoC: mediatek: mt8183-da7219: extract codec and DAI namesTzung-Bi Shih1-6/+7
Extracts codec and DAI names of DA7219. Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20200709122445.1584497-4-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>