summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/rt5670.c
Commit message (Collapse)AuthorAgeFilesLines
* ASoC: rt5670: remove unused mux/mixer defineBard liao2019-01-071-54/+0
| | | | | | | | Some mux/mixer are not used. Remove them from the driver. Signed-off-by: Bard liao <yung-chuan.liao@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* Merge tag 'sound-4.20-rc1' of ↵Linus Torvalds2018-10-251-0/+12
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound updates from Takashi Iwai: "There have been little changes in ALSA core stuff, but ASoC core still kept rolling for the continued restructuring. The rest are lots of small driver-specific changes and some minor API updates. Here are highlights: General: - Appropriate fall-through annotations everywhere - Some code cleanup in memalloc code, handling non-cacahed pages more commonly in the helper - Deployment of SNDRV_PCM_INFO_SYNC_APPLPTR flag consistently Drivers: - More HD-audio CA0132 codec improvement for supporting other Creative boards - Plumbing legacy HD-audio codecs as ASoC BE on Intel SST; this will give move support of existing HD-audio devices with DSP - A few device-specific HD-audio quirks as usual - New quirk for RME CC devices and correction for B&W PX for USB-audio - FireWire: code refactoring including devres usages ASoC Core: - Continued componentization works; it's almost done! - A bunch of new for_each_foo macros - Cleanups and fixes in DAPM code ASoC Drivers: - MCLK support for several different devices, including CS42L51, STM32 SAI, and MAX98373 - Support for Allwinner A64 CODEC analog, Intel boards with DA7219 and MAX98927, Meson AXG PDM inputs, Nuvoton NAU8822, Renesas R8A7744 and TI PCM3060" * tag 'sound-4.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (299 commits) ASoC: stm32: sai: fix master clock naming ASoC: stm32: add clock dependency for sai ALSA: hda/ca0132 - Actually fix microphone issue ASoC: sun4i-i2s: move code from startup/shutdown hooks into pm_runtime hooks ASoC: wm2000: Remove wm2000_read helper function ASoC: cs42l51: fix mclk support ASoC: wm_adsp: Log addresses as 8 digits in wm_adsp_buffer_populate ASoC: wm_adsp: Rename memory fields in wm_adsp_buffer ASoC: cs42l51: add mclk support ASoC: stm32: sai: set sai as mclk clock provider ASoC: dt-bindings: add mclk support to cs42l51 ASoC: dt-bindings: add mclk provider support to stm32 sai ASoC: soc-core: fix trivial checkpatch issues ASoC: dapm: Add support for hw_free on CODEC to CODEC links ASoC: Intel: kbl_da7219_max98927: minor white space clean up ALSA: i2c/cs8427: Fix int to char conversion ALSA: doc: Brush up the old writing-an-alsa-driver ASoC: rsnd: tidyup SSICR::SWSP for TDM ASoC: rsnd: enable TDM settings for SSI parent ASoC: pcm3168a: add hw constraint for capture channel ...
| * ASoC: rt5670: Add quirk for Thinkpad 8 tabletHans de Goede2018-08-281-0/+12
| | | | | | | | | | | | | | | | The Thinkpad 8 needs a quirk for jack-detect and the internal mic to work correctly. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | 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: rt5670: improve PLL function's stabilityBard Liao2018-05-171-1/+1
| | | | | | | Set PR-38 register to 0x1fe1 will make PLL function more stable. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: rt5670: replace codec to componentKuninori Morimoto2018-02-121-148/+147
| | | | | | | | | | | | | | 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>
* ASoC: rt5670: add set_bclk_ratio in dai opsBard Liao2017-09-281-0/+19
| | | | | | | | We need to set a specific bit for 50 bclk rate. So add set_bclk_ratio function to set the bit. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: rt5670: refactor DMI quirks and fix Dell Venue settingsPierre-Louis Bossart2017-09-251-19/+105
| | | | | | | | | | | | Additional checks exposed a mistake in the quirk for the Dell Venue Pro 5855 (Dmic2 instead of Dmic1). Rather than adding quirk tables, merge all quirks in a single table and use flags to differentiate platforms. Also add a parameter override to help support additional platforms using this codec CC: Bard Liao <bardliao@realtek.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
*-. Merge remote-tracking branches 'asoc/topic/rt5665', 'asoc/topic/rt5670', ↵Mark Brown2017-09-011-26/+34
|\ \ | | | | | | | | | 'asoc/topic/rt5677' and 'asoc/topic/samsung' into asoc-next
| | * ASoC: codecs: rt5670: add jack detection quirk for Dell Venue 5585Pierre-Louis Bossart2017-08-231-0/+16
| | | | | | | | | | | | | | | | | | | | | Jack is not detected by default, using jdmode=3 works fine Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * ASoC: rt5670: merge ADC L/R MuxBard Liao2017-07-261-26/+16
| | | | | | | | | | | | | | | | | | | | | Some ADC L/R Muxes share the some control bit. So, merge them. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * ASoC: rt5670: add symmetric_rates flagBard Liao2017-07-261-0/+2
| |/ | | | | | | | | | | | | rt5670 requires symmetric rate of capture and playback. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | Merge remote-tracking branch 'asoc/topic/msm8916' into asoc-nextMark Brown2017-09-011-1/+1
|\ \
| * | 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: rt5670: Fix GPIO headset detection regressionTakashi Iwai2017-08-221-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | RT5670 codec driver and its machine driver for Intel CHT assume the implicit GPIO mapping on the index 0 while BIOS on most devices don't provide it. The recent commit f10e4bf6632b ("gpio: acpi: Even more tighten up ACPI GPIO lookups") restricts such cases and it resulted in a regression where the headset jack setup fails like: rt5670 i2c-10EC5672:00: ASoC: Cannot get gpio at index 0: -2 rt5670 i2c-10EC5672:00: Adding jack GPIO failed For fixing this, we need to provide the GPIO mapping explicitly in the machine driver. Also this patch corrects the string to be passed to gpiolib to match with the pre-given mapping, too. Fixes: f10e4bf6632b ("gpio: acpi: Even more tighten up ACPI GPIO lookups") Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=115531 Reported-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
*-. Merge remote-tracking branches 'asoc/topic/rt5614', 'asoc/topic/rt5645', ↵Mark Brown2017-07-031-7/+4
|\ \ | | | | | | | | | 'asoc/topic/rt5651', 'asoc/topic/rt5665' and 'asoc/topic/rt5670' into asoc-next
| | * ASoC: rt5670: fix incompatible pointer type of set_sysclkBard Liao2017-06-301-1/+1
| | | | | | | | | | | | | | | | | | | | | The first parameter is codec not dai. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * ASoC: rt5670: move set_sysclk to codec levelBard Liao2017-06-281-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: rt5670: remove duplicate route.Bard Liao2017-06-281-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | { "ADC Stereo1 Filter", NULL, "PLL1", is_sys_clk_from_pll }, and { "ADC Stereo2 Filter", NULL, "PLL1", is_sys_clk_from_pll }, are defined twice in the driver. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | | Merge remote-tracking branch 'asoc/topic/intel' into asoc-nextMark Brown2017-07-031-0/+9
|\ \ \ | |_|/ |/| |
| * | ASoC: codecs: rt5670: fix jd mode for Lenovo Miix 2 10Pierre-Louis Bossart2017-06-281-0/+9
| |/ | | | | | | | | | | | | | | jd mode 2 (3.3V) is required apparently Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=96691 Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* / ASoC: rt5670: fix wrong audio routeBard Liao2017-06-281-3/+2
|/ | | | | | | | | When we select "IF1_ADC4" for IF1 ADC Muxes, it is actually connected to "TxDP_ADC" widget. This patch fixes the audio route and remove the unexisting "IF1_ADC4" widget. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: codecs: rt5670: add Thinkpad Tablet 10 quirkNicole Faerber2017-04-181-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | The Thinkpad Tablet tablet has a similar audio setup as the Intel Braswell platform. A quirk is needed to detect the platform and setup the platform data properly: Manufacturer: LENOVO Product Name: 20C1CTO1WW Version: ThinkPad 10 Manufacturer: LENOVO Product Name: 20C3001VHH Version: ThinkPad 10 Manufacturer: LENOVO Product Name: 20C10024GE Version: ThinkPad Tablet B Manufacturer: LENOVO Product Name: 20359 Version: Lenovo Miix 2 10 Signed-off-by: Nicole Faerber <nicole.faerber@id3p.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: codecs: rt5670: add quirk for Lenovo Thinkpad 10Pierre-Louis Bossart2017-01-311-0/+1
| | | | | | | | the BIOS incorrectly reports this codec as 5640 but it is really a rt5670 Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: rt5670: Add missing 10EC5072 ACPI IDTakashi Iwai2016-11-301-0/+1
| | | | | | | | rt5670 driver supports also RT5672 codec, but its ACPI ID is missing. This was found on Dell Wyse 3040 box. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: rt5670: Enable Braswell platform workaround for Dell Wyse 3040Takashi Iwai2016-11-301-0/+7
| | | | | | | | Dell Wyse 3040 requires the platform workaround for enabling dmic and jack detection as defined for Braswell CRB. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: rt5670: increse LDO powerBard Liao2016-10-271-2/+2
| | | | | | | Inrecse LDO power for better performance. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: rt5670: Enable MCLK detectionBard Liao2016-10-241-1/+3
| | | | | | | | | There is a power saving mechanism in rt5670. It will turn off some unused power when MCLK is not present. We call that "MCLK detection" and it should be enabled by default. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: codec duplicated callback function goes to component on rt5670Kuninori Morimoto2016-08-081-6/+8
| | | | | | | | | | codec driver and component driver has duplicated callback functions, and codec side functions are just copied to component side when register timing. This was quick-hack, but no longer needed. This patch moves these functions from codec driver to component driver. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: rt5670: patch reg-0x8aBard Liao2016-06-211-1/+2
| | | | | | | | | | | reg-8a assign the tracking source for each ASRC tracker. The default value is 0x0000 which means all ASRC trackers will track LRCK1. But in most case, we wish each ASRC tracker track the corresponding LRCK. i.e. ASRC1 tracks LRCK1, ASRC2 tracks LRCK2 and so on. So, we rewrite reg-8a as 0x0123. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: rt5670: fix HP Playback Volume controlBard Liao2016-06-071-1/+1
| | | | | | | | The register setting for HP Playback Volume is inverted. So, set the invert flag in SOC_DOUBLE_TLV. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
*-. Merge remote-tracking branches 'asoc/topic/tas2552', 'asoc/topic/tas5086', ↵Mark Brown2015-08-301-4/+3
|\ \ | | | | | | | | | 'asoc/topic/tegra', 'asoc/topic/tlv' and 'asoc/topic/topology' into asoc-next
| | * ASoC: rt5670: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGELars-Peter Clausen2015-08-051-4/+3
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DECLARE_TLV_DB_RANGE() has the advantage over using TLV_DB_RANGE_HEAD() that it automatically calculates the number of items in the TLV and is hence less prone to manual error. Generate using the following coccinelle script // <smpl> @@ declarer name DECLARE_TLV_DB_RANGE; identifier tlv; constant x; @@ -unsigned int tlv[] = { - TLV_DB_RANGE_HEAD(x), +DECLARE_TLV_DB_RANGE(tlv, ... -}; +); // </smpl> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
| |
| \
*-. \ Merge remote-tracking branches 'asoc/topic/rt298', 'asoc/topic/rt5640', ↵Mark Brown2015-08-301-1/+1
|\ \ \ | | |/ | |/| | | | 'asoc/topic/rt5651' and 'asoc/topic/rt5670' into asoc-next
| | * ASoC: rt5670: Prefix hexadecimal ID register value with 0x in error printJarkko Nikula2015-07-061-1/+1
| |/ | | | | | | | | | | | | | | Make it obvious that unexpected value read from ID register is printed in hexadecimal. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| |
| \
| \
| \
*---. \ Merge remote-tracking branches 'asoc/topic/rcar', 'asoc/topic/reg-default', ↵Mark Brown2015-08-301-4/+5
|\ \ \ \ | | |_|/ | |/| | | | | | 'asoc/topic/rl6231', 'asoc/topic/rockchip' and 'asoc/topic/rt286' into asoc-next
| | | * ASoC: Add function "rl6231_get_pre_div" to correct the dmic clock calculationOder Chiou2015-08-051-3/+4
| | |/ | |/| | | | | | | | | | | | | Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * regmap: Use reg_sequence for multi_reg_write / register_patchNariman Poushin2015-07-161-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | Separate the functionality using sequences of register writes from the functions that take register defaults. This change renames the arguments in order to support the extension of reg_sequence to take an optional delay to be applied after any given register in a sequence is written. This avoids adding an int to all register defaults, which could substantially increase memory usage for regmaps with large default tables. This also updates all the clients of multi_reg_write/register_patch. Signed-off-by: Nariman Poushin <nariman@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| |
| \
*-. | Merge remote-tracking branches 'asoc/topic/const', 'asoc/topic/cs35l32', ↵Mark Brown2015-08-301-1/+1
|\ \| | | | | | | | | | 'asoc/topic/cs4265' and 'asoc/topic/cs42l52' into asoc-next
| * | ASoC: Constify snd_soc_dai_ops variablesAxel Lin2015-07-151-1/+1
| |/ | | | | | | | | | | | | | | The snd_soc_dai_ops variables are not modified after initialization in these drivers, so make them const. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* / ASoC: drivers: Drop owner assignment from i2c_driverKrzysztof Kozlowski2015-07-151-1/+0
|/ | | | | | | | i2c_driver does not need to set an owner because i2c_register_driver() will set it. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* Merge remote-tracking branch 'asoc/topic/rt5670' into asoc-nextMark Brown2015-06-221-3/+2
|\
| * ASoC: rt5670: Constify ACPI device ids and register defaultsMathias Krause2015-06-151-3/+2
| | | | | | | | | | | | | | | | | | Constify the ACPI device ID array and the register map, no need to have them writable at runtime. Also drop the unneeded RT5670_INIT_REG_LEN define. Signed-off-by: Mathias Krause <minipli@googlemail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: rt5670: Replace direct snd_soc_codec dapm field accessLars-Peter Clausen2015-05-201-12/+13
| | | | | | | | | | | | | | | | | | | | The dapm field of the snd_soc_codec struct is eventually going to be removed, in preparation for this replace all manual access to codec->dapm.bias_level with snd_soc_codec_get_bias_level() and replace all other manual access to codec->dapm with snd_soc_codec_get_dapm(). Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: Move bias level update to the coreLars-Peter Clausen2015-04-271-1/+0
|/ | | | | | | | | All drivers have the same line at the end of the set_bias_level callback to update the bias_level state. Move this update into snd_soc_dapm_force_bias_level() and remove them from the drivers. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: rt5670: Replace w->codec snd_soc_dapm_to_codec(w->dapm)Lars-Peter Clausen2015-03-121-1/+1
| | | | | | | | The codec field of the snd_soc_widget struct is eventually going to be removed, use snd_soc_dapm_to_codec(w->dapm) instead. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: rt5670: export jack suspend/resume APIsBard Liao2015-03-111-0/+18
| | | | | | | | | | | | | | | We force enable "Mic Det Power" when a jack is inserted. Also, we set codec idle_bias_off = true. As a result, codec driver will not suspend as we expect. On Braswell, we don't need the jack detection when suspend but need it after resume, so export the jack suspend/resume APIs which are provided for machine driver to control during suspend/resume. Signed-off-by: Jie Yang <yang.jie@intel.com> Signed-off-by: Jin Yao <yao.jin@linux.intel.com> Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: rt5670: Add IRQ functionBard Liao2015-03-111-2/+174
| | | | | | | | | | This patch adds the IRQ function support of rt5670. We use a flag named dev_gpio in platform data to inform codec driver if the IRQ function is used or not. Also, we export rt5670_set_jack_detect for machine driver to pass the jack point. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* Merge tag 'v4.0-rc3' into asoc-rt5670Mark Brown2015-03-101-7/+12
|\ | | | | | | | | | | | | Linux 4.0-rc3 Conflicts: sound/soc/codecs/rt5670.c
| * Merge remote-tracking branch 'asoc/fix/rt5670' into asoc-linusMark Brown2015-03-041-1/+6
| |\