Age | Commit message (Collapse) | Author |
|
Backported commit f997df18c0e4c988de49e984329cefdf6e13ed86
According to the manual [1], SYS_MCLK should base on SYS_FS, not on sample rate.
Calculating SYS_MCLK using sample rate only prevents playing/recording
samples with rate < 16 kHz:
---------------------------------------------------------------
root@apalis-t30:~# aplay test-8k-sample.wav
Playing WAVE 'test-8k-sample.wav' : Signed 16 bit
[...] tegra-snd-apalis-tk1-sgtl5000 tegra-snd-apalis-tk1-sgtl5000.0: ASoC: machine hw_params failed: -22
Little Endian, Rate 8000 Hz, Stereo
aplay: set_params:1403: Unable to install hw params:
...
---------------------------------------------------------------
Using the helper from sgtl5000.h fixes this issue.
To keep determination of sys_fs solid, use a helper in device driver.
[1] https://www.nxp.com/docs/en/data-sheet/SGTL5000.pdf
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
|
|
Calculate SYS_MCLK using sample rate or SYS_FS.
These helpers allow to simplify a code to set up external system clock
for different sample rates.
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
|
|
Backported commit 8326ab1285e71e24481d8e1eee3e72a6b3abbb38
If VDDA != VDDIO and any of them is greater than 3.1V, charge pump
source can be assigned automatically [1].
[1] https://www.nxp.com/docs/en/data-sheet/SGTL5000.pdf
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
Reviewed-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
|
|
Backported commit 8337f764b45e122bd17b8c84b7ac26da3086fe26
To enable "zero cross detect" for ADC/HP, change
HP_ZCD_EN/ADC_ZCD_EN bits only instead of writing the whole
CHIP_ANA_CTRL register.
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
Reviewed-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
|
|
Backported from commit 19a1d41649f695658a67898dcb9312de02878eb1.
This control mute/unmute the ADC input of SGTL5000
using its CHIP_ANA_CTRL register.
Tuned: add Headphone and Line-Out mute/unmute controlling.
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
Reviewed-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
|
|
Backported from commit 55e23d488cd1367638ee304bd8bb6210f53d13db.
SGTL5000_SMALL_POP is a bit mask, not a value. Usage of
correct definition makes device probing code more clear.
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
Reviewed-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Igor Opaniuk <igor.opaniuk@toradex.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
|
|
Backported from commit e6e98e2e05baa3862ac7d1d2334f88ec927c8f66.
VAG power control is improved to fit the manual [1]. This patch fixes as
minimum one bug: if customer muxes Headphone to Line-In right after boot,
the VAG power remains off that leads to poor sound quality from line-in.
I.e. after boot:
- Connect sound source to Line-In jack;
- Connect headphone to HP jack;
- Run following commands:
$ amixer set 'Headphone' 80%
$ amixer set 'Headphone Mux' LINE_IN
Change VAG power on/off control according to the following algorithm:
- turn VAG power ON on the 1st incoming event.
- keep it ON if there is any active VAG consumer (ADC/DAC/HP/Line-In).
- turn VAG power OFF when there is the latest consumer's pre-down event
come.
- always delay after VAG power OFF to avoid pop.
- delay after VAG power ON if the initiative consumer is Line-In, this
prevents pop during line-in muxing.
According to the data sheet [1], to avoid any pops/clicks,
the outputs should be muted during input/output
routing changes.
[1] https://www.nxp.com/docs/en/data-sheet/SGTL5000.pdf
Fixes: 9b34e6cc3bc2 ("ASoC: Add Freescale SGTL5000 codec support")
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
Reviewed-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
|
|
sound/soc/tegra/tegra30_dam.c: In function 'tegra30_dam_probe':
sound/soc/tegra/tegra30_dam.c:620:3: error: this 'if' clause does not
guard... [-Werror=misleading-indentation]
if ((i == TEGRA30_DAM_CTRL_RSVD_6) ||
^~
sound/soc/tegra/tegra30_dam.c:624:4: note: ...this statement, but the
latter is misleadingly indented as if it is guarded by the 'if'
dam->reg_cache[i] =
^~~
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Acked-by: Max Krummenacher <max.krummenacher@toradex.com>
|
|
On a mx28evk with a sgtl5000 codec we notice a loud 'click' sound to happen
5 seconds after the end of a playback.
The SMALL_POP bit should fix this, but its definition is incorrect:
according to the sgtl5000 manual it is bit 0 of CHIP_REF_CTRL register, not
bit 1.
Fix the definition accordingly and enable the bit as intended per the code
comment.
After applying this change, no loud 'click' sound is heard after playback
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
(cherry picked from commit c251ea7bd7a04f1f2575467e0de76e803cf59149)
|
|
CHRGPUMP_POWERUP
The SGTL5000_CHIP_ANA_POWER register is cached. Update the cached
value instead of writing it directly.
Upstream-status: sent
Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
(cherry picked from commit 309abdeda8c9331013f25b1a1209d9ce8334237b)
(cherry picked from commit 8a8b303a7431e66a7ec6ec52bc0e04ed0a1335d0)
|
|
Since commit e5d80e82e32e (ASoC: sgtl5000: Convert to use regmap directly) a
kernel oops is observed after a suspend/resume sequence.
The kernel oops happens inside sgtl5000_restore_regs() as codec->reg_cache is no
longer a valid pointer.
Add the remaining register entries into sgtl5000_reg_defaults[] and remove
sgtl5000_restore_regs() completely, which allows suspend/resume to work fine and
make the code simpler.
Tested on a im53-qsb board.
Reported-by: Shawn Guo <shawn.guo@freescale.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Tested-by: Shawn Guo <shawn.guo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 29aa37cddfb9b721013ff28608200d73a9426368)
|
|
Powering down PLL before switching to a mode that does not use it
is a bad idea. It would cause the SGTL5000 be without internal
clock supply, especially on the I2C interface, which would make
subsequent access to it fail.
Thus, in case of not using PLL any longer, first set the mode
control, then power down PLL.
Signed-off-by: Oskar Schirmer <oskar@scara.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit e06e4c2d530fd4995c41083009647263ccd77d3b)
|
|
The SGTL5000 Capture Attenuate Switch (or "ADC Volume Range Reduction"
as it is called in the manual) is single bit only.
Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Reviewed-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit 65f2b226763bc348a9b9145aa5e17e7e3f6d8c35)
|
|
When a sound capture/playback is terminated while a playback/capture
is running, power_vag_event() will clear SGTL5000_CHIP_ANA_POWER in
the SND_SOC_DAPM_PRE_PMD event, thus muting the respective other
channel.
Don't clear SGTL5000_CHIP_ANA_POWER when both DAC and ADC are active
to prevent this.
Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Reviewed-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit f091f3f07328f75d20a2a5970d1f8b58d95fc990)
|
|
According to the sgtl5000 reference manual, the default value of CHIP_SSS_CTRL
is 0x10.
Reported-by: Oskar Schirmer <oskar@scara.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Cc: stable@vger.kernel.org
(cherry picked from commit 016fcab8ff46fca29375d484226ec91932aa4a07)
|
|
The VAG_POWER must be enabled after all other bits in CHIP_ANA_POWER
and disabled before any other bit in CHIP_ANA_POWER. See the SGTL5000
datasheet (Table 31, BIT 7, page 42-43). Failing to follow this order
will result in ugly loud "POP" noise at the end of playback.
To achieve such order, use the _PRE and _POST DAPM widgets to trigger
the power_vag_event, where the event type check has to be fixed
accordingly as well.
Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
(cherry picked from commit dd4d2d6dfb49e8916064f2cb07f0ad7b32a82fb7)
|
|
After a 'reboot' command in Linux or after pressing the system's reset button
the sgtl5000 driver fails to probe:
sgtl5000 0-000a: Device with ID register ffff is not a sgtl5000
sgtl5000 0-000a: ASoC: failed to probe CODEC -19
imx-sgtl5000 sound.12: ASoC: failed to instantiate card -19
imx-sgtl5000 sound.12: snd_soc_register_card failed (-19)
sgtl5000 codec does not have a reset line, nor a reset command in software, so
after a system reset the codec does not contain the default register values
from sgtl5000_reg_defaults[] anymore, as these are only valid after a
power-on-reset cycle.
Fix this issue by explicitly reading all the reset register values from
sgtl5000_reg_defaults[] and writing them back into sgtl5000 to ensure a sane
state.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Tested-by: Eric Nelson <eric.nelson@boundarydevices.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
(cherry picked from commit af8ee11209e749c75eabf32b2a4ca631f396acf8)
Conflicts:
sound/soc/codecs/sgtl5000.c
|
|
This reverts commit f162e88fc6aac0fef03c49c1ac596995a03ff134.
Somehow NVIDIA's media player does not like it to be fixed as
it starts stuttering like crazy at times.
Still keep the dangerous time out handling clean-up.
While at it get rid of the excessive dev_info() logging as well.
|
|
Use HDA HDMI audio now on Colibri T30 as well allowing for up to 7.1
multi-channel playback. Split board sound initialisation between Apalis
and Colibri T30 in order to distinguish better between default SPDIF
being supported out-of-the-box on Apalis vs. this being an optional
feature for the Colibri. Therefore remove SPDIF for the Colibri T30.
While at it add csus clock required for vi_sensor camera master clock
on Apalis T30 and clk_out_2/extern2 for Colibri T30, fix debug UART1
initialisation, get rid of spurious CONFIG_SND_USB enable and further
clean-up both board platform data files.
|
|
Hack HDA driver to make it the 2nd rather than the first sound card as
the first one should be the SGTL5000 which is always present on our T30
modules. Especially on Ixora where there is no HDA codec on the carrier
board HDA being the first sound card does not make much sense even more
though as there was no primary device (e.g. device=hw:0,0).
|
|
Fix issue with slow SPDIF clock by just doubling desired rate prior to
doing any further calculations on it.
BTW: A proper fix might involve overall clock doubler configuration.
|
|
The AC97 sampling rate is really fixed to 48 kHz at all times.
While at it clean-up dangerous time out handling.
|
|
|
|
|
|
Fix errors when registration fails, correctly unregister the
platform device.
|
|
Avoid extensive HDMI messages during boot.
[ 30.234829] HDMI hot plug event: Codec=3 Pin=5 Presence_Detect=1 ELD_Valid=0
[ 30.253652] HDMI status: Codec=3 Pin=5 Presence_Detect=1 ELD_Valid=1
[ 32.333657] HDMI: detected monitor SyncMaster at connection type HDMI
[ 32.340116] HDMI: available speakers: FL/FR
[ 32.344616] HDMI: supports coding type LPCM: channels = 2, rates = 44100 48000 88200, bits = 16 20 24
|
|
Hack for Realtek HDA driver not to crash due to PCI structure not being
initialised as expected.
|
|
arch/arm/mach-tegra/common.c
drivers/ata/ahci-tegra.c
|
|
Prepare Kconfig for Colibri T30 ALSA SoC SGTL5000 board driver to be
usable on Apalis T30 as well.
|
|
sgtl5000 microphone gain only has 2 bits of resolution, so maximum value is 3.
From Eric Nelson:
"We also found that for the microphones we have here (commodity PC boom mics) a
default value of 2 for the gain gives the best results."
So change the default microphone gain as well.
Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
|
|
LINE_IN also needs VAG_POWER on or we may hear noise when directly
route LINE_IN to Headphone Mux.
Tested on imx28evk.
Signed-off-by: Dong Aisheng <dong.aisheng@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
|
|
Correct SGTL5000_CHIP_CLK_CTRL to SGTL5000_CHIP_REF_CTRL in
sgtl5000_restore_regs(), and add comment to explain the
restore order.
Reported-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Zeng Zhaoming <zengzm.kernel@gmail.com>
Acked-by: Dong Aisheng <dong.aisheng@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
|
|
As manual described, VAG is an internal voltage reference of DAC/ADC,
So enabled it before DAC/ADC up.
One more thing should care about is VAG fully ramped down requires 400ms,
wait it to avoid pop.
Signed-off-by: Zeng Zhaoming <zengzm.kernel@gmail.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
|
|
Give the correct number of entries to TLV_DB_RANGE_HEAD to prevent
reading more data than actually is in the array.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
|
|
Ensure all mask bits are clear before setting new value.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Dong Aisheng <b29396@freescale.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
|
|
We have defined SGTL5000_LINREG_VDDD_MASK in sgtl5000.h,
use it instead of hardcoded (0x1 << 4) - 1 for the mask.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
|
|
Otherwise calling ldo_regulator_remove() does not unregister regulator
and free memories.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
|
|
According to the datasheet:
CHIP_MIC_CTRL 0x002A
BITS[9:8] BIAS_RESISTOR
0x0 = Powerd off
0x1 = 2.0 kohm
0x2 = 4.0 kohm
0x3 = 8.0 kohm
To set mic bias resistor, we need to update bits[9:8] of
SGTL5000_CHIP_MIC_CTRL register.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
|
|
According to the datasheet:
CHIP_MIC_CTRL 0x002A
BITS[9:8] BIAS_RESISTOR
0x0 = Powerd off
0x1 = 2.0 kohm
0x2 = 4.0 kohm
0x3 = 8.0 kohm
Thus SGTL5000_BIAS_R_MASK should be defined as 0x0300 instead of 0x0200.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
|
|
The module device table for of_device_id should use "of" type.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
|
|
version.
Conflicts:
sound/soc/codecs/sgtl5000.c
|
|
- select RT5640 ASoC support in Cardhu machine Kconfig
- enable RT5640 ASoC driver in tegra3_defconfig
- select RT5639 ASoC codec when selecting RT5640, othwise kernel
linking will fail
Bug 1190823
Change-Id: I1046c30667d4ca8276080f1b3174eccd0b25328c
Signed-off-by: Bryan Wu <pengw@nvidia.com>
Reviewed-on: http://git-master/r/168884
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Winnie Hsu <whsu@nvidia.com>
|
|
Add configurability support for i2s parameters.
See 907bac80691c7df5b5b57cbf27f91e8bb1dcf434.
|
|
Conflicts:
arch/arm/mach-tegra/tegra3_usb_phy.c
arch/arm/mach-tegra/usb_phy.c
drivers/usb/gadget/tegra_udc.c
drivers/usb/otg/Makefile
drivers/video/tegra/fb.c
sound/soc/tegra/tegra_pcm.c
|
|
WAR to check souncard data's avp_id before trying to set
DMA address. An invalid avp_id can cause invlaid rtd, causing
panic in control ioctl calls.
Bug 1046249
Bug 1044761
Bug 1049940
Bug 1050152
Change-Id: Ib536220fdb92f8256c777d6fa14b66e47bc6b7be
Signed-off-by: Shashank Sharma <shashanks@nvidia.com>
Reviewed-on: http://git-master/r/134426
(cherry picked from commit 007fd7b1ae101c5be2a3d35ad11e7190862c04ca)
Reviewed-on: http://git-master/r/142493
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Tested-by: Matthew Pedro <mapedro@nvidia.com>
Reviewed-by: Winnie Hsu <whsu@nvidia.com>
|
|
Integrate ALSA SoC SGTL5000 codec on Toradex Colibri T30.
|
|
Removing tegra_gpio_enable and disable calls as they are supported
through set direction calls in the driver.
|
|
Activate microphone bias which is used to enable microphone ground on Colibri T20.
|
|
Merge with latest NVIDIA L4T R16.
Only real conflict concerning inverted VBUS gpio support.
|
|
Add support for setting of DMA address through alsa control for AVP
rendering. This is required to directly do DMA from IRAM to I2S.
Bug 1024403
Change-Id: I6b79ae6e9a562160a19d238b817e1a8b407ac208
Signed-off-by: Sumit Bhattacharya <sumitb@nvidia.com>
Reviewed-on: http://git-master/r/127436
(cherry picked from commit f270f46bef98a56f44432e608041adb617c22559)
Signed-off-by: Chandrakanth Gorantla <cgorantla@nvidia.com>
Change-Id: I195aae9043f967273283579f44d5367fe73d542f
Reviewed-on: http://git-master/r/129159
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Scott Peterson <speterson@nvidia.com>
|