From patchwork Thu Sep 15 23:10:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cheng-yi Chiang X-Patchwork-Id: 9334897 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 12E78601C2 for ; Thu, 15 Sep 2016 23:11:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E9B3129C77 for ; Thu, 15 Sep 2016 23:11:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DE5ED29C88; Thu, 15 Sep 2016 23:11:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 760A729C77 for ; Thu, 15 Sep 2016 23:11:51 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bkfor-0002XD-5A; Thu, 15 Sep 2016 23:11:49 +0000 Received: from mail-pa0-x22d.google.com ([2607:f8b0:400e:c03::22d]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bkfoo-0002Vn-W9 for linux-rockchip@lists.infradead.org; Thu, 15 Sep 2016 23:11:47 +0000 Received: by mail-pa0-x22d.google.com with SMTP id id6so20067527pad.3 for ; Thu, 15 Sep 2016 16:11:26 -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; bh=cIxyJsZIAB0ohy+8wKq9YhXWdKdiQFGV8tF3qcQielc=; b=HBMY5+GwQjxUhMC8BM/FhiU3juIZDj/orbvefnjJTD7nyhNWbFW0eg3yFB7+as2IGb lvetyNGAI7SelZ6GP+MHz8oDZ0Uhb4SNOWDrfO6Vyda8LPrflAMXtrnhDDVL6EGdbwS2 I6dD1P1AMQO6KY5uVt/Al/Yc2/MkWqp51AXZE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=cIxyJsZIAB0ohy+8wKq9YhXWdKdiQFGV8tF3qcQielc=; b=TbT9h74wUFB5MK1QiOEsjVMl3rehppeKfMzBcwEep/DtHcaOitWE+8kowLUncV0a9h waAtLUtgWfSYGKyZ9dPb8y5UdQV/Xoi4tBbnq6KbpoOhWwGqSiayaBkkayjvrcxMIOPR y0Qu/iOFOmMF2Hg6g4wMqANcGq5Adz/3LesBhWDZnT5+tr7iraaFsKYtl+KyW8YiRSH+ 9x/u9e8M+fs8s1CEQbGpJP0GAH8z5LFO895+IOBB4lmy8y4qm7xxpzx47+aeilKACCg6 BhIWvx+y/c05rNeDYgLE4ZNfP7pQsx9RKt2pJq7nwu7uSPIp6P/EUT/OmXAJRaAPnhPG AfLA== X-Gm-Message-State: AE9vXwNI2SeB2XHUvmpRIWc7+JBXndYXmAj8HTOnaGrDVeM2wv7Y3MYfB15ZtMxJe1d3Eyij X-Received: by 10.66.222.202 with SMTP id qo10mr18386523pac.76.1473981085931; Thu, 15 Sep 2016 16:11:25 -0700 (PDT) Received: from localhost.localdomain ([172.19.4.199]) by smtp.gmail.com with ESMTPSA id 70sm14587324pfn.46.2016.09.15.16.11.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 15 Sep 2016 16:11:25 -0700 (PDT) From: Cheng-Yi Chiang To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] ASoC: rockchip: Support headset button function on rk3399 Date: Fri, 16 Sep 2016 07:10:06 +0800 Message-Id: <1473981006-20542-1-git-send-email-cychiang@chromium.org> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160915_161147_107881_0B223728 X-CRM114-Status: UNSURE ( 8.97 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alsa-devel@alsa-project.org, Heiko Stuebner , Takashi Iwai , linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, Mark Brown , Cheng-Yi Chiang MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Set the mapping between button and media key event. Signed-off-by: Cheng-Yi Chiang --- sound/soc/rockchip/rk3399_gru_sound.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sound/soc/rockchip/rk3399_gru_sound.c b/sound/soc/rockchip/rk3399_gru_sound.c index 164b6da..ee06489 100644 --- a/sound/soc/rockchip/rk3399_gru_sound.c +++ b/sound/soc/rockchip/rk3399_gru_sound.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -209,6 +210,14 @@ static int rockchip_sound_da7219_init(struct snd_soc_pcm_runtime *rtd) return ret; } + snd_jack_set_key(rockchip_sound_jack.jack, SND_JACK_BTN_0, KEY_MEDIA); + snd_jack_set_key( + rockchip_sound_jack.jack, SND_JACK_BTN_1, KEY_VOLUMEUP); + snd_jack_set_key( + rockchip_sound_jack.jack, SND_JACK_BTN_2, KEY_VOLUMEDOWN); + snd_jack_set_key( + rockchip_sound_jack.jack, SND_JACK_BTN_3, KEY_VOICECOMMAND); + da7219_aad_jack_det(codec, &rockchip_sound_jack); return 0;