From patchwork Thu Apr 12 09:57:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akshu Agrawal X-Patchwork-Id: 10338101 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 528F960329 for ; Thu, 12 Apr 2018 09:58:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 406052873A for ; Thu, 12 Apr 2018 09:58:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 34AD128749; Thu, 12 Apr 2018 09:58:15 +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=-2.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=ham 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 1C5A22873A for ; Thu, 12 Apr 2018 09:58:13 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 66A4C267140; Thu, 12 Apr 2018 11:58:11 +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 D9705267356; Thu, 12 Apr 2018 11:58:08 +0200 (CEST) Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0069.outbound.protection.outlook.com [104.47.33.69]) by alsa0.perex.cz (Postfix) with ESMTP id 705C3266FD1 for ; Thu, 12 Apr 2018 11:58:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=l8y2lzFavZMLLc3GHT6QFLt4OtPwFQFWps47Pzk/eJM=; b=vsGZB8q3dSRqZ5G4yFOPkJK5SJc+vQa1ahQGhzC5JaE4C+Ki5gPqs1HAjRmSRls7DbP1bu/SejgvU13nLG0QaGW9DOzCWxM9Fy8mCTfpc06XtDVW7BUWb/d6x2+kXSM08QYc0aNl8tt2WL+OIuSGI3jSt2O4I2ovkXSQuk7cwI4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Akshu.Agrawal@amd.com; Received: from akshu-HP-EliteBook-745-G2.mshome.net (202.56.249.162) by CY4PR1201MB0182.namprd12.prod.outlook.com (2603:10b6:910:1d::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.675.10; Thu, 12 Apr 2018 09:57:59 +0000 From: Akshu Agrawal To: broonie@kernel.org, alsa-devel@alsa-project.org Date: Thu, 12 Apr 2018 17:57:11 +0800 Message-Id: <1523527031-6132-1-git-send-email-akshu.agrawal@amd.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [202.56.249.162] X-ClientProxiedBy: PN1PR01CA0072.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:1::12) To CY4PR1201MB0182.namprd12.prod.outlook.com (2603:10b6:910:1d::11) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:CY4PR1201MB0182; X-Microsoft-Exchange-Diagnostics: 1; CY4PR1201MB0182; 3:fykEZgO4ykCX0x76gCsXjPKxOb2NLiGIrpbIlw9029WBGWYcJBq1xobv3TXrKgjgxzBMbYyB4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G8yoONSoK9RBT+ZzoAuNTGU1cH/VMWzFMdHSZliYQdZ8cUBqlmeok6zKdf5qFxGXKszK3v/QdLDTHz8s9Tb5+iCVcnomWzQP5a5KBqHY3F/Crepu4h5DJfWR00OcLmiqVGFkDSQfb2OzZJ2O4aM+6Vw3U6K0KAMK2kHy1QPYIE/Wq9vlHR/xMPLECH8jMJ0RdK9fyXcjtSjDsI5LJY0ujREzF6LwkfGAjXr/Qu1NiTftcpzYDAgGR3OmamCoVWX1KPHQDiG; 4:8vFaCUaYq1uSSZ2kNP0knsDwO1YMN1VfFuoLnhxg/i/4a1aeXpafwBzwAHbj8jd3Hxn6mBTMYQdO9kdGiFGHLgSCSUdKtbWM+f548Cs1iXolIpvRfUDNsEd84NJ9+OY3twTFnyzi9OIfexGxsQEuaJlQaVPDymPFjGdyKU9qb17Lh0r7EuWOomIqQlNS1yfGRhRSdi0tcHx2WqoAbvozfNJWsIrXfW27nHqKq13/bbcTvk6Eo1OBMpDIzUEJD4DfX4yYtWYOgKSw08YwBYNM3u7oD3Z2K297PwqIWWHY8oGpMuuzSYQaMvghmpjXq9pw X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231221)(944501327)(52105095)(10201501046)(3002001)(6055026)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123560045)(20161123558120)(6072148)(201708071742011); SRVR:CY4PR1201MB0182; BCL:0; PCL:0; RULEID:; SRVR:CY4PR1201MB0182; X-Forefront-PRVS: 06400060E1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(346002)(396003)(39860400002)(39380400002)(366004)(189003)(199004)(956004)(48376002)(7736002)(6506007)(186003)(3846002)(68736007)(6116002)(386003)(26005)(66066001)(47776003)(8676002)(53416004)(53936002)(36756003)(97736004)(106356001)(105586002)(69596002)(39060400002)(478600001)(50466002)(16526019)(16586007)(81166006)(6512007)(8936002)(5660300001)(50226002)(6666003)(486006)(316002)(305945005)(72206003)(4326008)(25786009)(81156014)(52116002)(2906002)(86362001)(51416003)(6486002)(2616005)(476003)(44832011); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR1201MB0182; H:akshu-HP-EliteBook-745-G2.mshome.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR1201MB0182; 23:2Vi90EVF2AcR/Wjv99zT3UjZtl88/ZAljHOtmnu?= =?us-ascii?Q?jdt4HsUBT9tFjYFdHedgybnk3mqe3DERYPahwMXOobO8YlJvaqETR0oJlUXQ?= =?us-ascii?Q?qvU/z4ZQ3FlZKKF+JeOgzF5T4icgW8lTYSKX0aFaRgDw5dcJv8yQNriLl/7E?= =?us-ascii?Q?jHS418/vhcOp6/qqovZe4UJgVaI2bN0eJic4GUjYJ9c58AjTbYDLwOxzF/Fb?= =?us-ascii?Q?aNFK31nx0Jo940EvZ7VrQdw3m49O6+30ne1FD10ONovZOanTJJFGqilH/Rx4?= =?us-ascii?Q?wJlUuDPXms9CmE5XZQYyo8ilm+EDGPnM9P2oB+ezQLalGWYiNEiJt7PjqaAs?= =?us-ascii?Q?LQ/wHKzAKrboRO3LaRtaHGP3k8vRtlES6bEYnJo/WZUCTB8vlO9PvvXiZDse?= =?us-ascii?Q?Ooe0c721tdo+QQhKGT7DuLPX5tjeP29xvhZSRyWNvljJ/uhTo4xVREHOgmxX?= =?us-ascii?Q?Z8QsBjWmDIX+qINZcCKjMIx7EQ4pegbf9FC/ZLNB+kHJ5B7/Iu21QtND9hza?= =?us-ascii?Q?D9tVhYoWSyErdfPjSXRH9JudGlDhaAQasSOzv0DdhqWrKviLJhm4BPEVtcxT?= =?us-ascii?Q?C3Yx3VnyAXmu4oqs3ssJSdjPt92OYJbK1gmqbDIOTw2wWJFNIOGUdzKpjtbJ?= =?us-ascii?Q?87m28NIRnG4Jhq/BVrA491YcY+XTM8LBaejgjpfPHeDvQLvNQnX3XRCzsOyo?= =?us-ascii?Q?F98J38H9Tz4e1R73svIgL7dycn8O5tkS6yR/9BUgYM5cerRShnKETJifeZGV?= =?us-ascii?Q?jFxogZY19VIlg3Mf1KLpGMqzSoH+Onf7nwz0aIWuGBsjIvbq5G9Ct1ODCw+S?= =?us-ascii?Q?dGOImOFeYwrIg8chF1RtO6gvCu+xhKZAw5E7AcbGeASAD9XrShqZ9Bd3wF4b?= =?us-ascii?Q?E8zEMq5AoHEygL2xIeUqNMZEFUwVNZ59GBby2LXecn1kpoQEGyL77v9zyb24?= =?us-ascii?Q?rk5issoqUFrWMEzdwh3RrhApyV4FM+wc93fHzCM5k0tu+OdSAQ3g3Z8Rn1Yl?= =?us-ascii?Q?TatXX3VMIKhCI5UAfkQULITBvwdESuA/PSqvd060lKxcJ8TlJH36hGu2bP9u?= =?us-ascii?Q?6po8NNg5tsZUc406cCpj77S1va7eZ8CXU4IgskONkBSbKCP/ISiZsxiVrw1/?= =?us-ascii?Q?F0zriPhhGUdy6LsTU934prDlEBfMydSxGWah7IvlfzeYaSJKu9pM7Q5jaIrU?= =?us-ascii?Q?lDNEHCvymP4jxWJ6NNAaveS2B+CKdlZ4xvxXg?= X-Microsoft-Antispam-Message-Info: RQXXuOz1lQwVLwefMEWfgQN4jzRKwqW7QoAG36X/9BYBBUrgdgtRMrTqTyZTvQ6r5Wwn0nEpSWUwDyObz6S7UsYqkYwqDk9NICfR16GyrPc69AMogkydBwt8mvg/2pqLbxbC3ffCr9FPszv2u4WvmRtMJofXDiuexP9ZFVakSbqz8BVw0O98ZIocFDEBpn7w X-Microsoft-Exchange-Diagnostics: 1; CY4PR1201MB0182; 6:3Y6dvw6CT1l/60BJp5UYUeFaKKbSeRJ5s+ZsJlgguJYEWj2OHtC8PEv+d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z6DDkiHWHplafAG5f9VJIR0YUXCPiVRUekDQKps7ObEgmsMdV6RuVS7fOYtw9Tym0Wt27xaqxRI6lK5EVOTEM5DhhhW3wD6/K4G817e4j3t/8NI0rWFHza78TYdmU3q1J66UlJhYsQES/BK9pF0P+ExRs+78i1G/7b1/k1bH8a5P+kQoY+AfKd7AHsjEgn7FJwxkQuvZLPnhDmVWtIkvdpRVPn X-MS-Office365-Filtering-Correlation-Id: ef9e3f5f-923d-4b0f-4c18-08d5a05be0c6 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Apr 2018 09:57:59.1041 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ef9e3f5f-923d-4b0f-4c18-08d5a05be0c6 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1201MB0182 Cc: tiwai@suse.de, Alexander.Deucher@amd.com, lgirdwood@gmail.com, djkurtz@chromium.org, akshu.agrawal@amd.com Subject: [alsa-devel] [v3] ASoC: AMD: Support headset button on Stoney DA7219 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Adds headset button support. TEST=Tested Volume UP/Down, Play/Pause functionality Signed-off-by: Akshu Agrawal Reviewed-by: Daniel Kurtz --- v2: Changed KEY_MEDIA to KEY_PLAYPAUSE v3: Using cz_jack.jack instead of jack->jack sound/soc/amd/acp-da7219-max98357a.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sound/soc/amd/acp-da7219-max98357a.c b/sound/soc/amd/acp-da7219-max98357a.c index b205c78..d281c22 100644 --- a/sound/soc/amd/acp-da7219-max98357a.c +++ b/sound/soc/amd/acp-da7219-max98357a.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include "../codecs/da7219.h" @@ -80,6 +81,11 @@ static int cz_da7219_init(struct snd_soc_pcm_runtime *rtd) return ret; } + snd_jack_set_key(cz_jack.jack, SND_JACK_BTN_0, KEY_PLAYPAUSE); + snd_jack_set_key(cz_jack.jack, SND_JACK_BTN_1, KEY_VOLUMEUP); + snd_jack_set_key(cz_jack.jack, SND_JACK_BTN_2, KEY_VOLUMEDOWN); + snd_jack_set_key(cz_jack.jack, SND_JACK_BTN_3, KEY_VOICECOMMAND); + da7219_aad_jack_det(component, &cz_jack); return 0;