From patchwork Fri Apr 14 15:25:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Binding X-Patchwork-Id: 83489 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp467228vqo; Fri, 14 Apr 2023 08:29:49 -0700 (PDT) X-Google-Smtp-Source: AKy350YkjvhMdZ7cVzlWuy7rZw3bohzQ0VmzWvfdCzrUKGOK8Rd2WnpjZDyL3DJ7dobVoSK8ynUG X-Received: by 2002:a17:90a:7785:b0:246:818c:d8e4 with SMTP id v5-20020a17090a778500b00246818cd8e4mr5713657pjk.11.1681486189465; Fri, 14 Apr 2023 08:29:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681486189; cv=none; d=google.com; s=arc-20160816; b=RT01AYpn68cT0ki8VwazPe6EG9IjJt/l0nscWfKWp82SYJNNl+SN2y80sMV0NmmvUd P0ci+KVXI//1kh11eVNc0ePKqICkpG9xnadiH9dh5GBZIMF2eanx1hmlOF5ovMydSC29 EtqSyqPdAu8sAvNML1hOqhYoEzrs9uFgMGny9QeRO8HfYFVmixZM1OfiVmyhnQ9qft1i qB5ut/lznBvyD6F2RV6CJsKb7P/ru+zIaiWpBlWLtR4WBtaY2fogozxMwH1wdrayPmFu N75Y/fhf7FPkAL/bqNddMNbv4udhickEvhwQtoy+pxwNs3lYMsx/gwvN16Ogcx22FVkC SKsA== 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=I3l9dEf9Pxrt0iwsB+1r4Bv1ieTEMmtO3O+2uHhuyLc=; b=XztR7kRv/CeSZWJWXhE6eLacxX3LO93DZdgJuTmnoYxFmZ+pTVnidnxB2vPppduD8+ DzPDjTwwhSRM2wMtYSl285grGyOC6PBOWCF3WzK2sJ8dw0WNt2rIRmk4kuOCxMpCrqvp +SvMqD6O/Bj3h4U2VqASOnlLwPJ3ex+WpZY8iDQGvcEOn0wWIHe01QDOjY3/OLrrKpgc Quag93TuXUeCNAtE9p2hTcfN71kvboR4UOsD7bO5z4TC4/IrpJF9PQWw0GgzQCsP4sJA EN96yi1F7XYSmqJQGzc3LuY8D6CNoEgfJY/NOAXmb73GnLFdPHYPh0tf3hqhny0eBMZ2 mK5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=H7Lglqao; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 2-20020a630d42000000b004fb7e7ef77dsi4889346pgn.693.2023.04.14.08.29.36; Fri, 14 Apr 2023 08:29:49 -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=H7Lglqao; 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 S231362AbjDNP1W (ORCPT + 99 others); Fri, 14 Apr 2023 11:27:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231274AbjDNP1K (ORCPT ); Fri, 14 Apr 2023 11:27:10 -0400 Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BE95FF0D for ; Fri, 14 Apr 2023 08:26:34 -0700 (PDT) Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 33EDVEGo030487; Fri, 14 Apr 2023 10:26:02 -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=I3l9dEf9Pxrt0iwsB+1r4Bv1ieTEMmtO3O+2uHhuyLc=; b=H7LglqaoEwfzYkPgtASdJxtxvolzG99MPScVDQjlRdAQ/DIwrHLNwiBfOMLt06Ac8ZVF g/w5FMFls8dIZD6N0QYUtVgwXDAGVV1mkZXQ02BhThiUvHXeczPloFrTAmMEFWp8pQ7p ovuA9EApLPzTKianpN0jZ9GT0GbtnWsJg946R0A8AqR7/Liyg06MFq2i/nsk6DVAP1GT hyHU5uAFSDlg0tvXpRp2xnpxwmoc4DLopQxlFve5HNLXEI9dGdYfszbomdYw0pfVB6rl 9J90AdDUGuCJJExfGtayzfnCymxMSZAjtUqWLZP6npzi7WEK9x0MdX9OdYzFEfygUUXl PA== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 3pu5p3skxn-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 14 Apr 2023 10:26:02 -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_256_GCM_SHA384) id 15.2.1118.26; Fri, 14 Apr 2023 10:25:59 -0500 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.2.1118.26 via Frontend Transport; Fri, 14 Apr 2023 10:25:59 -0500 Received: from sbinding-cirrus-dsktp2.ad.cirrus.com (unknown [198.90.238.135]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 5782211C6; Fri, 14 Apr 2023 15:25:59 +0000 (UTC) From: Stefan Binding To: Mark Brown , Jaroslav Kysela , Takashi Iwai CC: , , , Stefan Binding Subject: [PATCH v1 1/4] ALSA: hda: cs35l41: Clean up Firmware Load Controls Date: Fri, 14 Apr 2023 16:25:49 +0100 Message-ID: <20230414152552.574502-2-sbinding@opensource.cirrus.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230414152552.574502-1-sbinding@opensource.cirrus.com> References: <20230414152552.574502-1-sbinding@opensource.cirrus.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: zUZitPZy_kxOGxncML1uE6UtVdccA4Kb X-Proofpoint-GUID: zUZitPZy_kxOGxncML1uE6UtVdccA4Kb 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763166062473984347?= X-GMAIL-MSGID: =?utf-8?q?1763166062473984347?= Ensure Firmware Load control and Firmware Type control returns 1 when the value changes. Remove fw_mutex from firmware load control put, since it is unnecessary, and prevents any possibility of mutex inversion. Signed-off-by: Stefan Binding --- sound/pci/hda/cs35l41_hda.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/sound/pci/hda/cs35l41_hda.c b/sound/pci/hda/cs35l41_hda.c index b5210abb5141f..d100189e15b83 100644 --- a/sound/pci/hda/cs35l41_hda.c +++ b/sound/pci/hda/cs35l41_hda.c @@ -835,34 +835,26 @@ static int cs35l41_fw_load_ctl_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct cs35l41_hda *cs35l41 = snd_kcontrol_chip(kcontrol); - unsigned int ret = 0; - - mutex_lock(&cs35l41->fw_mutex); if (cs35l41->request_fw_load == ucontrol->value.integer.value[0]) - goto err; + return 0; if (cs35l41->fw_request_ongoing) { dev_dbg(cs35l41->dev, "Existing request not complete\n"); - ret = -EBUSY; - goto err; + return -EBUSY; } /* Check if playback is ongoing when initial request is made */ if (cs35l41->playback_started) { dev_err(cs35l41->dev, "Cannot Load/Unload firmware during Playback\n"); - ret = -EBUSY; - goto err; + return -EBUSY; } cs35l41->fw_request_ongoing = true; cs35l41->request_fw_load = ucontrol->value.integer.value[0]; schedule_work(&cs35l41->fw_load_work); -err: - mutex_unlock(&cs35l41->fw_mutex); - - return ret; + return 1; } static int cs35l41_fw_type_ctl_get(struct snd_kcontrol *kcontrol, @@ -881,8 +873,12 @@ static int cs35l41_fw_type_ctl_put(struct snd_kcontrol *kcontrol, struct cs35l41_hda *cs35l41 = snd_kcontrol_chip(kcontrol); if (ucontrol->value.enumerated.item[0] < HDA_CS_DSP_NUM_FW) { - cs35l41->firmware_type = ucontrol->value.enumerated.item[0]; - return 0; + if (cs35l41->firmware_type != ucontrol->value.enumerated.item[0]) { + cs35l41->firmware_type = ucontrol->value.enumerated.item[0]; + return 1; + } else { + return 0; + } } return -EINVAL; From patchwork Fri Apr 14 15:25:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Binding X-Patchwork-Id: 83492 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp474359vqo; Fri, 14 Apr 2023 08:40:33 -0700 (PDT) X-Google-Smtp-Source: AKy350bRRqSg6Q0w+8wmfO+b90dNlP1x8crKiAOTVAphg4hPU31bFzqKHl1gRNOD2ITjdOTiOsGt X-Received: by 2002:a17:902:ebc5:b0:1a6:8405:f709 with SMTP id p5-20020a170902ebc500b001a68405f709mr3280021plg.20.1681486832857; Fri, 14 Apr 2023 08:40:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681486832; cv=none; d=google.com; s=arc-20160816; b=DQYNmPJq3F5nqR4oc/+ewjVaiHcXxB2AkthCTEdQda5NL7UuD/d6zkaJtKOocnN/i8 Rq83g0xACf6ngAzZK16xqTs5UD7ICHKWv+DeseoZyVPwVuagVdid+/jRlEgIeZ97jsTm a1ollCG60xO9nkLzNxUixw/mViGz06M1lbyyU3YlLe9PJmqG4o/6bKAzmb2OzUvVwXnw jLXZfygxVG0jD8AxPj7FIuejHGFCvuoImhLSxVgbi6nfXR8cgTgA9wOBMc3Ad0awY3uH aGEx6Qe/lBNFbZboW+CauL2VaCboN2+rX1tXBEVdekz+QryqZstsegYmPnFmZ0dXgwR8 MBNw== 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=K1cH0ZtWLCX8sI+lF/y9e1IRq9QfXxo07nEhVezuoz8=; b=Cac2lFcWW6r2vWdILaTKoIe9sZAca+Ru3ybiSHOlELgr/ByYfQlayZYIJ8nCQxCKYb 5P7h34ajPaJgH4kJgXwrKZbCXVuw1g86SlO5m2s0HCj72dbv1WA4rKzj0MDFiLBj9T8l 22ncizLJos5y9+5c1dUIeg057u+rxYlikHPI4iF8m691K4bGfTuHS+bl2WTx3a8gnd2s VqftNlEXiv5hkkDChlPlGsxCBa5QqqBwhcUDpVlqprSmwbjnJ+R1qeiiUYzPWcGTAvOd t0A7wouHa5OF0lQuTpVa5HjKHIMnQMEiEk1qwNMIyGgt65P6ytjdN5x0ru8QwZhdmjgD fxxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=KwdFeteY; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i4-20020a170902c94400b001a076305275si5090628pla.318.2023.04.14.08.40.11; Fri, 14 Apr 2023 08:40:32 -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=KwdFeteY; 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 S231435AbjDNP1f (ORCPT + 99 others); Fri, 14 Apr 2023 11:27:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231359AbjDNP1K (ORCPT ); Fri, 14 Apr 2023 11:27:10 -0400 Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01F0910255 for ; Fri, 14 Apr 2023 08:26:37 -0700 (PDT) Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 33E7k6Wk003961; Fri, 14 Apr 2023 10:26:01 -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=K1cH0ZtWLCX8sI+lF/y9e1IRq9QfXxo07nEhVezuoz8=; b=KwdFeteYV3LvVQ4LwHXsqQ6/9A/ryuBJIE/ur0hLpjJfMliaxImDpIFPP+O/q8MDmiqF +kap4nqKA0GMNqbNqI0GsOUYOJay8DXhjJlReMg9BZXvby46xZLTr/lZkB/9sTSilknk mctQ6JUORS8RxXF++tQu/lxSPo/mc1XCf29o+6WQnAXdxQr6WTLm94AfUELMUEIC1a7e MTpEXcqUc1CZ2hiIvYPJ8ETTvftATAi4JO7kmPpPCb2jmGfDXJeYslO8kGOuUUTeuCBc KKZGr5YSNi+GgmK7ktyxQtr1cpyLjcIQWjKBsxASPXwJ+QGwQbbXYCwU4Yy/KeOXdJO4 iQ== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3pxm3qa2sv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 14 Apr 2023 10:26:01 -0500 Received: from ediex02.ad.cirrus.com (198.61.84.81) by ediex01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Fri, 14 Apr 2023 10:25:59 -0500 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by anon-ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Fri, 14 Apr 2023 10:25:59 -0500 Received: from sbinding-cirrus-dsktp2.ad.cirrus.com (unknown [198.90.238.135]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 8ED9545D; Fri, 14 Apr 2023 15:25:59 +0000 (UTC) From: Stefan Binding To: Mark Brown , Jaroslav Kysela , Takashi Iwai CC: , , , Stefan Binding Subject: [PATCH v1 2/4] ALSA: hda: cs35l41: Fix endian conversions Date: Fri, 14 Apr 2023 16:25:50 +0100 Message-ID: <20230414152552.574502-3-sbinding@opensource.cirrus.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230414152552.574502-1-sbinding@opensource.cirrus.com> References: <20230414152552.574502-1-sbinding@opensource.cirrus.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: 5jipqptVmrcXanMYxa1yYbmgYy1HOgdG X-Proofpoint-GUID: 5jipqptVmrcXanMYxa1yYbmgYy1HOgdG 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763166737296688902?= X-GMAIL-MSGID: =?utf-8?q?1763166737296688902?= Found during static analysis, ensure variables are correct types before endian conversion. Signed-off-by: Stefan Binding --- sound/pci/hda/cs35l41_hda.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sound/pci/hda/cs35l41_hda.c b/sound/pci/hda/cs35l41_hda.c index d100189e15b83..b02462ae21f04 100644 --- a/sound/pci/hda/cs35l41_hda.c +++ b/sound/pci/hda/cs35l41_hda.c @@ -308,8 +308,8 @@ static int cs35l41_request_firmware_files(struct cs35l41_hda *cs35l41, } #if IS_ENABLED(CONFIG_EFI) -static int cs35l41_apply_calibration(struct cs35l41_hda *cs35l41, unsigned int ambient, - unsigned int r0, unsigned int status, unsigned int checksum) +static int cs35l41_apply_calibration(struct cs35l41_hda *cs35l41, __be32 ambient, __be32 r0, + __be32 status, __be32 checksum) { int ret; @@ -379,10 +379,10 @@ static int cs35l41_save_calibration(struct cs35l41_hda *cs35l41) /* Calibration can only be applied whilst the DSP is not running */ ret = cs35l41_apply_calibration(cs35l41, - cpu_to_be32(cl->calAmbient), - cpu_to_be32(cl->calR), - cpu_to_be32(cl->calStatus), - cpu_to_be32(cl->calR + 1)); + (__be32)cpu_to_be32(cl->calAmbient), + (__be32)cpu_to_be32(cl->calR), + (__be32)cpu_to_be32(cl->calStatus), + (__be32)cpu_to_be32(cl->calR + 1)); } } vfree(data); @@ -745,7 +745,7 @@ static int cs35l41_runtime_resume(struct device *dev) static int cs35l41_smart_amp(struct cs35l41_hda *cs35l41) { - int halo_sts; + __be32 halo_sts; int ret; ret = cs35l41_init_dsp(cs35l41); @@ -773,7 +773,7 @@ static int cs35l41_smart_amp(struct cs35l41_hda *cs35l41) &halo_sts, sizeof(halo_sts)); if (ret) { - dev_err(cs35l41->dev, "Timeout waiting for HALO Core to start. State: %d\n", + dev_err(cs35l41->dev, "Timeout waiting for HALO Core to start. State: %u\n", halo_sts); goto clean_dsp; } From patchwork Fri Apr 14 15:25:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Binding X-Patchwork-Id: 83494 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp475579vqo; Fri, 14 Apr 2023 08:42:39 -0700 (PDT) X-Google-Smtp-Source: AKy350aHwIWn1d5nYTw3edxZr94RBWKK65FSrKVyonHI2/0d6Or+7We/Rg3VfeMnI+pIPD5+53cF X-Received: by 2002:a05:6a00:14cc:b0:63b:6933:a30d with SMTP id w12-20020a056a0014cc00b0063b6933a30dmr3420120pfu.25.1681486959366; Fri, 14 Apr 2023 08:42:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681486959; cv=none; d=google.com; s=arc-20160816; b=PCwf6/rwJV61khrRAJy2RNqRY0DQT22NPeTmMKU0wMRTF2emaemQu6OD5XjPuRStRn 6xpL7BGdPo8R5cKnLluaTzQrdBzySYmPCZgfh0aYjoT7PHx/6799+djA1amj4f+utH4X KxNI+PF4c47PyiNhRJGXNoivVkN7NwT6ynxCVFZF2fyDRIoCMSWCyLDMt87paw1cu3us G8YGv0imwSb7/iyRLv2Q5vI95X67ego4Ze42HixvcCBoErwQrIAnsPIR6niPAXJqXIai 7o5pLKVjhT2zKuSA3YO5nWLC6Tj7ADltFdveYVi8s+uR2KreQrDRzr9nDnmnJmoPfprJ LOYw== 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=fjFs/7f3dFz2OTkn4kKsaTBEamc34d9Tzg4y7U6KXUM=; b=YO/oRk6wxulSeruoGxZk//EoUWzTjsSPkLST8TuDhK0BE5sM6lGgAxKPgEAO+ZWeCr IyFVOp3/SHoibslBzWe67M7cUzNjh/2AQ06WGRhRk8UI1D+wPVDNhlm3BjWzECXWmpSD X2eXyMDt5kae9XGABJJrF4AdtATamUqjcMcrQ4ru3HfX1xO4UJ5phS2OgDjng2iyPBwe 3SJHN0XEdGcAFRBsZYTmtUL9sIgZAdPoNI8LR/fgMlaHjcYafZHRjrkhbJpC4z+M0Qyx rzKqniR0ITLNKxuErRK3EUmRgFrENlDjiNQr0T47VRsS1s143b5ZIODH/eismFhIXUrf oucA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=VtmhZIrD; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y69-20020a626448000000b0063b5f88b7b7si2943400pfb.340.2023.04.14.08.42.24; Fri, 14 Apr 2023 08:42:39 -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=VtmhZIrD; 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 S231426AbjDNP1d (ORCPT + 99 others); Fri, 14 Apr 2023 11:27:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231294AbjDNP1K (ORCPT ); Fri, 14 Apr 2023 11:27:10 -0400 Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00719FF34 for ; Fri, 14 Apr 2023 08:26:37 -0700 (PDT) Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 33E7k6Wl003961; Fri, 14 Apr 2023 10:26:02 -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=fjFs/7f3dFz2OTkn4kKsaTBEamc34d9Tzg4y7U6KXUM=; b=VtmhZIrD6mNr91Sr6u02L2CkY8drI77l1O/CeKzpMPLfJmBOtX37Q63ea6B8yMpPVo+s DjdSvpJM/s4ghTWL/gJmlDjNCJ0nnJB4jSHJPlRa9JwtMQHWt5gRayF8K9hP3DUXZS3n 7jxfpkdv42fsrHc03WHT7OlAysLx76ODc4Pp6iWn7eY6x66LZHn89rzA0GSqvGHf4dWn AI51zD14+CrBJlpvesyokbaJ4ga3d9YfFCYH7dr57malXyJyGf8O1EsWAk1gVuwfuEEH COWJl1D9HimtXUImDDvxtakmsf6js3U6l2X0BYy667NLd3edUqVHQW8itvdZ6wdaDVdp +Q== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3pxm3qa2sv-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 14 Apr 2023 10:26:01 -0500 Received: from ediex02.ad.cirrus.com (198.61.84.81) by ediex01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Fri, 14 Apr 2023 10:26:00 -0500 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by anon-ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Fri, 14 Apr 2023 10:26:00 -0500 Received: from sbinding-cirrus-dsktp2.ad.cirrus.com (unknown [198.90.238.135]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id C6B2511C6; Fri, 14 Apr 2023 15:25:59 +0000 (UTC) From: Stefan Binding To: Mark Brown , Jaroslav Kysela , Takashi Iwai CC: , , , Stefan Binding Subject: [PATCH v1 3/4] ALSA: cs35l41: Fix default regmap values for some registers Date: Fri, 14 Apr 2023 16:25:51 +0100 Message-ID: <20230414152552.574502-4-sbinding@opensource.cirrus.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230414152552.574502-1-sbinding@opensource.cirrus.com> References: <20230414152552.574502-1-sbinding@opensource.cirrus.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: mmGkCZSi7rCS15raiHdKCPZq_Ps-Hxj1 X-Proofpoint-GUID: mmGkCZSi7rCS15raiHdKCPZq_Ps-Hxj1 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763166813888136663?= X-GMAIL-MSGID: =?utf-8?q?1763166869714172367?= Several values do not match the defaults of CS35L41, fix them. Signed-off-by: Stefan Binding --- sound/soc/codecs/cs35l41-lib.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/codecs/cs35l41-lib.c b/sound/soc/codecs/cs35l41-lib.c index 8538e2871c5fa..1e4205295a0de 100644 --- a/sound/soc/codecs/cs35l41-lib.c +++ b/sound/soc/codecs/cs35l41-lib.c @@ -46,7 +46,7 @@ static const struct reg_default cs35l41_reg[] = { { CS35L41_DSP1_RX5_SRC, 0x00000020 }, { CS35L41_DSP1_RX6_SRC, 0x00000021 }, { CS35L41_DSP1_RX7_SRC, 0x0000003A }, - { CS35L41_DSP1_RX8_SRC, 0x00000001 }, + { CS35L41_DSP1_RX8_SRC, 0x0000003B }, { CS35L41_NGATE1_SRC, 0x00000008 }, { CS35L41_NGATE2_SRC, 0x00000009 }, { CS35L41_AMP_DIG_VOL_CTRL, 0x00008000 }, @@ -58,8 +58,8 @@ static const struct reg_default cs35l41_reg[] = { { CS35L41_IRQ1_MASK2, 0xFFFFFFFF }, { CS35L41_IRQ1_MASK3, 0xFFFF87FF }, { CS35L41_IRQ1_MASK4, 0xFEFFFFFF }, - { CS35L41_GPIO1_CTRL1, 0xE1000001 }, - { CS35L41_GPIO2_CTRL1, 0xE1000001 }, + { CS35L41_GPIO1_CTRL1, 0x81000001 }, + { CS35L41_GPIO2_CTRL1, 0x81000001 }, { CS35L41_MIXER_NGATE_CFG, 0x00000000 }, { CS35L41_MIXER_NGATE_CH1_CFG, 0x00000303 }, { CS35L41_MIXER_NGATE_CH2_CFG, 0x00000303 }, From patchwork Fri Apr 14 15:25:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Binding X-Patchwork-Id: 83490 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp467631vqo; Fri, 14 Apr 2023 08:30:23 -0700 (PDT) X-Google-Smtp-Source: AKy350YCq/mDSfjgx5nB76x6X87p0cgH6LoZJsRnPTy5fbiK2YhE7z4DWAc57SKBKmvzatWX9SH9 X-Received: by 2002:a05:6a00:1acd:b0:635:a4fb:35e2 with SMTP id f13-20020a056a001acd00b00635a4fb35e2mr9186460pfv.3.1681486222895; Fri, 14 Apr 2023 08:30:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681486222; cv=none; d=google.com; s=arc-20160816; b=oPtSzm8Y1I6or761lHSrXLxmF8A+eXl0U9Q/IozSTFan7EKQK4gtXtv/t+ymTFXBRD fMCjYt7ttjnwQo2PQA7zFqpcBKKZgLEXiqvvCcO16bP4WH2YZn+WwItA+cpZnOOxhl3x ire58sIeFaJPN/Ag+XuaG1TeynlqYQkJ4lvz6aZx7I6FybZ2qGYdSTZVIHDU3oi9L4zJ hvmmT8c6IZ+/aecblRkBe2RpAh+gxlufSR4oh00N9md9zyHIHn9pO8Qgj8yf8XWlZYjT QOOwpLGYWJyL4DAGV6YzAiICEoOijTyqOyqZK4vsBDLZOMNTaY3MVGTEdmzuWPMDHQb4 EqWw== 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=uiepQRJc6hSwibfyXox6IpHGvJY0zVutwuW3J5LXHm8=; b=myMpHdqxU71syAaahhF00WXQqdsl1Kw5IvZ5dhIBQk6liXD55gtSy/ErPPefYxRHxV 1Gt+eIjGWG6pP107RvNURMgX8VfuG2vDDwUIkTFhBvAUvyhqXoFwWsHY60lWIu8lgsyM jpJ3Lk4wYyYlCT1EQifJ/Ao4sPP7NB7GERAnAgZRZiz/zMmc1lKnIWFLOnAjIYJVfkoS RqTbstmN8n/oX4h7CU9PQjafV90Xr4/QrZQ+k21RxnemZU2uOlDLmCZEPnHy0um7kjx/ TMjGxND/gJMbwhOVTal48bckbd/f290dg4UFy89aU6r8/RTxHPD+dkvkqBHpI4gjbxbV z5Cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=lffR9rAF; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 124-20020a620682000000b0063b1421d10fsi4517831pfg.222.2023.04.14.08.30.06; Fri, 14 Apr 2023 08:30:22 -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=lffR9rAF; 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 S229950AbjDNP1a (ORCPT + 99 others); Fri, 14 Apr 2023 11:27:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231349AbjDNP1K (ORCPT ); Fri, 14 Apr 2023 11:27:10 -0400 Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCEF0FF2A for ; Fri, 14 Apr 2023 08:26:34 -0700 (PDT) Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 33EDVEGp030487; Fri, 14 Apr 2023 10:26:03 -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=uiepQRJc6hSwibfyXox6IpHGvJY0zVutwuW3J5LXHm8=; b=lffR9rAF2TvlA5UVdy2L784HaL99xv6BEHVEVqtxMGmiSImaAEBm8a+hm97At8fmn49Z Y15Hu9cxquqpWi/5ApRHSpOqjTSEslpVaBVQiNmj2zMLVMo2kGdp306fYsiCJUr7HSM6 UhbXCVI/7Dnj+iIqIDZ0b5reAPGh9D6azwwWXn/7tk7uIebRI1UVqATtRJvyCkFW4yuL 1Ff9PNaKlpfwu4O8hdBUWKqb5NpR6imTE33QJpogBpdKAyU4K7Uj+rmC1un2nX46NjZe N/27btx8c3WXXdLcBbMH1xldfJlcY++fkrofl3hcd+EvdRTUQDEPdR9++E6oV/Fj7vRA Xw== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 3pu5p3skxn-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 14 Apr 2023 10:26:03 -0500 Received: from ediex02.ad.cirrus.com (198.61.84.81) by ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Fri, 14 Apr 2023 10:26:00 -0500 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by anon-ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Fri, 14 Apr 2023 10:26:00 -0500 Received: from sbinding-cirrus-dsktp2.ad.cirrus.com (unknown [198.90.238.135]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 0980845D; Fri, 14 Apr 2023 15:26:00 +0000 (UTC) From: Stefan Binding To: Mark Brown , Jaroslav Kysela , Takashi Iwai CC: , , , Stefan Binding Subject: [PATCH v1 4/4] ALSA: hda/realtek: Delete cs35l41 component master during free Date: Fri, 14 Apr 2023 16:25:52 +0100 Message-ID: <20230414152552.574502-5-sbinding@opensource.cirrus.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230414152552.574502-1-sbinding@opensource.cirrus.com> References: <20230414152552.574502-1-sbinding@opensource.cirrus.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: E2mLVeeRv9wTXg4ldyB9dpCwOjvo4cvB X-Proofpoint-GUID: E2mLVeeRv9wTXg4ldyB9dpCwOjvo4cvB 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763166098036386547?= X-GMAIL-MSGID: =?utf-8?q?1763166098036386547?= This ensures that the driver is properly cleaned up when freed. Signed-off-by: Stefan Binding --- sound/pci/hda/patch_realtek.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 3b9f077a227f7..bbeffbb84091e 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -6757,6 +6757,8 @@ static void cs35l41_generic_fixup(struct hda_codec *cdc, int action, const char else spec->gen.pcm_playback_hook = comp_generic_playback_hook; break; + case HDA_FIXUP_ACT_FREE: + component_master_del(dev, &comp_master_ops); } }