extcon: arizona: Add processing of mic det DT into extcon driver
authorCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Tue, 22 Oct 2013 15:13:40 +0000 (16:13 +0100)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Wed, 14 Dec 2016 04:42:45 +0000 (13:42 +0900)
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
drivers/extcon/extcon-arizona.c

index a0ed35b..e968981 100644 (file)
@@ -1120,6 +1120,11 @@ static void arizona_micd_set_level(struct arizona *arizona, int index,
        regmap_update_bits(arizona->regmap, reg, mask, level);
 }
 
+static int arizona_extcon_of_get_pdata(struct arizona *arizona)
+{
+       return 0;
+}
+
 static int arizona_extcon_probe(struct platform_device *pdev)
 {
        struct arizona *arizona = dev_get_drvdata(pdev->dev.parent);
@@ -1137,6 +1142,14 @@ static int arizona_extcon_probe(struct platform_device *pdev)
        if (!info)
                return -ENOMEM;
 
+       if (IS_ENABLED(CONFIG_OF)) {
+               if (!dev_get_platdata(arizona->dev)) {
+                       ret = arizona_extcon_of_get_pdata(arizona);
+                       if (ret < 0)
+                               return ret;
+               }
+       }
+
        info->micvdd = devm_regulator_get(&pdev->dev, "MICVDD");
        if (IS_ERR(info->micvdd)) {
                ret = PTR_ERR(info->micvdd);