Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3093526pxk; Mon, 7 Sep 2020 03:02:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQ6o/CLATVI44lPyHMmLjIc+GYMCISBI7+jI4UM+7cvIECNOlHYlq3derfOjTXkgB+lZGu X-Received: by 2002:a17:906:a256:: with SMTP id bi22mr13537294ejb.375.1599472964239; Mon, 07 Sep 2020 03:02:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599472964; cv=none; d=google.com; s=arc-20160816; b=TYG76Vg70eVUSJ/Kgjc/wrJnur1SbWxjt5NBJS+YMD/MLUkfcZHdnJjtxFvRWTbOp4 /5OtRBKRCOCWteKEdxhgpVwe7xkBBpZoGneOtQ2fDcyDACrWQq/7zME6A4KVEROmQRjb 9glWJ6svySor/arYRuyiTOB40Ll+cOfFx1XkXkjQvPhQovdDccoMC3vedCRn7uhQbX56 0tqxG5OirUm1K8mMg4+apc3SkrxtrykIg5nd8PymREeL+eKqGGob05Wjsq7G5rNCKecv T2LK5XFWdjlhwdDnL6XkSiDWY4gctUiFBbQtTYOpRRbfV9QiOTEbiQ4yBqb8j/xgtaq9 Xo9Q== 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=2nWlloeWe4+nv6hVrTbPWUl2P9w8K0JESAZLCRmELVU=; b=RhvlthpoCt207X0fQAFgd+9r028BL8g4Kk8ah4tkQLxOSaem6Dy5l9KpGh9KFU8vmX r5ZGxQsgnA3u9+LjjEROe9SdQKklK6WmTo5P2S8Lpo+eSJ0PTSyNPQcP3elAXpU2dJVT YGbgeRZMzudBV1s2IHqm7llyPlC0NpwMGgs0LYp4ypy0r8M+/saNzTx+zjCwqor68oc8 p68N6nWKxn8AfS8O1rRrIdjRnlFH1x4V9A02vzGqeaQSrEsgBSf1blQ8Na4Tab8NCex4 6nMVwXtuoGzEKc+miTwJsIQge2r4wP+hKl+9TbCLZy63olu5f1F7by3s1mEfHoMJQat1 i8CQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="ZSFhT/G0"; 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 g12si9366555ejj.277.2020.09.07.03.02.21; Mon, 07 Sep 2020 03:02:44 -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="ZSFhT/G0"; 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 S1728598AbgIGKBG (ORCPT + 99 others); Mon, 7 Sep 2020 06:01:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728395AbgIGKA7 (ORCPT ); Mon, 7 Sep 2020 06:00:59 -0400 Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2C8FC061573 for ; Mon, 7 Sep 2020 03:00:58 -0700 (PDT) Received: by mail-pl1-x641.google.com with SMTP id j7so1445185plk.11 for ; Mon, 07 Sep 2020 03:00:58 -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=2nWlloeWe4+nv6hVrTbPWUl2P9w8K0JESAZLCRmELVU=; b=ZSFhT/G0q2ZaK8YsX7jmEYkhDH+k8OV7xGmjBtvpTzk3L39iAumjSbh4Axz8veUrI1 zbtz8cidopzd53DfFCwBiLaW9GeSIXA49tQhOlPKtK30jJV2Yg7j72ll/sD1XJfplKrS AxpoKTS6ly9EvBwPZ/5OZ+U4tj7GTMQmaAlDU= 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=2nWlloeWe4+nv6hVrTbPWUl2P9w8K0JESAZLCRmELVU=; b=WIIccAGdXxtzFZ1FLqdiwnvbPFo8RQLF0reyeYlt3pJeOJw/6IVijrL6IQUdokVRAT tW4+5/aPLKIe6tndgoHHgcDBlfFMktNUXzq0v+lrQur+HNzBb3AlXYok9IY5dzksaITy Ud1QCCZhZCm8u/rNp8DVrusDpAt2nGih3lP4ocTGaI+W917AzdLAzT7TOcyekYQsZl25 h+esSOoCmDF82nuB83lsZIIzNnC703DBxMZhUGQAHBGk4GPpe98/I+gFnPb0qZez5iY/ KJ09sF4lucripge8cLycroDX6EbD3XaWYh3lSgtdp+oHmXQJEya2QCXObIuiIwWov0m9 crLw== X-Gm-Message-State: AOAM532dHOh36XTI6FBl/y1fGzZy27lgIdWyg1sWFvI5BWX3ZaSa0KbG aHWPYEe91cFu2IAk3QnDScB+091OC2I9WHVx X-Received: by 2002:a17:902:d709:: with SMTP id w9mr17541295ply.117.1599472857215; Mon, 07 Sep 2020 03:00:57 -0700 (PDT) Received: from localhost ([2401:fa00:1:10:de4a:3eff:fe7d:d39c]) by smtp.gmail.com with ESMTPSA id g17sm11882180pjl.30.2020.09.07.03.00.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 07 Sep 2020 03:00:56 -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 Subject: [PATCH v7 1/3] ASoC: hdmi-codec: Use set_jack ops to set jack Date: Mon, 7 Sep 2020 18:00:37 +0800 Message-Id: <20200907100039.1731457-2-cychiang@chromium.org> X-Mailer: git-send-email 2.28.0.526.ge36021eeef-goog In-Reply-To: <20200907100039.1731457-1-cychiang@chromium.org> References: <20200907100039.1731457-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 --- 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..d1de5bcd5daa 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_detect(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_detect, }; 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.526.ge36021eeef-goog