diff options
author | Shengjiu Wang <b02247@freescale.com> | 2013-11-21 16:10:55 +0800 |
---|---|---|
committer | Shengjiu Wang <b02247@freescale.com> | 2013-11-21 17:34:58 +0800 |
commit | 88b654102c34db84df51496bc8721aa8d68c686d (patch) | |
tree | ab3c92f4b6fb1f4986447d8f942bb30a2c01a183 /sound | |
parent | cc6a006ae2a66950ed9b74d69129fa69c58a95ce (diff) |
ENGR00264453 asoc: when codec probe failed, alsa return RETRY error.
If there is no codec device, the machine driver will not register the
card. then alsa will not return RETRY error. update the error handling
for machine driver.
Add for cs42888 and si476x.
update dts file for sound-fm.
Signed-off-by: Shengjiu Wang <b02247@freescale.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/fsl/imx-cs42888.c | 2 | ||||
-rw-r--r-- | sound/soc/fsl/imx-si476x.c | 19 |
2 files changed, 20 insertions, 1 deletions
diff --git a/sound/soc/fsl/imx-cs42888.c b/sound/soc/fsl/imx-cs42888.c index efecc6641c6d..5116d781fdad 100644 --- a/sound/soc/fsl/imx-cs42888.c +++ b/sound/soc/fsl/imx-cs42888.c @@ -281,7 +281,7 @@ static int imx_cs42888_probe(struct platform_device *pdev) goto fail; } codec_dev = of_find_i2c_device_by_node(codec_np); - if (!codec_dev) { + if (!codec_dev || !codec_dev->driver) { dev_err(&pdev->dev, "failed to find codec platform device\n"); ret = -EINVAL; goto fail; diff --git a/sound/soc/fsl/imx-si476x.c b/sound/soc/fsl/imx-si476x.c index 621fd1823a55..938528ccdd46 100644 --- a/sound/soc/fsl/imx-si476x.c +++ b/sound/soc/fsl/imx-si476x.c @@ -13,6 +13,7 @@ #include <linux/module.h> #include <linux/of_platform.h> +#include <linux/of_i2c.h> #include <sound/soc.h> #include "imx-audmux.h" @@ -95,6 +96,8 @@ static int imx_si476x_probe(struct platform_device *pdev) struct snd_soc_card *card = &snd_soc_card_imx_3stack; struct device_node *ssi_np, *np = pdev->dev.of_node; struct platform_device *ssi_pdev; + struct i2c_client *fm_dev; + struct device_node *fm_np; int int_port, ext_port, ret; ret = of_property_read_u32(np, "mux-int-port", &int_port); @@ -124,6 +127,20 @@ static int imx_si476x_probe(struct platform_device *pdev) goto end; } + fm_np = of_parse_phandle(pdev->dev.of_node, "fm-controller", 0); + if (!fm_np) { + dev_err(&pdev->dev, "phandle missing or invalid\n"); + ret = -EINVAL; + goto end; + } + + fm_dev = of_find_i2c_device_by_node(fm_np); + if (!fm_dev || !fm_dev->driver) { + dev_err(&pdev->dev, "failed to find FM platform device\n"); + ret = -EINVAL; + goto end; + } + card->dev = &pdev->dev; card->dai_link->cpu_dai_name = dev_name(&ssi_pdev->dev); card->dai_link->platform_of_node = ssi_np; @@ -137,6 +154,8 @@ static int imx_si476x_probe(struct platform_device *pdev) end: if (ssi_np) of_node_put(ssi_np); + if (fm_np) + of_node_put(fm_np); return ret; } |