summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/mt6358.c
AgeCommit message (Collapse)AuthorFilesLines
2021-03-18ASoC: mt6358: remove useless initializationsPierre-Louis Bossart1-2/+2
cppcheck warnings: sound/soc/codecs/mt6358.c:334:19: style: Variable 'stage' is assigned a value that is never used. [unreadVariable] int i = 0, stage = 0; ^ sound/soc/codecs/mt6358.c:350:19: style: Variable 'stage' is assigned a value that is never used. [unreadVariable] int i = 0, stage = 0; ^ 185/930 files checked 25% done Checking sound/soc/codecs/mt6359.c ... 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-14-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-15ASoC: mediatek: mt6358: support DMIC one-wire modeJiaxin Yu1-1/+22
Supports DMIC one-wire mode. Uses a DT property "dmic-mode" to select. Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com> Link: https://lore.kernel.org/r/1591353222-18576-2-git-send-email-jiaxin.yu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-21ASoC: mediatek: mt6358: support WoVTzung-Bi Shih1-0/+105
Switch mono DMIC on to support wake-on-voice. Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20191019143504.2.I57266d36564f393e9d701c9db648cc2efb0346fc@changeid Signed-off-by: Mark Brown <broonie@kernel.org>
2019-08-15ASoC: mediatek: mt6358: add delay after dmic clock onJiaxin Yu1-0/+4
Most dmics produce a high level when they receive clock. The difference between power-on and memory record time is about 10ms, but the dmic needs 50ms to output normal data. This commit add 100ms delay after SoC output clock so that we can cut off the pop noise at the beginning. Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com> Link: https://lore.kernel.org/r/1564980997-11359-1-git-send-email-jiaxin.yu@mediatek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-07-22sound: soc: codecs: mt6358: change return type of mt6358_codec_init_regHariprasad Kelam1-5/+1
As mt6358_codec_init_reg function always returns 0 , change return type from int to void. fixes below issue reported by coccicheck sound/soc/codecs/mt6358.c:2260:5-8: Unneeded variable: "ret". Return "0" on line 2289 Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com> Acked-by: Tzung-Bi Shih <tzungbi@google.com> Link: https://lore.kernel.org/r/20190709182543.GA6611@hari-Inspiron-1545 Signed-off-by: Mark Brown <broonie@kernel.org>
2019-05-08ASoC: mediatek: mt6358: save PGA for mixer controlTzung-Bi Shih1-4/+29
mt6358_amic_disable() resets PGA to 0. Save the gain settings from mixer control and restore them when using the microphone. Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-05-08ASoC: mediatek: mt6358: save output volume for mixer controlsTzung-Bi Shih1-40/+51
Output volume settings from mixer controls would be lost. Imagine that "Headphone Volume" has set to -10dB via amixer: - in mtk_hp_enable() - hp_store_gain() saves the volume setting -10dB from regmap_read() to ana_gain[AUDIO_ANALOG_VOLUME_HPOUTL] - headset_volume_ramp() ramps up from -10dB to -10dB - in mtk_hp_disable() - headset_volume_ramp() ramps down from -10dB to -40dB Next time in mtk_hp_enable(), hp_store_gain() would save -40dB but not -10dB. As a result, headset_volume_ramp() would ramp from -10dB to -40dB (which is mute). Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-05-08ASoC: mediatek: mt6358: initialize setting when ramping volumeTzung-Bi Shih1-4/+3
Mt6358 ramps up from the smallest volume (i.e. -10dB) to target dB when opening and ramps down from target dB to mute (i.e. -40dB) when closing. If target is equal to -10dB when opening, headset_volume_ramp() simply leaves current setting (which may not be -10dB) unchanged. Execute the loop at least once to initialize the setting to the starting point (i.e. from). Signed-off-by: Tzung-Bi Shih <tzungbi@google.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-01-25ASoC: mediatek: mt6358: add codec driverShunli Wang1-0/+2336
add the mt6358 codec driver. Signed-off-by: Shunli Wang <shunli.wang@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>