asoc: tegra: ALC5639 machine: Add ALC5639 audio codec
Rakesh Iyer [Sun, 29 Jan 2012 06:17:59 +0000 (22:17 -0800)]
Changes made to add support of ALC5639 codec for kai.

Bug 931371

Signed-off-by: Rakesh Iyer <riyer@nvidia.com>
Reviewed-on: http://git-master/r/77953
(cherry picked from commit 481fabd90e34b9a8246d494b0caefa212238c1c2)

Change-Id: I1bcc882cb4b8f7bd257b737295061ea1e9e7e41c
Signed-off-by: Pritesh Raithatha <praithatha@nvidia.com>
Reviewed-on: http://git-master/r/82731
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>
Tested-by: Varun Wadekar <vwadekar@nvidia.com>
Reviewed-by: Manoj Gangwal <mgangwal@nvidia.com>

sound/soc/tegra/Kconfig
sound/soc/tegra/tegra_rt5640.c

index f3f185f..5cda31d 100644 (file)
@@ -151,6 +151,28 @@ config SND_SOC_TEGRA_TLV320AIC326X
          Say Y or M here if you want to add support for SoC audio on Tegra
          boards using the TI AIC326X codec.
 
+config MACH_HAS_SND_SOC_TEGRA_RT5639
+       bool
+       help
+         Machines that use the SND_SOC_TEGRA_RT5639 driver should select
+         this config option, in order to allow the user to enable
+         SND_SOC_TEGRA_RT5639.
+
+config SND_SOC_TEGRA_RT5639
+       tristate "SoC Audio support for Tegra boards using a ALC5639 codec"
+       depends on SND_SOC_TEGRA && I2C && TEGRA_DC
+       depends on MACH_HAS_SND_SOC_TEGRA_RT5639
+       depends on SND_SOC_TEGRA_RT5640
+       select SND_SOC_TEGRA30_I2S if ARCH_TEGRA_3x_SOC
+       select SND_SOC_TEGRA30_SPDIF if ARCH_TEGRA_3x_SOC
+       select SND_SOC_RT5639
+       select SND_SOC_SPDIF
+       select SND_SOC_TEGRA30_DAM if ARCH_TEGRA_3x_SOC
+       help
+         Say Y or M here if you want to add support for SoC audio on Tegra
+         boards using the ALC5639 codec. Currently, the supported board
+         is Kai.
+
 config MACH_HAS_SND_SOC_TEGRA_RT5640
        bool
        help
index 5bbfab3..3801718 100644 (file)
@@ -450,6 +450,11 @@ static __devinit int tegra_rt5640_driver_probe(struct platform_device *pdev)
                return -EINVAL;
        }
 
+       if (pdata->codec_name)
+               card->dai_link->codec_name = pdata->codec_name;
+       if (pdata->codec_dai_name)
+               card->dai_link->codec_dai_name = pdata->codec_dai_name;
+
        machine = kzalloc(sizeof(struct tegra_rt5640), GFP_KERNEL);
        if (!machine) {
                dev_err(&pdev->dev, "Can't allocate tegra_rt5640 struct\n");