From 91021c920e31683a94363f39c48eb1a60fa970b9 Mon Sep 17 00:00:00 2001 From: Sameer Pujar Date: Fri, 7 Jun 2019 20:53:16 +0530 Subject: [PATCH] ASoC: tegra-alt: get rid of i2s_soc_data soc_data structure for i2s appears to be redundant for following reasons. * is_soc_t210 is unused. For older kernels this was added to implement MBIST WAR, bug 200035860. WAR is not required for kernel > k4.4 and hence cleaned up as part of bug 2485656. * set_audio_cif and set_slot_ctrl point to the same functions for Tegra210 and Tegra186. Thus there is no need to have soc_data members for it. Hence references to soc_data is removed from the i2s driver. Bug 200503387 Change-Id: I597bd594da70f2d27d9c330b871d26cf3651f7af Signed-off-by: Sameer Pujar Reviewed-on: https://git-master.nvidia.com/r/2132446 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Mohan Kumar D Reviewed-by: Jonathan Hunter GVS: Gerrit_Virtual_Submit Reviewed-by: Ravindra Lokhande Reviewed-by: mobile promotions Tested-by: mobile promotions --- .../soc/tegra-alt/include/tegra210_i2s_alt.h | 12 --------- sound/soc/tegra-alt/tegra210_i2s_alt.c | 25 ++++--------------- 2 files changed, 5 insertions(+), 32 deletions(-) diff --git a/sound/soc/tegra-alt/include/tegra210_i2s_alt.h b/sound/soc/tegra-alt/include/tegra210_i2s_alt.h index 72b682a4..fa3e0add 100644 --- a/sound/soc/tegra-alt/include/tegra210_i2s_alt.h +++ b/sound/soc/tegra-alt/include/tegra210_i2s_alt.h @@ -191,17 +191,6 @@ #define TEGRA210_I2S_RX_FIFO_DEPTH 64 -struct tegra210_i2s_soc_data { - void (*set_audio_cif)(struct regmap *map, - unsigned int reg, - struct tegra210_xbar_cif_conf *conf); - void (*set_slot_ctrl)(struct regmap *map, - unsigned int total_slots, - unsigned int tx_slot_mask, - unsigned int rx_slot_mask); - bool is_soc_t210; -}; - enum tegra210_i2s_path { I2S_RX_PATH, I2S_TX_PATH, @@ -209,7 +198,6 @@ enum tegra210_i2s_path { }; struct tegra210_i2s { - const struct tegra210_i2s_soc_data *soc_data; struct clk *clk_i2s; struct clk *clk_i2s_sync; struct clk *clk_audio_sync; diff --git a/sound/soc/tegra-alt/tegra210_i2s_alt.c b/sound/soc/tegra-alt/tegra210_i2s_alt.c index 6f23c5c5..ea55bda5 100644 --- a/sound/soc/tegra-alt/tegra210_i2s_alt.c +++ b/sound/soc/tegra-alt/tegra210_i2s_alt.c @@ -620,8 +620,8 @@ static int tegra210_i2s_hw_params(struct snd_pcm_substream *substream, frame_format = val & TEGRA210_I2S_CTRL_FRAME_FORMAT_MASK; if (frame_format == TEGRA210_I2S_CTRL_FRAME_FORMAT_FSYNC_MODE) { - i2s->soc_data->set_slot_ctrl(i2s->regmap, channels, tx_mask, - rx_mask); + tegra210_i2s_set_slot_ctrl(i2s->regmap, channels, tx_mask, + rx_mask); cif_conf.audio_channels = channels; cif_conf.client_channels = channels; } else { @@ -699,7 +699,7 @@ static int tegra210_i2s_hw_params(struct snd_pcm_substream *substream, reg = TEGRA210_I2S_AXBAR_TX_CIF_CTRL; } - i2s->soc_data->set_audio_cif(i2s->regmap, reg, &cif_conf); + tegra210_xbar_set_cif(i2s->regmap, reg, &cif_conf); if (i2s->format == SND_SOC_DAIFMT_RIGHT_J) tegra210_i2s_set_rjm_offset(i2s, sample_size); @@ -1037,21 +1037,9 @@ static const struct regmap_config tegra210_i2s_regmap_config = { .cache_type = REGCACHE_FLAT, }; -static const struct tegra210_i2s_soc_data soc_data_tegra210 = { - .set_audio_cif = tegra210_xbar_set_cif, - .set_slot_ctrl = tegra210_i2s_set_slot_ctrl, - .is_soc_t210 = true, -}; - -static const struct tegra210_i2s_soc_data soc_data_tegra186 = { - .set_audio_cif = tegra210_xbar_set_cif, - .set_slot_ctrl = tegra210_i2s_set_slot_ctrl, - .is_soc_t210 = false, -}; - static const struct of_device_id tegra210_i2s_of_match[] = { - { .compatible = "nvidia,tegra210-i2s", .data = &soc_data_tegra210 }, - { .compatible = "nvidia,tegra186-i2s", .data = &soc_data_tegra186 }, + { .compatible = "nvidia,tegra210-i2s" }, + { .compatible = "nvidia,tegra186-i2s" }, {}, }; @@ -1059,7 +1047,6 @@ static int tegra210_i2s_platform_probe(struct platform_device *pdev) { const struct of_device_id *match; struct device_node *np = pdev->dev.of_node; - struct tegra210_i2s_soc_data *soc_data; struct tegra210_i2s *i2s; struct resource *mem, *memregion; struct property *prop; @@ -1073,7 +1060,6 @@ static int tegra210_i2s_platform_probe(struct platform_device *pdev) ret = -ENODEV; goto err; } - soc_data = (struct tegra210_i2s_soc_data *)match->data; i2s = devm_kzalloc(&pdev->dev, sizeof(struct tegra210_i2s), GFP_KERNEL); if (!i2s) { @@ -1082,7 +1068,6 @@ static int tegra210_i2s_platform_probe(struct platform_device *pdev) goto err; } - i2s->soc_data = soc_data; i2s->tx_mask = i2s->rx_mask = 0xFFFF; i2s->bclk_ratio = 2; i2s->enable_cya = false;