Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp8839367ybi; Wed, 10 Jul 2019 00:11:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqyd0T/YuLr2BYcKjqYGrgavRmTkcbBMvT/99tGTL/FvnG+D1B4VFexgp0YRfSgvXL7QHUpe X-Received: by 2002:a17:90a:9bc5:: with SMTP id b5mr5138681pjw.109.1562742659977; Wed, 10 Jul 2019 00:10:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562742659; cv=none; d=google.com; s=arc-20160816; b=zR01iG49e+uAginxsybeDoP6qkMsjODx26pR/o/VyRfK5nmo3u1AzGNEkZrqXu/WDB aJJjnpv0bKcZhvlLH9/lLHDbnMkWe/PyzNoRwTVFuwOb+ZsGbY0VOjCqPbHYEbysC1Kv GI6RGBAWHamdasD4wojimKlA2Z/v+DwJiFHCRgr0ZFTp80gkvhZA4eGW9FSU27y94kHt Lp9/oVrCE29Nn4byPX2k+Jj+MYxddP4C4jp7XT7ie5qrQVA87TphtVFWPZvnHMif3GD7 MRJ/fXTMnaOWzeCkq11e8d/aw1JMDZCPE6Eq4e0Lrd/a8cPRWTcljIX+OFX8luziSlxp g40Q== 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=opTBgfSTSFi3V1ce9YlYEnYQO/1kKdgFofPaGYJTBOY=; b=QpdZNdWgt/K9aGnILhenWTAj0q4h7mA6Y5OEOMV31paBE2SxL4FlLOHrZwmg4k9Uii jnWccTRgoYSmS2PJ5rjSL/dMbXWv8XwKWfoMMAH76BQTCmaWdTeebttRUPfwb0rHibvI 7d/sLARjnadMs62LfGWBiETdQw+wbpyYgegsPxR0G2k7rZbyey+NY0BHo8f/pEe4yS6l Aa3rsJgXvOqBu/UNK5JbNHXYzZy+GROKLOpdB7LV1aE1/T8eMySXkRXkEDPJOcn8dIme XLsD7Qy/bD8zl36WUvrYv6nL+p43Ha1Jx2SFFe3wENI0/HvUQzr6Nm8QUSXVe096RPsg FTTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=RjICyuOq; 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 a63si1354703pla.348.2019.07.10.00.10.44; Wed, 10 Jul 2019 00:10: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=RjICyuOq; 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 S1727101AbfGJHIy (ORCPT + 99 others); Wed, 10 Jul 2019 03:08:54 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:42714 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726098AbfGJHIx (ORCPT ); Wed, 10 Jul 2019 03:08:53 -0400 Received: by mail-pg1-f196.google.com with SMTP id t132so757170pgb.9 for ; Wed, 10 Jul 2019 00:08:53 -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=opTBgfSTSFi3V1ce9YlYEnYQO/1kKdgFofPaGYJTBOY=; b=RjICyuOquidt6LyqOASElFqobDNn4mo6EWt1hQsD6iwRx26+bMSTRwY0lCmMrVaHSG 6a47JWfUcXiJfqoCtNQ7lq7rjKXQcz2UUkE2pHMU2JgLeyFB7HyoZ+a4e8q03awEvrPl 4wQTV2TDpVxnBFrbqJ7OGM83LJNpTu4ZxCalU= 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=opTBgfSTSFi3V1ce9YlYEnYQO/1kKdgFofPaGYJTBOY=; b=I7MnTbz5sniFwkqV1Mh6OwO9e552ihQ5EcKlaktUK3mYS6ZRMwTnaSsk35Sr2xjgdc 7CTeiK8RxIt6N58WsCBlJf6uGcQlyrzZHKAyPmAb/MxooTLFX1NBd/8d/Xzwtw7ZJw5I 1vaWPd1U9tQOdt6p3l0KlrdvA/3ewZFoiwbHBFkZLZPPB3CzT/ZczU3N3BpIwPKSo5K6 2KRQNLE4+RdO+cNcECDxIZlMjLSyNmnx4UAQWYq3UKZEIoD+B1XxVHdsuQR39VNoPKDf XFawhx6adtT4M9KZO8+0us9E1cSfmH9lWDJFIrlrjq/msmdjZg2pcych5jq56eY/s6rE ZfFg== X-Gm-Message-State: APjAAAWLLqXmW7Yo20+6MinBl41DGtnCFyJQsP2FiywA85hlds+EglR3 Q3fO0ho2y7XdIxKG2fQOQTCUpJlhgDc= X-Received: by 2002:a65:4045:: with SMTP id h5mr36503650pgp.247.1562742532604; Wed, 10 Jul 2019 00:08:52 -0700 (PDT) Received: from localhost ([2401:fa00:1:b:e688:dfd2:a1a7:2956]) by smtp.gmail.com with ESMTPSA id b36sm3319370pjc.16.2019.07.10.00.08.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Jul 2019 00:08:52 -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 v2 4/4] ASoC: rockchip_max98090: Add HDMI jack support Date: Wed, 10 Jul 2019 15:07:51 +0800 Message-Id: <20190710070751.260061-5-cychiang@chromium.org> X-Mailer: git-send-email 2.22.0.410.gd8fdbe21b5-goog In-Reply-To: <20190710070751.260061-1-cychiang@chromium.org> References: <20190710070751.260061-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 3617012692ea..177c8a7ec8de 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" @@ -133,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] = { @@ -150,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.22.0.410.gd8fdbe21b5-goog