From: Xing Wang Date: Thu, 17 May 2018 06:29:18 +0000 (+0800) Subject: audio: auge: only spdifin_event extcon for spdif_a in g12a X-Git-Tag: khadas-vims-v0.9.6-release~1778 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2ca7e4e50d297de6093814b42d65c89a2df50a9c;p=platform%2Fkernel%2Flinux-amlogic.git audio: auge: only spdifin_event extcon for spdif_a in g12a PD#165680: audio: auge: only spdifin_event extcon for spdif_a in g12a Change-Id: Ie8486dc460a9452dc8a0f26a2a5acce83ee7bf26 Signed-off-by: Xing Wang --- diff --git a/sound/soc/amlogic/auge/spdif.c b/sound/soc/amlogic/auge/spdif.c index a61e438..0fcdb21 100644 --- a/sound/soc/amlogic/auge/spdif.c +++ b/sound/soc/amlogic/auge/spdif.c @@ -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); }