Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp163854pxk; Fri, 11 Sep 2020 03:26:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxt9/wrjTfK1XXDtYg6uTbe5E/ZlqL6I37rV1of6rbtEVCoSv+1Vs0k3Cm29+xLXMT+GIKS X-Received: by 2002:a17:906:7102:: with SMTP id x2mr1355292ejj.260.1599819962040; Fri, 11 Sep 2020 03:26:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599819962; cv=none; d=google.com; s=arc-20160816; b=EnaXKBJKXEP/VAmb9+vyFHtSX3XKKMXvmIL8U15kY8lF5PNMf+Oga90FdUTwhgvsUN fVZxavKxwKKC2pKh0noubL/MKNuhGYdGXSNAs45cn9E+LqHh02RVKZxnhOcFo2pcCmo4 H3yP7U9umxn/ZudVLSOkKAqQxljuo8vR6z3lFhdPN1KAvTbLncPfuZhFGhSdBwiw8mwG x1mZfc+TiBS5eT3MVcv6VETmLsQENZXkOOKFjWIhFg7nuGs7sOSajzWjyfH7M43DRgmW rXUmbB3phLaB6iU6Jrd9hUaUT8Ov63A9nCnojwbP35curGlysD2OtXkerzIODAj6BB1x toSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=kvYixO51YaoIO33ChNYvtKOsnVvLnU5BAv+BZxGwFTk=; b=thK3FAODtzJewyGu7Mr0ae2IsIYe8i88ylc9JI1Xg0At5Ymb6vwBsKl1rHXytgAG80 FYDJob+35CEjy0jTqGY/xjbYVPk/DZEepMEQ0o/YpIcgA+8poevQKjLcwu9ZmA1ls7A+ nF3vcQX9wrMcq6TweDMFg6ymUMn02SOvFiSP0LsI/AbNHa1SrxSKQ/KwnrYY57jtKLJ6 n+1Mie5nQuXGY/E916FBw3tvJWUHyzUz8T6HScsYTsQjeuRZKca9imWtUQXKmOSRX502 fGKD6DeIFW7d8TShU3XyqUl/WAq7q7roV3Y7/ASif31Csmscg1wxWfwYAnRAF5xJQgNt j/8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=GSWpdAds; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t2si993492ejj.264.2020.09.11.03.25.39; Fri, 11 Sep 2020 03:26:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=GSWpdAds; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725898AbgIKKXg (ORCPT + 99 others); Fri, 11 Sep 2020 06:23:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725863AbgIKKXR (ORCPT ); Fri, 11 Sep 2020 06:23:17 -0400 Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28A23C061573 for ; Fri, 11 Sep 2020 03:23:17 -0700 (PDT) Received: by mail-pf1-x442.google.com with SMTP id o68so7109325pfg.2 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=tvu1vWuBux93M9JdP0eZJsRO2JsHrgXwfufEMllWbdWiwKBUUb1UkxmRpW8uexe75o ih4FKR9BglEsW3SGDe0sQLPgcULTrvuTQtqTN8H7qn5d/X42SV7W90RH3MZFlwzBIv4V tjxw2kdHrg1Tv1D1oaZor0nEzCmJZeg0yITei1hV9UBQg200dtwRq0yOST7bQMckjLg5 LMCJ2Q0Va/LViYXx+daLy2F9AXtaGeAB01otdes+zbZienipFgkNmmoL9dCMvPxcvY96 VOQvVI63DohW7xoLFQNesrowme79UpdW9mTxH98MQ5+kqn2HkFLio6ALNLGKYQm66vDd crZA== X-Gm-Message-State: AOAM531Qt75JeQtN8XBQQNCXKXr6Jftg5pSUSJdliA6tGeaTIXUmfiTo 05DuTtPtuOLs8rpcy5PDAvvLrgi/XsI8O1Hf 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 Cc: Mark Brown , Taniya Das , Rohit kumar , Banajit Goswami , Patrick Lai , Andy Gross , Bjorn Andersson , Liam Girdwood , Rob Herring , Jaroslav Kysela , Takashi Iwai , Srini Kandagatla , Stephan Gerhold , Matthias Brugger , Heiko Stuebner , dianders@chromium.org, dgreid@chromium.org, tzungbi@chromium.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linux-mediatek@lists.infradead.org, linux-rockchip@lists.infradead.org, Cheng-Yi Chiang , Tzung-Bi Shih 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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