aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/sound/soc/codecs/mt6359.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-10-09ASoC: Explicitly include correct DT includesRob Herring1-1/+1
The DT of_device.h and of_platform.h date back to the separate of_platform_bus_type before it was merged into the regular platform bus. As part of that merge prepping Arm DT support 13 years ago, they "temporarily" include each other. They also include platform_device.h and of.h. As a result, there's a pretty much random mix of those include files used throughout the tree. In order to detangle these headers and replace the implicit includes with struct declarations, users need to explicitly include the correct includes. Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com> Reviewed-by: Claudiu Beznea <claudiu.beznea@tuxon.dev> # for at91 Signed-off-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20231006-dt-asoc-header-cleanups-v3-1-13a4f0f7fee6@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
2023-05-23ASoC: mediatek: mt6359: update route for lineout muxTrevor Wu1-9/+35
Originally, lineout playback source can only be DAC_3RD. Some SoC masters only support stereo MTKAIF outputs, so lineout path can't be used in such case. MTKAIF connections are as follows. MOSI0 -> DAC_L MOSI1 -> DAC_R MOSI2 -> DAC_3rd In the patch, lineout playback source can be chosen between DAC_L and DAC_3rd, so sound can be outputted via lineout even though SoC only supports stereo MTKAIF outputs. Signed-off-by: Trevor Wu <trevor.wu@mediatek.com> Link: https://lore.kernel.org/r/20230508071532.21665-5-trevor.wu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-05-23ASoC: mediatek: mt6359: add mtkaif gpio settingTrevor Wu1-0/+16
Add mtkaif gpio driving to increase signal strength and smt setting to prevent from overshooting. Signed-off-by: Trevor Wu <trevor.wu@mediatek.com> Link: https://lore.kernel.org/r/20230508071532.21665-4-trevor.wu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-05-23ASoC: mediatek: mt6359: fix kselftest error of playback gainTrevor Wu1-6/+82
kselftest tries to read/write the default value. The default register value of playback gain is 0x1F(mute), but max gain we specified is 0x12. The range of the control is 0x0~0x12 and mute(0x1F) is only used in the driver internally. To solve the problem, implement a new callback mt6359_get_playback_volsw to report user configured volume instead of the register value. In addition, update max of "Headset Volume" to 0x12, so it can match the maximum seen on latest data sheet. Signed-off-by: Trevor Wu <trevor.wu@mediatek.com> Link: https://lore.kernel.org/r/20230508071532.21665-3-trevor.wu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-05-23ASoC: mediatek: mt6359: add supply for MTKAIFTrevor Wu1-0/+4
There are three output data pins MISO0, MISO1 and MISO2 for mt6359. UL_SRC should be enabled when MISO0 or MISO1 is used, and UL_SRC_34 should be enabled when MISO2 is used. Signed-off-by: Trevor Wu <trevor.wu@mediatek.com> Link: https://lore.kernel.org/r/20230508071532.21665-2-trevor.wu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2023-03-13ASoC: mediatek: mt6359: fix UNINIT problemTrevor Wu1-1/+1
Coverity shows decaring variable reg without initializer. When regmap_read returns an error, reg keeps the value left from earlier computation. To prevent from the unexpected result in the case, assign 0 to reg. Signed-off-by: Trevor Wu <trevor.wu@mediatek.com> Link: https://lore.kernel.org/r/20230307040938.7484-5-trevor.wu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-13ASoC: mt6359: Fix refcount leak bugLiang He1-0/+1
In mt6359_parse_dt() and mt6359_accdet_parse_dt(), we should call of_node_put() for the reference returned by of_get_child_by_name() which has increased the refcount. Fixes: 683530285316 ("ASoC: mt6359: fix failed to parse DT properties") Fixes: eef07b9e0925 ("ASoC: mediatek: mt6359: add MT6359 accdet jack driver") Signed-off-by: Liang He <windhl@126.com> Link: https://lore.kernel.org/r/20220713102013.367336-1-windhl@126.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-05-09ASoC: mt6359: Add endianness flag in snd_soc_component_driverCharles Keepax1-6/+4
The endianness flag is used on the CODEC side to specify an ambivalence to endian, typically because it is lost over the hardware link. This device receives audio over an I2S DAI and as such should have endianness applied. As the core will now expand the formats to cover both endian types, remove the redundant manual specification of both. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20220504170905.332415-20-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-09-15ASoC: mediatek: mt6359: Fix unexpected error in bind/unbind flowTrevor Wu1-1/+1
mt6359-sound is a MFD driver. Because its regmap is retrieved from its parent, it shouldn't be freed in mt6359-sound driver. snd_soc_component_exit_regmap() will do regmap_exit(), this results in unexpected results if sound card unregister flow is invoked when users try to bind/unbind audio codec. Remove the usage of snd_soc_component_exit_regmap(). Instead, set component->regmap = NULL in the component remove function. Signed-off-by: Trevor Wu <trevor.wu@mediatek.com> Link: https://lore.kernel.org/r/20210915034659.25044-1-trevor.wu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-10ASoc: codecs: mt6359: remove useless initializationsPierre-Louis Bossart1-1/+1
cppcheck warning: sound/soc/codecs/mt6359.c:274:8: style: Variable 'i' is assigned a value that is never used. [unreadVariable] int i = 0, stage = 0; ^ sound/soc/codecs/mt6359.c:274:19: style: Variable 'stage' is assigned a value that is never used. [unreadVariable] int i = 0, stage = 0; ^ Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20210426214701.235106-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-03-18ASoC: mt6359: remove useless assignmentPierre-Louis Bossart1-2/+2
cppcheck warning: sound/soc/codecs/mt6359.c:242:19: style: Variable 'stage' is assigned a value that is never used. [unreadVariable] int i = 0, stage = 0; ^ sound/soc/codecs/mt6359.c:260:19: style: Variable 'stage' is assigned a value that is never used. [unreadVariable] int i = 0, stage = 0; ^ sound/soc/codecs/mt6359.c:274:8: style: Variable 'i' is assigned a value that is never used. [unreadVariable] int i = 0, stage = 0; ^ sound/soc/codecs/mt6359.c:274:19: style: Variable 'stage' is assigned a value that is never used. [unreadVariable] int i = 0, stage = 0; ^ Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20210312182246.5153-15-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-02-02ASoC: mt6359: reduce log verbosity for optional DT propertiesTzung-Bi Shih1-7/+11
DT properties "dmic-mode" and "mic-type-X" are optional. Reduces the log verbosity and changes the message a bit to avoid misleading. Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20210202033557.1621029-1-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-20ASoC: mediatek: mt6359: Fix regulator_dev_lookup() fails for id "LDO_VAUD18"Jiaxin Yu1-3/+4
Mt6359 platform device is instantiated by mfd_add_devices(). In the case, dev->of_node is NULL so that always fails to get the regulator_dev. Use regualator-name "vaud18" that in dts node instead of "LDO_VAUD19-supply". So that we can get regulator_dev through regulator_lookup_by_name() directly. Fixes: 64a70744b778 ("ASoC: Fix vaud18 power leakage of mt6359") Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com> Link: https://lore.kernel.org/r/1605841573-1442-2-git-send-email-jiaxin.yu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-11ASoC: Remove mt6359_platform_driver_removeShane.Chien1-12/+0
remove mt6359_platform_driver_remove due to it is useless. Signed-off-by: Shane.Chien <shane.chien@mediatek.com> Link: https://lore.kernel.org/r/1605068096-12587-1-git-send-email-shane.chien@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-10ASoC: Fix vaud18 power leakage of mt6359Shane.Chien1-24/+1
vaud18 is power of mt6359 audio path. It should only enable when audio is used, instead of in boot up stage. Once mt6359 audio path is enabled or disabled, vaud18 is controlled by regulator supply widget "LDO_VAUD18". Due to vaud18 is controlled by regulator dapm macro instead of regmap, the macro MT6359_LDO_VAUD18_CON0 and variable avdd_reg is no used and removed from mt6359.h. Signed-off-by: Shane.Chien <shane.chien@mediatek.com> Link: https://lore.kernel.org/r/1604975492-6142-2-git-send-email-shane.chien@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-04ASoC: mediatek: mt6359: add the calibration functionsJiaxin Yu1-0/+110
Add the calibraion functions for initializing the codec when registering the machine driver. Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com> Link: https://lore.kernel.org/r/1604390378-23993-2-git-send-email-jiaxin.yu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-09-08ASoC: mt6359: fix failed to parse DT propertiesTzung-Bi Shih1-4/+9
Mt6359 platform device is instantiated by mfd_add_devices(). In the case, dev->of_node is NULL so that mt6359_parse_dt() always fails to parse the desired DT properties. Gets the DT properties via dev->parent->of_node. Fixes: 8061734ab654 ("ASoC: mediatek: mt6359: add codec driver") Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20200908070044.1142644-1-tzungbi@google.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-08-20ASoC: mediatek: mt6359: add codec driverJiaxin Yu1-0/+2753
Add the mt6359 codec driver. Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com> Reviewed-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/1597913493-10747-2-git-send-email-jiaxin.yu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>