For making the development easier, add quirk module option to override
the platform data setup. For example, a platform with inverted jack
detection with jd_mode=2, pass the value 0x21 (0x1 = inv_jd1_1, 0x20 =
jd_mode=2). It overrides the whole pdata fields, so pass it
carefully.
Signed-off-by: Takashi Iwai <[email protected]>
Tested-by: James Cameron <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
We will set some volatile registers in jack detection function. But
those volatile registers will be clear in rt5665_calibrate function
because we set cache bypass and reset codec in rt5665_calibrate function.
This patch add a flag to make sure that rt5665_calibrate is done
before starting jack detection.
Signed-off-by: Bard Liao <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
The property type of "nuvoton,crosstalk-bypass" changes to boolean.
The document is updated as well.
Signed-off-by: John Hsu <[email protected]>
Signed-off-by: John Hsu <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Don't populate the arrays fs_list and ps_list on the stack but make
them static const. Makes the object code smaller:
Before:
text data bss dec hex filename
12084 4888 64 17036 428c sound/soc/codecs/ak4642.o
After:
text data bss dec hex filename
11883 5032 64 16979 4253 sound/soc/codecs/ak4642.o
Signed-off-by: Colin Ian King <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
This patch is uploaded for enabling the speaker protection features
of the audio codec.
Signed-off-by: Bard Liao <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Move set_sysclk to codec level and people can use it at both
codec and dai level.
Signed-off-by: Bard Liao <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
{ "ADC Stereo1 Filter", NULL, "PLL1", is_sys_clk_from_pll }, and
{ "ADC Stereo2 Filter", NULL, "PLL1", is_sys_clk_from_pll }, are
defined twice in the driver.
Signed-off-by: Bard Liao <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
When we select "IF1_ADC4" for IF1 ADC Muxes, it is actually connected
to "TxDP_ADC" widget. This patch fixes the audio route and remove the
unexisting "IF1_ADC4" widget.
Signed-off-by: Bard Liao <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
The timer may still be running when rt5645_i2c_remove() gets called,
call del_timer_sync() to make sure it is stopped.
Signed-off-by: Hans de Goede <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
GPD Win requires jd_mode=3 and the inverted flag for making the jack
detection working. Unfortunately, the BIOS doesn't give a nice way to
match with DMI strings, and the only working way so far is to match
with the board vendor/name/version/date to some known patterns.
Hopefully other vendors won't do such a stupid setup, too...
Thanks to Hans de Goede for the DMI matching suggestion.
Suggested-by: Hans de Goede <[email protected]>
Tested-by: Hans de Goede <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
The flag will invert jd1_1 status. Which will be used if the jack
connector is normal closed.
Signed-off-by: Bard Liao <[email protected]>
Tested-by: Hans de Goede <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
The jd_invert flag is actually used for level triggered IRQ. Rename
it to let code more readable.
Signed-off-by: Bard Liao <[email protected]>
Tested-by: Hans de Goede <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Read the jd status after invert control. The benefit is we don't need
to invert the reading jd status when jd invert is needed.
Signed-off-by: Bard Liao <[email protected]>
Tested-by: Hans de Goede <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Make crosstalk functoin optional.
The jack detection can speed up without crosstalk detection.
Let the decision of function usage to platform design.
The patch helps the issue concern as follows:
Google issue 35574278: Chell_headphone pop back from S3
There is a concern as follows:
cras getting blocked for 2 seconds (worst-case 3 seconds)
As I understand, ChromeOS expects resume finishes in 1 seconds.
Video/Audio playing after 3 seconds of resume seems against the spec.
If we really have to make the choice I would choose pop noise instead
of waiting for 3 seconds.
Signed-off-by: John Hsu <[email protected]>
Signed-off-by: John Hsu <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Fix the issue that mic type detection error after resume.
The microphone type detection procedure will recognize
testing signal on JKSLV pin, but before the procedure,
JKSLV already had supply voltage, that results in the failure.
Therefore, the patch turns off the power and reset the jack type
configuration before suspend. Then redo the jack detection
procedure after resume.
The patch help to fix the issue as follows:
Google issue 37973093: CTIA/OMTP jack type detection failure after resume
Reported Issue
Chrome OS Version : ChromeOS R59-9460.13.0
Type of hardware : DVT sample
What steps will reproduce the problem?
(1 Play a music
(2 Insert a headphones
(3 Close laptop lid 3 sec then open it
What is the expected output?
The music is normal in the headphones.
What do you see instead?
Singer voice in the music is not clear.
How frequently does this problem reproduce?
Always
What is the impact to the user, and is there a workaround?
If so, what is it?
Re-insert the headset or close the laptop lid and
then open it again can be repaired.
Signed-off-by: John Hsu <[email protected]>
Signed-off-by: John Hsu <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Assign default value for codec private data when property not given.
If without those default value and property, the codec will work
abnormally.
Signed-off-by: John Hsu <[email protected]>
Signed-off-by: John Hsu <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
It adds ASoC driver for AUD96P22 stereo audio codec integrated on ZTE
ZX family SoCs. The driver includes the support for a number of volume
and mute controls, and power bits for various playback and recording
components.
Due to that the board for testing only supports playback, recording
support is untested.
Signed-off-by: Baoyou Xie <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Without CONFIG_I2C, we get a build failure:
sound/soc/codecs/es8316.c:633:1: error: data definition has no type or storage class [-Werror]
sound/soc/codecs/es8316.c:633:1: error: type defaults to 'int' in declaration of 'module_i2c_driver' [-Werror=implicit-int]
sound/soc/codecs/es8316.c:633:1: error: parameter names (without types) in function declaration [-Werror]
sound/soc/codecs/es8316.c:623:26: error: 'es8316_i2c_driver' defined but not used [-Werror=unused-variable]
This adds the required Kconfig dependency.
Fixes: b8b88b7087 ("ASoC: add es8316 codec driver")
Signed-off-by: Arnd Bergmann <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
The array ni_div does not need to be in global scope and is not
modified, so make it static const.
Cleans up sparse warning:
"symbol 'ni_div' was not declared. Should it be static?"
Signed-off-by: Colin Ian King <[email protected]>
Acked-By: Vinod Koul <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Currently when HP detection procedure runs for certain MCLK
frequencies, when PLL is bypassed, the procedure will incorrectly
report Lineout instead of Headphones due to timing incosistencies.
To avoid this problem, the PLL is temporarily enabled (if currently
bypassed and MCLK present) to provide consistent timings for the
procedure, regardless of MCLK frequency.
Signed-off-by: Adam Thomson <[email protected]>
Acked-by: Sathyanarayana Nujella <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Current ak4613 accepts all range of Sampling Rate, but it depends on
inputed master clock. This patch adds hw constraint rule for it.
Signed-off-by: Kuninori Morimoto <[email protected]>
Tested-by: Hiroyuki Yokoyama <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
GPIO ACPI mapping table is defined on platform basis. Codec driver
shouldn't have known what platform is using it.
Make codec driver more generic by moving platform code to where it
belongs.
Signed-off-by: Andy Shevchenko <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
I2C devices are enumerated by IDs, and not by instances.
Make it clear by using proper module device table for ACPI case.
Signed-off-by: Andy Shevchenko <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
The sgtl5000 features an automatic volume control block (AVC), which
reduces loud signals and amplifies low level signals for easier
listening. This patch adds support for this AVC block to the driver.
Apart from the "AVC Switch" control which enables the block following
controls for the configuration of AVC are added:
+ AVC Threshold Volume: threshold where audio is compressed when
the measured level is above or expanded when below
+ AVC Max Gain Volume: maximum gain which can be applied when
the measured audio level is below threshold
+ AVC Hard Limiter Switch: when enabled the signal is limited to
the programmed threshold.
+ AVC Integrator Response: response time of the integrator
The AVC block is enabled and configured using the DAP_AVC_CTRL and
DAP_AVC_THRESHOLD registers.
Following 2 checkpatch.pl strict checks are ignored because the
indentation style is different for the struct snd_kcontrol_new
definition:
patch:147: CHECK: Alignment should match open parenthesis
patch:150: CHECK: Alignment should match open parenthesis
Signed-off-by: Richard Leitner <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
snd_pcm_hw_constraint_list(), *_ratnums() and *_ratdens() receive the
const pointers. Constify the corresponding static objects for better
hardening.
Signed-off-by: Takashi Iwai <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
snd_pcm_hw_constraint_list(), *_ratnums() and *_ratdens() receive the
const pointers. Constify the corresponding static objects for better
hardening.
Signed-off-by: Takashi Iwai <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
In the suspend, the IRQ function will not work in some machines. So the JD
status should be checked in the resume function.
Signed-off-by: Oder Chiou <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Add a codec driver for the Everest ES8316, based on code provided by
David Yang from Everest Semi.
I limited the functionality to items where the vendor code was clear,
and things that can be tested on the Weibu F3C (Intel Cherry Trail).
As a result the initial implementation only supports running in slave
mode at single speed (up to 48kHz sample rate) using I2S. HPD is not
supported.
Signed-off-by: David Yang <[email protected]>
[[email protected]: significant cleanups and simplifications,
remove dead/unclear code]
Signed-off-by: Daniel Drake <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Add the startup function to count DAI instead of hw_params.
This change matches the number of opened DAIs.
If this change isn't applied, you may get unexpected error due to
mismatching of count. Since the excution number of hw_params and
shutdown may be different, the mismatching happens.
Signed-off-by: Kuninori Morimoto <[email protected]>
Signed-off-by: Ryo Kodama <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
struct snd_pcm_hw_constraint_list ratec is not used.
Let's remove it
Signed-off-by: Kuninori Morimoto <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Very fast systems may violate the minimum constraints for time the reset
line needs to remain low, or communicate with the device too soon after
releasing the reset. Fix this by adding some delays in to allow the chip
to properly reset, also factor out the reset into a function as it is
likely it will be re-used in later additions to the driver.
Signed-off-by: Charles Keepax <[email protected]>
Acked-by: Paul Handrigan <[email protected]>
Signed-off-by: Mark Brown <[email protected]>