From patchwork Thu Jan 22 23:47:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anatol Pomozov X-Patchwork-Id: 5689861 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0EE7E9F2ED for ; Thu, 22 Jan 2015 23:47:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3990B20272 for ; Thu, 22 Jan 2015 23:47:53 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 5FB9520268 for ; Thu, 22 Jan 2015 23:47:50 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id BE685265338; Fri, 23 Jan 2015 00:47:46 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id C24FD26530E; Fri, 23 Jan 2015 00:47:35 +0100 (CET) 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 C17B426530E; Fri, 23 Jan 2015 00:47:31 +0100 (CET) Received: from mail-qa0-f73.google.com (mail-qa0-f73.google.com [209.85.216.73]) by alsa0.perex.cz (Postfix) with ESMTP id F3B6B265307 for ; Fri, 23 Jan 2015 00:47:23 +0100 (CET) Received: by mail-qa0-f73.google.com with SMTP id n8so322514qaq.0 for ; Thu, 22 Jan 2015 15:47:23 -0800 (PST) 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=0LcebLHqU5opd83ptMjRdNBu74MkmVtLQTwnlh05MJI=; b=iaHaJ24rrSzyGK36dHY1afKd2PkwfSjq5k3ZCUva+kZUVpjOAz8wFR3rTw9hspQ1Lc Rr4PYdo9fJmPTEb1sgnW9MRWGbnCWAzUZkRm4rD525Jp7Bvw8RHF7x49DhJ4rcQcTQWs SxcBjP7HjVC7BTp/8QeGkf7YpHl5QC4IbYaJlpM/KFGpj/BrM2qk6zgM05TNOM+//hdU z5J9VWTAIpyhTiv7vb0qb2wO3YwsznfYJTXCVerX23xGAguFME/BgVTDxhYtYmRJnln0 hfwtv7oU3HEs2RqdxkWxlsk7tVWx3wkuo1kJs1ikGcqlhitJO2J+svJxhTXjuKgEq6bp VJmQ== X-Gm-Message-State: ALoCoQnkrnapjKn1VhRrqOLPRSbFnnUzFfftenzSwqSizC7A0QjysnVlZny3ATa5l2MbzWiT+c9AZGEzVFMDcuSDy5dwL2ROUoLDylrH5cyF+EWLNgTtyHTvAMSNT5B9SsjlMY6m7s+obGCvc/ZMZHHRPkd5/VVzyhCFSmlxqy/t2hyhGFsJypY= X-Received: by 10.52.6.161 with SMTP id c1mr3173369vda.5.1421970442574; Thu, 22 Jan 2015 15:47:22 -0800 (PST) Received: from corpmail-nozzle1-1.hot.corp.google.com ([100.108.1.104]) by gmr-mx.google.com with ESMTPS id fg3si641967qcb.1.2015.01.22.15.47.22 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Jan 2015 15:47:22 -0800 (PST) Received: from anatol.mtv.corp.google.com ([172.22.64.197]) by corpmail-nozzle1-1.hot.corp.google.com with ESMTP id PW03rGAK.1; Thu, 22 Jan 2015 15:47:22 -0800 Received: by anatol.mtv.corp.google.com (Postfix, from userid 67983) id 8E7671003AC; Thu, 22 Jan 2015 15:47:21 -0800 (PST) From: Anatol Pomozov To: alsa-devel@alsa-project.org, broonie@kernel.org, dgreid@chromium.org Date: Thu, 22 Jan 2015 15:47:16 -0800 Message-Id: <1421970436-15862-1-git-send-email-anatol.pomozov@gmail.com> X-Mailer: git-send-email 2.2.0.rc0.207.ga3a616c Cc: Anatol Pomozov Subject: [alsa-devel] [PATCH] ASoC: ts3a227e: Remap keys to match Android headset specification 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 ts3a227e datasheet says typical key resistance is key1 50 Om key2 135 Om key3 240 Om key4 470 Om The android headset specification expect buttons impedance: A (MEDIA) 0-70 Om D (VOICECOMMAND) 110-180 Om B (VOLUMEUP) 210-290 Om C (VOLUMEDOWN) 360-680 Om Thus key mapping should be key1 - MEDIA key2 - VOICECOMMAND key3 - VOLUMEUP key3 - VOLUMEDOWN Signed-off-by: Anatol Pomozov Acked-by: Dylan Reid --- sound/soc/codecs/ts3a227e.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/codecs/ts3a227e.c b/sound/soc/codecs/ts3a227e.c index 9f2dced..54d431c 100644 --- a/sound/soc/codecs/ts3a227e.c +++ b/sound/soc/codecs/ts3a227e.c @@ -221,9 +221,9 @@ int ts3a227e_enable_jack_detect(struct snd_soc_component *component, struct ts3a227e *ts3a227e = snd_soc_component_get_drvdata(component); snd_jack_set_key(jack->jack, SND_JACK_BTN_0, KEY_MEDIA); - snd_jack_set_key(jack->jack, SND_JACK_BTN_1, KEY_VOLUMEUP); - snd_jack_set_key(jack->jack, SND_JACK_BTN_2, KEY_VOLUMEDOWN); - snd_jack_set_key(jack->jack, SND_JACK_BTN_3, KEY_VOICECOMMAND); + snd_jack_set_key(jack->jack, SND_JACK_BTN_1, KEY_VOICECOMMAND); + snd_jack_set_key(jack->jack, SND_JACK_BTN_2, KEY_VOLUMEUP); + snd_jack_set_key(jack->jack, SND_JACK_BTN_3, KEY_VOLUMEDOWN); ts3a227e->jack = jack; ts3a227e_jack_report(ts3a227e);