Message ID | 20230227091938.1671416-2-chancel.liu@nxp.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp2321545wrd; Mon, 27 Feb 2023 01:37:47 -0800 (PST) X-Google-Smtp-Source: AK7set/FMLXxz66wRqzQ0vhWKpxlL1hVe+fJTx23bQYxARKz+r3wVi2qxKRv7LsUrAysi6U9AX8h X-Received: by 2002:aa7:c1c7:0:b0:4af:69b8:52af with SMTP id d7-20020aa7c1c7000000b004af69b852afmr16390154edp.24.1677490667140; Mon, 27 Feb 2023 01:37:47 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1677490667; cv=pass; d=google.com; s=arc-20160816; b=0r/N3Hjgl2hQ1tUsbr7PJwIXvsODAo4Cf5IeOzuZJMgjTf7ZgEKA1laeY/wgwFTI23 BU6bf5yn9DGBGP09LAiroKcnMsrGBkVq03dDbmWlE/jk+ScRPVxqxQbLJOq9jIIjF+Oy 8Vyr2gjfKEWHpSUtzefTE2rWHsSQNsJ38k8eTbU20Nk7XlkxbARNXg/dEDz5Jvl8TU/Y eqwtN3hdPAYCdO4jQSnNFt3lBiPsesSkNuJVFbxTc2G7UMprtpnzsakxMcjPuKldhLyv H6mua4SZJUtj15v2cSovNW+zXJqDKceSD9ox/+KD1ni7KHya1KPdUr7P5/pQCV9U/WR9 K/4w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=8B2Ks62e7FIWpo1ioxvaK5qmzWqJzcSAZC0XDtZm++k=; b=I7LyYwGU5QoBf/50SCG4DFkkcaORlkZgK74M8hXEk/pkQQryC0F2pAedp/YrCDXobE 22BZ1DJeqcH24diQxOAoTC9W8Afpu4LFSsVJoI4o6E9NVLtVAsOYpXEe0GRPFoyalUWa DicgLZmdk11OLhDa7tPGhpQpGk+oh56+xkuu3shaEYKY8KF9znn0Cax8U91fhM36Z5nu gR7vWA4qCNydhLbiFyxEcgV11NesgEgdX/zt9E0CdF3B6L5KzlDB7MSmTZ9Y56aHSNp8 G618RMec97SLTYC1EBM7R89AgxodQC6FiCAP81lpFRvX6lM12XnZ+TIFj1FOdYEqYq3Z ecXg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=PzVLI4Sx; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r17-20020a056402035100b004ad8fc759f9si8192776edw.17.2023.02.27.01.37.24; Mon, 27 Feb 2023 01:37:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=PzVLI4Sx; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229701AbjB0JVy (ORCPT <rfc822;sukrut.bellary@gmail.com> + 99 others); Mon, 27 Feb 2023 04:21:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230040AbjB0JVd (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 27 Feb 2023 04:21:33 -0500 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2077.outbound.protection.outlook.com [40.107.20.77]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A37F91026E; Mon, 27 Feb 2023 01:20:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ROG2uXFLgXQljAsFib77VvJiNWbv1Z1sNmjZ4y8oq66gN/5snQP0/eJSz5s6U9suIwhCIss6B164zGiwolFAxUsdw7HT7nM1mp5WClKJqe141xMCbOHcNVmltCppQEHDChMwEz9bXgiS5BFRBNYtbW0tJGMS0v053WVfFqgdR7qnHZAhIMCGALaqvocq3f11/OyglRZHeimYrLxxF+9YGQeZFdXc7ir35DUKnJAhYMbtCYc7VEzuOdJh1BVelvNRJL+eIYQLtdBFw/PmWKp/c7FmcgIFQABDaewp5UF17lGLTp3bFmjIKQKzXlNncFLsY3e23bOJaBGULZrzAd8U+g== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=8B2Ks62e7FIWpo1ioxvaK5qmzWqJzcSAZC0XDtZm++k=; b=HkPQrDuYDgT8jHAp+6iGSmzAckl6KWTP3IsMHVATbsbkBSBfvkRf37KBPcfmQ058v+w01OECElE7HMZ3PPIl/6sm/8fYA5caJdwuPag2oz2kf84BfE9PgNKD29m1VyDndoiJTkaupZyzy/6onUvqp69+/bFrH00xF7fbyYEGSg7+lDviAVT9qlLkM7Edczg7fwKicZmeCF4AXO0iyKwAHucdgm4fiNkJNMLMss1Yb0Yiwcxcv62fVMY2pKMDSr+qNJvhPWckah0L/4HMT/NQB+wSgVxYpauywA3THu5ktxSYtZtf9DzPHkg24MwoogjSrmYe73q0JE+7pCtuW6GKXQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8B2Ks62e7FIWpo1ioxvaK5qmzWqJzcSAZC0XDtZm++k=; b=PzVLI4SxoBHf9xhprA8xRVIPZ/ao3KSGKEyy7uJ8F8kGgOdrp/3wbHSGBK4zmB7ZYqJVZiwD+RZouMgSbbMVfdnQwcoPsMt/dhweGwadH1N9s98oiYaQm3a3ETLO/57iRmjLOtMYof4nMimaAKzpn5QBq/UDLDmHxd6CkSv2UJE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB4222.eurprd04.prod.outlook.com (2603:10a6:803:46::19) by AM9PR04MB8922.eurprd04.prod.outlook.com (2603:10a6:20b:409::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.24; Mon, 27 Feb 2023 09:20:09 +0000 Received: from VI1PR04MB4222.eurprd04.prod.outlook.com ([fe80::8562:affc:e0c:c610]) by VI1PR04MB4222.eurprd04.prod.outlook.com ([fe80::8562:affc:e0c:c610%7]) with mapi id 15.20.6134.029; Mon, 27 Feb 2023 09:20:09 +0000 From: Chancel Liu <chancel.liu@nxp.com> To: lgirdwood@gmail.com, broonie@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, perex@perex.cz, tiwai@suse.com, ckeepax@opensource.cirrus.com, patches@opensource.cirrus.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Cc: Chancel Liu <chancel.liu@nxp.com> Subject: [PATCH v2 2/2] ASoC: wm8524: Correct the MUTE setting while power up/down Date: Mon, 27 Feb 2023 17:19:38 +0800 Message-Id: <20230227091938.1671416-2-chancel.liu@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230227091938.1671416-1-chancel.liu@nxp.com> References: <20230227091938.1671416-1-chancel.liu@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR04CA0206.apcprd04.prod.outlook.com (2603:1096:4:187::21) To VI1PR04MB4222.eurprd04.prod.outlook.com (2603:10a6:803:46::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR04MB4222:EE_|AM9PR04MB8922:EE_ X-MS-Office365-Filtering-Correlation-Id: ff2f33a0-98c6-4a48-c794-08db18a3d228 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: j4Pzc9GB390ozY+diSiVEh5rYFBHoTb23eeD4Kd/jxfdeD8NPxk5Kd5SigiL7Zfyto6mn5v58PFG8tkVPN4QoiOI4sBtaTyhJ6Dbj3ATQjhKKoRfRR3MfaC0lroPrf3aeKjyjuKoCKvXbbwP289P+w2Sm4RYCOwE0oCy1lN7WhvVW+/bLt3griN5OWGUTxp2g7BbtRWh/FnZwNYE3uFTEU7Cjf1vhbzWpuL+eF/MQqG4RQ4e5JrbLHDLIhyfi3Dm+ak8Uf3QnyO6yH8KaLRIQsbZ9aitcWS20gOuFsq1OxEp8I4UyspEWVuBQhbdCrnOM7SLvExrF2FSbXPqloLsAzyFwyDWIzaMoKEziY7vJCeBuqI/N0yjBOCKnGHlQQDI+kRk3DacImy9LQ90lb9vNSD28hvaqNTwXDJ2hryMAUmMrdW7c1Yv5hZ+58pyi1ii1/jsm7hH86EhkSMgFVfOQwuP7DPcf+9yvkyGrFoZ2qhdft+e5y6dH+sWtaCEly8kFCnJg8JFMt5eYfP33VKzVI6BgHStzdIfPAw/loG4Pz8pmXC3IulAcd3Wfihn1cZC4fqnCuy5z02GPbVTcvlSCo5aDPRshEcD0aHu6W2aHGI6jr68FbvxofhG0Hfj0yzPLtUEq+k8US1gL4Z4itx8DJqLDtaZFcpDE3OjtDz+8Ue24yfc8j7Avc1AdSFICd1YV8uKpkoIrYQOMI8x0U0ZCk5MmSQVUSZYLJy79IAcGGw= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB4222.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(366004)(39860400002)(346002)(396003)(376002)(136003)(451199018)(66946007)(5660300002)(186003)(26005)(66556008)(8936002)(41300700001)(66476007)(4326008)(52116002)(6666004)(83380400001)(38100700002)(6506007)(6512007)(316002)(1076003)(921005)(36756003)(6486002)(86362001)(478600001)(2906002)(2616005)(44832011)(7416002)(8676002)(38350700002)(4744005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 8DAsVdVOgXwtZ+4Sbwk0Efs0v7SdN4HDmYjyHp3DxcJolzWcAJQaqhStWBkpEKOkiFB5131aEBCrbksmeUxXmQXAMx0Y3TEwbux9ZJvG2Zf0MD9malN3miCD7a2tbTTnufO4NwE8Sd09gcKsMiwzyLFnQ8iMM7wwJwj10o5X70nKcV6ecQjQjEZNZ06GknVaT17Z71a8W+Y1ls4hossGXlyDOIZUjGI/FyQo3j6TUUbwp7BXuX62AB1SbDou8VT3qL8gJz0PrjLvb915a2kk9lqDBXaJ1W2FEi5eO/SYCYFARPGlL905+oG2yeeyftwVousXYGITxQ2p5b9L3XvIAWhY8wAjCDEPvFuESgSVfwecXce4q3YmSy/YRfzJExv53D9Q2uhz7Bk6aW5w0nf/5XaotepLitevHK5vlVgwGeaBRTQURUOt4Jv1/QMykbBJb60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fwk97I/QyN6ukj7c3DQDFK+YXvCxC5FJVfjy1HMaYOWlU9zwX/Bmib4bv1wMh8gcl4a2Qzp+IMjcjhYD X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ff2f33a0-98c6-4a48-c794-08db18a3d228 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB4222.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Feb 2023 09:20:09.0805 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: MSrqo4btNMfdbGig6x2dv5A5q3aMp9KAUkeHZbFbRjVtt1NGMDN8zszMJQt9hWGbiRHjoIt0xZH6vHQUau0QaQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8922 X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_RPBL,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758976453809285759?= X-GMAIL-MSGID: =?utf-8?q?1758976453809285759?= |
Series |
[v2,1/2] ASoC: dt-bindings: wlf,wm8524: Convert to json-schema
|
|
Commit Message
Chancel Liu
Feb. 27, 2023, 9:19 a.m. UTC
wm8524 should be unmuted while power up and muted while power down.
Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
---
sound/soc/codecs/wm8524.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Comments
On Mon, Feb 27, 2023 at 05:19:38PM +0800, Chancel Liu wrote: > wm8524 should be unmuted while power up and muted while power down. > @@ -75,7 +75,7 @@ static int wm8524_startup(struct snd_pcm_substream *substream, > SNDRV_PCM_HW_PARAM_RATE, > &wm8524->rate_constraint); > > - gpiod_set_value_cansleep(wm8524->mute, 1); > + gpiod_set_value_cansleep(wm8524->mute, 0); > > return 0; > } I *think* the theory with these is that the device should be muted by default so that any noise during startup is minimised, and only unmuted when there's an actual audio stream, done in wm8524_mute_stream(). I am unclear why this default state is set up in startup(), or why we unmute in shutdown(). It could be that the startup thing is trying to work around some suspend/resume thing? In any case I'm not sure this helps, I think really we should just not be managing the GPIO in these functions at all and setting the default state to be muted when the GPIO is requested. With this change we'd move the unmute _mute_stream() does much earlier, meaning that any noise output by the SoC during startup will get played.
diff --git a/sound/soc/codecs/wm8524.c b/sound/soc/codecs/wm8524.c index b56dcac60244..8f2130e05b32 100644 --- a/sound/soc/codecs/wm8524.c +++ b/sound/soc/codecs/wm8524.c @@ -75,7 +75,7 @@ static int wm8524_startup(struct snd_pcm_substream *substream, SNDRV_PCM_HW_PARAM_RATE, &wm8524->rate_constraint); - gpiod_set_value_cansleep(wm8524->mute, 1); + gpiod_set_value_cansleep(wm8524->mute, 0); return 0; } @@ -86,7 +86,7 @@ static void wm8524_shutdown(struct snd_pcm_substream *substream, struct snd_soc_component *component = dai->component; struct wm8524_priv *wm8524 = snd_soc_component_get_drvdata(component); - gpiod_set_value_cansleep(wm8524->mute, 0); + gpiod_set_value_cansleep(wm8524->mute, 1); } static int wm8524_set_dai_sysclk(struct snd_soc_dai *codec_dai,