From 2ca7e4e50d297de6093814b42d65c89a2df50a9c Mon Sep 17 00:00:00 2001 From: Xing Wang Date: Thu, 17 May 2018 14:29:18 +0800 Subject: [PATCH] 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 --- sound/soc/amlogic/auge/spdif.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/sound/soc/amlogic/auge/spdif.c b/sound/soc/amlogic/auge/spdif.c index a61e438e87d3..0fcdb2124f82 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); } -- 2.20.1