Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2561054pxb; Mon, 19 Apr 2021 08:27:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/Gy4etX7qb/Mpt14duoTQRHGoyi3xT9L+EYK8rbC+bOVA+4j/JA1wDUucagYyZamQ3CE/ X-Received: by 2002:a17:906:dfd6:: with SMTP id jt22mr22542939ejc.161.1618846027665; Mon, 19 Apr 2021 08:27:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618846027; cv=none; d=google.com; s=arc-20160816; b=QiIs6X+kSTFD+3FzcXpsQ8UUbZJuY3/bOt4tFFE/U/NCbzqOgjqujrsBYf8cVjLH25 yekS/n1Srk2E2KpYY4BZc0DcHgAQVRQaiFVIqlu7ReMlAdS7DFFHk8MXX1DgVRCkwoAf hx6fxKJRIMdTEeRh600xc6tRVuFAaI4KLOFnd/Xy+OoeVlPKh5rL3SveapbLQbTzAg15 3FrYhTBo6Vc7S4oO3EB/D5fS2bmnpuRHxQV2xhcoVDGgCb33xU5NOIyEPu7lcWZLQvVN fPzI5HheK6FCBmUxwh3v7Y+a3Xt4BKK5cblgt6Zr44ruTRLLLMlPeg6KofgUfagLUrh+ +9ow== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=OGnTX/mRYc63ydeUNUo+nQsLsVXShQkyW88qfRRMxos=; b=AecOlL7rMSo9WaccWmv1e8/YWd1o1KmX2N2ZrPRN0mF/dwHRWKiKesOJjX6t0oiyyD 1knQfs0xnbL6tKkf7NI6OLJcjeItHVu9WfZQGbW+V4VrgcXyRGtZtkic5Ea0W2RdNcyc MO41m8xOXWo8HC3Y/OHIKLVelXJUQsEOHOIoN4zmleJUpstBxnkXSfCOxyLtPsfiYbps oBE0H30w5AE+WgcoJlB6GHpQcMitne7u26WioQ4OfKQvehVzwJAuXnhw/d16Fj9/IQQv oE8/maDmMS9nGy1vLvc9ZyAX1w3bE8IC6jrjUpN3wsTiuI9SB+uZPusJCGEgjfxbwyAf PqWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="O/We9hmS"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n1si12435844edy.167.2021.04.19.08.26.44; Mon, 19 Apr 2021 08:27:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="O/We9hmS"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240473AbhDSNU7 (ORCPT + 99 others); Mon, 19 Apr 2021 09:20:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:47728 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240531AbhDSNQc (ORCPT ); Mon, 19 Apr 2021 09:16:32 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A801561354; Mon, 19 Apr 2021 13:13:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1618838038; bh=BoVdH6KrJri0ZVRqOkfW+M41yFN1y391Hopf2LtxxdQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O/We9hmS0iwdsBoKifT3xRKHx5m8AuaZgDYEOIXlcjCjkB6t6pdSzGWjh9MEm3i6m m5K/YizFA94DKnpxnPKtUZ91X3ZGTQModQQ7+VA62ZCSHSn31imcA99DafvmdX2240 JFo3SHHGGhyzjhhg0suZbQrrWYiTymwmkiQ5LdM0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ryan Lee , Mark Brown , Sasha Levin Subject: [PATCH 5.10 020/103] ASoC: max98373: Changed amp shutdown register as volatile Date: Mon, 19 Apr 2021 15:05:31 +0200 Message-Id: <20210419130528.486019705@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210419130527.791982064@linuxfoundation.org> References: <20210419130527.791982064@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ryan Lee [ Upstream commit a23f9099ff1541f15704e96b784d3846d2a4483d ] 0x20FF(amp global enable) register was defined as non-volatile, but it is not. Overheating, overcurrent can cause amp shutdown in hardware. 'regmap_write' compare register readback value before writing to avoid same value writing. 'regmap_read' just read cache not actual hardware value for the non-volatile register. When amp is internally shutdown by some reason, next 'AMP ON' command can be ignored because regmap think amp is already ON. Signed-off-by: Ryan Lee Link: https://lore.kernel.org/r/20210325033555.29377-1-ryans.lee@maximintegrated.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/max98373-i2c.c | 1 + sound/soc/codecs/max98373-sdw.c | 1 + 2 files changed, 2 insertions(+) diff --git a/sound/soc/codecs/max98373-i2c.c b/sound/soc/codecs/max98373-i2c.c index 92921e34f948..32b0c1d98365 100644 --- a/sound/soc/codecs/max98373-i2c.c +++ b/sound/soc/codecs/max98373-i2c.c @@ -440,6 +440,7 @@ static bool max98373_volatile_reg(struct device *dev, unsigned int reg) case MAX98373_R2054_MEAS_ADC_PVDD_CH_READBACK: case MAX98373_R2055_MEAS_ADC_THERM_CH_READBACK: case MAX98373_R20B6_BDE_CUR_STATE_READBACK: + case MAX98373_R20FF_GLOBAL_SHDN: case MAX98373_R21FF_REV_ID: return true; default: diff --git a/sound/soc/codecs/max98373-sdw.c b/sound/soc/codecs/max98373-sdw.c index fa589d834f9a..14fd2f9a0bf3 100644 --- a/sound/soc/codecs/max98373-sdw.c +++ b/sound/soc/codecs/max98373-sdw.c @@ -214,6 +214,7 @@ static bool max98373_volatile_reg(struct device *dev, unsigned int reg) case MAX98373_R2054_MEAS_ADC_PVDD_CH_READBACK: case MAX98373_R2055_MEAS_ADC_THERM_CH_READBACK: case MAX98373_R20B6_BDE_CUR_STATE_READBACK: + case MAX98373_R20FF_GLOBAL_SHDN: case MAX98373_R21FF_REV_ID: /* SoundWire Control Port Registers */ case MAX98373_R0040_SCP_INIT_STAT_1 ... MAX98373_R0070_SCP_FRAME_CTLR: -- 2.30.2