audio: auge: only spdifin_event extcon for spdif_a in g12a
authorXing Wang <xing.wang@amlogic.com>
Thu, 17 May 2018 06:29:18 +0000 (14:29 +0800)
committerYixun Lan <yixun.lan@amlogic.com>
Mon, 2 Jul 2018 09:35:43 +0000 (02:35 -0700)
PD#165680: audio: auge: only spdifin_event extcon for spdif_a in g12a

Change-Id: Ie8486dc460a9452dc8a0f26a2a5acce83ee7bf26
Signed-off-by: Xing Wang <xing.wang@amlogic.com>
sound/soc/amlogic/auge/spdif.c

index a61e438e87d328964f28d64d786e18a9b4aae35c..0fcdb2124f82eddd5736b2f4fd427c88d16c17ac 100644 (file)
@@ -928,6 +928,21 @@ static int aml_spdif_parse_of(struct platform_device *pdev)
                        dev_info(dev, "aml_spdif_get_pins error!\n");
                        return PTR_ERR(p_spdif->pin_ctl);
                }
+
+               /* spdifin sample rate change event */
+               p_spdif->edev = devm_extcon_dev_allocate(dev, spdifin_extcon);
+               if (IS_ERR(p_spdif->edev)) {
+                       pr_err("failed to allocate spdifin extcon!!!\n");
+                       ret = -ENOMEM;
+                       return ret;
+               }
+               p_spdif->edev->dev.parent  = dev;
+               p_spdif->edev->name = "spdifin_event";
+
+               dev_set_name(&p_spdif->edev->dev, "spdifin_event");
+               ret = extcon_dev_register(p_spdif->edev);
+               if (ret < 0)
+                       pr_err("SPDIF IN extcon failed to register!!, ignore it\n");
        }
 
        /* clock for spdif in */
@@ -1056,21 +1071,6 @@ static int aml_spdif_platform_probe(struct platform_device *pdev)
 
        pr_info("%s, register soc platform\n", __func__);
 
-       /* spdifin sample rate change event */
-       aml_spdif->edev = devm_extcon_dev_allocate(dev, spdifin_extcon);
-       if (IS_ERR(aml_spdif->edev)) {
-               pr_err("failed to allocate spdifin extcon!!!\n");
-               ret = -ENOMEM;
-       } else {
-               aml_spdif->edev->dev.parent  = dev;
-               aml_spdif->edev->name = "spdifin_event";
-
-               dev_set_name(&aml_spdif->edev->dev, "spdifin_event");
-               ret = extcon_dev_register(aml_spdif->edev);
-               if (ret < 0)
-                       pr_err("SPDIF IN extcon failed to register!!, ignore it\n");
-       }
-
        return devm_snd_soc_register_platform(dev, &aml_spdif_platform);
 }