Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp6386639ybe; Wed, 18 Sep 2019 02:36:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqx22b3zF+xjB49cCLg76yex4iYaBtuwPEkSkUp7vxjsXIcc+8mBUfQJvi4c8oJHuLZpkQ/L X-Received: by 2002:a05:6402:65a:: with SMTP id u26mr9158000edx.86.1568799402230; Wed, 18 Sep 2019 02:36:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568799402; cv=none; d=google.com; s=arc-20160816; b=0lK6Dq/A3QO1O95XT1aaAkFWEbYMqLH7UK46n2+L0eweqqPeZNsT4l1BPYCg05mEVG MScjzNGy9LiOxFhWw6SaIXepxRXPXhY4XyJR22q3qdTm7uY/e/WWuJRgrdQV7Kch2JAt h+ypO4l1lO803Spb/Gw4JzACE5oC6/NuJbnryCJGm2mPBUGKpVRV0gdFPvoVHDjv5yaU OIdcUVNR05rdV0gFCoytTi8sK508n/h/BDSBCEtolQjOHPTh/NSeM45sGtZblFEwrvJ0 VtgHZVB/e26oRlxTHNjYTN0sinnY5q5m+4hTnANJNh9Z7lQZqmbPHjzz0hwsfPcAsmbM l4LA== 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=58QuMxmjHlqsWVtyFBQnvBpwo6+B1q1GdfYt1s4m2qE=; b=Q8qQHZK/ALpCm7Mdda+3uTtAy87fE2J8/gaqGEPilYRhv44poi+eFVlzhxvSSXD92U dJNIMKIaP0/0GzNqa/VPqPKnzjbevOXqfDGaFqZA9NLZruwHd565xt4W2EQvRGu7lqs/ hoZ1SIejqKng2lPjv5hVAnHNm1Zqyvi82kFddhizbVLfgYM5XXJw3Ajo4/Hvfumgmllb Cm9aAM887/hUe9StTwIa0kPSxLh147YO6QSyTSlrAm/igvdhGhf8HwhcT0/Shp+gxcOu 8Vf3ZC4LRgsXNRXYgq1V6WgtGLPUEQ4R4Wm+vpyNScvN7QWmOq1Ufx5htoeZ0XIXLws8 L5EA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=QTaH6GH5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id f4si2922015edf.6.2019.09.18.02.36.18; Wed, 18 Sep 2019 02:36:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=QTaH6GH5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1730323AbfIRIZy (ORCPT + 99 others); Wed, 18 Sep 2019 04:25:54 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:39415 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730256AbfIRIZx (ORCPT ); Wed, 18 Sep 2019 04:25:53 -0400 Received: by mail-pf1-f194.google.com with SMTP id i1so3876370pfa.6 for ; Wed, 18 Sep 2019 01:25:52 -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=58QuMxmjHlqsWVtyFBQnvBpwo6+B1q1GdfYt1s4m2qE=; b=QTaH6GH5UguvXVEDbNSlyuomPAH87bYVOWqCH6McKhsGTYK/xYVHQgKnh5a5Tw0WNQ e1ZPFnuD/Y0yn4S2mKnoxDRgTiB9Z50mHQ31aQMtM2MYHFdO9az/vg2dsYmvd6pDZ634 kY66oETu+TYVAH5TtMe6QmFRkiCAUAqTvr8BY= 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=58QuMxmjHlqsWVtyFBQnvBpwo6+B1q1GdfYt1s4m2qE=; b=KQzx65f+nGEhJVxJUvTpfSw2/CeQ1A9SUifZqJJmLNjgak3ukgAJkMsO5PUIRRioKe cMr9H1TIlRfGxA+3Fj9inKvZKHohQJfsqTiYQAAypSLE/6Q+QTXDAWY+JRgkQzmfQHHb RWnr9F1KCCexzFkebicCA/K1YeYWmAUzikSKEX2wa84lwODoGgR94vXoMqzQ2GCvMTVm 1CzE1c4kejT4XwSrWFBsNomLyFUnj7uA1pofc3ivOAe5OhfikgdzIfGODNYXfFLcxB6X tXu3vwMCC6iPQScAuvITi2mxaevUaQwftpNpukX3A5zOMofxrd60y3q1tSWF5/1n+pSQ DKbA== X-Gm-Message-State: APjAAAU54qTIHF8OFUSM/546oAxhZ2YoWfrOFosYkOMcisyiAGVkl+Az bYxxMeLj7lw1hom0+N1ZjTr1zGwAlsw= X-Received: by 2002:a63:1a5a:: with SMTP id a26mr2870744pgm.178.1568795151570; Wed, 18 Sep 2019 01:25:51 -0700 (PDT) Received: from localhost ([2401:fa00:1:10:79b4:bd83:e4a5:a720]) by smtp.gmail.com with ESMTPSA id v44sm13357519pgn.17.2019.09.18.01.25.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 18 Sep 2019 01:25:50 -0700 (PDT) From: Cheng-Yi Chiang To: linux-kernel@vger.kernel.org Cc: Neil Armstrong , Jerome Brunet , Jernej Skrabec , Jonas Karlman , Hans Verkuil , Mark Brown , Liam Girdwood , Takashi Iwai , Jaroslav Kysela , Russell King , Andrzej Hajda , Laurent Pinchart , David Airlie , Daniel Vetter , Heiko Stuebner , dianders@chromium.org, dgreid@chromium.org, tzungbi@chromium.org, alsa-devel@alsa-project.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, Cheng-Yi Chiang Subject: [PATCH v6 4/4] ASoC: rockchip_max98090: Add HDMI jack support Date: Wed, 18 Sep 2019 16:25:00 +0800 Message-Id: <20190918082500.209281-5-cychiang@chromium.org> X-Mailer: git-send-email 2.23.0.237.gc6a4ce50a0-goog In-Reply-To: <20190918082500.209281-1-cychiang@chromium.org> References: <20190918082500.209281-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 In machine driver, create a jack and let hdmi-codec report jack status. Signed-off-by: Cheng-Yi Chiang --- sound/soc/rockchip/Kconfig | 3 ++- sound/soc/rockchip/rockchip_max98090.c | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/sound/soc/rockchip/Kconfig b/sound/soc/rockchip/Kconfig index b43657e6e655..d610b553ea3b 100644 --- a/sound/soc/rockchip/Kconfig +++ b/sound/soc/rockchip/Kconfig @@ -40,9 +40,10 @@ config SND_SOC_ROCKCHIP_MAX98090 select SND_SOC_ROCKCHIP_I2S select SND_SOC_MAX98090 select SND_SOC_TS3A227E + select SND_SOC_HDMI_CODEC help Say Y or M here if you want to add support for SoC audio on Rockchip - boards using the MAX98090 codec, such as Veyron. + boards using the MAX98090 codec and HDMI codec, such as Veyron. config SND_SOC_ROCKCHIP_RT5645 tristate "ASoC support for Rockchip boards using a RT5645/RT5650 codec" diff --git a/sound/soc/rockchip/rockchip_max98090.c b/sound/soc/rockchip/rockchip_max98090.c index c82948e383da..c81c4acda917 100644 --- a/sound/soc/rockchip/rockchip_max98090.c +++ b/sound/soc/rockchip/rockchip_max98090.c @@ -134,6 +134,25 @@ enum { DAILINK_HDMI, }; +static struct snd_soc_jack rk_hdmi_jack; + +static int rk_hdmi_init(struct snd_soc_pcm_runtime *runtime) +{ + struct snd_soc_card *card = runtime->card; + struct snd_soc_component *component = runtime->codec_dai->component; + int ret; + + /* enable jack detection */ + ret = snd_soc_card_jack_new(card, "HDMI Jack", SND_JACK_LINEOUT, + &rk_hdmi_jack, NULL, 0); + if (ret) { + dev_err(card->dev, "Can't new HDMI Jack %d\n", ret); + return ret; + } + + return hdmi_codec_set_jack_detect(component, &rk_hdmi_jack); +} + /* max98090 and HDMI codec dai_link */ static struct snd_soc_dai_link rk_dailinks[] = { [DAILINK_MAX98090] = { @@ -151,6 +170,7 @@ static struct snd_soc_dai_link rk_dailinks[] = { .ops = &rk_aif1_ops, .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS, + .init = rk_hdmi_init, SND_SOC_DAILINK_REG(hdmi), } }; -- 2.23.0.237.gc6a4ce50a0-goog