Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2875887ybi; Thu, 4 Jul 2019 21:29:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqwLObl9gIvJgkAVUXAWW2yMi/sxooxFhDX0ZKDjF0FHdphYSTgQI/U+adlLyTEk2VS529f6 X-Received: by 2002:a63:2cd1:: with SMTP id s200mr2356008pgs.439.1562300999673; Thu, 04 Jul 2019 21:29:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562300999; cv=none; d=google.com; s=arc-20160816; b=hDEc+Q5FHJ8qYRyTV7hQke0X32h5lEfs3zpSpZTjWFHgf7kmWZZK6hyR/Og4M5b+Q5 +LgWZRTV8iTQcO/vRSMRvS+iL6ZpF+knhqxDKj7++XNIpExbbLTiYnKnD2jlccwv+gGK w98pcn1VVwJeOebRdNYkc4OHZytZlr7OEil+HFwcmqrzurxjWYbUu12D9ujkpsXu2TSO uLrPyxS2EwRhaombK7cncYc9V76CgZdgI8gfUzMW8NlNtTlGzcvjOdwEeAQ1MmWEA/I3 m2K13X/wenU15bUTrGYocQJ8Y8OJoBTC8jKc+eGgFI5JeQqSdNHQTsczEgIgFjiU8k56 GfGg== 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=Mt+OhzkdZXuABUeOm3oIQQxV+A0uMRzmq60uCRJmAJE=; b=C9g69LwjC05v6QwVrJ2NYujEJ+vfXLTIZThC5K9ADjJSjx8bB39vawGA9L9ANHcIRi 45c/oDDCB4anGf4ABoH/BbyOtz1PoKLat7VoWZkBvFTD5QYHh/sufidArbjTTjzONe/t 2cktBFNvzvbQ1yOb19I/K4OJJZ8sEBPHC1SkiWW8L1rZ01bevPnGGkzU5py1JaGw/PlK hjx+SnNiyhZvCnovW+GKsfwy3rhNhFULrEsM3U2gagCDavRCd44GM5BKMAusDZiXRd+0 BopEeCXqXX2hkuS1t7efpesYH4TcCJwLT5o2Lfaf9w4jtY2aOS4ai6GM7IgrLRDPxPeN 4DEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Hbexc+aC; 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 j71si7383368pge.50.2019.07.04.21.29.44; Thu, 04 Jul 2019 21:29:59 -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=Hbexc+aC; 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 S1727547AbfGEE1E (ORCPT + 99 others); Fri, 5 Jul 2019 00:27:04 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:42379 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725497AbfGEE1E (ORCPT ); Fri, 5 Jul 2019 00:27:04 -0400 Received: by mail-pg1-f196.google.com with SMTP id t132so3685719pgb.9 for ; Thu, 04 Jul 2019 21:27:04 -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=Mt+OhzkdZXuABUeOm3oIQQxV+A0uMRzmq60uCRJmAJE=; b=Hbexc+aCBum/RZ12dI3r5/XyzyiK+MvJQgQ2XO3/HVioP3PM/nCddAlz1xrMohN7M1 S0TUfchH1at/5Y1i17XhZAcSUqCKCip2aybO7YsuTVjIwJXSYImaa+d0n/+JHH0FYNkL NI0/aW8eXuQCvg6kpGPrNaIfIBqJ7QUDBMvFM= 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=Mt+OhzkdZXuABUeOm3oIQQxV+A0uMRzmq60uCRJmAJE=; b=FtaXE/yQEiSDhqispDFZYWqn6WF7cMbVUXeqt5cij0AgEQGP88P2koWJvfMv69mmYb NqPzd7YlcmuLXUFxB2SH4tPhPNePWx0zVYtCgO3cNd1euUfHVmrMbLc6wawEULX2xl9f G2hMl2QJwWVdw9cWcp6brchgY6uQDaGyZgxVluZzPv22uXiHed79961aSZ/75vyyZTc/ jCbGqpWLTkRDroYdyI25jXFlFvBit1bVM4PgqmFb5r+6kmwKjCvpB2XvzkbBOEW4nl4B Cs8keeDa3mNqtBxw4jawkjz++TrA5A+3GwaCujULM14S/MI1q88aOeasT4/UFlTlSzJu l0Bg== X-Gm-Message-State: APjAAAU8+njoTh0Qgms7M5GK8rUsWj4j7rCPVQz7sYImKUaZ2SYQ3W0H kt3n0s3Uf8kvTljYfpaeg+fuA7JmRX0= X-Received: by 2002:a17:90a:8d86:: with SMTP id d6mr2081909pjo.94.1562300823498; Thu, 04 Jul 2019 21:27:03 -0700 (PDT) Received: from localhost ([2401:fa00:1:b:e688:dfd2:a1a7:2956]) by smtp.gmail.com with ESMTPSA id t10sm6811920pjr.13.2019.07.04.21.27.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Jul 2019 21:27:02 -0700 (PDT) From: Cheng-Yi Chiang To: linux-kernel@vger.kernel.org Cc: 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 4/4] ASoC: rockchip_max98090: Add HDMI jack support Date: Fri, 5 Jul 2019 12:26:23 +0800 Message-Id: <20190705042623.129541-5-cychiang@chromium.org> X-Mailer: git-send-email 2.22.0.410.gd8fdbe21b5-goog In-Reply-To: <20190705042623.129541-1-cychiang@chromium.org> References: <20190705042623.129541-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/rockchip_max98090.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/sound/soc/rockchip/rockchip_max98090.c b/sound/soc/rockchip/rockchip_max98090.c index 195309d1225a..c0e430ca4d12 100644 --- a/sound/soc/rockchip/rockchip_max98090.c +++ b/sound/soc/rockchip/rockchip_max98090.c @@ -15,6 +15,7 @@ #include #include #include +#include #include "rockchip_i2s.h" #include "../codecs/ts3a227e.h" @@ -129,6 +130,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] = { @@ -146,6 +166,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.22.0.410.gd8fdbe21b5-goog