aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/samsung
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2013-07-02 08:10:28 -0400
committerMark Brown <broonie@linaro.org>2013-07-02 08:14:05 -0400
commit0429ffeff460c4302bd1520e696bafe446e15181 (patch)
treec34221ccf92f93b803b39ff3c0a51b354463f4a9 /sound/soc/samsung
parent8bb495e3f02401ee6f76d1b1d77f3ac9f079e376 (diff)
ASoC: samsung: Remove obsolete GPIO based DT pinmuxing
Since the Samsung platforms have moved to pinctrl for pin muxing and that is handled in the core the old GPIO based muxing code can just be removed. Something similar had been submitted by Thomas Abraham back in March but a resubmission following review never happened. Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/samsung')
-rw-r--r--sound/soc/samsung/i2s.c66
1 files changed, 4 insertions, 62 deletions
diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c
index 82ebb1a51479..7a1734697434 100644
--- a/sound/soc/samsung/i2s.c
+++ b/sound/soc/samsung/i2s.c
@@ -1016,52 +1016,6 @@ static struct i2s_dai *i2s_alloc_dai(struct platform_device *pdev, bool sec)
1016 return i2s; 1016 return i2s;
1017} 1017}
1018 1018
1019#ifdef CONFIG_OF
1020static int samsung_i2s_parse_dt_gpio(struct i2s_dai *i2s)
1021{
1022 struct device *dev = &i2s->pdev->dev;
1023 int index, gpio, ret;
1024
1025 for (index = 0; index < 7; index++) {
1026 gpio = of_get_gpio(dev->of_node, index);
1027 if (!gpio_is_valid(gpio)) {
1028 dev_err(dev, "invalid gpio[%d]: %d\n", index, gpio);
1029 goto free_gpio;
1030 }
1031
1032 ret = gpio_request(gpio, dev_name(dev));
1033 if (ret) {
1034 dev_err(dev, "gpio [%d] request failed\n", gpio);
1035 goto free_gpio;
1036 }
1037 i2s->gpios[index] = gpio;
1038 }
1039 return 0;
1040
1041free_gpio:
1042 while (--index >= 0)
1043 gpio_free(i2s->gpios[index]);
1044 return -EINVAL;
1045}
1046
1047static void samsung_i2s_dt_gpio_free(struct i2s_dai *i2s)
1048{
1049 unsigned int index;
1050 for (index = 0; index < 7; index++)
1051 gpio_free(i2s->gpios[index]);
1052}
1053#else
1054static int samsung_i2s_parse_dt_gpio(struct i2s_dai *dai)
1055{
1056 return -EINVAL;
1057}
1058
1059static void samsung_i2s_dt_gpio_free(struct i2s_dai *dai)
1060{
1061}
1062
1063#endif
1064
1065static const struct of_device_id exynos_i2s_match[]; 1019static const struct of_device_id exynos_i2s_match[];
1066 1020
1067static inline int samsung_i2s_get_driver_data(struct platform_device *pdev) 1021static inline int samsung_i2s_get_driver_data(struct platform_device *pdev)
@@ -1235,18 +1189,10 @@ static int samsung_i2s_probe(struct platform_device *pdev)
1235 pri_dai->sec_dai = sec_dai; 1189 pri_dai->sec_dai = sec_dai;
1236 } 1190 }
1237 1191
1238 if (np) { 1192 if (i2s_pdata && i2s_pdata->cfg_gpio && i2s_pdata->cfg_gpio(pdev)) {
1239 if (samsung_i2s_parse_dt_gpio(pri_dai)) { 1193 dev_err(&pdev->dev, "Unable to configure gpio\n");
1240 dev_err(&pdev->dev, "Unable to configure gpio\n"); 1194 ret = -EINVAL;
1241 ret = -EINVAL; 1195 goto err;
1242 goto err;
1243 }
1244 } else {
1245 if (i2s_pdata->cfg_gpio && i2s_pdata->cfg_gpio(pdev)) {
1246 dev_err(&pdev->dev, "Unable to configure gpio\n");
1247 ret = -EINVAL;
1248 goto err;
1249 }
1250 } 1196 }
1251 1197
1252 snd_soc_register_component(&pri_dai->pdev->dev, &samsung_i2s_component, 1198 snd_soc_register_component(&pri_dai->pdev->dev, &samsung_i2s_component,
@@ -1267,14 +1213,10 @@ static int samsung_i2s_remove(struct platform_device *pdev)
1267{ 1213{
1268 struct i2s_dai *i2s, *other; 1214 struct i2s_dai *i2s, *other;
1269 struct resource *res; 1215 struct resource *res;
1270 struct s3c_audio_pdata *i2s_pdata = pdev->dev.platform_data;
1271 1216
1272 i2s = dev_get_drvdata(&pdev->dev); 1217 i2s = dev_get_drvdata(&pdev->dev);
1273 other = i2s->pri_dai ? : i2s->sec_dai; 1218 other = i2s->pri_dai ? : i2s->sec_dai;
1274 1219
1275 if (!i2s_pdata->cfg_gpio && pdev->dev.of_node)
1276 samsung_i2s_dt_gpio_free(i2s->pri_dai);
1277
1278 if (other) { 1220 if (other) {
1279 other->pri_dai = NULL; 1221 other->pri_dai = NULL;
1280 other->sec_dai = NULL; 1222 other->sec_dai = NULL;