summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/rt286.c
AgeCommit message (Collapse)AuthorFilesLines
2017-05-14rt286: add Thinkpad Helix 2 to force_combo_jack_tableYifeng Li1-0/+7
Thinkpad Helix 2 is a tablet PC, the audio is powered by Core M broadwell-audio and rt286 codec. For all versions of Linux kernel, the stereo output doesn't work properly when earphones are plugged in, the sound was coming out from both channels even if the audio contains only the left or right channel. Furthermore, if a music recorded in stereo is played, the two channels cancle out each other out, as a result, no voice but only distorted background music can be heard, like a sound card with builtin a Karaoke sount effect. Apparently this tablet uses a combo jack with polarity incorrectly set by rt286 driver. This patch adds DMI information of Thinkpad Helix 2 to force_combo_jack_table[] and the issue is resolved. The microphone input doesn't work regardless to the presence of this patch and still needs help from other developers to investigate. This is my first patch to LKML directly, sorry for CC-ing too many people here. Link: https://bugzilla.kernel.org/show_bug.cgi?id=93841 Signed-off-by: Yifeng Li <tomli@tomli.me> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-08-08ASoC: codec duplicated callback function goes to component on rt286Kuninori Morimoto1-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>
2016-07-12ASoC: rt286: set combo jack for KabylakeVinod Koul1-0/+7
Like in Skylake, Kabylake also uses combo jack so add Kabylake to DMI match for combo jack configuration. Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-10Merge remote-tracking branches 'asoc/fix/imx-spdif', 'asoc/fix/mtk', ↵Mark Brown1-23/+3
'asoc/fix/mxs-saif', 'asoc/fix/qcom' and 'asoc/fix/rt286' into asoc-linus
2016-01-21ASoC: rt286: fix capture doesn't work at some casesBard Liao1-23/+3
RT286_CBJ_CTRL1(0x4f) bit 10 is needed for headset capture. It will be turned off when "VREF" widget is on and be turned on when bias level is ON. It is odd. And if "VREF" is turned on in bias level is ON, RT286_CBJ_CTRL1(0x4f) bit 10 will be turned off. This patch move the bit control from rt286_set_bias_level and rt298_vref_event to rt286_jack_detect. So it will be turned on once a jack is plugged in. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-17ASoC: rt286: set combo jack for SkylakeVinod Koul1-0/+6
Skylake platform also uses combo jack configuration, so add Skylake to existing DMI match for combo jack Signed-off-by: Vinod Koul <vinod.koul@intel.com> Acked-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-26Merge remote-tracking branches 'asoc/topic/rcar', 'asoc/topic/rl6347a', ↵Mark Brown1-3/+6
'asoc/topic/rockchip' and 'asoc/topic/rt286' into asoc-next
2015-10-07ASoC: rt286: Fix run time error while modifying const dataAxel Lin1-2/+6
Make a copy of memory for index_cache rather than directly use the rt286_index_def to avoid run time error. Fixes: c418a84a8c8f ("ASoC: Constify reg_default tables") Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-24ASoC: rl6347a: Clean up unneeded inclusion of header filesAxel Lin1-1/+0
Also move the include of sound/hda_verbs.h to rl6347a.h because it is used in rl6347a.h. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-30Merge remote-tracking branches 'asoc/topic/rcar', 'asoc/topic/reg-default', ↵Mark Brown1-3/+3
'asoc/topic/rl6231', 'asoc/topic/rockchip' and 'asoc/topic/rt286' into asoc-next
2015-07-16Merge branches 'topic/owner' and 'topic/reg-default' of ↵Mark Brown1-2/+2
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-max9877
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-08ASoC: rt286: Constify dmi_system_id tableAxel Lin1-2/+2
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-07ASoC: Constify reg_default tablesAxel Lin1-2/+2
Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Peter Rosin <peda@axentia.se> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-06ASoC: rt286: 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-22Merge remote-tracking branches 'asoc/topic/qcom', 'asoc/topic/rcar', ↵Mark Brown1-91/+6
'asoc/topic/rt286' and 'asoc/topic/rt5640' into asoc-next
2015-06-12ASoC: rt286: Add RL6347A class device shared support for RT286Oder Chiou1-91/+6
The patch separates the IO function from the rt286. It is prepared to share for new chips that support the same IO function. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-20ASoC: rt286: Replace direct snd_soc_codec dapm field accessLars-Peter Clausen1-15/+17
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-04-12Merge remote-tracking branches 'asoc/topic/omap', 'asoc/topic/qcom', ↵Mark Brown1-7/+18
'asoc/topic/rcar' and 'asoc/topic/rt286' into asoc-next
2015-04-12Merge tag 'asoc-v4.1' into asoc-nextMark Brown1-3/+14
ASoC: Changes for v4.1 A selection of changes for v4.1 so far. The main things are: - Move of jack registration to the card where it belongs. - Support for DAPM routes specified by both the machine driver and DT. # gpg: Signature made Thu 05 Mar 2015 01:10:27 GMT using RSA key ID 5D5487D0 # gpg: WARNING: digest algorithm MD5 is deprecated # gpg: please see https://gnupg.org/faq/weak-digest-algos.html for more information # gpg: Oops: keyid_from_fingerprint: no pubkey # gpg: Good signature from "Mark Brown <broonie@sirena.org.uk>" # gpg: aka "Mark Brown <broonie@debian.org>" # gpg: aka "Mark Brown <broonie@kernel.org>" # gpg: aka "Mark Brown <broonie@tardis.ed.ac.uk>" # gpg: aka "Mark Brown <broonie@linaro.org>" # gpg: aka "Mark Brown <Mark.Brown@linaro.org>"
2015-04-09ASoC: rt286: Restore default in probeBard Liao1-0/+8
RT286 can't do register reset. If the hardware power is still existing in power off, rt286 will keep the register settings. So, we need to restore the default register value in probe to make sure the cache value is the same as the real register value. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-24ASoC: rt286: check regmap_read result for ID checkBard Liao1-5/+9
It is worth to check the regmap_read result for ID check since it is the first regmap_read. And we can check if there is any i2c issue. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-17ASoC: rt286: Drop unnecessary dapm bias_level initializationLars-Peter Clausen1-1/+0
The default value for the bias_level is SND_SOC_BIAS_OFF when probe is being called, there is no need to initialize it explicitly. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-06ASoC: rt286: Change the DMI mapping for DinoBard Liao1-1/+1
The board ID will be changed between revisions. So, it is better to map it by project name. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-03-06ASoC: rt286: correct the OR to ANDJie Yang1-1/+1
Here it should be AND(&) to check the status. Signed-off-by: Jie Yang <yang.jie@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-02-24ASoC: rt286: add jack detection disable with NULL jack passedJie Yang1-3/+14
Some platforms, e.g. WSB, don't need jack detection when system is in Suspend, for power save reason. Here add headphone/mic jack detection disable feature with NULL jack passed in, when disabled, it will disable interrupt, and disable LDO1, which is used for jack detection when headphone is plugged in. Signed-off-by: Jie Yang <yang.jie@intel.com> Reviewed-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-02-09Merge remote-tracking branches 'asoc/topic/pxa', 'asoc/topic/rcar' and ↵Mark Brown1-2/+27
'asoc/topic/rt286' into asoc-next
2015-02-09Merge remote-tracking branch 'asoc/topic/w-codec' into asoc-nextMark Brown1-6/+7
2015-02-09ASoC: rt286: Add rt288 codec supportBard Liao1-1/+3
This patch adds support for rt288 codec. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-02-05ASoC: rt286: Add customize setting for Dell DinoBard Liao1-1/+24
The patch add the customize setting for Dell Dino project. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-02-05ASoC: rt286: Fix potencial crash in jd functionBard Liao1-0/+2
We assign rt286->codec in rt286_probe. If rt286_jack_detect is invoked before rt286_probe, rt286->codec will be NULL and cause a kernel panic. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-27Merge branch 'topic/rt286' of ↵Mark Brown1-36/+8
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-w-codec Conflicts: sound/soc/codecs/rt286.c
2015-01-26ASoC: rt286: Fix capture volume setting issueBard Liao1-32/+6
The purpose of rt286_adc_event is to mute/numnte the ADC mixer. However, it will also set the capture volume to default value. As a result, "ADC0 Capture Volume" is not working if it is set before capture start. This patch remove rt286_adc_event and add "ADC0 Capture Switch" to mute/unmute ADC mixer. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-15ASoC: rt286: Replace w->codec snd_soc_dapm_to_codec(w->dapm)Lars-Peter Clausen1-7/+8
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-15ASoC: rt286: set the same format for dac and adcBard Liao1-4/+2
There is only one I2S I/F, AD/DA path must operate to the same format. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-11-18ASoC: rt286: build warning of section mismatchSudip Mukherjee1-1/+1
while building we were getting the following build warning: Section mismatch in reference from the function rt286_i2c_probe() to the variable .init.data:force_combo_jack_table The function rt286_i2c_probe() references the variable __initdata force_combo_jack_table. This is often because rt286_i2c_probe lacks a __initdata annotation or the annotation of force_combo_jack_table is wrong. we were getting the warning as force_combo_jack_table was marked with __initdata Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-11-06ASoC: rt286: fix comment styleBard Liao1-4/+4
Adds spaces around the /* */. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-11-06ASoC: rt286: set combo jack by dmiBard Liao1-0/+14
This patch enables combo jack configuration according to dmi. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-10-31ASoC: rt286: reduce power consumptionBard Liao1-56/+155
This patch will optimize the power consumption of rt286. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-10-06Merge remote-tracking branches 'asoc/topic/max98090', 'asoc/topic/rockchip', ↵Mark Brown1-0/+2
'asoc/topic/rsnd' and 'asoc/topic/rt286' into asoc-next
2014-10-02ASoC: rt286: Fix compilation warning for !PMThierry Reding1-0/+2
The rt286_index_sync() function is only called in the resume path. If PM is disabled it becomes unused and shouldn't be built either. Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-09-26ASoC: rt286: Fix sync functionBard Liao1-1/+1
We try to write index registers into cache when we write an index register, but we change the reg value before updating the cache. As a result, the cache is never be updated. This patch will fix this issue. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
2014-09-26ASoC: rt286: Correct default valueBard Liao1-3/+2
This patch corrects some incorrect default value in the cache. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
2014-07-29ASoC: rt286: Fix null pointer issueBard Liao1-38/+36
To make the interrupt safe if it happens to be called before the card is ready, we use regmap read/write in the interrupt handler. Also, we try to prevent the interrupt happen before the card is ready by enabling codec's IRQ in the ASoC probe. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-07-14ASoC: rt286: make rt286_i2c_driver staticBard Liao1-1/+1
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-07-07ASoC: RT286: Fix silent at the beginning of streamBard Liao1-1/+19
This patch fix the issue that the output is almost silent at the beginning of starting a playback. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-07-07ASoC: RT286: move initial settings to _i2c_probeBard Liao1-50/+49
Move codec initial settings from asoc probe to i2c probe. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-07-07ASoC: RT286: check ID in i2c levelBard Liao1-8/+8
Move ID check from asoc level to i2c level. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-07-07ASoC: RT286: remove test codeBard Liao1-1/+0
Remove test code. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@linaro.org>