diff options
author | Arnd Bergmann <arnd@arndb.de> | 2016-03-18 11:50:33 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2016-07-12 05:23:54 -0400 |
commit | cf4129ea212d71f7860bded25d42388265172bee (patch) | |
tree | 54cdcba8036f50fbc79ab97a775caf6dfb00978f /sound | |
parent | 79886be09751c543155608036134b9948288bfc3 (diff) |
ASoC: ab8500-codec: remove platform data based probe
The ux500 platform hasn't used board files for a long time, and
nothing defines a ab8500_codec_platform_data, so we can just
remove the probing based on that and always use device tree
properties directly.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/codecs/ab8500-codec.c | 33 |
1 files changed, 4 insertions, 29 deletions
diff --git a/sound/soc/codecs/ab8500-codec.c b/sound/soc/codecs/ab8500-codec.c index 8b1d0c1a7839..2fc89155f14a 100644 --- a/sound/soc/codecs/ab8500-codec.c +++ b/sound/soc/codecs/ab8500-codec.c | |||
@@ -2464,45 +2464,20 @@ static int ab8500_codec_probe(struct snd_soc_codec *codec) | |||
2464 | struct device *dev = codec->dev; | 2464 | struct device *dev = codec->dev; |
2465 | struct device_node *np = dev->of_node; | 2465 | struct device_node *np = dev->of_node; |
2466 | struct ab8500_codec_drvdata *drvdata = dev_get_drvdata(dev); | 2466 | struct ab8500_codec_drvdata *drvdata = dev_get_drvdata(dev); |
2467 | struct ab8500_platform_data *pdata; | 2467 | struct ab8500_codec_platform_data codec_pdata; |
2468 | struct filter_control *fc; | 2468 | struct filter_control *fc; |
2469 | int status; | 2469 | int status; |
2470 | 2470 | ||
2471 | dev_dbg(dev, "%s: Enter.\n", __func__); | 2471 | dev_dbg(dev, "%s: Enter.\n", __func__); |
2472 | 2472 | ||
2473 | /* Setup AB8500 according to board-settings */ | 2473 | ab8500_codec_of_probe(dev, np, &codec_pdata); |
2474 | pdata = dev_get_platdata(dev->parent); | ||
2475 | 2474 | ||
2476 | if (np) { | 2475 | status = ab8500_audio_setup_mics(codec, &codec_pdata.amics); |
2477 | if (!pdata) | ||
2478 | pdata = devm_kzalloc(dev, | ||
2479 | sizeof(struct ab8500_platform_data), | ||
2480 | GFP_KERNEL); | ||
2481 | |||
2482 | if (pdata && !pdata->codec) | ||
2483 | pdata->codec | ||
2484 | = devm_kzalloc(dev, | ||
2485 | sizeof(struct ab8500_codec_platform_data), | ||
2486 | GFP_KERNEL); | ||
2487 | |||
2488 | if (!(pdata && pdata->codec)) | ||
2489 | return -ENOMEM; | ||
2490 | |||
2491 | ab8500_codec_of_probe(dev, np, pdata->codec); | ||
2492 | |||
2493 | } else { | ||
2494 | if (!(pdata && pdata->codec)) { | ||
2495 | dev_err(dev, "No codec platform data or DT found\n"); | ||
2496 | return -EINVAL; | ||
2497 | } | ||
2498 | } | ||
2499 | |||
2500 | status = ab8500_audio_setup_mics(codec, &pdata->codec->amics); | ||
2501 | if (status < 0) { | 2476 | if (status < 0) { |
2502 | pr_err("%s: Failed to setup mics (%d)!\n", __func__, status); | 2477 | pr_err("%s: Failed to setup mics (%d)!\n", __func__, status); |
2503 | return status; | 2478 | return status; |
2504 | } | 2479 | } |
2505 | status = ab8500_audio_set_ear_cmv(codec, pdata->codec->ear_cmv); | 2480 | status = ab8500_audio_set_ear_cmv(codec, codec_pdata.ear_cmv); |
2506 | if (status < 0) { | 2481 | if (status < 0) { |
2507 | pr_err("%s: Failed to set earpiece CM-voltage (%d)!\n", | 2482 | pr_err("%s: Failed to set earpiece CM-voltage (%d)!\n", |
2508 | __func__, status); | 2483 | __func__, status); |