summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Hunter <jonathanh@nvidia.com>2018-07-24 11:52:14 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-07-26 11:14:36 -0400
commit32c4669ca085cbfc344a7d8f16dc7efb41ca2ef4 (patch)
treece84b9ed89327bd3517a2bfe2a72565c8fcaf4d5
parentbcb4af75b685315a9b974809171fe37502fc95d0 (diff)
ASoC: tegra-alt: Remove legacy unused platform data
The Tegra ASoC platform data is never used by any current audio machine driver and so get rid of the platform data and the associated code. Bug 200417361 Change-Id: I1ef8ce331b67c85aea95b4a143a6982a32fefe93 Signed-off-by: Jon Hunter <jonathanh@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1784822 Reviewed-by: Sameer Pujar <spujar@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Dara Ramesh <dramesh@nvidia.com> Reviewed-by: Bibek Basu <bbasu@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
-rw-r--r--include/linux/platform_data/tegra_asoc_pdata.h73
-rw-r--r--sound/soc/tegra-alt/machine_drivers/tegra_machine_driver_mobile.c127
-rw-r--r--sound/soc/tegra-alt/machine_drivers/tegra_t186ref_p4573_alt.c15
3 files changed, 4 insertions, 211 deletions
diff --git a/include/linux/platform_data/tegra_asoc_pdata.h b/include/linux/platform_data/tegra_asoc_pdata.h
deleted file mode 100644
index 17b3dcaf5..000000000
--- a/include/linux/platform_data/tegra_asoc_pdata.h
+++ /dev/null
@@ -1,73 +0,0 @@
1/*
2 * Copyright (c) 2012-2013, NVIDIA CORPORATION. All rights reserved.
3 *
4 * This software is licensed under the terms of the GNU General Public
5 * License version 2, as published by the Free Software Foundation, and
6 * may be copied, distributed, and modified under those terms.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 */
14
15#define HIFI_CODEC 0
16#define BASEBAND 1
17#define BT_SCO 2
18#define VOICE_CODEC 3
19#define NUM_I2S_DEVICES 4
20
21#define TEGRA_DAIFMT_DSP_A 0
22#define TEGRA_DAIFMT_DSP_B 1
23#define TEGRA_DAIFMT_I2S 2
24#define TEGRA_DAIFMT_RIGHT_J 3
25#define TEGRA_DAIFMT_LEFT_J 4
26
27struct i2s_config {
28 int audio_port_id;
29 int is_i2s_master;
30 int i2s_mode;
31 int sample_size;
32 int rate;
33 int channels;
34 int bit_clk;
35};
36
37struct ahub_bbc1_config {
38 int port_id;
39 int sample_size;
40 int rate;
41 int channels;
42 int bit_clk;
43};
44
45enum tegra_speaker_edp_states {
46 TEGRA_SPK_EDP_NEG_1,
47 TEGRA_SPK_EDP_ZERO,
48 TEGRA_SPK_EDP_1,
49 TEGRA_SPK_EDP_NUM_STATES,
50};
51
52struct tegra_asoc_platform_data {
53 const char *codec_name;
54 const char *codec_dai_name;
55 int num_links;
56 int gpio_spkr_en;
57 int gpio_hp_det;
58 int gpio_hp_det_active_high;
59 int gpio_hp_mute;
60 int gpio_int_mic_en;
61 int gpio_ext_mic_en;
62 int gpio_ldo1_en;
63 int gpio_codec1;
64 int gpio_codec2;
65 int gpio_codec3;
66 bool micbias_gpio_absent;
67 bool use_codec_jd_irq;
68 unsigned int debounce_time_hp;
69 bool edp_support;
70 unsigned int edp_states[TEGRA_SPK_EDP_NUM_STATES];
71 struct i2s_config i2s_param[NUM_I2S_DEVICES];
72 struct ahub_bbc1_config *ahub_bbc1_param;
73};
diff --git a/sound/soc/tegra-alt/machine_drivers/tegra_machine_driver_mobile.c b/sound/soc/tegra-alt/machine_drivers/tegra_machine_driver_mobile.c
index 4d168df9b..7cbeff22f 100644
--- a/sound/soc/tegra-alt/machine_drivers/tegra_machine_driver_mobile.c
+++ b/sound/soc/tegra-alt/machine_drivers/tegra_machine_driver_mobile.c
@@ -25,7 +25,6 @@
25#include <linux/delay.h> 25#include <linux/delay.h>
26#include <linux/pm_runtime.h> 26#include <linux/pm_runtime.h>
27#include <linux/version.h> 27#include <linux/version.h>
28#include <linux/platform_data/tegra_asoc_pdata.h>
29#include <sound/core.h> 28#include <sound/core.h>
30#include <sound/jack.h> 29#include <sound/jack.h>
31#include <sound/pcm.h> 30#include <sound/pcm.h>
@@ -56,19 +55,13 @@
56 55
57/* machine structure which holds sound card */ 56/* machine structure which holds sound card */
58struct tegra_machine { 57struct tegra_machine {
59 struct tegra_asoc_platform_data *pdata;
60 struct tegra_asoc_audio_clock_info audio_clock; 58 struct tegra_asoc_audio_clock_info audio_clock;
61 unsigned int num_codec_links; 59 unsigned int num_codec_links;
62 int gpio_requested;
63 struct snd_soc_card *pcard;
64 int rate_via_kcontrol; 60 int rate_via_kcontrol;
65 bool is_hs_supported; 61 bool is_hs_supported;
66 int fmt_via_kcontrol; 62 int fmt_via_kcontrol;
67 unsigned int bclk_ratio_override; 63 unsigned int bclk_ratio_override;
68 struct tegra_machine_soc_data *soc_data; 64 struct tegra_machine_soc_data *soc_data;
69 struct regulator *digital_reg;
70 struct regulator *spk_reg;
71 struct regulator *dmic_reg;
72}; 65};
73 66
74/* used for soc specific data */ 67/* used for soc specific data */
@@ -135,16 +128,6 @@ static int tegra_machine_codec_get_bclk_ratio(struct snd_kcontrol *,
135static int tegra_machine_codec_put_bclk_ratio(struct snd_kcontrol *, 128static int tegra_machine_codec_put_bclk_ratio(struct snd_kcontrol *,
136 struct snd_ctl_elem_value *); 129 struct snd_ctl_elem_value *);
137 130
138/* rt565x specific APIs */
139static int tegra_rt565x_event_int_spk(struct snd_soc_dapm_widget *,
140 struct snd_kcontrol *, int);
141static int tegra_rt565x_event_int_mic(struct snd_soc_dapm_widget *,
142 struct snd_kcontrol *, int);
143static int tegra_rt565x_event_ext_mic(struct snd_soc_dapm_widget *,
144 struct snd_kcontrol *, int);
145static int tegra_rt565x_event_hp(struct snd_soc_dapm_widget *,
146 struct snd_kcontrol *, int);
147
148/* t210 soc data */ 131/* t210 soc data */
149static const struct tegra_machine_soc_data soc_data_tegra210 = { 132static const struct tegra_machine_soc_data soc_data_tegra210 = {
150 .num_xbar_dai_links = TEGRA210_XBAR_DAI_LINKS, 133 .num_xbar_dai_links = TEGRA210_XBAR_DAI_LINKS,
@@ -258,10 +241,10 @@ static struct snd_soc_compr_ops tegra_machine_compr_ops = {
258#endif 241#endif
259 242
260static const struct snd_soc_dapm_widget tegra_machine_dapm_widgets[] = { 243static const struct snd_soc_dapm_widget tegra_machine_dapm_widgets[] = {
261 SND_SOC_DAPM_SPK("x Int Spk", tegra_rt565x_event_int_spk), 244 SND_SOC_DAPM_SPK("x Int Spk", NULL),
262 SND_SOC_DAPM_HP("x Headphone Jack", tegra_rt565x_event_hp), 245 SND_SOC_DAPM_HP("x Headphone Jack", NULL),
263 SND_SOC_DAPM_MIC("x Int Mic", tegra_rt565x_event_int_mic), 246 SND_SOC_DAPM_MIC("x Int Mic", NULL),
264 SND_SOC_DAPM_MIC("x Mic Jack", tegra_rt565x_event_ext_mic), 247 SND_SOC_DAPM_MIC("x Mic Jack", NULL),
265 248
266 SND_SOC_DAPM_SPK("d1 Headphone", NULL), 249 SND_SOC_DAPM_SPK("d1 Headphone", NULL),
267 SND_SOC_DAPM_SPK("d2 Headphone", NULL), 250 SND_SOC_DAPM_SPK("d2 Headphone", NULL),
@@ -360,90 +343,6 @@ static struct snd_soc_pcm_stream tegra_machine_asrc_link_params[] = {
360 PARAMS(SNDRV_PCM_FMTBIT_S16_LE, 2), 343 PARAMS(SNDRV_PCM_FMTBIT_S16_LE, 2),
361}; 344};
362 345
363static int tegra_rt565x_event_int_spk(struct snd_soc_dapm_widget *w,
364 struct snd_kcontrol *k, int event)
365{
366 struct snd_soc_dapm_context *dapm = w->dapm;
367 struct snd_soc_card *card = dapm->card;
368 struct tegra_machine *machine = snd_soc_card_get_drvdata(card);
369 struct tegra_asoc_platform_data *pdata = machine->pdata;
370 int err;
371
372 if (machine->spk_reg) {
373 if (SND_SOC_DAPM_EVENT_ON(event))
374 err = regulator_enable(machine->spk_reg);
375 else
376 regulator_disable(machine->spk_reg);
377 }
378
379 if (!(machine->gpio_requested & GPIO_SPKR_EN))
380 return 0;
381
382 gpio_set_value_cansleep(pdata->gpio_spkr_en,
383 !!SND_SOC_DAPM_EVENT_ON(event));
384
385 return 0;
386}
387
388static int tegra_rt565x_event_hp(struct snd_soc_dapm_widget *w,
389 struct snd_kcontrol *k, int event)
390{
391 struct snd_soc_dapm_context *dapm = w->dapm;
392 struct snd_soc_card *card = dapm->card;
393 struct tegra_machine *machine = snd_soc_card_get_drvdata(card);
394 struct tegra_asoc_platform_data *pdata = machine->pdata;
395
396 if (!(machine->gpio_requested & GPIO_HP_MUTE))
397 return 0;
398
399 gpio_set_value_cansleep(pdata->gpio_hp_mute,
400 !SND_SOC_DAPM_EVENT_ON(event));
401 return 0;
402}
403
404static int tegra_rt565x_event_int_mic(struct snd_soc_dapm_widget *w,
405 struct snd_kcontrol *k, int event)
406{
407 struct snd_soc_dapm_context *dapm = w->dapm;
408 struct snd_soc_card *card = dapm->card;
409 struct tegra_machine *machine = snd_soc_card_get_drvdata(card);
410 struct tegra_asoc_platform_data *pdata = machine->pdata;
411 int ret = 0;
412
413 if (machine->dmic_reg) {
414 if (SND_SOC_DAPM_EVENT_ON(event))
415 ret = regulator_enable(machine->dmic_reg);
416 else
417 regulator_disable(machine->dmic_reg);
418 }
419
420 if (!(machine->gpio_requested & GPIO_INT_MIC_EN))
421 return 0;
422
423 gpio_set_value_cansleep(pdata->gpio_int_mic_en,
424 !!SND_SOC_DAPM_EVENT_ON(event));
425
426 return 0;
427}
428
429static int tegra_rt565x_event_ext_mic(struct snd_soc_dapm_widget *w,
430 struct snd_kcontrol *k, int event)
431{
432 struct snd_soc_dapm_context *dapm = w->dapm;
433 struct snd_soc_card *card = dapm->card;
434 struct tegra_machine *machine = snd_soc_card_get_drvdata(card);
435 struct tegra_asoc_platform_data *pdata = machine->pdata;
436
437 if (!(machine->gpio_requested & GPIO_EXT_MIC_EN))
438 return 0;
439
440 gpio_set_value_cansleep(pdata->gpio_ext_mic_en,
441 !SND_SOC_DAPM_EVENT_ON(event));
442
443 return 0;
444}
445
446
447static int tegra_machine_codec_get_rate(struct snd_kcontrol *kcontrol, 346static int tegra_machine_codec_get_rate(struct snd_kcontrol *kcontrol,
448 struct snd_ctl_elem_value *ucontrol) 347 struct snd_ctl_elem_value *ucontrol)
449{ 348{
@@ -1156,7 +1055,6 @@ static int tegra_machine_driver_probe(struct platform_device *pdev)
1156 struct device_node *np = pdev->dev.of_node; 1055 struct device_node *np = pdev->dev.of_node;
1157 struct snd_soc_card *card = &snd_soc_tegra_card; 1056 struct snd_soc_card *card = &snd_soc_tegra_card;
1158 struct tegra_machine *machine; 1057 struct tegra_machine *machine;
1159 struct tegra_asoc_platform_data *pdata = NULL;
1160 int ret = 0; 1058 int ret = 0;
1161 const struct of_device_id *match; 1059 const struct of_device_id *match;
1162 1060
@@ -1235,23 +1133,6 @@ static int tegra_machine_driver_probe(struct platform_device *pdev)
1235 1133
1236 dai_link_setup(pdev); 1134 dai_link_setup(pdev);
1237 1135
1238 pdata = devm_kzalloc(&pdev->dev,
1239 sizeof(struct tegra_asoc_platform_data),
1240 GFP_KERNEL);
1241 if (!pdata) {
1242 dev_err(&pdev->dev,
1243 "Can't allocate tegra_asoc_platform_data struct\n");
1244 ret = -ENOMEM;
1245 goto err_alloc_dai_link;
1246 }
1247
1248 pdata->gpio_codec1 = pdata->gpio_codec2 = pdata->gpio_codec3 =
1249 pdata->gpio_spkr_en = pdata->gpio_hp_mute =
1250 pdata->gpio_int_mic_en = pdata->gpio_ext_mic_en = -1;
1251
1252 machine->pdata = pdata;
1253 machine->pcard = card;
1254
1255 ret = tegra_alt_asoc_utils_init(&machine->audio_clock, 1136 ret = tegra_alt_asoc_utils_init(&machine->audio_clock,
1256 &pdev->dev, 1137 &pdev->dev,
1257 card); 1138 card);
diff --git a/sound/soc/tegra-alt/machine_drivers/tegra_t186ref_p4573_alt.c b/sound/soc/tegra-alt/machine_drivers/tegra_t186ref_p4573_alt.c
index e54728d9f..5ee6ae6e0 100644
--- a/sound/soc/tegra-alt/machine_drivers/tegra_t186ref_p4573_alt.c
+++ b/sound/soc/tegra-alt/machine_drivers/tegra_t186ref_p4573_alt.c
@@ -20,11 +20,6 @@
20#include <linux/module.h> 20#include <linux/module.h>
21#include <linux/of_platform.h> 21#include <linux/of_platform.h>
22#include <linux/version.h> 22#include <linux/version.h>
23#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
24#include <linux/platform_data/tegra_asoc_pdata.h>
25#else
26#include <mach/tegra_asoc_pdata.h>
27#endif
28 23
29#include <sound/pcm_params.h> 24#include <sound/pcm_params.h>
30#include <sound/soc.h> 25#include <sound/soc.h>
@@ -45,7 +40,6 @@ static const char * const dai_link_names[] = {
45 40
46struct tegra_t186 { 41struct tegra_t186 {
47 struct tegra_asoc_audio_clock_info audio_clock; 42 struct tegra_asoc_audio_clock_info audio_clock;
48 struct tegra_asoc_platform_data *pdata;
49 struct snd_soc_dai_link *codec_link; 43 struct snd_soc_dai_link *codec_link;
50 unsigned int num_codec_links; 44 unsigned int num_codec_links;
51 struct snd_soc_card *pcard; 45 struct snd_soc_card *pcard;
@@ -399,7 +393,6 @@ static int tegra186_driver_probe(struct platform_device *pdev)
399{ 393{
400 struct snd_soc_card *card = &snd_soc_tegra_t186; 394 struct snd_soc_card *card = &snd_soc_tegra_t186;
401 struct device_node *np = pdev->dev.of_node; 395 struct device_node *np = pdev->dev.of_node;
402 struct tegra_asoc_platform_data *pdata;
403 struct snd_soc_pcm_runtime *rtd; 396 struct snd_soc_pcm_runtime *rtd;
404 struct device *dev = &pdev->dev; 397 struct device *dev = &pdev->dev;
405 struct tegra_t186 *machine; 398 struct tegra_t186 *machine;
@@ -451,14 +444,6 @@ static int tegra186_driver_probe(struct platform_device *pdev)
451 444
452 dai_link_setup(pdev); 445 dai_link_setup(pdev);
453 446
454 pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
455 if (!pdata) {
456 dev_err(dev,
457 "Can't allocate tegra_asoc_platform_data struct\n");
458 return -ENOMEM;
459 }
460
461 machine->pdata = pdata;
462 machine->pcard = card; 447 machine->pcard = card;
463 448
464 ret = tegra_alt_asoc_utils_init(&machine->audio_clock, dev, card); 449 ret = tegra_alt_asoc_utils_init(&machine->audio_clock, dev, card);