Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp987745ybe; Thu, 19 Sep 2019 07:02:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqyx30EEDTHq7c6Q3YCpMJUtEOmDbHlqPbMyq38Zpy+OeSOYwORYKZ8fuKBNZI5HIJmGuInA X-Received: by 2002:a1c:a8d8:: with SMTP id r207mr2962223wme.135.1568901778460; Thu, 19 Sep 2019 07:02:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568901778; cv=none; d=google.com; s=arc-20160816; b=orLNEtW05vIOQiJhvkYJFQVKzjcUQ9O1cNI5+uzE5zzqm7zSZgCV5NVJhpx90YChso 54+bFtcfXwcYnr12/TaeNXCaIRuWf8PUjTHwwEosTNIFTC9Lz6HERNhznLGEUdvc4ryy 1py5MfIiEhWlo1LglEKsKOTAn1FIDWZEu+NHv+0/HDA4ZWTfWQfkWOfgWnRXiR/x4c0M vwv9ELyg8L3wc6c98H3H3o4JEp3MKD3oRUQwIXAy+0ecU4QPRYswOd9NsbjS0kAfMk9/ JGTPJQ2g2hE98r9EUWJpow8NbLe4U960DuWQckzpG6on8jWJ+XzK/+ZzB23eXwuww1TR vReQ== 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=YvltAwcazfPUXLVaME+JgA9zHiL2aoA68dvUhBxJ+k0=; b=Qy7mbT6c/WJYEDpRddFaSKSSkjF9xysfr+jjRflVF/QJCgWG112vLYCi1/T4W3MjzY IZ1ttO6vtyIcqoW8Kwx1Ygi5lMvleVyuBkhqdjiqwHkVcvIC6aDQpjdtWTlGpZFk9d5y y8fM5vSHsX41QGQrCsYqdz3iJqBRdjdGjAMgU9VRBdGJ6EbECSAB9xjfQEUXvBdmq7/d mJRV6ohIqZqg6Fn88LpbO0Y1C8yJi1hH1x65Ak+ysc5gP+ZfrqizrbMv/vnYaLP2YMTC ZpTj5pMqD0XRvh9g7EJlaLfC1Rh/UaBjceZmORtRBXjG/FkWhda3aJbzjyJ6rGFsY/7c jpmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=VvascM4p; 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 a33si5569938edf.121.2019.09.19.07.02.32; Thu, 19 Sep 2019 07:02:58 -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=VvascM4p; 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 S1732386AbfISNzp (ORCPT + 99 others); Thu, 19 Sep 2019 09:55:45 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:42640 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732376AbfISNzo (ORCPT ); Thu, 19 Sep 2019 09:55:44 -0400 Received: by mail-pf1-f193.google.com with SMTP id q12so2387048pff.9 for ; Thu, 19 Sep 2019 06:55:44 -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=YvltAwcazfPUXLVaME+JgA9zHiL2aoA68dvUhBxJ+k0=; b=VvascM4pkKU4F95ti9Bl2ciow4VSlKqVRkoSZam4Zy8pNf/KevJdJe7PbSc5A8Vbei 5rjN7aU8GqL4jAo2r4eOUtchAoARXaF/M/SDOimb4RwY4uw62x+wPKDT3kX7ps/g8kyT nKD1WRtYLJOSDO6M0MwbYowZ0jXZKtt1qrzFM= 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=YvltAwcazfPUXLVaME+JgA9zHiL2aoA68dvUhBxJ+k0=; b=N4+RTulFgTi5GYXLQ+3+JhuzdkQ7ZS+i331CPNvgsIj6+KHq2mDp/lJ2LIKQQZ4sq5 an9YYG5FJnJIDEjsHUIkJkj3sfPEPZzNButLwqhutfaM4iKvLQp/ffPXoHC1BXjzxTFr FGSjJMmdoAcl1o3AtblQcZD0zU6VqbEHNGadM+WX2nVrGoxcjCYsweP4sJe96TOkEda8 GeK2tj8VOaRTc9KJWDpV+JRGUUbE6LAdXIAkjQvD3Cf9ReRsOWrScebjtIcMrNXx8ynB nT8r65IZipawLfElGOGTyEMgPIrqNSMjHvnNuUgzkIPCEXOkxTgo+5NkGKp/97M/J7Pr LKZA== X-Gm-Message-State: APjAAAUswVMxH4qJ+jgKZBaHabuH9xAsbsg8vMIP3UWJBtqJTfqdJpQu bs1JUq3RU/QbseiI1yn6K+iJCRtL58k= X-Received: by 2002:a65:4189:: with SMTP id a9mr8987692pgq.399.1568901343986; Thu, 19 Sep 2019 06:55:43 -0700 (PDT) Received: from localhost ([2401:fa00:1:10:79b4:bd83:e4a5:a720]) by smtp.gmail.com with ESMTPSA id j16sm7633402pje.6.2019.09.19.06.55.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 19 Sep 2019 06:55:43 -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 v7 4/4] ASoC: rockchip_max98090: Add HDMI jack support Date: Thu, 19 Sep 2019 21:54:50 +0800 Message-Id: <20190919135450.62309-5-cychiang@chromium.org> X-Mailer: git-send-email 2.23.0.237.gc6a4ce50a0-goog In-Reply-To: <20190919135450.62309-1-cychiang@chromium.org> References: <20190919135450.62309-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 6c217492bb30..11cf252e8391 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