ASoC: samsung: Add pinctrl support to I2S driver
authorSylwester Nawrocki <s.nawrocki@samsung.com>
Thu, 14 Feb 2013 17:33:26 +0000 (18:33 +0100)
committerChanho Park <chanho61.park@samsung.com>
Tue, 18 Nov 2014 02:42:46 +0000 (11:42 +0900)
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
sound/soc/samsung/i2s.c

index 5c9b5e4..af6744a 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/module.h>
 #include <linux/of.h>
 #include <linux/of_gpio.h>
+#include <linux/pinctrl/consumer.h>
 #include <linux/pm_runtime.h>
 
 #include <sound/soc.h>
@@ -1232,7 +1233,10 @@ static int samsung_i2s_probe(struct platform_device *pdev)
        }
 
        if (np) {
-               if (samsung_i2s_parse_dt_gpio(pri_dai)) {
+               struct pinctrl *pctrl;
+               pctrl = devm_pinctrl_get_select_default(&pdev->dev);
+
+               if (IS_ERR(pctrl) && samsung_i2s_parse_dt_gpio(pri_dai)) {
                        dev_err(&pdev->dev, "Unable to configure gpio\n");
                        ret = -EINVAL;
                        goto err;