From b75cc383f724588fd2423464160306c6e1a5decd Mon Sep 17 00:00:00 2001 From: Arun Shamanna Lakshmi Date: Fri, 23 Jan 2015 10:46:11 -0800 Subject: [PATCH] ASoC: tegra-alt: Add support to enable I2S_CYA_0 I2S_CYA register is a spare register reserved for any issue in design. I2S4 has "i2s4a" and "i2s4b" pins in the pinmux. In order to select i2s4b pin for I2S4 instance, we need to enable CYA register Bug 1602439 Change-Id: I42c401a301efb648e1141159367038a084718a93 Signed-off-by: Arun Shamanna Lakshmi Reviewed-on: http://git-master/r/677018 (cherry picked from commit ecae3a30ba4bd9333872f1aff6e6215169fd16d0) Reviewed-on: http://git-master/r/679674 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Justin Kim (SW-TEGRA) Reviewed-by: Uday Gupta --- sound/soc/tegra-alt/tegra210_i2s_alt.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/sound/soc/tegra-alt/tegra210_i2s_alt.c b/sound/soc/tegra-alt/tegra210_i2s_alt.c index 8f0b916c..e265eb40 100644 --- a/sound/soc/tegra-alt/tegra210_i2s_alt.c +++ b/sound/soc/tegra-alt/tegra210_i2s_alt.c @@ -1,7 +1,7 @@ /* * tegra210_i2s.c - Tegra210 I2S driver * - * Copyright (c) 2014 NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2014-2015 NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -511,6 +511,9 @@ static int tegra210_i2s_hw_params(struct snd_pcm_substream *substream, i2s->soc_data->set_audio_cif(i2s->regmap, reg, &cif_conf); + if (i2s->enable_cya) + regmap_write(i2s->regmap, TEGRA210_I2S_CYA, 1); + return 0; } @@ -680,6 +683,7 @@ static bool tegra210_i2s_wr_reg(struct device *dev, unsigned int reg) case TEGRA210_I2S_TIMING: case TEGRA210_I2S_SLOT_CTRL: case TEGRA210_I2S_CLK_TRIM: + case TEGRA210_I2S_CYA: return true; default: return false; @@ -722,6 +726,7 @@ static bool tegra210_i2s_rd_reg(struct device *dev, unsigned int reg) case TEGRA210_I2S_SLOT_CTRL: case TEGRA210_I2S_CLK_TRIM: case TEGRA210_I2S_INT_STATUS: + case TEGRA210_I2S_CYA: return true; default: return false; @@ -746,7 +751,7 @@ static const struct regmap_config tegra210_i2s_regmap_config = { .reg_bits = 32, .reg_stride = 4, .val_bits = 32, - .max_register = TEGRA210_I2S_CLK_TRIM, + .max_register = TEGRA210_I2S_CYA, .writeable_reg = tegra210_i2s_wr_reg, .readable_reg = tegra210_i2s_rd_reg, .volatile_reg = tegra210_i2s_volatile_reg, @@ -796,6 +801,7 @@ static int tegra210_i2s_platform_probe(struct platform_device *pdev) i2s->soc_data = soc_data; i2s->tx_mask = i2s->rx_mask = 0xFFFF; i2s->bclk_ratio = 2; + i2s->enable_cya = false; i2s->clk_i2s = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(i2s->clk_i2s)) { @@ -882,6 +888,10 @@ static int tegra210_i2s_platform_probe(struct platform_device *pdev) i2s->fsync_width = 31; } + i2s->enable_cya = + of_property_read_bool(pdev->dev.of_node, + "enable-cya"); + num_supplies = of_property_count_strings(np, "regulator-supplies"); if (num_supplies > 0) { i2s->num_supplies = num_supplies;