summaryrefslogtreecommitdiff
path: root/sound/soc/tegra/tegra_wm8903.c
AgeCommit message (Collapse)Author
2012-04-26ASoC: Tegra: Pass snd_soc_card handle in tegra_asoc_utils_initSumit Bhattacharya
Change prototype of tegra_asoc_utils_init to pass snd_soc_card handle. It is needed to move common tegra machine driver codes to tegra_asoc_utils interface. Bug 968814 Change-Id: I98490ffdda51cf7d0b89adadb23c31892183bc0e Signed-off-by: Sumit Bhattacharya <sumitb@nvidia.com> Reviewed-on: http://git-master/r/97914 Reviewed-by: Simone Willett <swillett@nvidia.com> Tested-by: Simone Willett <swillett@nvidia.com>
2012-03-30ASoC: wm8903: resolve compilation time warningsSanjay Singh Rawat
bug 949219 Change-Id: I8abd1e837a774d15aef25ec8c40b857b8cba0426 Signed-off-by: Sanjay Singh Rawat <srawat@nvidia.com> Reviewed-on: http://git-master/r/92858 Reviewed-by: Simone Willett <swillett@nvidia.com> Tested-by: Simone Willett <swillett@nvidia.com>
2012-03-30ASoC: Tegra wm8903 machine: Remove regulator error messagePreetham Chandru
Few boards which uses wm8903 has independent regulators for spk and mic while others do not have it. For the boards which do not have independent regulators we should avoid getting their regulators otherwise we would get the following error messages: "tegra-snd-wm8903 tegra-snd-wm8903.0: No speaker regulator found" "tegra-snd-wm8903 tegra-snd-wm8903.0: No digital mic regulator found" Bug 956562 Signed-off-by: Preetham Chandru <pchandru@nvidia.com> Change-Id: Ide1ce141b5d45d56e834dc82a7cf5a7adc6c3e80 Reviewed-on: http://git-master/r/91548 Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com> Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
2012-03-22ASoC: Tegra WM8903 machine: Fix to control name conflictRamalingam C
This change resolves the control name (Line Out Switch) conflict between wm8903 codec driver and tegra machine driver. Bug 956506 Change-Id: Iab049c7fb2fdde0d481d07d8e1bbdbeea1a831d9 Signed-off-by: Ramalingam C <ramalingamc@nvidia.com> Reviewed-on: http://git-master/r/91510 Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> Reviewed-by: Automatic_Commit_Validation_User
2012-03-15ASoC: Tegra wm8903 machine: suspend/resume code for HP detectionAnkit Gupta
Suspend and resume code included for headphone detection. Earlier, it was causing problem in HP detection when device enters into LP0 state and headphone is plugged in. (Bug 937153) Change-Id: If625f0e7b857b40b0535f8bc8d1c262650886fa7 Signed-off-by: Ankit Gupta <ankitgupta@nvidia.com> Reviewed-on: http://git-master/r/89975 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com> Reviewed-by: Scott Peterson <speterson@nvidia.com>
2012-03-13ASoC: Tegra wm8903 machine: Fix to control namesRamalingam C
Fixing the typos in the member of cardhu_controls. Bug 946932 Change-Id: I26f2a5a60f40d55846a89aaa76dab00741e018d0 Signed-off-by: Ramalingam C <ramalingamc@nvidia.com> Reviewed-on: http://git-master/r/88824 Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com> Reviewed-by: Preetham Chandru <pchandru@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2012-01-30asoc:tegra: Support I2S slave modeScottPeterson
Support I2S slave mode. Disable pll_p_out1 and pll_a to reduce power when in slave mode. Slave mode disabled by default. Reviewed-on: http://git-master/r/76046 Change-Id: I873a11d54f1e037d99c86ff4cec06ee83064902a Signed-off-by: ScottPeterson <speterson@nvidia.com> Signed-off-by: Varun Wadekar <vwadekar@nvidia.com> Reviewed-on: http://git-master/r/77765 Reviewed-by: Automatic_Commit_Validation_User
2012-01-10asoc: tegra: wm8903 machine: Handle card register failureManoj Gangwal
Add the support for handling the wm8903 sound card registration failure error. Bug 910788 Change-Id: Ib25f9ca4dd7f5ebd417700421625eb2f3bdc7b5e Signed-off-by: Manoj Gangwal <mgangwal@nvidia.com> Reviewed-on: http://git-master/r/73694 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> (cherry picked from commit 505788de21a98bbc651a536a56f6594fa589252e) Reviewed-on: http://git-master/r/73963 Reviewed-by: Varun Wadekar <vwadekar@nvidia.com> Tested-by: Varun Wadekar <vwadekar@nvidia.com>
2011-12-08ASoC: Tegra: WAR to avoid incorrect mic detection eventSumit Bhattacharya
When 3-pin pin is interted in cardhu headset port mic short interrupts get asserted which also triggers mic detection interrupt. As a result ALSA detects presence of mic mistakenly. For cardhu register WM8903 mic short event for mic detection so that mic detection interrupt generated during mic short event gets cancelled. Bug 906524 Change-Id: Icfd9d9d26d171b075eac6e76f35227e43c928e0e Signed-off-by: Sumit Bhattacharya <sumitb@nvidia.com> Reviewed-on: http://git-master/r/68229 Reviewed-by: Scott Peterson <speterson@nvidia.com> Tested-by: Scott Peterson <speterson@nvidia.com>
2011-11-30ASoC: Tegra: WM8903: Support switch classSumit Bhattacharya
Add support to convey HP and mic jack status to switch class. Bug 872652 Change-Id: I2d64c97ef8bf0ab3dfeec3c711ef0e8048bff133 Signed-off-by: Sumit Bhattacharya <sumitb@nvidia.com> Reviewed-on: http://git-master/r/55670 Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com> Rebase-Id: Re41027a605ed344cd0dd90c1bc41656a04afb1c1
2011-11-30ASoC: Tegra WM8903 machine: Add support for Tegra30 BT SCOSumit Bhattacharya
Use BT SCO DAI-LINK interface for both Tegra20 and Tegra30. For Tegra30 use i2s3 for BT SCO connection. Bug 872652 Signed-off-by: Sumit Bhattacharya <sumitb@nvidia.com> Change-Id: I93d90843133267c1aed3386de5e7d40938952f53 Reviewed-on: http://git-master/r/62051 Tested-by: Sumit Bhattacharya <sumitb@nvidia.com> Reviewed-by: Scott Peterson <speterson@nvidia.com> Rebase-Id: R9d90a88375ecd8bad6f4c39a1ce083b87751b846
2011-11-30ASoC: Tegra WM8903 machine: Add suppport for Tegra20 BT SCOSumit Bhattacharya
Add a new dai-link interface to wm8903 machine driver which can be used for BT SCO playback and record on Tegra20. Also add code to program Tegra20 DAS controller depending on active dai-link. Bug 872652 Change-Id: I006a2542b20cfd94c246d19770aa836c2bbf4198 Signed-off-by: Sumit Bhattacharya <sumitb@nvidia.com> Reviewed-on: http://git-master/r/59060 Reviewed-by: Scott Peterson <speterson@nvidia.com> Rebase-Id: R36dfd3082c6119a452c0bab8858637b3f139f5e5
2011-11-30ASoC: Tegra: Tegra machine: Improve clk management logicSumit Bhattacharya
Use tegra asoc util lock_rate API to lock pll_a, pll_a_out and mclk settings whenever any DAI-link using these clocks is active. If any dai-link fails to set clock due to another active dai-link it will check if the current mclk rate is acceptable for it's purpose before erroring out. Also add hw_param ops for SPDIF dai-link. Bug 872652 Change-Id: I6ef1a3b69745bdf85cb88f5fbccfb05c37e33c5d Signed-off-by: Sumit Bhattacharya <sumitb@nvidia.com> Reviewed-on: http://git-master/r/63856 Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Rebase-Id: Rdf4d19ce1ff150dd5835c891dfed0cea16150016
2011-11-30ASoC: Tegra wm8903 machine: Use DSP mode for mono on Tegra20Sumit Bhattacharya
Use DSP mode for playback and capture on Tegra20 platforms. Bug 872652 Signed-off-by: Sumit Bhattacharya <sumitb@nvidia.com> Change-Id: Iddf6d3b5dc83d509ddf857a8c3b0bb0ec13d9879 Reviewed-on: http://git-master/r/62512 Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com> Rebase-Id: R48dbdcdad6191f354a63c4a01fb33668c43ac28a
2011-11-30ASoC: tegra machine: Correct spdif-dit codec nameSumit Bhattacharya
Change SPDIF dai-link codec name from spdif-dit to spdif-dit.0 since spdif-dit platform driver index has been changed from -1 to 0. Bug 872652 Signed-off-by: Sumit Bhattacharya <sumitb@nvidia.com> Change-Id: I3a234e237149607346301bf1f19d5a2e7f9e69b6 Reviewed-on: http://git-master/r/61509 Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com> Rebase-Id: Rdd42749aae8eb8f8eb5afbf541ba1f780fca9316
2011-11-30ASoC: Tegra: WM8903: Support speaker and dmicSumit Bhattacharya
Complete DAPM route map for cardhu and ventana. Expose more alsa controls to facilitate codec routing. Properly handle speaker, internal mic and external mic routing events. Bug 872652 Change-Id: I4620d08ade1f455a4075d9822fcfd5e34474133f Signed-off-by: Sumit Bhattacharya <sumitb@nvidia.com> Reviewed-on: http://git-master/r/55669 Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com> Rebase-Id: R42bcced2737f035bb1888fac064ee20fa6371143
2011-11-30ASoC: Tegra: Enable SPDIF DAI for Tegra30Sumit Bhattacharya
Bug 872652 Change-Id: Ia35ba728859bcba1bff1ce73c622203d027bc8f9 Signed-off-by: Sumit Bhattacharya <sumitb@nvidia.com> Reviewed-on: http://git-master/r/54989 Reviewed-by: Scott Peterson <speterson@nvidia.com> Reviewed-by: Stephen Warren <swarren@nvidia.com> Tested-by: Gerrit_Virtual_Submit Rebase-Id: Rd23d694c056cefb76669c510b1367128255f3835
2011-11-30ASoC: Tegra: Enable SPDIF DAI for Tegra20Sumit Bhattacharya
Bug 872652 Signed-off-by: Sumit Bhattacharya <sumitb@nvidia.com> Change-Id: Ia58d12a6bf7d99b0679cf0dc5f0d727af06903c8 Reviewed-on: http://git-master/r/53812 Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com> Rebase-Id: R0535370b359e6e69f554bb39f9d393c33a3557c9
2011-11-30ASoC: Tegra: Support Cardhu board in tegra_wm8903.cStephen Warren
Cardhu is a Tegra30 tablet reference design. In terms of audio, it is extremely similar to Harmony/Ventana, except that the WM8903 codec is attached to a different I2C bus ID, and different I2S port. Signed-off-by: Stephen Warren <swarren@nvidia.com> Rebase-Id: Re7572cfde2e359dfb8cf16a5eff38e271f25479d
2011-11-30ASoC: Tegra: Complete Tegra->Tegra20 renamingStephen Warren
Rename Tegra20-specific Kconfig variables, module filenames, all internal symbol names, clocks, and platform devices, to reflect the fact the DAS and I2S drivers are for a specific HW version. Signed-off-by: Stephen Warren <swarren@nvidia.com> Rebase-Id: Re5b72edd9dff4c93466b2db96dd40eb708343ccb
2011-11-30ASoC: Tegra: Remove unnecessary includesStephen Warren
These includes aren't needed, and the files are about to be renamed. Signed-off-by: Stephen Warren <swarren@nvidia.com> Rebase-Id: Ra771bcec753a844849744da8d7c67f403e7a1dcd
2011-08-24ASoC: Tegra: wm8903 machine driver: Drop Ventana supportStephen Warren
Board file support for Ventana is not yet mainlined, and probably won't ever be given the move to Device-Tree. Consequently, the Ventana entry is being removed from arch/arm/tools/mach-types in the next merge window, since it was registered over a year ago. This will also remove function machine_is_ventana(), which is used by the ASoC Tegra WM8903 machine driver. This will cause compilation failures. Drop Ventana support to resolve this. Hopefully, in the not-too-distant future, tegra_wm8903.c will be able to configure itself from Device-Tree, and hence we'll be able to re-instate Ventana support just by creating a .dts file for the board. Also note that Aebl support is in a similar boat. However, that board isn't scheduled for deprecation for at least another 5 months, and perhaps we will have completely removed non-Device-Tree support from tegra_wm8903.c by then and/or adjusted mach-types policy. Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-08-09ASoC: Tegra: wm8903 machine driver: Allow re-insertion of moduleStephen Warren
Two issues were preventing module snd-soc-tegra-wm8903.ko from being removed and re-inserted: a) The speaker-enable GPIO is hosted by the WM8903 chip. This GPIO must be freed before snd_soc_unregister_card() is called, because that triggers wm8903.c:wm8903_remove(), which calls gpiochip_remove(), which then fails if any of the GPIOs are in use. To solve this, free all GPIOs first, so the code doesn't care where they come from. b) We need to call snd_soc_jack_free_gpios() to match the call to snd_soc_jack_add_gpios() during initialization. Without this, the call to snd_soc_jack_add_gpios() fails during any subsequent modprobe and initialization, since the GPIO and IRQ are already registered. In turn, this causes the headphone state not to be monitored, so the headphone is assumed not to be plugged in, and the audio path to it is never enabled. Signed-off-by: Stephen Warren <swarren@nvidia.com> Cc: stable@kernel.org Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-05-27ASoC: Tegra: Enable Kaen HP_MUTE at bootStephen Warren
We want the default state of the HP_MUTE signal to be asserted, so that the headphones are muted before the first audio playback. Without this, the headphones are left unmuted until shortly after the first audio playback completes. Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-04-20ASoC: Tegra: wm8903: s/code/data/ for control/widget/mapsStephen Warren
Replace calls to a variety of registration functions by updating struct snd_soc_card snd_soc_tegra_wm8903 to directly point at the various control/widget/map tables instead. The ASoC core now performs any required registration based on these data fields. (Applying Mark's TrimSlice review comments to the existing driver) Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-04-20ASoC: Tegra: Retrieve card from DAPM context not codecStephen Warren
Card widgets are created in the card's DAPM context, not any codec's DAPM context. Hence, w->codec==NULL. Instead, find the card from the widget through the DAPM context of the widget, not the codec of the widget. Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-04-20ASoC: Tegra: Don't return mclk_changed from utils_set_rateStephen Warren
Only the clock programming code needs to know whether the clocks changed, and that is encapsulated within tegra_asoc_utils_set_rate(). The machine driver's call to snd_soc_dai_set_sysclk(codec_dai, ...) is safe irrespective of whether the clocks changed. (Applying Mark's TrimSlice review comments to the existing driver) Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-04-20ASoC: Tegra: wm8903: Remove redundant drvdata clearsStephen Warren
When the driver is not initialized/registered, nothing should be touching these fields anyway, so there's no point clearing them out. (Applying Mark's TrimSlice review comments to the existing driver) Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-04-20ASoC: Tegra: wm8903 probe: Don't call machine_is_*()Stephen Warren
This machine driver is a platform driver, and hence will only be instantiated on the correct machines. Hence, there is no need to check the current machine during probe. (Applying Mark's TrimSlice review comments to the existing driver) Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-04-18ASoC: Tegra: Support more boardsStephen Warren
* Ventana is identical to Harmony. * Seaboard, Kaen, and Aebl are all pretty similar, mainly with slightly different sets of GPIOs, and slightly different WM8903 pin connectivity. Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-04-18ASoC: Tegra: Don't store snd_soc_jack_gpio in an arrayStephen Warren
Storing the struct in an array makes the assignments to the GPIO member a little non-obvious, and is pointless when there's only a single GPIO. (I thought I fixed this during the review cycle when first submitting this driver, but I guess I overlooked that) Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-04-18ASoC: Tegra: Rename harmony.c to tegra_wm8903.cStephen Warren
Soon, this machine driver will be updated to handle a number of Tegra boards using the WM8903 codec. Rename the file in advance to reflect this. Fix the content of tegra_wm8903.c to match the rename; replace references to Harmony board with something more generic. * s/struct tegra_harmony/struct tegra_wm8903/ * s/harmony/machine/ # variable name * Similar rename for some functions * Similar comment fix * Similar MODULE_DESCRIPTION fix Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>