From patchwork Tue Dec 13 09:53:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rouven Czerwinski X-Patchwork-Id: 32732 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp19044wrn; Tue, 13 Dec 2022 01:54:07 -0800 (PST) X-Google-Smtp-Source: AA0mqf6en0+pzwLKaHCANa/2+AOjhpxpHgfgQue03AeKq0b6symaRaueCAuL3vjE6RNK/bVaFrG5 X-Received: by 2002:a17:90a:b786:b0:212:cf2f:74ec with SMTP id m6-20020a17090ab78600b00212cf2f74ecmr19974070pjr.37.1670925247274; Tue, 13 Dec 2022 01:54:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670925247; cv=none; d=google.com; s=arc-20160816; b=oIwz6hrlQAaNV1Grtnq3xvwChTvuc1UySpQggSend2IbSfyFlRAny5kHg/pDhOEGOH 8ff0X3laOWyJeyOFxv3Q7janm4MMxnOiI5k1W1l89ovMDeo+g+ldm3yroprjzpnOrJVz 0g2ggkmYEirW2MZQzC6g/dUfPo5cDATY9/RSU8Ak91EVWpS6eDS8imeAmURxc4+q9mCS whUG+4Rra9eXRLVwyhSRmopco2P5mM+9EGD/Ajdp5LajQseDBHt1RUFsRTIBwLu6duPI 3r4uXRj0MSW7Ym+D9ZCFCbzHVkmZ8e7dosWBH3q3ae5ILxTZxtg2Lm7/YFbTZpi9AF+x /ahw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=xcIoBC624VZV+7ia9neA81Hha2nbREA/7ZWczr4XJ0M=; b=yTRSOwFpITYOrBglwRqtoFmhEY7b/kF43B0clwgpilCFjxAGfI9W4kWMREaKRNhqCN rT3yWUt06+R3GqmahOfDWFS4t5ltrpETDooEBlS9Xfp8Ed5Y/ylpfwj539b125S9GpxS +1NZyafFW0nAsL8sGMAWzSbn6mWEIbutGI17Hl3g4or/9+g0rKFJopROLZY3CxGDx6a1 MvbhGd45I1qkLdpS+8L1oK+aQOM+Kq7eSreatVXICYjpTMN8X7NnFp2tI5Ms2Vr2VLTo a0NANxGv4T7XMSfSQs9bEMF1sO1ehw+d0qoFjENzeVCikDdLTdxozP7oP89KAHQfgEyp IcMg== ARC-Authentication-Results: i=1; mx.google.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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ml23-20020a17090b361700b0021a04add441si11308124pjb.104.2022.12.13.01.53.54; Tue, 13 Dec 2022 01:54:07 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234981AbiLMJxm (ORCPT + 99 others); Tue, 13 Dec 2022 04:53:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233933AbiLMJxj (ORCPT ); Tue, 13 Dec 2022 04:53:39 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 003F72604 for ; Tue, 13 Dec 2022 01:53:37 -0800 (PST) Received: from ptz.office.stw.pengutronix.de ([2a0a:edc0:0:900:1d::77] helo=localhost) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p51yc-0000eF-QL; Tue, 13 Dec 2022 10:53:30 +0100 From: Rouven Czerwinski To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai Cc: kernel@pengutronix.de, Marco Felsch , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] ASoC: max98088: fix dai1/2_hw_params access Date: Tue, 13 Dec 2022 10:53:27 +0100 Message-Id: <20221213095328.122309-1-r.czerwinski@pengutronix.de> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a0a:edc0:0:900:1d::77 X-SA-Exim-Mail-From: r.czerwinski@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS autolearn=ham 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752092112076501001?= X-GMAIL-MSGID: =?utf-8?q?1752092112076501001?= From: Marco Felsch According the reference manuals [1], [2] updating register 0x14/1c should only be done after #shdn bit is set to 0. [1] https://datasheets.maximintegrated.com/en/ds/MAX98089.pdf [2] https://datasheets.maximintegrated.com/en/ds/MAX98088.pdf Signed-off-by: Marco Felsch --- sound/soc/codecs/max98088.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/soc/codecs/max98088.c b/sound/soc/codecs/max98088.c index 405ec16be2b6..7f108e147355 100644 --- a/sound/soc/codecs/max98088.c +++ b/sound/soc/codecs/max98088.c @@ -977,6 +977,8 @@ static int max98088_dai1_hw_params(struct snd_pcm_substream *substream, rate = params_rate(params); + snd_soc_component_update_bits(component, M98088_REG_51_PWR_SYS, M98088_SHDNRUN, 0); + switch (params_width(params)) { case 16: snd_soc_component_update_bits(component, M98088_REG_14_DAI1_FORMAT, @@ -990,8 +992,6 @@ static int max98088_dai1_hw_params(struct snd_pcm_substream *substream, return -EINVAL; } - snd_soc_component_update_bits(component, M98088_REG_51_PWR_SYS, M98088_SHDNRUN, 0); - if (rate_value(rate, ®val)) return -EINVAL; @@ -1047,6 +1047,8 @@ static int max98088_dai2_hw_params(struct snd_pcm_substream *substream, rate = params_rate(params); + snd_soc_component_update_bits(component, M98088_REG_51_PWR_SYS, M98088_SHDNRUN, 0); + switch (params_width(params)) { case 16: snd_soc_component_update_bits(component, M98088_REG_1C_DAI2_FORMAT, @@ -1060,8 +1062,6 @@ static int max98088_dai2_hw_params(struct snd_pcm_substream *substream, return -EINVAL; } - snd_soc_component_update_bits(component, M98088_REG_51_PWR_SYS, M98088_SHDNRUN, 0); - if (rate_value(rate, ®val)) return -EINVAL;