diff options
| author | Kenneth Westfield <kwestfie@codeaurora.org> | 2015-03-13 03:54:17 -0400 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2015-03-16 07:06:38 -0400 |
| commit | 8ebe148be9aa12641c62a3c99c65859bf95445fe (patch) | |
| tree | 68c1c4ced4e3739f050126ec2dbffd68f697bf04 | |
| parent | 97a33ced310ab9bdb16699c2c64b28f29de0a23d (diff) | |
ASoC: qcom: Modify test for DSP in LPASS driver
As the representation of the DSP in the device
tree has changed from a required subnode to an
optional phandle, modify the test for DSP
existence in the LPASS CPU DAI driver,
accordingly.
Signed-off-by: Kenneth Westfield <kwestfie@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
| -rw-r--r-- | sound/soc/qcom/lpass-cpu.c | 33 |
1 files changed, 7 insertions, 26 deletions
diff --git a/sound/soc/qcom/lpass-cpu.c b/sound/soc/qcom/lpass-cpu.c index d5167131787f..6698d058de29 100644 --- a/sound/soc/qcom/lpass-cpu.c +++ b/sound/soc/qcom/lpass-cpu.c | |||
| @@ -359,45 +359,26 @@ static const struct regmap_config lpass_cpu_regmap_config = { | |||
| 359 | .cache_type = REGCACHE_FLAT, | 359 | .cache_type = REGCACHE_FLAT, |
| 360 | }; | 360 | }; |
| 361 | 361 | ||
| 362 | static int lpass_cpu_parse_of(struct device *dev) | 362 | static int lpass_cpu_platform_probe(struct platform_device *pdev) |
| 363 | { | 363 | { |
| 364 | struct lpass_data *drvdata; | ||
| 364 | struct device_node *dsp_of_node; | 365 | struct device_node *dsp_of_node; |
| 366 | struct resource *res; | ||
| 367 | int ret; | ||
| 365 | 368 | ||
| 366 | dsp_of_node = of_get_child_by_name(dev->of_node, "qcom,adsp"); | 369 | dsp_of_node = of_parse_phandle(pdev->dev.of_node, "qcom,adsp", 0); |
| 367 | if (!dsp_of_node) { | 370 | if (dsp_of_node) { |
| 368 | dev_err(dev, "%s() error getting qcom,adsp sub-node\n", | 371 | dev_err(&pdev->dev, "%s() DSP exists and holds audio resources\n", |
| 369 | __func__); | ||
| 370 | return -EINVAL; | ||
| 371 | } | ||
| 372 | |||
| 373 | if (of_device_is_available(dsp_of_node)) { | ||
| 374 | dev_err(dev, "%s() DSP exists and holds audio resources\n", | ||
| 375 | __func__); | 372 | __func__); |
| 376 | return -EBUSY; | 373 | return -EBUSY; |
| 377 | } | 374 | } |
| 378 | 375 | ||
| 379 | return 0; | ||
| 380 | } | ||
| 381 | |||
| 382 | static int lpass_cpu_platform_probe(struct platform_device *pdev) | ||
| 383 | { | ||
| 384 | struct lpass_data *drvdata; | ||
| 385 | struct resource *res; | ||
| 386 | int ret; | ||
| 387 | |||
| 388 | drvdata = devm_kzalloc(&pdev->dev, sizeof(struct lpass_data), | 376 | drvdata = devm_kzalloc(&pdev->dev, sizeof(struct lpass_data), |
| 389 | GFP_KERNEL); | 377 | GFP_KERNEL); |
| 390 | if (!drvdata) | 378 | if (!drvdata) |
| 391 | return -ENOMEM; | 379 | return -ENOMEM; |
| 392 | platform_set_drvdata(pdev, drvdata); | 380 | platform_set_drvdata(pdev, drvdata); |
| 393 | 381 | ||
| 394 | ret = lpass_cpu_parse_of(&pdev->dev); | ||
| 395 | if (ret) { | ||
| 396 | dev_err(&pdev->dev, "%s() error getting DT node info: %d\n", | ||
| 397 | __func__, ret); | ||
| 398 | return ret; | ||
| 399 | } | ||
| 400 | |||
| 401 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "lpass-lpaif"); | 382 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "lpass-lpaif"); |
| 402 | if (!res) { | 383 | if (!res) { |
| 403 | dev_err(&pdev->dev, "%s() error getting resource\n", __func__); | 384 | dev_err(&pdev->dev, "%s() error getting resource\n", __func__); |
