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: 9334899 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 4D69D601C2 for ; Thu, 15 Sep 2016 23:13:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 30BFA29C6F for ; Thu, 15 Sep 2016 23:13:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 258C929C77; Thu, 15 Sep 2016 23:13:45 +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 E370229C8B for ; Thu, 15 Sep 2016 23:13:43 +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 1bkfov-0002XK-Dl; Thu, 15 Sep 2016 23:11:53 +0000 Received: from mail-pa0-x231.google.com ([2607:f8b0:400e:c03::231]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bkfoo-0002Vm-VW for linux-arm-kernel@lists.infradead.org; Thu, 15 Sep 2016 23:11:47 +0000 Received: by mail-pa0-x231.google.com with SMTP id wk8so20049836pab.1 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=Pki8h0HeZEYEI/tRz5ZQzIYO8ITkaL6rOIXLr8JW+PjpBLvS8aRSR3KVWlc6yguJaK Gdo5Ae7IXpHH2hC9aChhJW3Bh04uE5fPEivQE0qvNskIdN4Rb3AA4ZwXTpYbbY057IHg 57kbdalYxupOeffz++CzYrwi+wF4nNf4BBGXX4zawN4EFPNbjS39dct7fzaQoJ7auxB8 eRAX9Sv3XE/bBoMZj7gqIUV2LFJMFbCyP8F9Qww7pgMZ2xkszFitv1CgVRe5d9+Lis44 iD1mxdVnwt9EPXfiUR6vCGjNzO4xnizgJBqXl94If/LWj9QcbvdS69lKVfZ7MEbFBZbh 0d6Q== X-Gm-Message-State: AE9vXwMlqjSFVyXkvBNp3NGjZvwiNmmX0FIq5vGwNOtoo/2EIWIOF0X3zoSBby94t/7WJOoT 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_100257_C813A920 X-CRM114-Status: GOOD ( 10.40 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: 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-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=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;