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: 9334909 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 4E54660839 for ; Thu, 15 Sep 2016 23:26:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 28F1229C62 for ; Thu, 15 Sep 2016 23:26:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0932129C88; Thu, 15 Sep 2016 23:26:02 +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=-1.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,T_DKIM_INVALID autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0D6F929C62 for ; Thu, 15 Sep 2016 23:26:00 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 44FB6266E7A; Fri, 16 Sep 2016 01:25:59 +0200 (CEST) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 2445B2666BB; Fri, 16 Sep 2016 01:23:41 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 4BD802666EC; Fri, 16 Sep 2016 01:11:32 +0200 (CEST) Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by alsa0.perex.cz (Postfix) with ESMTP id 07E2B2666BB for ; Fri, 16 Sep 2016 01:11:26 +0200 (CEST) Received: by mail-pa0-f54.google.com with SMTP id id6so20067523pad.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=BGJ3MSeZdD9gTnf1C2Gjx9AOVlPmzmKPLSRpyb7c0SmNpw+GBNaxNv6u/vJ1j7g1uV WZdJmRtflQjKdoQnmdTl0bTMu9P0h6ERuCaj8qZUDIq/Pzp6dbf7NIjAJfYWKFkwa9vG MOXMUeqZObygO6lSkcFxPTrcXqOl9ghGTcznFr6ZcQZNMokX/ZoQ30rxTdZEZREPC/TX 0y+Ss+u1ZiuETkkaXgv8CmUtqc/7AzcB6ch7Y+y3AKqvByGJvhp+VKY/amXrQgmV/z1x oE3spcIhUF+ewJNWN690FOE4c1TGUzUoBwe2RCDfO7Uqa35IbojDFqv5btPQ5ifenAY8 /RTA== X-Gm-Message-State: AE9vXwPeuryodJt56TmSpnhzoFZP4g+JQCGytjxBslIEM4BnW01FT9ocTCufl4Yl1KpTpojS 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 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 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 Subject: [alsa-devel] [PATCH] ASoC: rockchip: Support headset button function on rk3399 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.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;