summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/rt5665.c
AgeCommit message (Collapse)AuthorFilesLines
2017-06-30ASoC: rt5665: calibration should be done before jack detectionBard Liao1-0/+7
We will set some volatile registers in jack detection function. But those volatile registers will be clear in rt5665_calibrate function because we set cache bypass and reset codec in rt5665_calibrate function. This patch add a flag to make sure that rt5665_calibrate is done before starting jack detection. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-17ASoC: rt5665: make local symbol rt5665_i2c_driver staticWei Yongjun1-1/+1
Fixes the following sparse warnings: sound/soc/codecs/rt5665.c:4928:19: warning: symbol 'rt5665_i2c_driver' was not declared. Should it be static? Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-17ASoC: rt5665: Fix uninitialized warning in rt5665_i2s_pin_event()Geert Uytterhoeven1-3/+7
With gcc 4.1.2: sound/soc/codecs/rt5665.c: In function ‘rt5665_i2s_pin_event’: sound/soc/codecs/rt5665.c:2610: warning: ‘mask1’ may be used uninitialized in this function sound/soc/codecs/rt5665.c:2610: warning: ‘val2’ may be used uninitialized in this function sound/soc/codecs/rt5665.c:2610: warning: ‘val1’ may be used uninitialized in this function The first one is currently a false positive, as rt5665_i2s_pin_event() is never called with snd_soc_dapm_widget.shift set to a value not handled by the switch() statement. But that may change, so preinitialize mask1 to fix this, like is already done for mask2. The last two are false-positives, the compiler is just not smart enough to notice the mask and val variables are always used together. Fixes: 9b5d3865b3b410d2 ("ASoC: rt5665: set i2s pin share configuration") Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-14ASoC: rt5665: add ADC STO2 ASRC supportBard Liao1-0/+3
"ADC Stereo2 Filter" is with ASRC supported. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-05-14ASoC: rt5665: fix gcc-7 warningArnd Bergmann1-68/+68
gcc-7 warns that there is a duplicate 'const' specifier in some variables that are declared using the SOC_ENUM_SINGLE_DECL macro: sound/soc/codecs/rt5665.c:915:14: error: duplicate 'const' declaration specifier [-Werror=duplicate-decl-specifier] static const SOC_ENUM_SINGLE_DECL(rt5665_if1_1_01_adc_enum, sound/soc/codecs/rt5665.c:918:14: error: duplicate 'const' declaration specifier [-Werror=duplicate-decl-specifier] static const SOC_ENUM_SINGLE_DECL(rt5665_if1_1_23_adc_enum, sound/soc/codecs/rt5665.c:921:14: error: duplicate 'const' declaration specifier [-Werror=duplicate-decl-specifier] static const SOC_ENUM_SINGLE_DECL(rt5665_if1_1_45_adc_enum, sound/soc/codecs/rt5665.c:924:14: error: duplicate 'const' declaration specifier [-Werror=duplicate-decl-specifier] static const SOC_ENUM_SINGLE_DECL(rt5665_if1_1_67_adc_enum, ... This removes one to fix the 68 warnings in this file Fixes: 33ada14a26c8 ("ASoC: add rt5665 codec driver") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-04-30Merge remote-tracking branch 'asoc/topic/rt5665' into asoc-nextMark Brown1-80/+142
2017-04-11ASoC: rt5665: move rt5665_set_jack_detect to .set_jackBard Liao1-3/+3
Now, we can use .set_jack callback function on codec level. So we don't need export rt5665_set_jack_detect. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-20ASoC: rt5665: fix wrong pre div reg of IF2 and IF3Bard Liao1-2/+5
The pre divider control register of IF1 and IF2/3 are different. The driver used the same register for all interfaces which was a mistake. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-20ASoC: rt5665: fix wrong shift rt5665_if2_1_adc_in_enumBard Liao1-1/+1
The shift is RT5665_IF2_1_ADC_IN_SFT not RT5665_IF3_ADC_IN_SFT. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-16ASoC: rt5665: set i2s pin share configurationBard Liao1-3/+55
I2S2 and I2S3 are share pins. We need to configure it when i2s is active and disable it when i2s is inactive. To disable i2s pins means to set them as gpio. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-13ASoC: rt5665: move set_sysclk to codec levelBard Liao1-5/+4
Move set_sysclk to codec level and people can use it at both codec and dai level. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-13ASoC: rt5665: move set_pll to codec levelBard Liao1-9/+9
Move set_pll function to codec level and people can use it at both codec and dai level. Also, lower case "source" to keep it consistent. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-08ASoC: rt5665: enhance jack type detection functionBard Liao1-2/+5
Use manual mode for jack detection function to increase accuracy. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-08ASoC: rt5665: enable TDM if more than 2 channelsBard Liao1-55/+59
TDM is necessary for more than 2 channels. And there is no control bit to specify which slots are using. Machine driver will not need to call snd_soc_dai_set_tdm_slot if we do it in rt5665_hw_params. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-08ASoC: rt5665: increase button detection accuracyBard Liao1-1/+2
Use sar adc for button detection to increase accuracy. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-08ASoC: rt5665: CLKDET is also a power of ASRCBard Liao1-0/+3
We need to power on CLKDET to use ASRC function. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-08ASoC: rt5665: Vref3 is necessary for Mono AmpBard Liao1-0/+1
Vref3 is necessary for Mono Amp. So add it to dapm routes Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-08ASoC: rt5665: increase LDO levelBard Liao1-1/+1
Too low LDO level will cause a few functions unstable. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-03-08ASoC: rt5665: fix getting wrong work handler containerBard Liao1-1/+1
We got rt5665 private data from wrong work. It will result in kernel panic. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
2016-11-16ASoC: rt5665: Use devm_gpio_request_one()Axel Lin1-4/+2
Simplify the code a bit. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-11-16ASoC: rt5665: Fix missing mutex_unlock in rt5665_calibrateAxel Lin1-2/+3
Reported-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-11-14ASoC: add rt5665 codec driverBard Liao1-0/+4875
This is the initial codec driver for rt5665. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>