summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/rt5670.c
Commit message (Collapse)AuthorAgeFilesLines
*-. 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
| |\
| | * ASoC: rt5670: Set RT5670_IRQ_CTRL1 non volatileBard Liao2015-02-241-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | RT5670_IRQ_CTRL1(0xbd) is a non volatile register. And we need to restore its value after suspend/resume. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
| | * ASoC: rt5670: Fix the speaker mono output issueBard Liao2015-02-211-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | We need to set left/right control for the speaker amp to get stereo output on speaker. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | |
| | \
| *-. \ Merge remote-tracking branches 'asoc/topic/rt5670', 'asoc/topic/rt5677', ↵Mark Brown2015-02-091-0/+1
| |\ \ \ | | | |/ | | | | | | | | 'asoc/topic/rx51', 'asoc/topic/samsung' and 'asoc/topic/sh' into asoc-next
| | * | ASoC: rt5670: Set use_single_rw flag for regmapBard Liao2015-02-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RT5670 doesn't support auto incrementing writes so driver should set the use_single_rw flag for regmap. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
| | | |
| | \ \
| *-. \ \ Merge remote-tracking branches 'asoc/topic/fsl-spdif', 'asoc/topic/imx', ↵Mark Brown2015-02-091-0/+83
| |\ \ \ \ | | | |/ / | | | | / | | | |/ | | |/| 'asoc/topic/intel', 'asoc/topic/jz4740' and 'asoc/topic/max98357a' into asoc-next
| | | * ASoC: rt5670: add API to select ASRC clock sourceMengdong Lin2015-01-071-0/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When codec is in slave mode, ASRC can suppress noise for asynchronous MCLK and LRCLK or special I2S format. This patch defines an API to select the clock source for specified filters. And the codec driver will turn on ASRC for these filters if ASRC is selected as their clock source. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mengdong Lin <mengdong.lin@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | | Merge remote-tracking branch 'asoc/topic/w-codec' into asoc-nextMark Brown2015-02-091-7/+9
| |\ \ \ | | |_|/ | |/| |
| | * | ASoC: rt5670: Replace w->codec snd_soc_dapm_to_codec(w->dapm)Lars-Peter Clausen2015-01-151-7/+9
| | |/ | | | | | | | | | | | | | | | | | | | | | 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: Keep sysclk on if JD func is usedBard Liao2014-12-221-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | System clock is necessary for rt5670 JD function. We assume system clock source will be set in machine driver. So there are two things left we should do in codec driver. 1. Set sysclk to codec internal clock in probe since machine driver may not do that before JD function is registered. 2. Power up PLL once sysclk source is switched to PLL. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | ASoC: rt5670: Add runtime PM supportBard Liao2014-12-221-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | This patch adds runtime PM support on rt5670 codec. Signed-off-by: Lin Mengdong <mengdong.lin@intel.com> Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | ASoC: rt5670: set platform data by dmiBard Liao2014-12-221-0/+18
| |/ | | | | | | | | | | | | | | This patch set specific data according to dmi data. Signed-off-by: Jin, Yao <yao.jin@intel.com> Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: rt5670: Check sysclk source by private dataBard Liao2015-03-091-8/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, is_sys_clk_from_pll check sysclk source by reading codec register value. And it will be invoked before updating dapm widget power. In some machine driver, snd_soc_dai_set_sysclk is called in dapm event to switch codec sysclk to RC clock in idle mode. And in some use cases (such as syspend/resume) hw_params will not be called when the dapm widget is powered up. As a result, is_sys_clk_from_pll will return 0 although it is supposed to be 1. To solve this, we let is_sys_clk_from_pll check sysclk sysclk_src which is stored in private data and don't change the value of sysclk_src when codec sysclk is switched to internal clock. The internal clock can only be used in idle mode, so it sould be fine if we don't set sysclk_src to internal clock. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: rt5670: Revert Keep sysclk on patchBard Liao2015-03-091-11/+0
| | | | | | | | | | | | | | | | | | The "Keep sysclk on if JD func is used" patch force enable/disable pin in rt5670_set_dai_sysclk. But some machine driver call it in dapm widget event. It will cause kernel crash. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: rt5670: Fix the speaker mono output issueBard Liao2015-03-041-0/+6
| | | | | | | | | | | | | | | | We need to set left/right control for the speaker amp to get stereo output on speaker. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: rt5670: add API to select ASRC clock sourceMengdong Lin2015-03-021-0/+83
| | | | | | | | | | | | | | | | | | | | | | When codec is in slave mode, ASRC can suppress noise for asynchronous MCLK and LRCLK or special I2S format. This patch defines an API to select the clock source for specified filters. And the codec driver will turn on ASRC for these filters if ASRC is selected as their clock source. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mengdong Lin <mengdong.lin@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: rt5670: Keep sysclk on if JD func is usedBard Liao2015-03-021-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | System clock is necessary for rt5670 JD function. We assume system clock source will be set in machine driver. So there are two things left we should do in codec driver. 1. Set sysclk to codec internal clock in probe since machine driver may not do that before JD function is registered. 2. Power up PLL once sysclk source is switched to PLL. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: rt5670: Add runtime PM supportBard Liao2015-03-021-0/+9
| | | | | | | | | | | | | | | | This patch adds runtime PM support on rt5670 codec. Signed-off-by: Lin Mengdong <mengdong.lin@intel.com> Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: rt5670: set platform data by dmiBard Liao2015-03-021-0/+18
|/ | | | | | | | This patch set specific data according to dmi data. Signed-off-by: Jin, Yao <yao.jin@intel.com> Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
*-. Merge remote-tracking branches 'asoc/topic/rt5645', 'asoc/topic/rt5670', ↵Mark Brown2014-12-081-21/+115
|\ \ | | | | | | | | | 'asoc/topic/rt5677', 'asoc/topic/samsung' and 'asoc/topic/sgtl5000' into asoc-next
| | * ASoC: rt5670: add DMIC ASRC supportBard Liao2014-11-251-0/+12
| | | | | | | | | | | | | | | | | | | | | This patch will enable ASRC for DMIC if ASRC is useable. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * ASoC: rt5670: check if asrc is useableBard Liao2014-11-251-2/+14
| | | | | | | | | | | | | | | | | | | | | To use ASRC, the sysclk should be faster than 384 times sample rate of I2S1. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * ASoC: rt5670: make bias level more reasonableBard Liao2014-11-141-7/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patah separate bias level off to standby and off. The standby level will provide the necessary power for JD and push button functions. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * ASoC: rt5670 : Add ACPI match ID for Intel CHT/BSW platformsMengdong Lin2014-11-141-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds the ACPI match ID for rt5670/5672 codec. So on Intel CherryTrail/Braswell platforms, the codec can be enumerated from ACPI and depends on ACPI to get platform-specific info and power saving. Signed-off-by: Mengdong Lin <mengdong.lin@intel.com> Reviewed-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * ASoC: rt5670: add rt5672 codec supportBard Liao2014-11-111-12/+59
| |/ | | | | | | | | | | | | | | | | rt5672 is very similar to rt5670. Therefore we use one codec driver to support both codecs. The difference between rt5670 and rt5672 is there is some difference in their dapm routing table. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: rt5670: change dapm routes of PLL connectionBard Liao2014-11-061-4/+4
| | | | | | | | | | | | | | | | PLL should be powered up once filter power is on. So, "PLL1" should be connected to filters instead of DACs. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: rt5670: correct the incorrect default valuesBard Liao2014-11-061-14/+14
|/ | | | | | | | The patch corrects the incorrect default register values. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
* ASoC: rt5670: Fix duplicate const warningsMark Brown2014-08-011-72/+37
| | | | | | | | Since SOC_ENUM_SINGLE_DECL() includes a const as part of the macro adding an explicit const in the source is duplication and causes sparse to warn. Remove the extra consts. Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: rt5670: Staticise non-exported symbolsMark Brown2014-08-011-3/+3
| | | | Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: add RT5670 CODEC driverBard Liao2014-07-021-0/+2692
This patch adds a minimum support of Realtek ALC5670 codec. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@linaro.org>
OpenPOWER on IntegriCloud