diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-02-11 11:06:37 +0000 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-02-11 11:06:37 +0000 |
commit | f0f3214e8be1068121ba829fcd8c1c22b5bd6975 (patch) | |
tree | 8debeb79f21d1f615f6352c832ab2cc3696acb95 | |
parent | a948cae6ab124d7ff4365c9e72b33079b7769ae2 (diff) | |
parent | 324a7fb02b9e7a226916e3593f756cd85312bae8 (diff) | |
download | linux-f0f3214e8be1068121ba829fcd8c1c22b5bd6975.tar.bz2 |
Merge remote-tracking branch 'asoc/topic/mxs' into asoc-next
-rw-r--r-- | include/sound/saif.h | 16 | ||||
-rw-r--r-- | sound/soc/mxs/mxs-saif.c | 49 |
2 files changed, 21 insertions, 44 deletions
diff --git a/include/sound/saif.h b/include/sound/saif.h deleted file mode 100644 index f22f3e16edf4..000000000000 --- a/include/sound/saif.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright 2011 Freescale Semiconductor, Inc. All Rights Reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#ifndef __SOUND_SAIF_H__ -#define __SOUND_SAIF_H__ - -struct mxs_saif_platform_data { - bool master_mode; /* if true use master mode */ - int master_id; /* id of the master if in slave mode */ -}; -#endif diff --git a/sound/soc/mxs/mxs-saif.c b/sound/soc/mxs/mxs-saif.c index 365d9d27a321..e70e6c844f96 100644 --- a/sound/soc/mxs/mxs-saif.c +++ b/sound/soc/mxs/mxs-saif.c @@ -32,7 +32,6 @@ #include <sound/pcm.h> #include <sound/pcm_params.h> #include <sound/soc.h> -#include <sound/saif.h> #include <asm/mach-types.h> #include <mach/hardware.h> #include <mach/mxs.h> @@ -662,46 +661,40 @@ static int mxs_saif_probe(struct platform_device *pdev) struct device_node *np = pdev->dev.of_node; struct resource *iores, *dmares; struct mxs_saif *saif; - struct mxs_saif_platform_data *pdata; struct pinctrl *pinctrl; int ret = 0; + struct device_node *master; - - if (!np && pdev->id >= ARRAY_SIZE(mxs_saif)) + if (!np) return -EINVAL; saif = devm_kzalloc(&pdev->dev, sizeof(*saif), GFP_KERNEL); if (!saif) return -ENOMEM; - if (np) { - struct device_node *master; - saif->id = of_alias_get_id(np, "saif"); - if (saif->id < 0) - return saif->id; - /* - * If there is no "fsl,saif-master" phandle, it's a saif - * master. Otherwise, it's a slave and its phandle points - * to the master. - */ - master = of_parse_phandle(np, "fsl,saif-master", 0); - if (!master) { - saif->master_id = saif->id; - } else { - saif->master_id = of_alias_get_id(master, "saif"); - if (saif->master_id < 0) - return saif->master_id; - } + ret = of_alias_get_id(np, "saif"); + if (ret < 0) + return ret; + else + saif->id = ret; + + /* + * If there is no "fsl,saif-master" phandle, it's a saif + * master. Otherwise, it's a slave and its phandle points + * to the master. + */ + master = of_parse_phandle(np, "fsl,saif-master", 0); + if (!master) { + saif->master_id = saif->id; } else { - saif->id = pdev->id; - pdata = pdev->dev.platform_data; - if (pdata && !pdata->master_mode) - saif->master_id = pdata->master_id; + ret = of_alias_get_id(master, "saif"); + if (ret < 0) + return ret; else - saif->master_id = saif->id; + saif->master_id = ret; } - if (saif->master_id < 0 || saif->master_id >= ARRAY_SIZE(mxs_saif)) { + if (saif->master_id >= ARRAY_SIZE(mxs_saif)) { dev_err(&pdev->dev, "get wrong master id\n"); return -EINVAL; } |