aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/rt5665.c
AgeCommit message (Collapse)Author
2020-06-22ASoC: codecs: rt*: rename to snd_soc_component_read()Kuninori Morimoto
We need to use snd_soc_component_read() instead of snd_soc_component_read32() This patch renames _read32() to _read() Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87d05z4mce.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-07-23ASoC: rt5665: Fix a typo in the name of a functionChristophe JAILLET
All function names start with rt5665_, except 'rt5655_set_verf()'. It is likely a typo. Fix it to be consistent. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://lore.kernel.org/r/20190722212639.26954-1-christophe.jaillet@wanadoo.fr Signed-off-by: Mark Brown <broonie@kernel.org>
2019-07-05ASoC: rt5665: remove redundant assignment to variable idxColin Ian King
The variable idx is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King <colin.king@canonical.com> Link: https://lore.kernel.org/r/20190705075303.14692-1-colin.king@canonical.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-06-19treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500Thomas Gleixner
Based on 2 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation # extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 4122 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Enrico Weigelt <info@metux.net> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-07regmap: split up regmap_config.use_single_rwDavid Frey
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>
2018-02-12ASoC: rt5665: remove rt5668 supportBard Liao
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>
2018-02-12ASoC: rt5665: replace codec to componentKuninori Morimoto
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>
2017-09-01Merge remote-tracking branches 'asoc/topic/rt5665', 'asoc/topic/rt5670', ↵Mark Brown
'asoc/topic/rt5677' and 'asoc/topic/samsung' into asoc-next
2017-08-21Merge tag 'v4.13-rc6' into asoc-msm8916Mark Brown
Linux 4.13-rc6
2017-08-10ASoC: codecs: add const to snd_soc_codec_driver structuresBhumika Goyal
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>
2017-08-01ASoC: rt5665: fix wrong register for bclk ratio controlBard Liao
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>
2017-07-24ASoC: rt5665: constify acpi_device_id.Arvind Yadav
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>
2017-07-24ASoC: rt5665: add MONOVOL Playback Volume controlBard Liao
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>
2017-07-20ASoC: rt5665: add clock sync control for master modeBard Liao
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>
2017-07-20ASoC: rt5665: add clcok control for master modeBard Liao
Add i2s clock control for codec master mode. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-07-17ASoC: rt5665: force using PLL if MCLK is not suitableBard Liao
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>
2017-06-30ASoC: rt5665: calibration should be done before jack detectionBard Liao
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 Yongjun
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 Uytterhoeven
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 Liao
"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 Bergmann
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 Brown
2017-04-11ASoC: rt5665: move rt5665_set_jack_detect to .set_jackBard Liao
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 Liao
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 Liao
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 Liao
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 Liao
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 Liao
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 Liao
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 Liao
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 Liao
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 Liao
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 Liao
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 Liao
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 Liao
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 Lin
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 Lin
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 Liao
This is the initial codec driver for rt5665. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>