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 <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
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 <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Like in Skylake, Kabylake also uses combo jack so add Kabylake to
DMI match for combo jack configuration.
Signed-off-by: Vinod Koul <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
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 <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Skylake platform also uses combo jack configuration, so add
Skylake to existing DMI match for combo jack
Signed-off-by: Vinod Koul <[email protected]>
Acked-by: Bard Liao <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Make a copy of memory for index_cache rather than directly use the
rt286_index_def to avoid run time error.
Fixes: c418a84a8c ("ASoC: Constify reg_default tables")
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Also move the include of sound/hda_verbs.h to rl6347a.h because it is used
in rl6347a.h.
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
i2c_driver does not need to set an owner because i2c_register_driver()
will set it.
Signed-off-by: Krzysztof Kozlowski <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
dmi_check_system() takes "const struct dmi_system_id *", so make the
dmi_system_id table const.
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Make it obvious that unexpected value read from ID register is printed in
hexadecimal.
Signed-off-by: Jarkko Nikula <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
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 <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
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 <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
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 <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
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 <[email protected]>"
# gpg: aka "Mark Brown <[email protected]>"
# gpg: aka "Mark Brown <[email protected]>"
# gpg: aka "Mark Brown <[email protected]>"
# gpg: aka "Mark Brown <[email protected]>"
# gpg: aka "Mark Brown <[email protected]>"
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 <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
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 <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
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 <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
The board ID will be changed between revisions. So, it is better
to map it by project name.
Signed-off-by: Bard Liao <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
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 <[email protected]>
Reviewed-by: Bard Liao <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
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 <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
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 <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
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 <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
There is only one I2S I/F, AD/DA path must operate to the same
format.
Signed-off-by: Bard Liao <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
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 <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
This patch enables combo jack configuration according to dmi.
Signed-off-by: Bard Liao <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
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 <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
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 <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Cc: [email protected]
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 <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
This patch fix the issue that the output is almost silent at the
beginning of starting a playback.
Signed-off-by: Bard Liao <[email protected]>
Signed-off-by: Mark Brown <[email protected]>