summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/rt5665.c
Commit message (Collapse)AuthorAgeFilesLines
* regmap: split up regmap_config.use_single_rwDavid Frey2018-09-071-1/+2
| | | | | | | | | | | | | | | | Split regmap_config.use_single_rw into use_single_read and use_single_write. This change enables drivers of devices which only support bulk operations in one direction to use the regmap_bulk_*() functions for both directions and have their bulk operation split into single operations only when necessary. Update all struct regmap_config instances where use_single_rw==true to instead set both use_single_read and use_single_write. No attempt was made to evaluate whether it is possible to set only one of use_single_read or use_single_write. Signed-off-by: David Frey <dpfrey@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: rt5665: remove rt5668 supportBard Liao2018-02-121-5/+0
| | | | | | | | Remove rt5668 support from rt5665 codec driver since rt5668 will not go into mass production. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: rt5665: replace codec to componentKuninori Morimoto2018-02-121-177/+168
| | | | | | | | | | | | | | Now we can replace Codec to Component. Let's do it. Note: xxx_codec_xxx() -> xxx_component_xxx() .idle_bias_off = 1 -> .idle_bias_on = 0 .ignore_pmdown_time = 0 -> .use_pmdown_time = 1 - -> .endianness = 1 - -> .non_legacy_dai_naming = 1 Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
*---. Merge remote-tracking branches 'asoc/topic/rt5665', 'asoc/topic/rt5670', ↵Mark Brown2017-09-011-5/+48
|\ \ \ | | | | | | | | | | | | 'asoc/topic/rt5677' and 'asoc/topic/samsung' into asoc-next
| * | | ASoC: rt5665: constify acpi_device_id.Arvind Yadav2017-07-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-241-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-201-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-201-1/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-171-3/+6
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-211-2/+2
|\ \ \ | | |/ | |/| | | | Linux 4.13-rc6
| * | ASoC: rt5665: fix wrong register for bclk ratio controlBard Liao2017-08-011-2/+2
| |/ | | | | | | | | | | | | | | 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-101-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-301-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>
* ASoC: rt5665: make local symbol rt5665_i2c_driver staticWei Yongjun2017-05-171-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>
* ASoC: rt5665: Fix uninitialized warning in rt5665_i2s_pin_event()Geert Uytterhoeven2017-05-171-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>
* ASoC: rt5665: add ADC STO2 ASRC supportBard Liao2017-05-141-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>
* ASoC: rt5665: fix gcc-7 warningArnd Bergmann2017-05-141-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>
* Merge remote-tracking branch 'asoc/topic/rt5665' into asoc-nextMark Brown2017-04-301-80/+142
|\
| * ASoC: rt5665: move rt5665_set_jack_detect to .set_jackBard Liao2017-04-111-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>
| * ASoC: rt5665: fix wrong pre div reg of IF2 and IF3Bard Liao2017-03-201-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>
| * ASoC: rt5665: set i2s pin share configurationBard Liao2017-03-161-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>
| * ASoC: rt5665: move set_sysclk to codec levelBard Liao2017-03-131-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>
| * ASoC: rt5665: move set_pll to codec levelBard Liao2017-03-131-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>
| * ASoC: rt5665: enhance jack type detection functionBard Liao2017-03-081-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>
| * ASoC: rt5665: enable TDM if more than 2 channelsBard Liao2017-03-081-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>
| * ASoC: rt5665: increase button detection accuracyBard Liao2017-03-081-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>
* | ASoC: rt5665: fix wrong shift rt5665_if2_1_adc_in_enumBard Liao2017-03-201-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>
* ASoC: rt5665: CLKDET is also a power of ASRCBard Liao2017-03-081-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>
* ASoC: rt5665: Vref3 is necessary for Mono AmpBard Liao2017-03-081-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>
* ASoC: rt5665: increase LDO levelBard Liao2017-03-081-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>
* ASoC: rt5665: fix getting wrong work handler containerBard Liao2017-03-081-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
* ASoC: rt5665: Use devm_gpio_request_one()Axel Lin2016-11-161-4/+2
| | | | | | | 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-161-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>
* ASoC: add rt5665 codec driverBard Liao2016-11-141-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>