Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1237060pxp; Thu, 17 Mar 2022 05:55:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxyCP5ocMZpBz9O7q+kgytyaOsa6ohiW1CJZjd2vy957XRYYCrDcr9cHXnKtFjCye1P2jo0 X-Received: by 2002:a17:902:b948:b0:153:9994:b587 with SMTP id h8-20020a170902b94800b001539994b587mr5090673pls.68.1647521729205; Thu, 17 Mar 2022 05:55:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647521729; cv=none; d=google.com; s=arc-20160816; b=ddcdO9hoBdRjQwvbIy27c41dbHNYVTOjZ200RZHcxWHIgRBvUXWy3/J1hImF7WgB9u lk8cx9u+X0MZ9956+vwI/C7WsizqhrCCcrI8rgB9V4pNqgqREIGYyHHYrwKsx6YiXFZi R4wxBZIA4N3BAcSdmq1reQNd5EbI2MMLryJHL1bIWshIMo4h0YFL8LWIIirg0ZNQcI7X /rvknvzoPE1V0PzAUFLHbFugMF1A/nAizWZBc5O5Lt6ATrBsL4xPX2LSDn70aY7g/deD nc6299M6AbBPYvp22DWeqYgjLnMK5kvIqAm+dO0Wpn3ewAdsXje6ZsNRbXDjJDcF/PcQ laQg== 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=xxRGWV0GdBuYVwUw8paO+jr9OgLMwyNzezVazBUiXZE=; b=wxm2emjErzVwEsWyB7sMfdQla5hS2A8trKyu4kTZFm1tbf10WysGOZsVL6IdJFBZiw MPx+0IVCLysAX9YvAYSv8K9K0cP1EL/LylUFSpsF2TaP161ibhdqkrKc/Es/ceOVqddI PNPKwlWfL/MH3YAFMSJLc+S9UkeXI6h8Pk5nJk8yEhXy9l9fCxHQpmAeR47S5CT9b6Qo pJZKnAJ43yrdDQv1qcgRQWoDbiH4RwvbL4x+ZHGovwojmhdMKtwogJ/u63ue72Pl65qU hCTQpFvl16HdSH/8xjDl+3FzAoSttIqgP6L8W7Tgg7TzFFsiXXG/wSfAdZ6VzX1pqUZW lgbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=SXapGSIo; 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 s15-20020a65644f000000b003820fac6c22si1009483pgv.340.2022.03.17.05.55.17; Thu, 17 Mar 2022 05:55:29 -0700 (PDT) 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=SXapGSIo; 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 S231944AbiCQJdY (ORCPT + 99 others); Thu, 17 Mar 2022 05:33:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231876AbiCQJdH (ORCPT ); Thu, 17 Mar 2022 05:33:07 -0400 Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9578E1D4C1C; Thu, 17 Mar 2022 02:31:51 -0700 (PDT) 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 22H7ecZt022935; Thu, 17 Mar 2022 04:31:35 -0500 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=xxRGWV0GdBuYVwUw8paO+jr9OgLMwyNzezVazBUiXZE=; b=SXapGSIot2dyqHDqYWofeNaeBPDfH+1dpYnJ9q9xhHcdd5CJUCyRzWibTq5fRa3Ozwh3 5t9tM0o8GIkcNh51lR2y+ehtp4zSh0fXXZiwmd7SpXU0dwudOqXAe/ux8daauuggT5+m aLYrgJVAACFSwWDaioF4MRMP5BFapM6czs4+YeAwNp/oV2sr7p5zvIyEPc29BaiYHvmG u2+o/4bpKA58+skfS5PXSFY+dcf0hKe7E44yIzivtTgMh58zl6t7uDEUDmpvgJTeRPz8 oQakOW5Efn0VGPwBu+VgWUbzukHBh/tsyOjrt2JM8Qb9eUjFyOiFBqyCw88DGGv1AUaS cA== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3et5yp475f-8 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Thu, 17 Mar 2022 04:31:35 -0500 Received: from EDIEX01.ad.cirrus.com (198.61.84.80) by EDIEX02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.18; Thu, 17 Mar 2022 09:31:33 +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; Thu, 17 Mar 2022 09:31:33 +0000 Received: from aryzen.ad.cirrus.com (unknown [198.61.64.95]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id AA68E11D1; Thu, 17 Mar 2022 09:31:33 +0000 (UTC) From: Lucas Tanure To: Liam Girdwood , Mark Brown , Rob Herring , Jaroslav Kysela , Takashi Iwai CC: , , , , Lucas Tanure Subject: [PATCH v4 12/16] ALSA: hda: cs35l41: Reorganize log for playback actions Date: Thu, 17 Mar 2022 09:31:16 +0000 Message-ID: <20220317093120.168534-13-tanureal@opensource.cirrus.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220317093120.168534-1-tanureal@opensource.cirrus.com> References: <20220317093120.168534-1-tanureal@opensource.cirrus.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: AH0mSEcksv28JnM0er7NnqiKotfDky7J X-Proofpoint-GUID: AH0mSEcksv28JnM0er7NnqiKotfDky7J 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 as all regmap access should show the same issues logging the last one should be enough. 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 ece784662dbd..3294837ff606 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