Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp8095709rwb; Tue, 13 Dec 2022 02:02:05 -0800 (PST) X-Google-Smtp-Source: AA0mqf565KFLzARHLi3uNGMfG8RPBMLzLW2V2tkBSJnencCVa6YaTb7oWExGhUtthC5YjXgCAOR+ X-Received: by 2002:a17:903:264b:b0:189:ec62:3b2d with SMTP id je11-20020a170903264b00b00189ec623b2dmr20461201plb.4.1670925725206; Tue, 13 Dec 2022 02:02:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670925725; cv=none; d=google.com; s=arc-20160816; b=WzT5gbJYklfrXXJVCFIFJCpA7QvvapoRbIuCLdISjKAditBfQEHp7480zoi8Lyjrzz Za51qwt/5cB8cDlIl0NOz/QsTNbuRodDlbkd1R9/QIbVGgGWfvU2RuAgJMs2Dqc8MMpy MXTIQ708QeEubcTlTHDF8A7djbN5p3JyDsmYb4zGcSsQ80i7pYVFj7+EySe6en0h4Td5 16bdiQ58Ip4moGVTI4n+4sQPylBEQFga4y6/4ovXt3hPKHQyRb+R+3YFxFTLsEBmx/+a pnOYRpMUWoROmFM2yKkTdBG1hp00+Mzso9UvT+2KwRzBBrQgiGjkidU6VYyr0QnjqjGS tp2A== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w17-20020a170902e89100b00188b63f078dsi11092642plg.362.2022.12.13.02.01.55; Tue, 13 Dec 2022 02:02:05 -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 + 74 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 Content-Transfer-Encoding: 8bit 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 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; -- 2.38.1