summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/rt5645.c
AgeCommit message (Collapse)AuthorFilesLines
2015-10-07Merge remote-tracking branches 'asoc/fix/db1200', 'asoc/fix/dwc', ↵Mark Brown1-3/+3
'asoc/fix/imx-ssi', 'asoc/fix/maintainers', 'asoc/fix/rt5645', 'asoc/fix/sgtl5000' and 'asoc/fix/tas2552' into asoc-linus
2015-10-01ASoC: rt5645: Correct the naming and setting of ADC Boost Volume ControlOder Chiou1-3/+3
Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-23ASoC: rt5645: Prevent the pop sound in case of playback and the jack is pluggingOder Chiou1-0/+3
Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-23ASoC: rt5645: Increase the delay time to remove the pop soundOder Chiou1-1/+1
Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-23ASoC: rt5645: Use the type SOC_DAPM_SINGLE_AUTODISABLE to prevent the weird ↵Oder Chiou1-2/+2
sound in runtime of power up Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-14Merge branch 'fix/rt5645' of ↵Mark Brown1-0/+7
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-fix-rt5645
2015-09-11ASoC: rt5645: Remove incorrect settingsOder Chiou1-6/+0
The patch removes the incorrect settings to avoid the pop sound in the first playback with headphone after boot. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-09ASoC: rt5645: Add struct dmi_system_id "Google Ultima" for chrome platformJohn Lin1-0/+7
Signed-off-by: John Lin <john.lin@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-30Merge remote-tracking branches 'asoc/topic/tas2552', 'asoc/topic/tas5086', ↵Mark Brown1-4/+3
'asoc/topic/tegra', 'asoc/topic/tlv' and 'asoc/topic/topology' into asoc-next
2015-08-30Merge remote-tracking branches 'asoc/topic/rcar', 'asoc/topic/reg-default', ↵Mark Brown1-5/+6
'asoc/topic/rl6231', 'asoc/topic/rockchip' and 'asoc/topic/rt286' into asoc-next
2015-08-30Merge remote-tracking branches 'asoc/topic/const', 'asoc/topic/cs35l32', ↵Mark Brown1-1/+1
'asoc/topic/cs4265' and 'asoc/topic/cs42l52' into asoc-next
2015-08-30Merge remote-tracking branch 'asoc/topic/ssm4567' into asoc-nextMark Brown1-1/+0
2015-08-30Merge remote-tracking branch 'asoc/topic/rt5645' into asoc-nextMark Brown1-206/+209
2015-08-30Merge remote-tracking branch 'asoc/fix/rt5645' into asoc-linusMark Brown1-0/+7
2015-08-27ASoC: rt5645: Prevent the pop sound of the headphone while rebooting or ↵Oder Chiou1-11/+24
shutdowning Add i2c shutdown function to prevent the pop sound of the headphone while the system is rebooting or shutdowning. It de-initials the jack detection function, and it cannot be turned off in _BIAS_OFF. If we don't de-initial it, the pop sound will be heard in the situation of powering off. And replace the related register settings from magic number to meaningful defined name. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-25ASoC: rt5645: Add struct dmi_system_id "Google Celes" for chrome platformOder Chiou1-0/+7
Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
2015-08-25ASoC: rt5645: Add the register RT5645_CHARGE_PUMP to readable check functionOder Chiou1-0/+1
Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-25ASoC: rt5645: Remove the incorrect setting of the JD modeOder Chiou1-2/+0
The patch removes the incorrect setting of the JD mode. It will cause pop sound in the booting time. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-25ASoC: rt5645: Modify the jack detection function to prevent the pop sound ↵Oder Chiou1-2/+11
while the jack plug in The patch corrects the sequence of the jack detection. It will prevent the pop sound while the jack plug in. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-25ASoC: rt5645: Modify the headphone depop and calibration function to prevent ↵Oder Chiou1-79/+32
the pop sound in the booting time Remove the original calibration function and modify the depop and calibration function to prevent the pop sound in the booting time. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-05ASoC: rt5645: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGELars-Peter Clausen1-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>
2015-08-05ASoC: Add function "rl6231_get_pre_div" to correct the dmic clock calculationOder Chiou1-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>
2015-08-03ASoC: rt5645: Fix lost pin setting for DMIC1Bard Liao1-0/+2
I2S2_DAC pin can be used for I2S or GPIO. We should set it as GPIO if we use GPIO5 as DMIC1 data pin. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-20ASoC: rt5645: Remove return value in jack detect workNicolas Boichat1-1/+1
"ASoC: rt5645: Check if codec is initialized in workqueue handler" adds a check if codec is NULL in rt5645_irq_detection, which returns an int. However, "ASoC: rt5645: Remove irq_jack_detection function" removes that function, and moves the code in jack_detect_work, which returns void. Remove the return value to fix compilation warning. Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-20Merge branch 'fix/rt5645' of ↵Mark Brown1-0/+3
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-rt5645
2015-07-17ASoC: rt5645: Add regulator supportKoro Chen1-3/+58
This adds basic regulator support for rt5645. Signed-off-by: Koro Chen <koro.chen@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-17ASoC: rt5645: Fix missing free_irqKoro Chen1-3/+14
The driver does not free irq when snd_soc_register_codec returns error. It does not return error when request irq failed, either. Add return when request irq failed, and free_irq if snd_soc_register_codec failed. Signed-off-by: Koro Chen <koro.chen@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-17ASoC: rt5645: Remove unused rt5645 variableNicolas Boichat1-1/+0
"ASoC: rt5645: Simplify rt5645_enable_push_button_irq" removes the test that accessed rt5645->pdata.jd_mode (that test is now done in rt5645_jack_detect only), so we do not need that variable anymore. Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-17ASoC: rt5645: Check if codec is initialized in workqueue handlerNicolas Boichat1-0/+3
This fixes kernel panic on boot, if rt5645->codec is NULL when rt5645_jack_detect_work is first called. rt5645_jack_detect_work needs rt5645->codec to be initialized to setup dapm pins. Also, reporting jack events is useless, as the jacks cannot be set before the codec is ready. Since we manually call the interrupt handler in rt5645_set_jack_detect, the initial jack state will be reported correctly, and dapm pins will be setup at that time. Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-16regmap: Use reg_sequence for multi_reg_write / register_patchNariman Poushin1-2/+2
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>
2015-07-16ASoC: rt5645: Simplify rt5645_enable_push_button_irqNicolas Boichat1-21/+12
LDO2/Mic Det Power pins are already enabled/disabled in rt5645_jack_detect (the jack out code path previously did not disable those if button function is enabled: modify it to make it so). Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-16ASoC: rt5645: Update dapm pins when the card is not instantiated yetNicolas Boichat1-25/+11
This makes sure the dapm state is consistent when the card is instantiated. However, if the card is not instantiated yet, we still update the registers manually in the "jack in" case, so that we can immediately report if a mic is present or not. Disabling "Mic Det Power" after detection, and on jack out, can wait until the card gets instantiated. Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-15ASoC: drivers: Drop owner assignment from i2c_driverKrzysztof Kozlowski1-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>
2015-07-15ASoC: Constify snd_soc_dai_ops variablesAxel Lin1-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>
2015-07-14ASoC: rt5645: Remove irq_jack_detection functionNicolas Boichat1-31/+22
irq_jack_detection is only called from rt5645_jack_detect_work: remove the function to simplify the code. Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-07Merge branch 'topic/codec-dapm' of ↵Mark Brown1-42/+33
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-rt5645 Conflicts: sound/soc/codecs/rt5645.c
2015-07-07ASoC: rt5645: Replace direct snd_soc_codec dapm field accessLars-Peter Clausen1-41/+32
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>
2015-07-07ASoC: rt5645: move RT5645 muxes to rt5645_specific_dapm_widgetsBard Liao1-17/+22
This is a similar patch to "move RT5650 muxes to rt5650_specific_ dapm_widgets" patch. The purpose is to silence the "has no paths" warnings. 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>
2015-07-06ASoC: rt5645: Constify dmi_system_id tableAxel Lin1-1/+1
dmi_check_system() takes "const struct dmi_system_id *", so make the dmi_system_id table const. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-06ASoC: rt5645: Prefix hexadecimal ID register value with 0x in error printJarkko Nikula1-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>
2015-06-15ASoC: rt5645: move RT5650 muxes to rt5650_specific_dapm_widgetsMichele Curti1-17/+18
Developing a driver for an Asus X205TA laptop I get these dmesg errors: rt5645 i2c-10EC5648:00: ASoC: mux RT5650 IF1 ADC1 Swap Mux has no paths rt5645 i2c-10EC5648:00: ASoC: mux RT5650 IF1 ADC2 Swap Mux has no paths rt5645 i2c-10EC5648:00: ASoC: mux RT5650 IF1 ADC3 Swap Mux has no paths rt5645 i2c-10EC5648:00: ASoC: mux RT5650 IF1 ADC Mux has no paths rt5645 i2c-10EC5648:00: ASoC: mux RT5650 IF1 DAC1 L Mux has no paths rt5645 i2c-10EC5648:00: ASoC: mux RT5650 IF1 DAC1 R Mux has no paths rt5645 i2c-10EC5648:00: ASoC: mux RT5650 IF1 DAC2 L Mux has no paths rt5645 i2c-10EC5648:00: ASoC: mux RT5650 IF1 DAC2 R Mux has no paths so, move these muxes to the rt5650_specific_dapm_widgets[] list. Signed-off-by: Michele Curti <michele.curti@gmail.com> Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-12ASoC: rt5645: Use devm_gpiod_get_optional for hp-detectAxel Lin1-2/+3
Since hp-detect is optional, use devm_gpiod_get_optional instead. In additional, it should return error if devm_gpiod_get_optional fails. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-12ASoC: rt5645: Add the device tree parserOder Chiou1-6/+19
Modify the RT5645 driver to parse platform data from device tree. This is missing from previous patch in sound/soc/codecs/rt5645.c, that was present in v3. 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>
2015-06-10ASoC: rt5645: change gpio to gpiod APIsOder Chiou1-35/+12
Move gpio to gpio_desc and use gpiod APIs in codec driver. 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>
2015-06-10Merge tag 'asoc-v4.2' into asoc-rt5645Mark Brown1-6/+5
ASoC: Updates for v4.2 The big thing this release has been Liam's addition of topology support to the core. We've also seen quite a bit of driver work and the continuation of Lars' refactoring for component support. - Support for loading ASoC topology maps from firmware, intended to be used to allow self-describing DSP firmware images to be built which can map controls added by the DSP to userspace without the kernel needing to know about individual DSP firmwares. - Lots of refactoring to avoid direct access to snd_soc_codec where it's not needed supporting future refactoring. - Big refactoring and cleanup serieses for the Wolfson ADSP and TI TAS2552 drivers. - Support for TI TAS571x power amplifiers. - Support for Qualcomm APQ8016 and ZTE ZX296702 SoCs. - Support for x86 systems with RT5650 and Qualcomm Storm.
2015-06-10ASoC: rt5645: make RT5650_TDM_CTRL_4 readableOder Chiou1-0/+1
Register RT5650_TDM_CTRL_4(0x7A) is readable and used for mixer setting. It should be added in rt5645_readable_register function. 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>
2015-06-10ASoC: rt5645: Lock mutex in rt5645_enable_push_button_irqNicolas Boichat1-0/+6
rt5645_enable_push_button_irq uses snd_soc_dapm_*_unlocked functions, so it needs to lock the required dapm mutex. Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-05Merge remote-tracking branch 'asoc/topic/rt5645' into asoc-nextMark Brown1-249/+829
2015-06-05Merge remote-tracking branch 'asoc/topic/dapm' into asoc-nextMark Brown1-2/+1
2015-06-05ASoC: rt5645: Init jack_detect_work before registering irqNicolas Boichat1-2/+2
Prevents frequent panic on boot, if the irq handler rt5645_irq gets called before the workqueue rt5645_jack_detect_work is initialized. Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org