Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3848331pxp; Wed, 23 Mar 2022 06:58:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJySGvVJdtUjzKL235MOwHczA1IioZg9VMcDaaSabVjn5vS+ZUaE1R4BVTsSi++PD8ZdKif9 X-Received: by 2002:a17:906:3ad3:b0:6cd:382b:86e5 with SMTP id z19-20020a1709063ad300b006cd382b86e5mr40089ejd.145.1648043898953; Wed, 23 Mar 2022 06:58:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648043898; cv=none; d=google.com; s=arc-20160816; b=aSPc8khyU7PjGvpFBjzTBfeUNUJTsK4UkhEFkD5JhM3tyr2hcRwHeNcbJnmoFvd5Mr 2GwwVzRsu15QOPV6TUm9gIjvSSgPlCUczMx3s3ovbYP9xQc0cfWce6s6oMROxPnZY810 81vcYn6JYEKDfGt1foH60SoPNpqfPHxUxxWvTGOhivJ7IkvcGISvKW7eMdBMYpnttW3Q e+1aCOehVzzrDzcqnRKEndlmBSmGHFZLwgFwTcPdcEO1xFF4Ucwzs/XLppc7qrr7aJBK dmW5ELVPnzG6iavR1jx8SJxLpHdo8bH2I98wDJl73xaXa9+0+jw9PyfGa+mFqPDzfZHo fIVg== 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=UCkMgHBS9W53USnkgPMo3T5iT1pDbNorDijYng05QUdYyn9Snwv1/2Rsd1AtoU9HpJ XI/GZRDl5772VVCNpeyQVAx26nZ+hLMTBq5C+6BMg8czow5PJDbHj/sXQ/k/69o9Bt6d dPipa4zka1MTAAPYBAkg1dBa8OVz0V8Yy6RXqDMfuJtEuPmVj2ST3SmZCAhhMNRsGeEF wDW35b3hmB/pq4/lLpkLqmpU+pYKdQ6OjzHe8Sf0uKEX/IbcwsnOubglcHq0Mg3O/hMS 0xhNEMztRlxnoOXM9XNsuBG3TFzCoGvaYw6wZYFBnlHH9kFmO7ZAtHcXRUwAGaKrFXD7 eUJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=HqC6KOai; 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 f5-20020a170906738500b006dfb71913ebsi12440323ejl.890.2022.03.23.06.57.52; Wed, 23 Mar 2022 06:58:18 -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=HqC6KOai; 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 S238472AbiCVPU7 (ORCPT + 99 others); Tue, 22 Mar 2022 11:20:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238406AbiCVPUY (ORCPT ); Tue, 22 Mar 2022 11:20:24 -0400 Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4AB4D5BD07; Tue, 22 Mar 2022 08:18:56 -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 22MCnUfG013136; Tue, 22 Mar 2022 10:18:42 -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=HqC6KOaiVZVJNQRTVAwsFyOtNSziuAYe+rH6HYakf+BfURaIS887qiCxiJJw7uKf5Ji4 yxBrNXOtV27/cFbpPrAVgxWpL5tvO9HnSfDOE4Sq+6tneyLscxUv2swYFj1buBm0ZOwd w9+bH7JDZtmLAN3wGzZH334vaBj809HfMJFl/rCB/K8t/0A8ODmCbmEhQ/P3rd7bwsD3 L1QZRDsfzvv5Js5i9n+1FZsproBIKbH051QKUh5JapW3BlnUTqdr0c8X8ZW05xoATfBG +VhP3uEPqLGo/X5dur+3GP7QYfEelbdxJlDNkYERYTI+Vhy95rZwF3Yn7m0IKsGxdSzL gw== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3ewbknc0jc-9 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Tue, 22 Mar 2022 10:18:42 -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; Tue, 22 Mar 2022 15:18:35 +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; Tue, 22 Mar 2022 15:18:35 +0000 Received: from aryzen.ad.cirrus.com (unknown [198.61.65.125]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id D0379477; Tue, 22 Mar 2022 15:18:34 +0000 (UTC) From: Lucas Tanure To: Liam Girdwood , Mark Brown , Rob Herring , Jaroslav Kysela , Takashi Iwai CC: , , , , Lucas Tanure Subject: [PATCH v5 12/16] ALSA: hda: cs35l41: Reorganize log for playback actions Date: Tue, 22 Mar 2022 15:18:15 +0000 Message-ID: <20220322151819.4299-13-tanureal@opensource.cirrus.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220322151819.4299-1-tanureal@opensource.cirrus.com> References: <20220322151819.4299-1-tanureal@opensource.cirrus.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: b4Q3ovl4SDfzykNyvcrg2iEmhMZieSEB X-Proofpoint-GUID: b4Q3ovl4SDfzykNyvcrg2iEmhMZieSEB 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