From patchwork Wed Jul 17 16:30:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksandr Suvorov X-Patchwork-Id: 11048123 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1238913BD for ; Wed, 17 Jul 2019 17:27:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EC90D287B7 for ; Wed, 17 Jul 2019 17:27:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E094A287DB; Wed, 17 Jul 2019 17:27:04 +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.9 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RDNS_NONE autolearn=no version=3.3.1 Received: from alsa0.perex.cz (unknown [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CFD69228C9 for ; Wed, 17 Jul 2019 17:27:02 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 2730F1678; Wed, 17 Jul 2019 18:31:43 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 2730F1678 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1563381153; bh=r3GjKQMUqOWC1eBDaUk5LD0UOD3O6DOuLimOTUpM5x8=; h=From:To:Date:References:In-Reply-To:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=SFNJ0lj0O7RPPFTofsdPRvrdOYvNpDmV8fFnN520CddScEaTv+pRBVPOl6R8IZZP7 1hbv33j+b8UO+YCEDCCu2pWsAfzfYm0ngyBhw/Hs9gNDT6exqiUAI/zyNrUeNapEiF bief1sqep/DqJxX3P/OSMvmIPARw2rtrt5RnpAUQ= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 2E158F80368; Wed, 17 Jul 2019 18:30:48 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id EFAEAF80367; Wed, 17 Jul 2019 18:30:44 +0200 (CEST) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-am5eur02on070a.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe07::70a]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 428A0F80228 for ; Wed, 17 Jul 2019 18:30:42 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 428A0F80228 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=toradex.com header.i=@toradex.com header.b="jCvqkDRC" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=og+RGvyTyiNwi6GX+3YZr03BMTnKRHLsc3X9hup24wA8gRVsS+uK51D1aMgPVuGk4MNgqDbJmhbDswtIrObM1wTiaMiwRksfsxxrrsM1QUpvDVzRnd1bq+FzKMLpBoNFKu+imZDb4CfBiUL6E+9R1K/4X69N8hr6/I4qbb9R2w5MiaXCmi8+xwOTc4j45SJCKEzLBypQz2BqqGzB3JKlC3+HpKagp0un/JiVsed8wXuNcVof+uR2EmjSGPuGb/DTVOPuQwsI0+WR7MsliOLoeuKZOv3Yjk/oGR3OA3pYZpgh7wYr64pfT7OUz/2W7PqQMP4KqKVUywTTjW5FVPWEoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=K2UXyMi9DYe+ul0wF8SP426L4Srsrjmy/9dcjFCM2jA=; b=SvHvPex5pAWXt5A7kUlhKfjKgOSzaimsQsah3GgbgJ57bHCXW5tGRXFNuitSjf9C+pvZ+hjB2CyYurNIS/qTE8L4NkpSx9ub69sBTm18Nz6HvG0niRyQezyYF2PNfkyZ0SkuBu4VDS2exxmTrryOM+577VyY9CheAcaK4tWwvD4B1AnXT31sMFj4BqVkt/hQAHA61WHUHbjk1t/XgSg1UW63CLf36zyhaxbvn/LzE5APjZTzuV9S5omkw5JavPn3GCxfw6o3GcLutw2fvquGBaj59TgLFahRjWeaStm26aBYEfbX2Ag6heUKseIVIXlJB5OsBWouFgJjImYgy0Bx3g== ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=toradex.com;dmarc=pass action=none header.from=toradex.com;dkim=pass header.d=toradex.com;arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toradex.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=K2UXyMi9DYe+ul0wF8SP426L4Srsrjmy/9dcjFCM2jA=; b=jCvqkDRCIWd1oPRjY7j/gpcoxqZWbrbNVrmYcbto6WTKJwfvf+rEYMIeHafNOnnPRtCQzmpR+3sBalXfBGhJWxkoBsMFtgrUcWagNCzUy4/QdLu92XvSXoG2W+EiTPFBz5A1wzwvOF9Rnk3Jacfv/R7QRHl2JRxJ0bTC+8hXG4Q= Received: from AM6PR05MB6535.eurprd05.prod.outlook.com (20.179.18.16) by AM6PR05MB6408.eurprd05.prod.outlook.com (20.179.6.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2073.14; Wed, 17 Jul 2019 16:30:40 +0000 Received: from AM6PR05MB6535.eurprd05.prod.outlook.com ([fe80::c860:b386:22a:8ec9]) by AM6PR05MB6535.eurprd05.prod.outlook.com ([fe80::c860:b386:22a:8ec9%6]) with mapi id 15.20.2094.011; Wed, 17 Jul 2019 16:30:40 +0000 From: Oleksandr Suvorov To: Fabio Estevam Thread-Topic: [PATCH v4 1/6] ASoC: Define a set of DAPM pre/post-up events Thread-Index: AQHVPLz4I2peC5u/q0ONqoJMqxCAfQ== Date: Wed, 17 Jul 2019 16:30:40 +0000 Message-ID: <20190717163014.429-2-oleksandr.suvorov@toradex.com> References: <20190717163014.429-1-oleksandr.suvorov@toradex.com> In-Reply-To: <20190717163014.429-1-oleksandr.suvorov@toradex.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM4PR0202CA0001.eurprd02.prod.outlook.com (2603:10a6:200:89::11) To AM6PR05MB6535.eurprd05.prod.outlook.com (2603:10a6:20b:71::16) authentication-results: spf=none (sender IP is ) smtp.mailfrom=oleksandr.suvorov@toradex.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.20.1 x-originating-ip: [194.105.145.90] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f2b052f8-35dc-48ea-5460-08d70ad41b40 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020); SRVR:AM6PR05MB6408; x-ms-traffictypediagnostic: AM6PR05MB6408: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5797; x-forefront-prvs: 01018CB5B3 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(39850400004)(136003)(346002)(396003)(376002)(366004)(189003)(199004)(486006)(305945005)(7736002)(2616005)(11346002)(476003)(446003)(1076003)(52116002)(36756003)(53936002)(66066001)(81156014)(81166006)(71200400001)(8676002)(6436002)(4744005)(6512007)(50226002)(8936002)(256004)(71190400001)(4326008)(3846002)(44832011)(6486002)(68736007)(14454004)(6116002)(2906002)(316002)(5660300002)(1411001)(99286004)(478600001)(66476007)(66556008)(64756008)(66446008)(66946007)(76176011)(86362001)(6916009)(6506007)(102836004)(386003)(26005)(186003)(54906003)(25786009); DIR:OUT; SFP:1102; SCL:1; SRVR:AM6PR05MB6408; H:AM6PR05MB6535.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: toradex.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: CnRA2phoJVoUe3lDqRmYC5IF8kcpUTpITrYAYzefnTbJlbyewZ3j0V41tKqJSoreWyAYLJcC1uBgsUE1+GSOypeY1zWTr83GYRCoXj/WvYPtfYuZPVY/E3ykExbZdYkNxV/l+L2RykQ9uNh4O47tRFvGK5mfMN6rKSsnQ012cE/N2ySArINbHHWnEgKnX4HUKiUbb14DECw5Tygop3EmHqp6kyl9sVTv8Rq5vf8kXmzrY036p3cQsrHhGTZEnuz3FO8+BR/YZr9AVt9nhAXxK6Z8uaLYX0XnCjU7mnNnTUsx5yhsc2kEgpsyC0rJ3H7dItfcy9e//iuy/4Sg6JcfD6DmWYZ4apzyQzpOBVUNaOldstYRmWmnirYnmO1E+xqaD0D7LcZ06jI9zjm0PdK9FUtmd4/nvvnjEEhbxC/7Io8= MIME-Version: 1.0 X-OriginatorOrg: toradex.com X-MS-Exchange-CrossTenant-Network-Message-Id: f2b052f8-35dc-48ea-5460-08d70ad41b40 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Jul 2019 16:30:40.4698 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: d9995866-0d9b-4251-8315-093f062abab4 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: oleksandr.suvorov@toradex.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB6408 Cc: Igor Opaniuk , "alsa-devel@alsa-project.org" , Liam Girdwood , Marcel Ziswiler , Takashi Iwai , "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" , Oleksandr Suvorov , Mark Brown Subject: [alsa-devel] [PATCH v4 1/6] ASoC: Define a set of DAPM pre/post-up events X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP Prepare to use SND_SOC_DAPM_PRE_POST_PMU definition to reduce coming code size and make it more readable. Signed-off-by: Oleksandr Suvorov Reviewed-by: Marcel Ziswiler Reviewed-by: Igor Opaniuk --- Changes in v4: - CC the patch to kernel-stable Changes in v3: None Changes in v2: - Fix patch formatting include/sound/soc-dapm.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index c00a0b8ade086..6c66941601307 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h @@ -353,6 +353,8 @@ struct device; #define SND_SOC_DAPM_WILL_PMD 0x80 /* called at start of sequence */ #define SND_SOC_DAPM_PRE_POST_PMD \ (SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD) +#define SND_SOC_DAPM_PRE_POST_PMU \ + (SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU) /* convenience event type detection */ #define SND_SOC_DAPM_EVENT_ON(e) \ From patchwork Wed Jul 17 16:30:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksandr Suvorov X-Patchwork-Id: 11048095 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 655E91510 for ; Wed, 17 Jul 2019 17:12:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5025528779 for ; Wed, 17 Jul 2019 17:12:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 440A7287BF; Wed, 17 Jul 2019 17:12:07 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 15705287C1 for ; Wed, 17 Jul 2019 17:12:03 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 937201697; Wed, 17 Jul 2019 18:32:28 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 937201697 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1563381198; bh=XdZoJmnbYx7p82+9phO7y23ZmGe9Gb1TyPZVNEfoq2s=; h=From:To:Date:References:In-Reply-To:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=ABKVTxsgfDGT7HWP8bRRfrB3qcsRHwZ5ezZG5v4hpYuf0s2z5gxSCY1X0AwojwAw9 JZHO7Slhi9CoSjQIZI7QbORam0KIC/mm2mgDqQ3s+9LdDoQgF7dic+/HNh83eKJUT1 p0W7aAWStnzUzBRE28zq+t1+ZZ6ZleNA1oMV4IBU= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 2D6D6F803D1; Wed, 17 Jul 2019 18:30:51 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5304DF80363; Wed, 17 Jul 2019 18:30:46 +0200 (CEST) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-am5eur02on070a.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe07::70a]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 776AFF800C4 for ; Wed, 17 Jul 2019 18:30:43 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 776AFF800C4 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=toradex.com header.i=@toradex.com header.b="b4bm0bMf" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Dst5itm0E7jeWznksztgF85nHWOrdYWemr1i41XHSNTyphgqMeT7Fefee1MOK4lrNWHUP+agjqv3TR8tknWrEDz3qz2z2sFn4LHtNFDSK8jfZiDKwyQHOcss2/r7xRV+Vsb2i/I7pLIuK5waG/Z9Yne/dwq0b6H7t0pQogeBpnYudqsby+7wMBUQ+qt4qfa8chWelZ0gDFLLCbDxNRF8g2+2UZLkmxRkmZPgXqroZNqM1reOJ7mMW/hf5MT7vT5S9oTNsngyptMilAnJloJPskNj9S7cojWkn967H/8A4mKZJskmB/UWe+4766L/76/zasmLsOW6+bzQQnuaFiH55g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DYJkuVcKIAL548TLIFic27o2x1Bxx2j5rySRs1eN5AY=; b=lhEG3nap3pOZcX4iKsfnifjuWakhOa2ENCjA1yI5GPH+UaKANUH1z2u5pChkwoe9VRm1w6LL0BWOGWxEvJaPV4CB8I+RxPxpiufHXJ0yJZc4RyQbOMjxrbZUSaoKOgZwghBfZEkG77d3wA+gKwPN3GQh4mDE1u2W1QBaCCguQRMDApiNM1m/Dg9Xyr7cKSMXXw6vMt4vXFKbucyOAPMTItuCU/S6hL659FH6U+by0yyc2RCzCrSDgj80dGW8ypcQjAgwP4O1lQUwrS4mU/H7gvm8YLuzpEzKin2ALlyaIoDqryzN6Rm8N+oW/jh0nEpHY2Is4OFiRf33Zw6TcJl9Pw== ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=toradex.com;dmarc=pass action=none header.from=toradex.com;dkim=pass header.d=toradex.com;arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toradex.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DYJkuVcKIAL548TLIFic27o2x1Bxx2j5rySRs1eN5AY=; b=b4bm0bMfbpzSk2qJd+WTT4hrjrgUEiWYiz14yu56sDuMvHaFkIfyPWTAHkEV7uQ705Xq58TMBGFEz+f4hmC4AXUhk6zhsFh3YMIyO57ivm9gDkOubzqF7BRBcSaCa21/VQc4nYIq2Us9Bksd5xHeLlHo1qtHvxikwxWrDceFblo= Received: from AM6PR05MB6535.eurprd05.prod.outlook.com (20.179.18.16) by AM6PR05MB6408.eurprd05.prod.outlook.com (20.179.6.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2073.14; Wed, 17 Jul 2019 16:30:42 +0000 Received: from AM6PR05MB6535.eurprd05.prod.outlook.com ([fe80::c860:b386:22a:8ec9]) by AM6PR05MB6535.eurprd05.prod.outlook.com ([fe80::c860:b386:22a:8ec9%6]) with mapi id 15.20.2094.011; Wed, 17 Jul 2019 16:30:42 +0000 From: Oleksandr Suvorov To: Fabio Estevam Thread-Topic: [PATCH v4 2/6] ASoC: sgtl5000: Improve VAG power and mute control Thread-Index: AQHVPLz51rZrvf5VC0OcnVMVmKBhPA== Date: Wed, 17 Jul 2019 16:30:41 +0000 Message-ID: <20190717163014.429-3-oleksandr.suvorov@toradex.com> References: <20190717163014.429-1-oleksandr.suvorov@toradex.com> In-Reply-To: <20190717163014.429-1-oleksandr.suvorov@toradex.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM3PR07CA0090.eurprd07.prod.outlook.com (2603:10a6:207:6::24) To AM6PR05MB6535.eurprd05.prod.outlook.com (2603:10a6:20b:71::16) authentication-results: spf=none (sender IP is ) smtp.mailfrom=oleksandr.suvorov@toradex.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.20.1 x-originating-ip: [194.105.145.90] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 4eab325d-d528-44a4-9add-08d70ad41c2f x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020); SRVR:AM6PR05MB6408; x-ms-traffictypediagnostic: AM6PR05MB6408: x-ms-exchange-purlcount: 1 x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1443; x-forefront-prvs: 01018CB5B3 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(39850400004)(136003)(346002)(396003)(376002)(366004)(189003)(199004)(486006)(305945005)(7736002)(2616005)(11346002)(476003)(446003)(1076003)(52116002)(36756003)(53936002)(66066001)(81156014)(81166006)(71200400001)(8676002)(6436002)(6512007)(50226002)(6306002)(8936002)(14444005)(256004)(71190400001)(4326008)(3846002)(44832011)(6486002)(68736007)(14454004)(6116002)(2906002)(316002)(5660300002)(1411001)(99286004)(966005)(478600001)(66476007)(66556008)(64756008)(66446008)(66946007)(76176011)(86362001)(6916009)(6506007)(102836004)(386003)(26005)(186003)(54906003)(25786009); DIR:OUT; SFP:1102; SCL:1; SRVR:AM6PR05MB6408; H:AM6PR05MB6535.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: toradex.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: +6DUfuEMKBO9pf62XQZyAfu2rm7GObXDRuMti9On09YS6zaOnskAS0qKQX4ZAurp0cnV4+N/cYY6fLJRqguwXbpjsXMoMK7WyJ9+Sa/Wojros5EtVMI0+mBI0RhaG4R7jYPJgFXuV9TCxk6oVS9o1gdVnvlQBYpgOyDRENpA+MT79g9JSbfspFCXy9SA8t1je54VXx591oBxMOy4DO2pcWjHpLdZ0k1TDsKgVoWoOOeG+gYepDg+Adn+63MaNd+4S+VNv2npRvH77bmFUUPbU9ZEVgSD2Q+GQSngXV7OLGZ+fyoCy2fB+7vT3BGbe17ZTWH0T8Ofemn+qunC1Ng6jFmpOkUyRph61Ix7mPae9qnBdCPKRAqJ5ODDvWTOL8Gnyd1b3iQWxl6kiQRqGJNcpP9Ia5JkOzV1hVh0MIL2+3U= MIME-Version: 1.0 X-OriginatorOrg: toradex.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4eab325d-d528-44a4-9add-08d70ad41c2f X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Jul 2019 16:30:41.9510 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: d9995866-0d9b-4251-8315-093f062abab4 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: oleksandr.suvorov@toradex.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB6408 Cc: Igor Opaniuk , "alsa-devel@alsa-project.org" , Liam Girdwood , Marcel Ziswiler , Takashi Iwai , "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" , Oleksandr Suvorov , Mark Brown Subject: [alsa-devel] [PATCH v4 2/6] ASoC: sgtl5000: Improve VAG power and mute control X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP Change VAG power on/off control according to the following algorithm: - turn VAG power ON on the 1st incoming event. - keep it ON if there is any active VAG consumer (ADC/DAC/HP/Line-In). - turn VAG power OFF when there is the latest consumer's pre-down event come. - always delay after VAG power OFF to avoid pop. - delay after VAG power ON if the initiative consumer is Line-In, this prevents pop during line-in muxing. Also, according to the data sheet [1], to avoid any pops/clicks, the outputs should be muted during input/output routing changes. [1] https://www.nxp.com/docs/en/data-sheet/SGTL5000.pdf Signed-off-by: Oleksandr Suvorov Reviewed-by: Marcel Ziswiler Fixes: 9b34e6cc3bc2 ("ASoC: Add Freescale SGTL5000 codec support") --- Changes in v4: - Code optimization, simplify function signature (thanks to Cezary Rojewski for an idea) - CC the patch to kernel-stable - Add a Fixes tag Changes in v3: - Add the reference to NXP SGTL5000 data sheet to commit message Changes in v2: - Fix patch formatting sound/soc/codecs/sgtl5000.c | 216 ++++++++++++++++++++++++++++++------ 1 file changed, 185 insertions(+), 31 deletions(-) diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c index a6a4748c97f9d..a2aeb5fb9b537 100644 --- a/sound/soc/codecs/sgtl5000.c +++ b/sound/soc/codecs/sgtl5000.c @@ -31,6 +31,13 @@ #define SGTL5000_DAP_REG_OFFSET 0x0100 #define SGTL5000_MAX_REG_OFFSET 0x013A +/* Delay for the VAG ramp up */ +#define SGTL5000_VAG_POWERUP_DELAY 500 /* ms */ +/* Delay for the VAG ramp down */ +#define SGTL5000_VAG_POWERDOWN_DELAY 500 /* ms */ + +#define SGTL5000_OUTPUTS_MUTE (SGTL5000_HP_MUTE | SGTL5000_LINE_OUT_MUTE) + /* default value of sgtl5000 registers */ static const struct reg_default sgtl5000_reg_defaults[] = { { SGTL5000_CHIP_DIG_POWER, 0x0000 }, @@ -123,6 +130,19 @@ enum { I2S_SCLK_STRENGTH_HIGH, }; +enum { + HP_POWER_EVENT, + DAC_POWER_EVENT, + ADC_POWER_EVENT, + LAST_POWER_EVENT +}; + +static u16 mute_mask[] = { + SGTL5000_HP_MUTE, + SGTL5000_OUTPUTS_MUTE, + SGTL5000_OUTPUTS_MUTE +}; + /* sgtl5000 private structure in codec */ struct sgtl5000_priv { int sysclk; /* sysclk rate */ @@ -137,8 +157,109 @@ struct sgtl5000_priv { u8 micbias_voltage; u8 lrclk_strength; u8 sclk_strength; + u16 mute_state[LAST_POWER_EVENT]; }; +static inline int hp_sel_input(struct snd_soc_component *component) +{ + return (snd_soc_component_read32(component, SGTL5000_CHIP_ANA_CTRL) & + SGTL5000_HP_SEL_MASK) >> SGTL5000_HP_SEL_SHIFT; +} + +static inline u16 mute_output(struct snd_soc_component *component, + u16 mute_mask) +{ + u16 mute_reg = snd_soc_component_read32(component, + SGTL5000_CHIP_ANA_CTRL); + + snd_soc_component_update_bits(component, SGTL5000_CHIP_ANA_CTRL, + mute_mask, mute_mask); + return mute_reg; +} + +static inline void restore_output(struct snd_soc_component *component, + u16 mute_mask, u16 mute_reg) +{ + snd_soc_component_update_bits(component, SGTL5000_CHIP_ANA_CTRL, + mute_mask, mute_reg); +} + +static void vag_power_on(struct snd_soc_component *component, u32 source) +{ + if (snd_soc_component_read32(component, SGTL5000_CHIP_ANA_POWER) & + SGTL5000_VAG_POWERUP) + return; + + snd_soc_component_update_bits(component, SGTL5000_CHIP_ANA_POWER, + SGTL5000_VAG_POWERUP, SGTL5000_VAG_POWERUP); + + /* When VAG powering on to get local loop from Line-In, the sleep + * is required to avoid loud pop. + */ + if (hp_sel_input(component) == SGTL5000_HP_SEL_LINE_IN && + source == HP_POWER_EVENT) + msleep(SGTL5000_VAG_POWERUP_DELAY); +} + +static int vag_power_consumers(struct snd_soc_component *component, + u16 ana_pwr_reg, u32 source) +{ + int consumers = 0; + + /* count dac/adc consumers unconditional */ + if (ana_pwr_reg & SGTL5000_DAC_POWERUP) + consumers++; + if (ana_pwr_reg & SGTL5000_ADC_POWERUP) + consumers++; + + /* + * If the event comes from HP and Line-In is selected, + * current action is 'DAC to be powered down'. + * As HP_POWERUP is not set when HP muxed to line-in, + * we need to keep VAG power ON. + */ + if (source == HP_POWER_EVENT) { + if (hp_sel_input(component) == SGTL5000_HP_SEL_LINE_IN) + consumers++; + } else { + if (ana_pwr_reg & SGTL5000_HP_POWERUP) + consumers++; + } + + return consumers; +} + +static void vag_power_off(struct snd_soc_component *component, u32 source) +{ + u16 ana_pwr = snd_soc_component_read32(component, + SGTL5000_CHIP_ANA_POWER); + + if (!(ana_pwr & SGTL5000_VAG_POWERUP)) + return; + + /* + * This function calls when any of VAG power consumers is disappearing. + * Thus, if there is more than one consumer at the moment, as minimum + * one consumer will definitely stay after the end of the current + * event. + * Don't clear VAG_POWERUP if 2 or more consumers of VAG present: + * - LINE_IN (for HP events) / HP (for DAC/ADC events) + * - DAC + * - ADC + * (the current consumer is disappearing right now) + */ + if (vag_power_consumers(component, ana_pwr, source) >= 2) + return; + + snd_soc_component_update_bits(component, SGTL5000_CHIP_ANA_POWER, + SGTL5000_VAG_POWERUP, 0); + /* In power down case, we need wait 400-1000 ms + * when VAG fully ramped down. + * As longer we wait, as smaller pop we've got. + */ + msleep(SGTL5000_VAG_POWERDOWN_DELAY); +} + /* * mic_bias power on/off share the same register bits with * output impedance of mic bias, when power on mic bias, we @@ -170,36 +291,30 @@ static int mic_bias_event(struct snd_soc_dapm_widget *w, return 0; } -/* - * As manual described, ADC/DAC only works when VAG powerup, - * So enabled VAG before ADC/DAC up. - * In power down case, we need wait 400ms when vag fully ramped down. - */ -static int power_vag_event(struct snd_soc_dapm_widget *w, - struct snd_kcontrol *kcontrol, int event) +static int vag_and_mute_control(struct snd_soc_component *component, + int event, int event_source) { - struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); - const u32 mask = SGTL5000_DAC_POWERUP | SGTL5000_ADC_POWERUP; + struct sgtl5000_priv *sgtl5000 = + snd_soc_component_get_drvdata(component); switch (event) { - case SND_SOC_DAPM_POST_PMU: - snd_soc_component_update_bits(component, SGTL5000_CHIP_ANA_POWER, - SGTL5000_VAG_POWERUP, SGTL5000_VAG_POWERUP); - msleep(400); + case SND_SOC_DAPM_PRE_PMU: + sgtl5000->mute_state[event_source] = + mute_output(component, mute_mask[event_source]); + break; + case SND_SOC_DAPM_POST_PMU: + vag_power_on(component, event_source); + restore_output(component, mute_mask[event_source], + sgtl5000->mute_state[event_source]); break; - case SND_SOC_DAPM_PRE_PMD: - /* - * Don't clear VAG_POWERUP, when both DAC and ADC are - * operational to prevent inadvertently starving the - * other one of them. - */ - if ((snd_soc_component_read32(component, SGTL5000_CHIP_ANA_POWER) & - mask) != mask) { - snd_soc_component_update_bits(component, SGTL5000_CHIP_ANA_POWER, - SGTL5000_VAG_POWERUP, 0); - msleep(400); - } + sgtl5000->mute_state[event_source] = + mute_output(component, mute_mask[event_source]); + vag_power_off(component, event_source); + break; + case SND_SOC_DAPM_POST_PMD: + restore_output(component, mute_mask[event_source], + sgtl5000->mute_state[event_source]); break; default: break; @@ -208,6 +323,41 @@ static int power_vag_event(struct snd_soc_dapm_widget *w, return 0; } +/* + * Mute Headphone when power it up/down. + * Control VAG power on HP power path. + */ +static int headphone_pga_event(struct snd_soc_dapm_widget *w, + struct snd_kcontrol *kcontrol, int event) +{ + struct snd_soc_component *component = + snd_soc_dapm_to_component(w->dapm); + + return vag_and_mute_control(component, event, HP_POWER_EVENT); +} + +/* As manual describes, ADC/DAC powering up/down requires + * to mute outputs to avoid pops. + * Control VAG power on ADC/DAC power path. + */ +static int adc_updown_depop(struct snd_soc_dapm_widget *w, + struct snd_kcontrol *kcontrol, int event) +{ + struct snd_soc_component *component = + snd_soc_dapm_to_component(w->dapm); + + return vag_and_mute_control(component, event, ADC_POWER_EVENT); +} + +static int dac_updown_depop(struct snd_soc_dapm_widget *w, + struct snd_kcontrol *kcontrol, int event) +{ + struct snd_soc_component *component = + snd_soc_dapm_to_component(w->dapm); + + return vag_and_mute_control(component, event, DAC_POWER_EVENT); +} + /* input sources for ADC */ static const char *adc_mux_text[] = { "MIC_IN", "LINE_IN" @@ -280,7 +430,10 @@ static const struct snd_soc_dapm_widget sgtl5000_dapm_widgets[] = { mic_bias_event, SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD), - SND_SOC_DAPM_PGA("HP", SGTL5000_CHIP_ANA_POWER, 4, 0, NULL, 0), + SND_SOC_DAPM_PGA_E("HP", SGTL5000_CHIP_ANA_POWER, 4, 0, NULL, 0, + headphone_pga_event, + SND_SOC_DAPM_PRE_POST_PMU | + SND_SOC_DAPM_PRE_POST_PMD), SND_SOC_DAPM_PGA("LO", SGTL5000_CHIP_ANA_POWER, 0, 0, NULL, 0), SND_SOC_DAPM_MUX("Capture Mux", SND_SOC_NOPM, 0, 0, &adc_mux), @@ -301,11 +454,12 @@ static const struct snd_soc_dapm_widget sgtl5000_dapm_widgets[] = { 0, SGTL5000_CHIP_DIG_POWER, 1, 0), - SND_SOC_DAPM_ADC("ADC", "Capture", SGTL5000_CHIP_ANA_POWER, 1, 0), - SND_SOC_DAPM_DAC("DAC", "Playback", SGTL5000_CHIP_ANA_POWER, 3, 0), - - SND_SOC_DAPM_PRE("VAG_POWER_PRE", power_vag_event), - SND_SOC_DAPM_POST("VAG_POWER_POST", power_vag_event), + SND_SOC_DAPM_ADC_E("ADC", "Capture", SGTL5000_CHIP_ANA_POWER, 1, 0, + adc_updown_depop, SND_SOC_DAPM_PRE_POST_PMU | + SND_SOC_DAPM_PRE_POST_PMD), + SND_SOC_DAPM_DAC_E("DAC", "Playback", SGTL5000_CHIP_ANA_POWER, 3, 0, + dac_updown_depop, SND_SOC_DAPM_PRE_POST_PMU | + SND_SOC_DAPM_PRE_POST_PMD), }; /* routes for sgtl5000 */ From patchwork Wed Jul 17 16:30:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksandr Suvorov X-Patchwork-Id: 11048093 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 015AA138B for ; Wed, 17 Jul 2019 17:12:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DD9B2287CD for ; Wed, 17 Jul 2019 17:12:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CFE522873B; Wed, 17 Jul 2019 17:12:06 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 179502873B for ; Wed, 17 Jul 2019 17:12:03 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id DDEA216A4; Wed, 17 Jul 2019 18:33:21 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz DDEA216A4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1563381252; bh=qm0Enab7fDQSWonr+r1hW8wHJtXKYcbR4XwaP9Nx2mY=; h=From:To:Date:References:In-Reply-To:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=V3ESRYoGHbvrp2T+wTNXuBIztEZ39kL+QsyYDvh0HnmCXb334BjniYAFgz64xGWbL 0sWstDiUHyK/Grsk7cWFtRhMg7LcVZx0+bJbh7dq74nOgJEoSBf1+bL6vhSADTcHFf AgMWs97oj4DDyxb4onnjGJBIlikkFU5pJ12DCbmg= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 648C6F80445; Wed, 17 Jul 2019 18:31:06 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 0FE40F80446; Wed, 17 Jul 2019 18:30:54 +0200 (CEST) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20092.outbound.protection.outlook.com [40.107.2.92]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 89F33F800C2 for ; Wed, 17 Jul 2019 18:30:51 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 89F33F800C2 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=toradex.com header.i=@toradex.com header.b="kK1Ew/uj" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=G+iYmNzXKpQmyxnOMp7XufATGeUEskBVKacY3uOxxy/Q+Q19K9PWFAtbI1D/7E8twtIE4ddgzifPd6v7g+9OI+vwDbVrlCZU5WNTD3Psay2ZAgbbH8s4q07aiT/5dwfutIdn4y2zcsdW0qieUOEqTyf6Pl3M625UxoZQ0JWP2V7QEe6n9pHwCRFG4dtz56R3Bwrpoc2AtyCvUJs/NPkO0eRa2mHCuRTbt/T8RoFB15BwD/2jLtDH598lXmtqrMP0XVklq3iwA3A0+xftaYGsNdQez4DlmiC+gcw7O0cUL2QX056eBG21euhIaU/Erv690VXZhhp0hMA+Ia6kZwNXWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1zgKS5w0Kd5kAm9IRjctrX1ULbWsjFi2NOA54etofv0=; b=L5Uy2SU0eS8UuG7FJjnAGdbT2V3HPxaUetzxYSGrciKUMQOnEmjqw4W4xnbh1mf6hXxciGa475LtI02GUMr9L79TRBXgOeucjuhfMlRfcEj6X4P/tOGCsFOKM/Aq3/dyR3fW2lIpQ0u5/qKhYqF4UfsEbYFNHzjpPBH9k40aYSDjKw0k/lZRaVa6egDtVJKuisMJCFzNb2kc0iQHARWgFWUTGRpk8MfMGtiFwzM4EOcw0EcioGHxNVAMkhNLRArUWvod4m61xqb7DLMKLffHPmq39jFlgEP+QMGb590cbm6L87OjvizPUzhem5/MSlvOTVnrG8J3bj6e+iti8TyFKw== ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=toradex.com;dmarc=pass action=none header.from=toradex.com;dkim=pass header.d=toradex.com;arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toradex.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1zgKS5w0Kd5kAm9IRjctrX1ULbWsjFi2NOA54etofv0=; b=kK1Ew/uj7k+AH0urLS9j7kZojYth8jA5m+Iksjk6Eaf/QtTkhzLpV0/if/64hbVmeHyOCXhP9dJxOUoQg7NSLSf9SU33j0Sc1K9WVvzpzKZ9z4x820iduf19lLyfmYwjzOr9bczUTbQZfzJmGS3sS5C9kjMggltyAozRjwXfUFg= Received: from AM6PR05MB6535.eurprd05.prod.outlook.com (20.179.18.16) by AM6PR05MB6408.eurprd05.prod.outlook.com (20.179.6.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2073.14; Wed, 17 Jul 2019 16:30:50 +0000 Received: from AM6PR05MB6535.eurprd05.prod.outlook.com ([fe80::c860:b386:22a:8ec9]) by AM6PR05MB6535.eurprd05.prod.outlook.com ([fe80::c860:b386:22a:8ec9%6]) with mapi id 15.20.2094.011; Wed, 17 Jul 2019 16:30:50 +0000 From: Oleksandr Suvorov To: Fabio Estevam Thread-Topic: [PATCH v4 3/6] ASoC: sgtl5000: Fix definition of VAG Ramp Control Thread-Index: AQHVPLz+9/raU08NxU2wpAf8CiU9kQ== Date: Wed, 17 Jul 2019 16:30:49 +0000 Message-ID: <20190717163014.429-4-oleksandr.suvorov@toradex.com> References: <20190717163014.429-1-oleksandr.suvorov@toradex.com> In-Reply-To: <20190717163014.429-1-oleksandr.suvorov@toradex.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM3PR07CA0106.eurprd07.prod.outlook.com (2603:10a6:207:7::16) To AM6PR05MB6535.eurprd05.prod.outlook.com (2603:10a6:20b:71::16) authentication-results: spf=none (sender IP is ) smtp.mailfrom=oleksandr.suvorov@toradex.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.20.1 x-originating-ip: [194.105.145.90] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 22c87ec3-a4a2-42d8-ab5b-08d70ad420f6 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020); SRVR:AM6PR05MB6408; x-ms-traffictypediagnostic: AM6PR05MB6408: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2657; x-forefront-prvs: 01018CB5B3 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(39850400004)(136003)(346002)(396003)(376002)(366004)(189003)(199004)(486006)(305945005)(7736002)(2616005)(11346002)(476003)(446003)(1076003)(52116002)(36756003)(53936002)(66066001)(81156014)(81166006)(71200400001)(8676002)(6436002)(6512007)(50226002)(8936002)(14444005)(256004)(71190400001)(4326008)(3846002)(44832011)(6486002)(68736007)(14454004)(6116002)(2906002)(316002)(5660300002)(1411001)(99286004)(478600001)(66476007)(66556008)(64756008)(66446008)(66946007)(76176011)(86362001)(6916009)(6506007)(102836004)(386003)(26005)(186003)(54906003)(25786009); DIR:OUT; SFP:1102; SCL:1; SRVR:AM6PR05MB6408; H:AM6PR05MB6535.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: toradex.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: S9TyZbdoq284WwrwY8YueBJuIixgCKlKgheDS+SsWu6/cK2PsA3UK6crKNk84heTh8NYpfxq85y9ZmudBTr1yHylnEDeKHORIVICwn+UPdzdLxrl95Gr0cK6aBHs1Uiij5xHL2sMF2roI7VKknDau9uV1kMXh1cSeLBQvziK5JXwH6dznQWnQ8PCUkOKrrR+zrdWW0tTb+XWGLJwj/f0LlLexm7V21B68n/pV3EypKMAMEjnURpNLMSIcV/J1K1Y2/EmW89I+dfd35EPBy3hqFuKFJNFPbIi24OiryFOybgTQRkoWDBwdMBuQu8UyEwvtVP9oTRTml8iSA8yDGSu2kWbfVHFBUiqhAcbw1TbwRe3GShozM5+6AXPFiAaqMB43tJgdnI+fQdv7tFvAgFZSIrgi8Vil/nNCp4+dIEw9WI= MIME-Version: 1.0 X-OriginatorOrg: toradex.com X-MS-Exchange-CrossTenant-Network-Message-Id: 22c87ec3-a4a2-42d8-ab5b-08d70ad420f6 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Jul 2019 16:30:49.9575 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: d9995866-0d9b-4251-8315-093f062abab4 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: oleksandr.suvorov@toradex.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB6408 Cc: Igor Opaniuk , "alsa-devel@alsa-project.org" , Liam Girdwood , Marcel Ziswiler , Takashi Iwai , "linux-kernel@vger.kernel.org" , Oleksandr Suvorov , Mark Brown Subject: [alsa-devel] [PATCH v4 3/6] ASoC: sgtl5000: Fix definition of VAG Ramp Control X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP SGTL5000_SMALL_POP is a bit mask, not a value. Usage of correct definition makes device probing code more clear. Signed-off-by: Oleksandr Suvorov Reviewed-by: Marcel Ziswiler Reviewed-by: Igor Opaniuk --- Changes in v4: None Changes in v3: None Changes in v2: - Fix patch formatting sound/soc/codecs/sgtl5000.c | 2 +- sound/soc/codecs/sgtl5000.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c index a2aeb5fb9b537..a8d55c21a5f2d 100644 --- a/sound/soc/codecs/sgtl5000.c +++ b/sound/soc/codecs/sgtl5000.c @@ -1450,7 +1450,7 @@ static int sgtl5000_probe(struct snd_soc_component *component) /* enable small pop, introduce 400ms delay in turning off */ snd_soc_component_update_bits(component, SGTL5000_CHIP_REF_CTRL, - SGTL5000_SMALL_POP, 1); + SGTL5000_SMALL_POP, SGTL5000_SMALL_POP); /* disable short cut detector */ snd_soc_component_write(component, SGTL5000_CHIP_SHORT_CTRL, 0); diff --git a/sound/soc/codecs/sgtl5000.h b/sound/soc/codecs/sgtl5000.h index 18cae08bbd3a6..a4bf4bca95bf7 100644 --- a/sound/soc/codecs/sgtl5000.h +++ b/sound/soc/codecs/sgtl5000.h @@ -273,7 +273,7 @@ #define SGTL5000_BIAS_CTRL_MASK 0x000e #define SGTL5000_BIAS_CTRL_SHIFT 1 #define SGTL5000_BIAS_CTRL_WIDTH 3 -#define SGTL5000_SMALL_POP 1 +#define SGTL5000_SMALL_POP 0x0001 /* * SGTL5000_CHIP_MIC_CTRL From patchwork Wed Jul 17 16:30:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksandr Suvorov X-Patchwork-Id: 11048087 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D6477138B for ; Wed, 17 Jul 2019 17:12:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BDC83287C8 for ; Wed, 17 Jul 2019 17:12:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B0477287E9; Wed, 17 Jul 2019 17:12:04 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0E9B6287C8 for ; Wed, 17 Jul 2019 17:12:03 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 9093C1698; Wed, 17 Jul 2019 18:34:01 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9093C1698 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1563381291; bh=e1mxaf2y5Wjk22BxYFegf2uxwAjQ1+oqXqYLaM5mIyk=; h=From:To:Date:References:In-Reply-To:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=c1dhy0xq1/59dlsPPS6vp6DIz7nVpxli8N5orAYt6UoEaaYNDpGOrIzFT3DKhvcCz 0eRBl18bYWbo0MqtRCpSSvHVDgVEikuDuxZSzxodvg6gz71c8UCdc1HqdG1dqhHXbD pSykNDY3DGJRfvFCbjdb2dlJ9lUIUgjmQVNszAds= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 46C34F8045D; Wed, 17 Jul 2019 18:31:08 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 838C3F80445; Wed, 17 Jul 2019 18:30:55 +0200 (CEST) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20092.outbound.protection.outlook.com [40.107.2.92]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id CC98AF80444 for ; Wed, 17 Jul 2019 18:30:52 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz CC98AF80444 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=toradex.com header.i=@toradex.com header.b="LoO9Va12" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ANQ9we1GF4lX3578fbnnR1a6e+eaLaAw1lbx3oVqGfkEh7M2msst8Xv80dZmVm6okQ4zfUhbQJJLFrj0QwVleqJqoKZJfuo9S2ayCCvrx9oateMgQ+TRCHItI+KC84vN/5EVXKi/8X2krvxreFDNPw7vY3D9d8AgxK5RDDH6s5xPMC0G4wR3ZeQA2ENtRq/IVJX8l8htnNC7Iyj247kOHKDVDRpRpVBlxYmlPLXF2dIwsnGPBhVMOin09KMsTQi9K1QHuvSc2mDAMp2taJ8irQPA1M6ezMlKgZNFtrZlybmj6WRWYqQhMpDyrNExs+OvBzDpDjkTYs5mH1vnqiB7Og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=T50sXYNMNxjCZ3iAUZ/fyNPX/WDT5uQTAGK0OKZJgM8=; b=A1VDbrdYGv3L2ga3DjCKrddUu8zM8p+Se/n3anohVk8/QQP6E4E2lPhNFnJCSwap+Yfm0Qz2Y4sD8vF0o3KdPl0EtBYboqEtMv7+l9KrmNuN94SgJR8zmWL7QGgGQbPszlAVZbsZsnLls5bZWPHxqR7x6i8ejdYC+YIQaUsSIp/wtStI0UqLLdArPSK9wMtM3syIvuYw7k0Ky7oH3ipthNljvS673mQKq2N0cUfyv3rLUZHyJdKSTj2lfpA3dyeOnDOyOSN/GdzzisGeHn99r2cNQ4qQGk4E4AUTEcJh3doOLl7nDmz9zgwee6J/3pR0V6ggWBbYbtUG+tRN6Ep9KA== ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=toradex.com;dmarc=pass action=none header.from=toradex.com;dkim=pass header.d=toradex.com;arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toradex.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=T50sXYNMNxjCZ3iAUZ/fyNPX/WDT5uQTAGK0OKZJgM8=; b=LoO9Va12yJuNaPQ8PoNMxKL/FACYzLUdtPXf8FlXAdLkSq9weXnotV2aHLKo98gvBr+VYdlLaUs/v8a68qhtU/Q7opMDW57CsP+b2ce6HPNU4mT/ZIVpOCh5qMHCpwS2dzxBESY7jJl68qMdxA+xFAh6ty7zezDBz7IQX6bYcFM= Received: from AM6PR05MB6535.eurprd05.prod.outlook.com (20.179.18.16) by AM6PR05MB6408.eurprd05.prod.outlook.com (20.179.6.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2073.14; Wed, 17 Jul 2019 16:30:51 +0000 Received: from AM6PR05MB6535.eurprd05.prod.outlook.com ([fe80::c860:b386:22a:8ec9]) by AM6PR05MB6535.eurprd05.prod.outlook.com ([fe80::c860:b386:22a:8ec9%6]) with mapi id 15.20.2094.011; Wed, 17 Jul 2019 16:30:51 +0000 From: Oleksandr Suvorov To: Fabio Estevam Thread-Topic: [PATCH v4 4/6] ASoC: sgtl5000: add ADC mute control Thread-Index: AQHVPLz/r35mERsc3kyuoDGGQ3JgOg== Date: Wed, 17 Jul 2019 16:30:51 +0000 Message-ID: <20190717163014.429-5-oleksandr.suvorov@toradex.com> References: <20190717163014.429-1-oleksandr.suvorov@toradex.com> In-Reply-To: <20190717163014.429-1-oleksandr.suvorov@toradex.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM4P190CA0020.EURP190.PROD.OUTLOOK.COM (2603:10a6:200:56::30) To AM6PR05MB6535.eurprd05.prod.outlook.com (2603:10a6:20b:71::16) authentication-results: spf=none (sender IP is ) smtp.mailfrom=oleksandr.suvorov@toradex.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.20.1 x-originating-ip: [194.105.145.90] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 0a26a0f5-d332-4ed9-bdf9-08d70ad421e2 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020); SRVR:AM6PR05MB6408; x-ms-traffictypediagnostic: AM6PR05MB6408: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3044; x-forefront-prvs: 01018CB5B3 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(39850400004)(136003)(346002)(396003)(376002)(366004)(189003)(199004)(486006)(305945005)(7736002)(2616005)(11346002)(476003)(446003)(1076003)(52116002)(36756003)(53936002)(66066001)(81156014)(81166006)(71200400001)(8676002)(6436002)(4744005)(6512007)(50226002)(8936002)(256004)(71190400001)(4326008)(3846002)(44832011)(6486002)(68736007)(14454004)(6116002)(2906002)(316002)(5660300002)(1411001)(99286004)(478600001)(66476007)(66556008)(64756008)(66446008)(66946007)(76176011)(86362001)(6916009)(6506007)(102836004)(386003)(26005)(186003)(54906003)(25786009); DIR:OUT; SFP:1102; SCL:1; SRVR:AM6PR05MB6408; H:AM6PR05MB6535.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: toradex.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: iiKweZZyZqdi75JInVB4OHX4ShqIWTMl31biMdF3f2bc0AbioljY4sXXJOu5E+Bb2ENPl29rDfVSVlCcTa7FL6oq6V6j2RjgYVJpCFLTsd12LGC+KgDL1mOOHujz9RixPd15phct21fcQ6z1tfGmchsXiivtYA5TE4kFmGW6GjZYCHjiteQTucpyNPK9AQEVdov/ya/YS+Gtsl+xt+WAelgqSR7kcn4UQSPkHiSn3U5Ha/mEKrbfjt4S55NN1JB2UV1Fyv4EDF1wPEmvIGn+B7c7cw2DhjZ86BKCyRD8A1UGAN5cRiABm5jP2Uchgf9m1Bv5cv4+4cEJ3tvK1ZdjVUBydYriACXebbn9fIFgFB99NwXBtVSJ/y755xO3BIkSRBXqJYE16jdRpsBqqDHQpVuivtlLUeNLxSsjhUNOoM4= MIME-Version: 1.0 X-OriginatorOrg: toradex.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0a26a0f5-d332-4ed9-bdf9-08d70ad421e2 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Jul 2019 16:30:51.5036 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: d9995866-0d9b-4251-8315-093f062abab4 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: oleksandr.suvorov@toradex.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB6408 Cc: Igor Opaniuk , "alsa-devel@alsa-project.org" , Liam Girdwood , Marcel Ziswiler , Takashi Iwai , "linux-kernel@vger.kernel.org" , Oleksandr Suvorov , Mark Brown Subject: [alsa-devel] [PATCH v4 4/6] ASoC: sgtl5000: add ADC mute control X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP This control mute/unmute the ADC input of SGTL5000 using its CHIP_ANA_CTRL register. Signed-off-by: Oleksandr Suvorov Reviewed-by: Marcel Ziswiler Reviewed-by: Igor Opaniuk --- Changes in v4: None Changes in v3: None Changes in v2: - Fix patch formatting sound/soc/codecs/sgtl5000.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c index a8d55c21a5f2d..0123d9cfcb473 100644 --- a/sound/soc/codecs/sgtl5000.c +++ b/sound/soc/codecs/sgtl5000.c @@ -710,6 +710,7 @@ static const struct snd_kcontrol_new sgtl5000_snd_controls[] = { SGTL5000_CHIP_ANA_ADC_CTRL, 8, 1, 0, capture_6db_attenuate), SOC_SINGLE("Capture ZC Switch", SGTL5000_CHIP_ANA_CTRL, 1, 1, 0), + SOC_SINGLE("Capture Switch", SGTL5000_CHIP_ANA_CTRL, 0, 1, 1), SOC_DOUBLE_TLV("Headphone Playback Volume", SGTL5000_CHIP_ANA_HP_CTRL, From patchwork Wed Jul 17 16:30:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksandr Suvorov X-Patchwork-Id: 11048091 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0B4D4138B for ; Wed, 17 Jul 2019 17:12:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EB79C28779 for ; Wed, 17 Jul 2019 17:12:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DFBB7287C8; Wed, 17 Jul 2019 17:12:05 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1CB9E287CD for ; Wed, 17 Jul 2019 17:12:03 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id F2CB416AC; Wed, 17 Jul 2019 18:34:24 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz F2CB416AC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1563381315; bh=u/6RVwFldttNTOOjy1g2bB5C3Boi2mXaw51hEJwVuzI=; h=From:To:Date:References:In-Reply-To:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=LQHBCBU1lzS3lV+KtRM8q6XkVXU2ijwF5qpsiIYhhhnvnAu/cyW3MeDdmI/TCxlxD oojXfTt6RF/IBU0cyIFyQPgtqXIy9cEvO1h+xsencLtZAF/8X6LWQPWwymuWbT8pBs r1t+OctiYb9VCZjkV3CKkkn/3kuTcEezK/PMgMNU= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 83107F80483; Wed, 17 Jul 2019 18:31:09 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id BCE08F80445; Wed, 17 Jul 2019 18:30:57 +0200 (CEST) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60098.outbound.protection.outlook.com [40.107.6.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 19CC1F803F3 for ; Wed, 17 Jul 2019 18:30:54 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 19CC1F803F3 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=toradex.com header.i=@toradex.com header.b="nTSftXk0" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WfUWOxiMah6hHVBClnLs8r/xvLJ0KKfts/nncIgxpRnDOIbtMezL8fZBTcnTwdgumoaJnBGE/pU0+PQ763NgG8/w7MNQCfs7i4yXLWNprPqZtjfz49x1zjRazQhdjcDfzOM6QHGJUykAzj25vNcDAJk0ony0j1Us2dgRkHrFtpszGcpQY1d3KDkHzXkd24nSg6ED8Eme8CtiVzjpdCte54A4c0sPg7MO/cqeeLQU7FeDZRlStvawPYGgvXNb8nR53ww1smheDsg+8K+RMlLlQ6vrD5MZHwcp/0OlfMl+trURNOcGYc9R2Stx6WNob6/3aJ2pObKqCvylq260Bo83lQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CIrw0DsoEBE/Kyv7xQZQW02YH1iJP6RtEkaPNFXINpY=; b=H5rq02AkQVSaPKDZvcSlpKUxdotRyWfkalfDJ1NKz42/FbHBA1UE8O2AVpzzUC8WbaMRVIHJhIHNCZYenXGln5nTFE5s564vxdyrVHq3pb08UdLZgttxuJq13AyXGoNMReKmzMeAegLSFUWR1ttITVluJscnuH1F/Mzdwb4V18uqRhPbVIe5aY9aqV+D5OF0VV8F7Jj4at+SPsmyOw//n74NScGKfiUD3lwBjvNxyr1zrL1CXWOGzAVAD8HbH1K5xQp+WwIqndYdu9krL2lD56yNHp7utxQ3Puxy1wu3hSUDwrhjAin7c/h5y8IZtLn6fVIBnUJY9AoYjJY+wpwZgw== ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=toradex.com;dmarc=pass action=none header.from=toradex.com;dkim=pass header.d=toradex.com;arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toradex.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CIrw0DsoEBE/Kyv7xQZQW02YH1iJP6RtEkaPNFXINpY=; b=nTSftXk0G2vplLUCa+WUvw2bilnfqburZw3fhr3Jv36vMZI0Lea3g6f/HST2HYVJKwUpxlevWVD8wn083ZT9Jb8/uAez7BxUSpBUXQATvO91Haludo4zuVUApzmh6FaaWjVRGyH572xGIjO0c4Pcrrstrb9Q38PCgCpwo1TN9D4= Received: from AM6PR05MB6535.eurprd05.prod.outlook.com (20.179.18.16) by AM6PR05MB4455.eurprd05.prod.outlook.com (52.135.162.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2094.11; Wed, 17 Jul 2019 16:30:53 +0000 Received: from AM6PR05MB6535.eurprd05.prod.outlook.com ([fe80::c860:b386:22a:8ec9]) by AM6PR05MB6535.eurprd05.prod.outlook.com ([fe80::c860:b386:22a:8ec9%6]) with mapi id 15.20.2094.011; Wed, 17 Jul 2019 16:30:53 +0000 From: Oleksandr Suvorov To: Fabio Estevam Thread-Topic: [PATCH v4 5/6] ASoC: sgtl5000: Fix of unmute outputs on probe Thread-Index: AQHVPL0APvMXuyYKqEmMI8DZ4RRwwA== Date: Wed, 17 Jul 2019 16:30:53 +0000 Message-ID: <20190717163014.429-6-oleksandr.suvorov@toradex.com> References: <20190717163014.429-1-oleksandr.suvorov@toradex.com> In-Reply-To: <20190717163014.429-1-oleksandr.suvorov@toradex.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM4PR0202CA0006.eurprd02.prod.outlook.com (2603:10a6:200:89::16) To AM6PR05MB6535.eurprd05.prod.outlook.com (2603:10a6:20b:71::16) authentication-results: spf=none (sender IP is ) smtp.mailfrom=oleksandr.suvorov@toradex.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.20.1 x-originating-ip: [194.105.145.90] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 0d173b83-7225-47c7-15bd-08d70ad422d3 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020); SRVR:AM6PR05MB4455; x-ms-traffictypediagnostic: AM6PR05MB4455: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3044; x-forefront-prvs: 01018CB5B3 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(346002)(396003)(39850400004)(376002)(366004)(189003)(199004)(7736002)(4326008)(6916009)(478600001)(66556008)(66476007)(66446008)(81166006)(5660300002)(50226002)(305945005)(66946007)(71190400001)(64756008)(66066001)(71200400001)(1076003)(8936002)(2616005)(6436002)(81156014)(256004)(476003)(2906002)(8676002)(446003)(11346002)(14444005)(3846002)(52116002)(53936002)(44832011)(186003)(486006)(99286004)(102836004)(6506007)(386003)(76176011)(1411001)(26005)(68736007)(36756003)(86362001)(14454004)(25786009)(316002)(6512007)(54906003)(6486002)(6116002); DIR:OUT; SFP:1102; SCL:1; SRVR:AM6PR05MB4455; H:AM6PR05MB6535.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: toradex.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 7XK7MH4SDC+j5Kn9t5ZIPzC0te5xwJZ+t6EprXqbDcL8FwKbWt9bSXbwraCHS7ghY9wqOkalyIkHY0/+3OMgYjdcVkmZPIHy3HBdqXAXeJVrlrWe2UWfZqg2CGNb4Bpu0PA3R2F8QnLfJJbK63C1wE5NmmgZM5n3PAqPe3EYKw80fclL8krpIXACnHMGrWSi3pb/gzate0kF20I2bDx8IV0L7VlyAmvZ0X3a4LapWLXhyfXdPYaXe6lU13Ii02XBbr0BfttrVNuvb65Ye23Dve5IrzsesG48PjG/wKci3AOCbY9Si1tg4H1e2N4ppLpUgsP04nsWZ1iq38VEHAAvXduMEgScw7bw1sBx/gQc1n9429vIwsRNwMhF+5PXbgFH1VHbytokdfDLF0mzePS/tKwFSEUsMXGiDTq+k60XDLk= MIME-Version: 1.0 X-OriginatorOrg: toradex.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0d173b83-7225-47c7-15bd-08d70ad422d3 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Jul 2019 16:30:53.0747 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: d9995866-0d9b-4251-8315-093f062abab4 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: oleksandr.suvorov@toradex.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB4455 Cc: Igor Opaniuk , "alsa-devel@alsa-project.org" , Liam Girdwood , Marcel Ziswiler , Takashi Iwai , "linux-kernel@vger.kernel.org" , Oleksandr Suvorov , Mark Brown Subject: [alsa-devel] [PATCH v4 5/6] ASoC: sgtl5000: Fix of unmute outputs on probe X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP To enable "zero cross detect" for ADC/HP, change HP_ZCD_EN/ADC_ZCD_EN bits only instead of writing the whole CHIP_ANA_CTRL register. Signed-off-by: Oleksandr Suvorov Reviewed-by: Marcel Ziswiler Reviewed-by: Igor Opaniuk Reviewed-by: Fabio Estevam --- Changes in v4: None Changes in v3: None Changes in v2: - Fix patch formatting sound/soc/codecs/sgtl5000.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c index 0123d9cfcb473..31d546abde717 100644 --- a/sound/soc/codecs/sgtl5000.c +++ b/sound/soc/codecs/sgtl5000.c @@ -1443,6 +1443,7 @@ static int sgtl5000_probe(struct snd_soc_component *component) int ret; u16 reg; struct sgtl5000_priv *sgtl5000 = snd_soc_component_get_drvdata(component); + unsigned int zcd_mask = SGTL5000_HP_ZCD_EN | SGTL5000_ADC_ZCD_EN; /* power up sgtl5000 */ ret = sgtl5000_set_power_regs(component); @@ -1470,9 +1471,8 @@ static int sgtl5000_probe(struct snd_soc_component *component) 0x1f); snd_soc_component_write(component, SGTL5000_CHIP_PAD_STRENGTH, reg); - snd_soc_component_write(component, SGTL5000_CHIP_ANA_CTRL, - SGTL5000_HP_ZCD_EN | - SGTL5000_ADC_ZCD_EN); + snd_soc_component_update_bits(component, SGTL5000_CHIP_ANA_CTRL, + zcd_mask, zcd_mask); snd_soc_component_update_bits(component, SGTL5000_CHIP_MIC_CTRL, SGTL5000_BIAS_R_MASK, From patchwork Wed Jul 17 16:30:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksandr Suvorov X-Patchwork-Id: 11048089 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 023B217E0 for ; Wed, 17 Jul 2019 17:12:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E292F287C9 for ; Wed, 17 Jul 2019 17:12:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D67042881C; Wed, 17 Jul 2019 17:12:04 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 18268287C9 for ; Wed, 17 Jul 2019 17:12:03 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id F409716AD; Wed, 17 Jul 2019 18:35:08 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz F409716AD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1563381359; bh=7xwP9GKwHpiyRURJrsLVfYtcd3J/PwxINxGaLiDzCFQ=; h=From:To:Date:References:In-Reply-To:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=S7I9ZXKE6gRht1FQTgqpU1phqGojxQ/oRXRG+GBUrhsTciJiUyzkaHr3xua+ulRba vXhBFpHsiKGcneF7NhnF0+X4Y6eyiYpi2UiW4Q+PXK/xlXjMAn1tcIDgPRAJshIY8F qH23HrWY/hi/jAdHQcyJNqFGMV5+/dbTjLVPjASo= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 7E0F2F8048F; Wed, 17 Jul 2019 18:31:10 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 1AF35F80445; Wed, 17 Jul 2019 18:31:00 +0200 (CEST) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60102.outbound.protection.outlook.com [40.107.6.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 5B7BDF800C2 for ; Wed, 17 Jul 2019 18:30:56 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 5B7BDF800C2 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=toradex.com header.i=@toradex.com header.b="AsAd+HP5" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CJ1tQErUAcXkpXPaRrTlbsOY3wdgalFCMx1/CIzfsL0s4fwJN/AS7m7XmFSzi3xyDZv+3P25WbXLihpVpbEzMgESHn0rsaef7Vis9M6MjGcsN6xUg97QdwONXroBdJicm4vzsvv6Woy9uUFu9mVhoAeXtU3EdK8BeQ8cmsza18P6DwifBqMqicPPfaqkKHlw1yk+tjJXHyRxcE+YmZF4W0Udel/S6oHTSE2k++5A77ZHnZcGDO3rrGAH2oOM61lW9YIk+VYj2sBgIRD2UdidVPMLiXHR7QCGAvu+14J06nLFkO2kuiRtrmY+INOYomd/MIROm4fdSF4vnVyJK1sS7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GsUCfA7TQyvCZr2KqIuza0U8qfFvAbZZvMTpLacaLz8=; b=LZd46ZsDwM54uu63AfuWOyO0DPVig3RbLn3ULRRKXVxkhBmERQJwx+iSkOTicsZRs/6+88t5HUAMtqtxCN4g6ulG48lI3lh/Hbd0twrCRf4Otc5d3IbiTac+Z0FRG/ly2+VkfSY9mJXrBn5l5vHiqBm0BKeUTaswtxrRe9BU1xwgjzLrICFb9Kf4hmvOhrvNt0jAqikknGTicwY1XmAJFK0Be/XmXGQjNftERihUIRvlaW7DZ7SqzVOZ/OP8CHcUb0OT7TNKA46HkPGkIk6M2Cb8dxqV1hTO/0x8OAcDLKjcSV/7WovJIBC+9Q8Fs3SMq5GJmzTCvLla+TzX+WbHzQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=toradex.com;dmarc=pass action=none header.from=toradex.com;dkim=pass header.d=toradex.com;arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toradex.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GsUCfA7TQyvCZr2KqIuza0U8qfFvAbZZvMTpLacaLz8=; b=AsAd+HP5OmLHXAmVuNye2JB/LsWXM+19z0BB/mKrWA5c9y0zjKyRT4J84WyxaWpJja5ubzo0DxCLqlb3U15Vu5b3ZKRdhaMW4GV+TLW2gq1DbYIu0p5eBosnTf8VajKlQ2y/D5COM/Zr0zbFitFOiVs2vP6W80bjJ8QI4bhDSL4= Received: from AM6PR05MB6535.eurprd05.prod.outlook.com (20.179.18.16) by AM6PR05MB4455.eurprd05.prod.outlook.com (52.135.162.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2094.11; Wed, 17 Jul 2019 16:30:54 +0000 Received: from AM6PR05MB6535.eurprd05.prod.outlook.com ([fe80::c860:b386:22a:8ec9]) by AM6PR05MB6535.eurprd05.prod.outlook.com ([fe80::c860:b386:22a:8ec9%6]) with mapi id 15.20.2094.011; Wed, 17 Jul 2019 16:30:54 +0000 From: Oleksandr Suvorov To: Fabio Estevam Thread-Topic: [PATCH v4 6/6] ASoC: sgtl5000: Fix charge pump source assignment Thread-Index: AQHVPL0B+q/A+n5bN0Kf42jiqIXQuQ== Date: Wed, 17 Jul 2019 16:30:54 +0000 Message-ID: <20190717163014.429-7-oleksandr.suvorov@toradex.com> References: <20190717163014.429-1-oleksandr.suvorov@toradex.com> In-Reply-To: <20190717163014.429-1-oleksandr.suvorov@toradex.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM3PR07CA0082.eurprd07.prod.outlook.com (2603:10a6:207:6::16) To AM6PR05MB6535.eurprd05.prod.outlook.com (2603:10a6:20b:71::16) authentication-results: spf=none (sender IP is ) smtp.mailfrom=oleksandr.suvorov@toradex.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.20.1 x-originating-ip: [194.105.145.90] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 770b3b11-bf38-489b-7aeb-08d70ad423bd x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020); SRVR:AM6PR05MB4455; x-ms-traffictypediagnostic: AM6PR05MB4455: x-ms-exchange-purlcount: 1 x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:989; x-forefront-prvs: 01018CB5B3 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(346002)(396003)(39850400004)(376002)(366004)(189003)(199004)(7736002)(4326008)(6916009)(966005)(478600001)(66556008)(66476007)(66446008)(81166006)(5660300002)(50226002)(305945005)(66946007)(71190400001)(64756008)(66066001)(71200400001)(1076003)(8936002)(2616005)(6436002)(81156014)(256004)(476003)(2906002)(8676002)(446003)(11346002)(3846002)(52116002)(53936002)(44832011)(186003)(486006)(99286004)(102836004)(6506007)(386003)(76176011)(1411001)(26005)(68736007)(36756003)(86362001)(14454004)(25786009)(316002)(6512007)(6306002)(54906003)(6486002)(6116002); DIR:OUT; SFP:1102; SCL:1; SRVR:AM6PR05MB4455; H:AM6PR05MB6535.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: toradex.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 4NKyXphBDfnNA/oSAAZOuzi1zCxofok/9mAGjGlIEf8Ro2psjbOxQIfUYkXiddUTBops5JWNOjJgSXOdW/ukqk9+tx3zdnWJuZAAiLX7BkZhmvsU56VlxkNjEBqO9N4hEwOTdAtdjMEugbPIEJV3Yckk7rlqnTrWAFABXQ+HQKBAsPWzB5AQRfuuxBzBhzko1ZsaYt5iLx89hxvgYBQzRP/zSOs2dY4phZo5RXtdVf0gMoE2/Rcr7ZZgbGQULkq1zphDt/VreP7jhj72iAxmOUVIk2TkbFGa3uwpT9huah1XNfFO9IxxnZEo5Ht7GiEnhCrdmV7DPdjO/F1WBKMKpIdaKbkwzvEg4q3c4fYp5lLcumvKwJG7et361jDPq6XSYhbTBUWTxMFvpiJVpa5KO6RUmAWBIszXpOzlZIYxakY= MIME-Version: 1.0 X-OriginatorOrg: toradex.com X-MS-Exchange-CrossTenant-Network-Message-Id: 770b3b11-bf38-489b-7aeb-08d70ad423bd X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Jul 2019 16:30:54.6018 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: d9995866-0d9b-4251-8315-093f062abab4 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: oleksandr.suvorov@toradex.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB4455 Cc: Igor Opaniuk , "alsa-devel@alsa-project.org" , Liam Girdwood , Marcel Ziswiler , Takashi Iwai , "linux-kernel@vger.kernel.org" , Oleksandr Suvorov , Mark Brown Subject: [alsa-devel] [PATCH v4 6/6] ASoC: sgtl5000: Fix charge pump source assignment X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP If VDDA != VDDIO and any of them is greater than 3.1V, charge pump source can be assigned automatically [1]. [1] https://www.nxp.com/docs/en/data-sheet/SGTL5000.pdf Signed-off-by: Oleksandr Suvorov Reviewed-by: Marcel Ziswiler Reviewed-by: Igor Opaniuk Reviewed-by: Fabio Estevam --- Changes in v4: None Changes in v3: - Add the reference to NXP SGTL5000 data sheet to commit message - Fix multi-line comment format Changes in v2: - Fix patch formatting sound/soc/codecs/sgtl5000.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c index 31d546abde717..a04cba66615de 100644 --- a/sound/soc/codecs/sgtl5000.c +++ b/sound/soc/codecs/sgtl5000.c @@ -1328,12 +1328,17 @@ static int sgtl5000_set_power_regs(struct snd_soc_component *component) SGTL5000_INT_OSC_EN); /* Enable VDDC charge pump */ ana_pwr |= SGTL5000_VDDC_CHRGPMP_POWERUP; - } else if (vddio >= 3100 && vdda >= 3100) { + } else { ana_pwr &= ~SGTL5000_VDDC_CHRGPMP_POWERUP; - /* VDDC use VDDIO rail */ - lreg_ctrl |= SGTL5000_VDDC_ASSN_OVRD; - lreg_ctrl |= SGTL5000_VDDC_MAN_ASSN_VDDIO << - SGTL5000_VDDC_MAN_ASSN_SHIFT; + /* + * if vddio == vdda the source of charge pump should be + * assigned manually to VDDIO + */ + if (vddio == vdda) { + lreg_ctrl |= SGTL5000_VDDC_ASSN_OVRD; + lreg_ctrl |= SGTL5000_VDDC_MAN_ASSN_VDDIO << + SGTL5000_VDDC_MAN_ASSN_SHIFT; + } } snd_soc_component_write(component, SGTL5000_CHIP_LINREG_CTRL, lreg_ctrl);