From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 082AEC433E2 for ; Fri, 11 Sep 2020 10:25:09 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AD2A9221ED for ; Fri, 11 Sep 2020 10:25:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="tI8X1fXg"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="GSWpdAds" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AD2A9221ED Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 05E9C1681; Fri, 11 Sep 2020 12:24:16 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 05E9C1681 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1599819906; bh=Jo8UgR1leBOY+bqbP9XrGR3jTBoaDaSmL/fSUlBcmDg=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=tI8X1fXg1PYVrOcUbSu0D/Wvz98ULTtpW43gtzYAU+A0UVBm7BeOp6kFqzXMC7QLr R6rdvsYbcaRhzjVXxmIvuVQISEQs3VjYXTKXmf/itmEG7+UsGwuBw3WzP8SNRb+s3R jrnj1crBdceB5Vjycg4zF7L5PX9vsX0T6SyBSTBw= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id B24EBF80256; Fri, 11 Sep 2020 12:23:30 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 3AE3AF8028B; Fri, 11 Sep 2020 12:23:29 +0200 (CEST) Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id AAD2FF80274 for ; Fri, 11 Sep 2020 12:23:17 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz AAD2FF80274 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="GSWpdAds" Received: by mail-pg1-x543.google.com with SMTP id t14so6307858pgl.10 for ; Fri, 11 Sep 2020 03:23:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kvYixO51YaoIO33ChNYvtKOsnVvLnU5BAv+BZxGwFTk=; b=GSWpdAdszXbdXKJX4yNAExAhWJCVbLdQEeyZfgIMk8KomfCaI6vzKEWWQRzIj8HKNy uGqsXvDrkjlwXDM6miRLxAjBVF7iJsyE5m9mkBZk/e+Awu/41bz/bXE51kdtxyzF5dTk 0R0lFGyXqbz6InNutB2y0zQjBOCeecwSe0g/w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kvYixO51YaoIO33ChNYvtKOsnVvLnU5BAv+BZxGwFTk=; b=UqVbJ+/3Wum7VCgx7Li/esi3fRxl2JwZlODbmuzsY9FFq0sr8B0rocDo/ba07ZnUsd xVi9k+kJ9Sy6pksSXu9Za7p/GhgblJaiEVH0yEmZmqX+aDZrGKHX0mTe6K73L6t8VBXa Yalj6YGc1jSrIIhbdcS7S4pMDp2gjQKAB1Aznt5c8kzXy4xZ5YaGrB5cKKC8ztg8p0UI rxVVNx/HAYBnYXDLjrQZKeXbURxxd1h+AAILd+e+oeYzx37TzJcmcag4h1h5BErbq0qo XQg5mC2g9omLRTqb5EKCdT+N1spEsV6IclJ9JJDxpeZQO3ZI5XqrtMOEwGvzUIAkM1/m pgfg== X-Gm-Message-State: AOAM5324yEyyZyXp6TNmOG2MJwl5UChNC3S1GIFE6el0oNQswXv3+y6f ty21zOgZhf8uB6souIp7GdqW8g== X-Google-Smtp-Source: ABdhPJwdjJVLISJrjw+l9k/kjDfejJM23BC4e/83AQdjpvcRDl0M+oTjFJtCYyvaeaWbj3inhNq3gw== X-Received: by 2002:a63:2a96:: with SMTP id q144mr1215444pgq.447.1599819796332; Fri, 11 Sep 2020 03:23:16 -0700 (PDT) Received: from localhost ([2401:fa00:1:10:de4a:3eff:fe7d:d39c]) by smtp.gmail.com with ESMTPSA id f9sm1610921pjq.26.2020.09.11.03.23.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 11 Sep 2020 03:23:15 -0700 (PDT) From: Cheng-Yi Chiang To: linux-kernel@vger.kernel.org Subject: [PATCH v9 1/3] ASoC: hdmi-codec: Use set_jack ops to set jack Date: Fri, 11 Sep 2020 18:22:57 +0800 Message-Id: <20200911102259.3667381-2-cychiang@chromium.org> X-Mailer: git-send-email 2.28.0.618.gf4bc123cb7-goog In-Reply-To: <20200911102259.3667381-1-cychiang@chromium.org> References: <20200911102259.3667381-1-cychiang@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: Taniya Das , alsa-devel@alsa-project.org, Banajit Goswami , Heiko Stuebner , Liam Girdwood , Rohit kumar , Cheng-Yi Chiang , Tzung-Bi Shih , Patrick Lai , linux-rockchip@lists.infradead.org, Andy Gross , dgreid@chromium.org, devicetree@vger.kernel.org, tzungbi@chromium.org, Stephan Gerhold , linux-arm-msm@vger.kernel.org, Rob Herring , linux-mediatek@lists.infradead.org, Matthias Brugger , Bjorn Andersson , linux-arm-kernel@lists.infradead.org, dianders@chromium.org, Takashi Iwai , Mark Brown , Srini Kandagatla X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Use set_jack ops to set jack so machine drivers do not need to include hdmi-codec.h explicitly. Signed-off-by: Cheng-Yi Chiang Reviewed-by: Tzung-Bi Shih --- include/sound/hdmi-codec.h | 3 --- sound/soc/codecs/hdmi-codec.c | 12 ++++-------- sound/soc/mediatek/mt8173/mt8173-rt5650.c | 5 ++--- sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c | 5 ++--- .../mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c | 5 ++--- sound/soc/rockchip/rockchip_max98090.c | 3 +-- 6 files changed, 11 insertions(+), 22 deletions(-) diff --git a/include/sound/hdmi-codec.h b/include/sound/hdmi-codec.h index 7754631a3102..b55970859a13 100644 --- a/include/sound/hdmi-codec.h +++ b/include/sound/hdmi-codec.h @@ -117,9 +117,6 @@ struct hdmi_codec_pdata { struct snd_soc_component; struct snd_soc_jack; -int hdmi_codec_set_jack_detect(struct snd_soc_component *component, - struct snd_soc_jack *jack); - #define HDMI_CODEC_DRV_NAME "hdmi-audio-codec" #endif /* __HDMI_CODEC_H__ */ diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-codec.c index 8c6f540533ba..403d4c6a49a8 100644 --- a/sound/soc/codecs/hdmi-codec.c +++ b/sound/soc/codecs/hdmi-codec.c @@ -698,13 +698,9 @@ static void plugged_cb(struct device *dev, bool plugged) hdmi_codec_jack_report(hcp, 0); } -/** - * hdmi_codec_set_jack_detect - register HDMI plugged callback - * @component: the hdmi-codec instance - * @jack: ASoC jack to report (dis)connection events on - */ -int hdmi_codec_set_jack_detect(struct snd_soc_component *component, - struct snd_soc_jack *jack) +static int hdmi_codec_set_jack(struct snd_soc_component *component, + struct snd_soc_jack *jack, + void *data) { struct hdmi_codec_priv *hcp = snd_soc_component_get_drvdata(component); int ret = -EOPNOTSUPP; @@ -720,7 +716,6 @@ int hdmi_codec_set_jack_detect(struct snd_soc_component *component, } return ret; } -EXPORT_SYMBOL_GPL(hdmi_codec_set_jack_detect); static int hdmi_dai_spdif_probe(struct snd_soc_dai *dai) { @@ -806,6 +801,7 @@ static const struct snd_soc_component_driver hdmi_driver = { .use_pmdown_time = 1, .endianness = 1, .non_legacy_dai_naming = 1, + .set_jack = hdmi_codec_set_jack, }; static int hdmi_codec_probe(struct platform_device *pdev) diff --git a/sound/soc/mediatek/mt8173/mt8173-rt5650.c b/sound/soc/mediatek/mt8173/mt8173-rt5650.c index 347b095d478d..c28ebf891cb0 100644 --- a/sound/soc/mediatek/mt8173/mt8173-rt5650.c +++ b/sound/soc/mediatek/mt8173/mt8173-rt5650.c @@ -11,7 +11,6 @@ #include #include #include -#include #include "../../codecs/rt5645.h" #define MCLK_FOR_CODECS 12288000 @@ -154,8 +153,8 @@ static int mt8173_rt5650_hdmi_init(struct snd_soc_pcm_runtime *rtd) if (ret) return ret; - return hdmi_codec_set_jack_detect(asoc_rtd_to_codec(rtd, 0)->component, - &mt8173_rt5650_hdmi_jack); + return snd_soc_component_set_jack(asoc_rtd_to_codec(rtd, 0)->component, + &mt8173_rt5650_hdmi_jack, NULL); } enum { diff --git a/sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c b/sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c index 06d0a4f80fc1..e53c6200d5a7 100644 --- a/sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c +++ b/sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include @@ -369,8 +368,8 @@ static int mt8183_da7219_max98357_hdmi_init(struct snd_soc_pcm_runtime *rtd) if (ret) return ret; - return hdmi_codec_set_jack_detect(asoc_rtd_to_codec(rtd, 0)->component, - &priv->hdmi_jack); + return snd_soc_component_set_jack(asoc_rtd_to_codec(rtd, 0)->component, + &priv->hdmi_jack, NULL); } static struct snd_soc_dai_link mt8183_da7219_dai_links[] = { diff --git a/sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c b/sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c index 07410d7afaa9..327dfad41e31 100644 --- a/sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c +++ b/sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c @@ -9,7 +9,6 @@ #include #include #include -#include #include #include #include @@ -350,8 +349,8 @@ mt8183_mt6358_ts3a227_max98357_hdmi_init(struct snd_soc_pcm_runtime *rtd) if (ret) return ret; - return hdmi_codec_set_jack_detect(asoc_rtd_to_codec(rtd, 0)->component, - &priv->hdmi_jack); + return snd_soc_component_set_jack(asoc_rtd_to_codec(rtd, 0)->component, + &priv->hdmi_jack, NULL); } static struct snd_soc_dai_link mt8183_mt6358_ts3a227_dai_links[] = { diff --git a/sound/soc/rockchip/rockchip_max98090.c b/sound/soc/rockchip/rockchip_max98090.c index 9acfd024aa5d..c8f1a28a92b7 100644 --- a/sound/soc/rockchip/rockchip_max98090.c +++ b/sound/soc/rockchip/rockchip_max98090.c @@ -12,7 +12,6 @@ #include #include #include -#include #include #include #include @@ -238,7 +237,7 @@ static int rk_hdmi_init(struct snd_soc_pcm_runtime *runtime) return ret; } - return hdmi_codec_set_jack_detect(component, &rk_hdmi_jack); + return snd_soc_component_set_jack(component, &rk_hdmi_jack, NULL); } /* max98090 dai_link */ -- 2.28.0.618.gf4bc123cb7-goog