summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/rt5665.c
Commit message (Collapse)AuthorAge
*---. Merge remote-tracking branches 'asoc/topic/rt5665', 'asoc/topic/rt5670', ↵Mark Brown2017-09-01
|\ \ \ | | | | | | | | | | | | 'asoc/topic/rt5677' and 'asoc/topic/samsung' into asoc-next
| * | | ASoC: rt5665: constify acpi_device_id.Arvind Yadav2017-07-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | acpi_device_id are not supposed to change at runtime. All functions working with acpi_device_id provided by <acpi/acpi_bus.h> work with const acpi_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | | ASoC: rt5665: add MONOVOL Playback Volume controlBard Liao2017-07-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | MONOVOL Playback Volume is a playback volume control on "MONOVOL MIX". Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | | ASoC: rt5665: add clock sync control for master modeBard Liao2017-07-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We can sleect the i2s clock source for each i2s bus in master mode. The choice is depended on the HW design and the use case. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | | ASoC: rt5665: add clcok control for master modeBard Liao2017-07-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add i2s clock control for codec master mode. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | | ASoC: rt5665: force using PLL if MCLK is not suitableBard Liao2017-07-17
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | Idealy PLL will be set in machine driver if MCLK doesn't meet the requirement of codec. To let the codec driver be more general, we can use a common PLL setting once sysclk/pll doesn't set properly in machine driver. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | | Merge tag 'v4.13-rc6' into asoc-msm8916Mark Brown2017-08-21
|\ \ \ | | |/ | |/| | | | Linux 4.13-rc6
| * | ASoC: rt5665: fix wrong register for bclk ratio controlBard Liao2017-08-01
| |/ | | | | | | | | | | | | | | The register of setting back ratio should be RT5665_ADDA_CLK_2 instead of RT5665_ADDA_CLK_1. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: codecs: add const to snd_soc_codec_driver structuresBhumika Goyal2017-08-10
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Declare snd_soc_codec_driver structures as const as they are only passed as an argument to the function snd_soc_register_codec. This argument is of type const, so declare the structures with this property as const. In file codecs/sn95031.c, snd_soc_codec_driver structure is also used in a copy operation along with getting passed to snd_soc_register_codec. So, it can be made const too. Done using Coccinelle: @match disable optional_qualifier@ identifier s; position p; @@ static struct snd_soc_codec_driver s@p={...}; @good1@ identifier match.s; position p; @@ snd_soc_register_codec(...,&s@p,...) @bad@ identifier match.s; position p!={match.p,good1.p}; @@ s@p @depends on !bad disable optional_qualifier@ identifier match.s; @@ static +const struct snd_soc_codec_driver s={...}; Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: rt5665: calibration should be done before jack detectionBard Liao2017-06-30
| | | | | | | | | | | 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>
* ASoC: rt5665: make local symbol rt5665_i2c_driver staticWei Yongjun2017-05-17
| | | | | | | | | | 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>
* ASoC: rt5665: Fix uninitialized warning in rt5665_i2s_pin_event()Geert Uytterhoeven2017-05-17
| | | | | | | | | | | | | | | | | | | | | 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>
* ASoC: rt5665: add ADC STO2 ASRC supportBard Liao2017-05-14
| | | | | | | "ADC Stereo2 Filter" is with ASRC supported. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: rt5665: fix gcc-7 warningArnd Bergmann2017-05-14
| | | | | | | | | | | | | | | | | | | | | 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>
* Merge remote-tracking branch 'asoc/topic/rt5665' into asoc-nextMark Brown2017-04-30
|\
| * ASoC: rt5665: move rt5665_set_jack_detect to .set_jackBard Liao2017-04-11
| | | | | | | | | | | | | | | | 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>
| * ASoC: rt5665: fix wrong pre div reg of IF2 and IF3Bard Liao2017-03-20
| | | | | | | | | | | | | | | | | | 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>
| * ASoC: rt5665: set i2s pin share configurationBard Liao2017-03-16
| | | | | | | | | | | | | | | | | | 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>
| * ASoC: rt5665: move set_sysclk to codec levelBard Liao2017-03-13
| | | | | | | | | | | | | | | | 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>
| * ASoC: rt5665: move set_pll to codec levelBard Liao2017-03-13
| | | | | | | | | | | | | | | | 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>
| * ASoC: rt5665: enhance jack type detection functionBard Liao2017-03-08
| | | | | | | | | | | | | | 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>
| * ASoC: rt5665: enable TDM if more than 2 channelsBard Liao2017-03-08
| | | | | | | | | | | | | | | | | | 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>
| * ASoC: rt5665: increase button detection accuracyBard Liao2017-03-08
| | | | | | | | | | | | | | 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>
* | ASoC: rt5665: fix wrong shift rt5665_if2_1_adc_in_enumBard Liao2017-03-20
|/ | | | | | | 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>
* ASoC: rt5665: CLKDET is also a power of ASRCBard Liao2017-03-08
| | | | | | | 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>
* ASoC: rt5665: Vref3 is necessary for Mono AmpBard Liao2017-03-08
| | | | | | | 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>
* ASoC: rt5665: increase LDO levelBard Liao2017-03-08
| | | | | | | 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>
* ASoC: rt5665: fix getting wrong work handler containerBard Liao2017-03-08
| | | | | | | | | 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
* ASoC: rt5665: Use devm_gpio_request_one()Axel Lin2016-11-16
| | | | | | | Simplify the code a bit. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: rt5665: Fix missing mutex_unlock in rt5665_calibrateAxel Lin2016-11-16
| | | | | | 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>
* ASoC: add rt5665 codec driverBard Liao2016-11-14
This is the initial codec driver for rt5665. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>