summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/rt5670.c
AgeCommit message (Collapse)AuthorFilesLines
2015-05-20ASoC: rt5670: Replace direct snd_soc_codec dapm field accessLars-Peter Clausen1-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>
2015-04-27ASoC: Move bias level update to the coreLars-Peter Clausen1-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>
2015-03-12ASoC: rt5670: Replace w->codec snd_soc_dapm_to_codec(w->dapm)Lars-Peter Clausen1-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>
2015-03-11ASoC: rt5670: export jack suspend/resume APIsBard Liao1-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>
2015-03-11ASoC: rt5670: Add IRQ functionBard Liao1-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>
2015-03-10Merge tag 'v4.0-rc3' into asoc-rt5670Mark Brown1-7/+12
Linux 4.0-rc3 Conflicts: sound/soc/codecs/rt5670.c
2015-03-09ASoC: rt5670: Check sysclk source by private dataBard Liao1-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>
2015-03-09ASoC: rt5670: Revert Keep sysclk on patchBard Liao1-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>
2015-03-04Merge remote-tracking branch 'asoc/fix/rt5670' into asoc-linusMark Brown1-1/+6
2015-03-04ASoC: rt5670: Fix the speaker mono output issueBard Liao1-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>
2015-03-02ASoC: rt5670: add API to select ASRC clock sourceMengdong Lin1-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>
2015-03-02ASoC: rt5670: Keep sysclk on if JD func is usedBard Liao1-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>
2015-03-02ASoC: rt5670: Add runtime PM supportBard Liao1-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>
2015-03-02ASoC: rt5670: set platform data by dmiBard Liao1-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>
2015-02-24ASoC: rt5670: Set RT5670_IRQ_CTRL1 non volatileBard Liao1-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
2015-02-21ASoC: rt5670: Fix the speaker mono output issueBard Liao1-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>
2015-02-09Merge remote-tracking branches 'asoc/topic/rt5670', 'asoc/topic/rt5677', ↵Mark Brown1-0/+1
'asoc/topic/rx51', 'asoc/topic/samsung' and 'asoc/topic/sh' into asoc-next
2015-02-09Merge remote-tracking branches 'asoc/topic/fsl-spdif', 'asoc/topic/imx', ↵Mark Brown1-0/+83
'asoc/topic/intel', 'asoc/topic/jz4740' and 'asoc/topic/max98357a' into asoc-next
2015-02-09Merge remote-tracking branch 'asoc/topic/w-codec' into asoc-nextMark Brown1-7/+9
2015-02-09ASoC: rt5670: Set use_single_rw flag for regmapBard Liao1-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
2015-01-15ASoC: rt5670: Replace w->codec snd_soc_dapm_to_codec(w->dapm)Lars-Peter Clausen1-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>
2015-01-07ASoC: rt5670: add API to select ASRC clock sourceMengdong Lin1-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>
2014-12-22ASoC: rt5670: Keep sysclk on if JD func is usedBard Liao1-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>
2014-12-22ASoC: rt5670: Add runtime PM supportBard Liao1-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>
2014-12-22ASoC: rt5670: set platform data by dmiBard Liao1-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>
2014-12-08Merge remote-tracking branches 'asoc/topic/rt5645', 'asoc/topic/rt5670', ↵Mark Brown1-21/+115
'asoc/topic/rt5677', 'asoc/topic/samsung' and 'asoc/topic/sgtl5000' into asoc-next
2014-11-25ASoC: rt5670: add DMIC ASRC supportBard Liao1-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>
2014-11-25ASoC: rt5670: check if asrc is useableBard Liao1-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>
2014-11-14ASoC: rt5670: make bias level more reasonableBard Liao1-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>
2014-11-14ASoC: rt5670 : Add ACPI match ID for Intel CHT/BSW platformsMengdong Lin1-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>
2014-11-11ASoC: rt5670: add rt5672 codec supportBard Liao1-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>
2014-11-06ASoC: rt5670: change dapm routes of PLL connectionBard Liao1-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>
2014-11-06ASoC: rt5670: correct the incorrect default valuesBard Liao1-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
2014-08-01ASoC: rt5670: Fix duplicate const warningsMark Brown1-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>
2014-08-01ASoC: rt5670: Staticise non-exported symbolsMark Brown1-3/+3
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-07-02ASoC: add RT5670 CODEC driverBard Liao1-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>