Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp2111305pxm; Fri, 4 Mar 2022 09:34:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJxQ92tDDVtSxuAPeYS1jpM39JKg47Uwn4XR560GWVNKx1OIhZ4occSQsKt+LtonmHxaGjaJ X-Received: by 2002:a17:906:c14b:b0:6da:b30d:76a0 with SMTP id dp11-20020a170906c14b00b006dab30d76a0mr4251600ejc.279.1646415242045; Fri, 04 Mar 2022 09:34:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646415242; cv=none; d=google.com; s=arc-20160816; b=K3WeutkJzlL7w4aEeACrhUAe15VkuKCxcyGudNu7He29zlh1kfRTL9C8Xk/0NvtPoy Qiea70YLsuMVMXUcN6Z4hhYhqc0ovBgVoZ/3zoVRDs9fPctabrhv9E9ndU5aey5wQp21 ThLTAkBhVAtB8yVwf4aJtd2kEMS7mG+iVOo+2EBNw5lRu5ubXRe4t3gl8UzZwoTXXzGf Wosq9sEorBvucJ67TS88S0Tx8WCvcrIrTQMdLQnDKTQEKJAZQuoi1tNgFrIB7KuvyMl8 o4SA6XM6urikb8ncTwoRiVQoZDauV9UM/4UnFAgpS+fb4YCs42Lo+Lje+YNHGHkWbp/X s3Ig== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=QodoB5nWD3LF9aj69ESslxB6QbpX+2m0y7Bji4mb9EI=; b=VG7VAZSfh88z3vCOXmLi5a8iDc5S24zAaD4vUHS9MgM/mfn4mnnp+Uc9O16zqJHlA2 irYdk4b7PI9+e0DL9Q/f15zWfcf1+ovYg1eX8jwRevM46dSzGZwKAEgmKYkQUx6qN7KK mOJDqNS1H3O2DQpUjZZlaZaITdqN/pY+0B9ZMt6jmwsx3t+yAVAixdGAMizLcddIJBvD vBlEUJSjNkgQWwOp7bE6HSg82i23pk0z17yOnyOcJmwPuYMW3fXD8KeLP7b6W345rp5T TNvpg4pw8lo094o2J6iaiTWyCVeF4Q6WhxaLdwuHzEQ2kc13UwuUBSCXMWcAHQagHKco /vog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b="Zoo5qo/c"; 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=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i5-20020a05640242c500b004159d32e23fsi4133177edc.309.2022.03.04.09.33.37; Fri, 04 Mar 2022 09:34:02 -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=@cirrus.com header.s=PODMain02222019 header.b="Zoo5qo/c"; 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=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240267AbiCDPJ6 (ORCPT + 99 others); Fri, 4 Mar 2022 10:09:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240235AbiCDPJb (ORCPT ); Fri, 4 Mar 2022 10:09:31 -0500 Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A80CD148900; Fri, 4 Mar 2022 07:08:23 -0800 (PST) Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 2248TInL019088; Fri, 4 Mar 2022 09:07:43 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=PODMain02222019; bh=QodoB5nWD3LF9aj69ESslxB6QbpX+2m0y7Bji4mb9EI=; b=Zoo5qo/cVIybk4yFi9t/yyHmJBdyLwJWoQ+J2x1RRU7MCjBKm3bR//8wMfIQvbX6t6ll ZLrodQUoWHNAMVu6unaeS74Kp4RWyqrrrd9sIEvpbBEg5xlt06FfM2LHPwfoOqWZ9lT3 /xmwNIA9EqlWZzmMS3DLNyFss9ykI0duHflbQn1lT2rdmCS1A655hJCYiLWrr6ohvufU 4n2JrjCznCQDdreajCQYo8hv2cLbV77UGbS85UjWYCpCOUwtr/i9lzrYoJvT8ArRuelw yMtO+XpkJqPlq12+2wxlYj/SQK71F3Wyc4a7+czsBR87ZIrjAKFFjznxXv22QNK9s8Ja jw== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3ek4j3h413-11 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Fri, 04 Mar 2022 09:07:41 -0600 Received: from EDIEX01.ad.cirrus.com (198.61.84.80) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.18; Fri, 4 Mar 2022 15:07:29 +0000 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server id 15.1.2375.18 via Frontend Transport; Fri, 4 Mar 2022 15:07:29 +0000 Received: from aryzen.ad.cirrus.com (unknown [198.61.65.198]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 382EE11D1; Fri, 4 Mar 2022 15:07:29 +0000 (UTC) From: Lucas Tanure To: Liam Girdwood , Mark Brown , Rob Herring , Jaroslav Kysela , Takashi Iwai CC: , , , , Lucas Tanure Subject: [PATCH v2 16/20] hda: cs35l41: Reorganize log for playback actions Date: Fri, 4 Mar 2022 15:07:17 +0000 Message-ID: <20220304150721.3802-17-tanureal@opensource.cirrus.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220304150721.3802-1-tanureal@opensource.cirrus.com> References: <20220304150721.3802-1-tanureal@opensource.cirrus.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: qrKINcH41ooLGaFnFrlDj6_MwdudvkLx X-Proofpoint-ORIG-GUID: qrKINcH41ooLGaFnFrlDj6_MwdudvkLx X-Proofpoint-Spam-Reason: safe X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 For each case, only log the last regmap access so it doesn't get overwritten, and all regmap access should show the same issues. Change to dev_err to log this error. Also, differentiate between a regmap access failure and invalid playback action. Signed-off-by: Lucas Tanure --- sound/pci/hda/cs35l41_hda.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/sound/pci/hda/cs35l41_hda.c b/sound/pci/hda/cs35l41_hda.c index 08ce9b8005ec..fda4af323c32 100644 --- a/sound/pci/hda/cs35l41_hda.c +++ b/sound/pci/hda/cs35l41_hda.c @@ -144,10 +144,9 @@ static void cs35l41_hda_playback_hook(struct device *dev, int action) switch (action) { case HDA_GEN_PCM_ACT_OPEN: - ret = regmap_multi_reg_write(reg, cs35l41_hda_config, - ARRAY_SIZE(cs35l41_hda_config)); - regmap_update_bits(reg, CS35L41_PWR_CTRL2, - CS35L41_AMP_EN_MASK, 1 << CS35L41_AMP_EN_SHIFT); + regmap_multi_reg_write(reg, cs35l41_hda_config, ARRAY_SIZE(cs35l41_hda_config)); + ret = regmap_update_bits(reg, CS35L41_PWR_CTRL2, + CS35L41_AMP_EN_MASK, 1 << CS35L41_AMP_EN_SHIFT); break; case HDA_GEN_PCM_ACT_PREPARE: ret = cs35l41_hda_global_enable(cs35l41, 1); @@ -157,16 +156,16 @@ static void cs35l41_hda_playback_hook(struct device *dev, int action) ret = cs35l41_hda_global_enable(cs35l41, 0); break; case HDA_GEN_PCM_ACT_CLOSE: - regmap_update_bits(reg, CS35L41_PWR_CTRL2, - CS35L41_AMP_EN_MASK, 0 << CS35L41_AMP_EN_SHIFT); + ret = regmap_update_bits(reg, CS35L41_PWR_CTRL2, + CS35L41_AMP_EN_MASK, 0 << CS35L41_AMP_EN_SHIFT); break; default: - ret = -EINVAL; + dev_warn(cs35l41->dev, "Playback action not supported: %d\n", action); break; } if (ret) - dev_warn(cs35l41->dev, "Failed to apply multi reg write: %d\n", ret); + dev_err(cs35l41->dev, "Regmap access fail: %d\n", ret); } static int cs35l41_hda_channel_map(struct device *dev, unsigned int tx_num, unsigned int *tx_slot, -- 2.35.1