From patchwork Thu Jan 13 17:07:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas Tanure X-Patchwork-Id: 12712988 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0BD65C433EF for ; Thu, 13 Jan 2022 17:08:35 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id E06651F09; Thu, 13 Jan 2022 18:07:43 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E06651F09 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1642093714; bh=ft1hYXbrRA7RFA9HjAmdgL/0Ls5EkFqiBF1n2slNkKI=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=WbDssFqshl4oMAh+r79+E6CrZmMZJjCZoerg42DyKQnOG48kUtp2Szgr2qrR8Bacz pbOtDKODDYp8zXWzFAGldCBwkL5BI93kSC84baAtOPqJuCHuFUvDGLT+UslLax86Vg zAkhfC4nPXTCy49b2flnHIHAjKowfuC6ljqAuJ70= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id E382CF8019B; Thu, 13 Jan 2022 18:07:42 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 778CCF80088; Thu, 13 Jan 2022 18:07:40 +0100 (CET) Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 89394F80088 for ; Thu, 13 Jan 2022 18:07:34 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 89394F80088 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b="Yl7eXDWT" 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 20DGAZTT021018; Thu, 13 Jan 2022 11:07:32 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=PODMain02222019; bh=GAtWy8saaDNASzmwjnxbbHFXnbph2X6H4i7d21Nd0To=; b=Yl7eXDWTsM0tyE6HEu9Qtjq5aeCWNDRFwCbvxfV7csilDIwxbVGnYeDxEU7AIANVh6wH O3gGEvSI7YM41WQg9jjZUL6BKBordycLCvk1ZH/DabTKVe3mCDcHYW5pG0q0xoDzo1hi fC0sMaJR9fwGwRDIM1r/oLRQ4OUMlp3qP24vI2zKmauCZAmQ53RtKvrul0GA9Mnwsuly xZYhgywYd/3vDFQer+umv26oL+gW9NikHTjLbR1XNk/jvV7oBjmGjrK6TWnPKz3K9Mo4 Ml5m2pfdDEtMoP31NXM7nhH6iTKp6//BdbtsUWyNWV81o6iablExnIM+zSSlisojQbHI PQ== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3djqcb026x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Thu, 13 Jan 2022 11:07:32 -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; Thu, 13 Jan 2022 17:07:30 +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, 13 Jan 2022 17:07:30 +0000 Received: from aryzen.ad.cirrus.com (unknown [198.61.65.50]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id C59EBB13; Thu, 13 Jan 2022 17:07:29 +0000 (UTC) From: Lucas Tanure To: "Rafael J . Wysocki" , Len Brown , Hans de Goede , Mark Gross , Jaroslav Kysela , Takashi Iwai Subject: [PATCH 1/5] ALSA: hda: cs35l41: Avoid overwriting register patch Date: Thu, 13 Jan 2022 17:07:24 +0000 Message-ID: <20220113170728.1953559-1-tanureal@opensource.cirrus.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Proofpoint-GUID: dvxRVehPXollWW0CaTnrYuaYFoaHuRMI X-Proofpoint-ORIG-GUID: dvxRVehPXollWW0CaTnrYuaYFoaHuRMI X-Proofpoint-Spam-Reason: safe Cc: alsa-devel@alsa-project.org, Charles Keepax , Lucas Tanure , patches@opensource.cirrus.com, linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-acpi@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Charles Keepax regmap_register_patch can't be used to apply the probe sequence as a patch is already registers with the regmap by cs35l41_register_errata_patch and only a single patch can be attached to a single regmap. The driver doesn't currently rely on a cache sync to re-apply this probe sequence so simply switch it to a multi write. Signed-off-by: Charles Keepax Signed-off-by: Lucas Tanure --- sound/pci/hda/cs35l41_hda.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/pci/hda/cs35l41_hda.c b/sound/pci/hda/cs35l41_hda.c index 30b40d865863..c47c5f0b4e59 100644 --- a/sound/pci/hda/cs35l41_hda.c +++ b/sound/pci/hda/cs35l41_hda.c @@ -480,7 +480,7 @@ int cs35l41_hda_probe(struct device *dev, const char *device_name, int id, int i acpi_hw_cfg = NULL; if (cs35l41->reg_seq->probe) { - ret = regmap_register_patch(cs35l41->regmap, cs35l41->reg_seq->probe, + ret = regmap_multi_reg_write(cs35l41->regmap, cs35l41->reg_seq->probe, cs35l41->reg_seq->num_probe); if (ret) { dev_err(cs35l41->dev, "Fail to apply probe reg patch: %d\n", ret); From patchwork Thu Jan 13 17:07:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas Tanure X-Patchwork-Id: 12712992 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A1973C433F5 for ; Thu, 13 Jan 2022 17:10:00 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 5E22A2036; Thu, 13 Jan 2022 18:09:08 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 5E22A2036 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1642093798; bh=6jJqw1zxSZGJ4whrMvItC7N04L5/xejXvS5zoM+rFnE=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=QaabyEoMK0vnflWogiSHsBvOrAqrL8pjuZ3xcdCkwoEUTYDNIssWbbQaKvmViLuw7 WQnzP+MuAmBv33n98tcy8T8U4EQpwaRmWsUxk4XpcbPihL73DF+6ns0WsTpi4EYRV6 tLBJI16ngQcdzY18RuAmKJPbRXXK2p61cOHqmo8k= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 85A9BF80516; Thu, 13 Jan 2022 18:07:47 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 19C18F80516; Thu, 13 Jan 2022 18:07:46 +0100 (CET) Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id EF6A8F80054 for ; Thu, 13 Jan 2022 18:07:34 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz EF6A8F80054 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b="AAVok25A" 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 20DGAV40020998; Thu, 13 Jan 2022 11:07:33 -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=HI6bEErhvsZPIb7ephN7Y9393a6abI1s2gAyNDkJZXY=; b=AAVok25Aem42bor/3GPosb7Owzp05/4x22OYdTpKbVqaekymMPC8ll7a1A6cixEwXajk qv4UgpFBP9DFZf7As1F3IWVuW/o5aHTun4o65BEoExgZE6KJ+EzbjHRqYJ7jGG4FRdf2 tThu54E6vm6fow7jR9DGB6WkfDodYjl1vxfl16RV/hlfsHZa1tyKQVb+cXOhM44hydKY 0VtgMgwrB8jLHv8MdJaOZ33HKnUDViKK/KgmzkF6LCDWaE0Yg7Z65L6IBjvEq7GCdpoe e00jgNgK6vVtA8EZSRAD1+ghvWmpfdvej6+kP/wiwmZemhJ4fXmPr1nCDYddu+6GOiLf Bg== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3djqcb026y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Thu, 13 Jan 2022 11:07:33 -0600 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, 13 Jan 2022 17:07:31 +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, 13 Jan 2022 17:07:31 +0000 Received: from aryzen.ad.cirrus.com (unknown [198.61.65.50]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id C7E87B0E; Thu, 13 Jan 2022 17:07:30 +0000 (UTC) From: Lucas Tanure To: "Rafael J . Wysocki" , Len Brown , Hans de Goede , Mark Gross , Jaroslav Kysela , Takashi Iwai Subject: [PATCH 2/5] ALSA: hda: cs35l41: Add calls to newly added test key function Date: Thu, 13 Jan 2022 17:07:25 +0000 Message-ID: <20220113170728.1953559-2-tanureal@opensource.cirrus.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220113170728.1953559-1-tanureal@opensource.cirrus.com> References: <20220113170728.1953559-1-tanureal@opensource.cirrus.com> MIME-Version: 1.0 X-Proofpoint-GUID: pmEixx5NJrqnbqps-fMLCBxpSSPyDnrM X-Proofpoint-ORIG-GUID: pmEixx5NJrqnbqps-fMLCBxpSSPyDnrM X-Proofpoint-Spam-Reason: safe Cc: alsa-devel@alsa-project.org, Charles Keepax , Lucas Tanure , patches@opensource.cirrus.com, linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-acpi@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Charles Keepax The test key now needs to be manually held when calling cs35l41_register_errata_patch, after patch: 'commit f517ba4924ad ("ASoC: cs35l41: Add support for hibernate memory retention mode")' Add the missing function calls to this driver. Signed-off-by: Charles Keepax Signed-off-by: Lucas Tanure --- sound/pci/hda/cs35l41_hda.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sound/pci/hda/cs35l41_hda.c b/sound/pci/hda/cs35l41_hda.c index c47c5f0b4e59..509a380f9be7 100644 --- a/sound/pci/hda/cs35l41_hda.c +++ b/sound/pci/hda/cs35l41_hda.c @@ -463,6 +463,10 @@ int cs35l41_hda_probe(struct device *dev, const char *device_name, int id, int i goto err; } + ret = cs35l41_test_key_unlock(cs35l41->dev, cs35l41->regmap); + if (ret) + goto err; + ret = cs35l41_register_errata_patch(cs35l41->dev, cs35l41->regmap, reg_revid); if (ret) goto err; @@ -473,6 +477,10 @@ int cs35l41_hda_probe(struct device *dev, const char *device_name, int id, int i goto err; } + ret = cs35l41_test_key_lock(cs35l41->dev, cs35l41->regmap); + if (ret) + goto err; + ret = cs35l41_hda_apply_properties(cs35l41, acpi_hw_cfg); if (ret) goto err; From patchwork Thu Jan 13 17:07:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas Tanure X-Patchwork-Id: 12712989 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1A4D6C433F5 for ; Thu, 13 Jan 2022 17:09:09 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 685672006; Thu, 13 Jan 2022 18:08:17 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 685672006 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1642093747; bh=HCuF+JLwAfO4pGgFL8/yewbZvLUNniZUOVrmwxPJQQA=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=rrOlfRwwjZRY9UgP9PH3GJ1GuGtWULLCFN2QtRv7xkiKb5UxpOu981ZbJgXpUhL9k uoNscKC0oVVoCEiKC9BzSNHrqOH9ffjZjhOrRhqRB09btsukB78Aaz/0t4/YthmxLD KqVi1P2RhlvYuZF30sWI4r+YzmInBh3n7WP4OoFY= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id D5765F8013F; Thu, 13 Jan 2022 18:07:44 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id A3B17F8028D; Thu, 13 Jan 2022 18:07:42 +0100 (CET) Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 7BC25F8010B for ; Thu, 13 Jan 2022 18:07:35 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 7BC25F8010B Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b="ACXWgahF" 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 20DGAV41020998; Thu, 13 Jan 2022 11:07:34 -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=Gec5JZr/Y9//uxGFGGdu2d0McsJMuIB7A7Bb0u1sRVw=; b=ACXWgahFZ9fSR7ggCRO6q6WcMrTFiJBdI0Mo9XOZdMQxb7wz7U6LwAWgh913BPE8ny53 ++dJvUXvVAqfBzUH0DNiCF70XYgoNxmVEBFbi1Ih7y3gUxFGCDLNMku6mNaAL3od9ZxD AHPPzwQvd/xmXBVw9EXfPL8IZm5KI29gL6Lx+/MO/44tw75DrJhLYDWrB6rLG9s7Eyq8 BECGMRxmjMoqlfyrgBwaAJggFXXUUyp5ls2PRSemMXGlWaaABVscxemndUV2InBavxK0 0e+FGQyKBJXzeR3dtJKsdZxz3H5cKzM73N+G/3f0veHc9PXrfq1eCBrRINu+xwUQE1d1 jg== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3djqcb026y-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Thu, 13 Jan 2022 11:07:33 -0600 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, 13 Jan 2022 17:07:31 +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, 13 Jan 2022 17:07:31 +0000 Received: from aryzen.ad.cirrus.com (unknown [198.61.65.50]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 4B04BB13; Thu, 13 Jan 2022 17:07:31 +0000 (UTC) From: Lucas Tanure To: "Rafael J . Wysocki" , Len Brown , Hans de Goede , Mark Gross , Jaroslav Kysela , Takashi Iwai Subject: [PATCH 3/5] ALSA: hda: cs35l41: Move cs35l41* calls to its own symbol namespace Date: Thu, 13 Jan 2022 17:07:26 +0000 Message-ID: <20220113170728.1953559-3-tanureal@opensource.cirrus.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220113170728.1953559-1-tanureal@opensource.cirrus.com> References: <20220113170728.1953559-1-tanureal@opensource.cirrus.com> MIME-Version: 1.0 X-Proofpoint-GUID: -focsmKxe0hIUvMgZBWBu82KdQqnWk2U X-Proofpoint-ORIG-GUID: -focsmKxe0hIUvMgZBWBu82KdQqnWk2U X-Proofpoint-Spam-Reason: safe Cc: alsa-devel@alsa-project.org, Lucas Tanure , patches@opensource.cirrus.com, linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-acpi@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Create own namespace and avoid polluting the global namespace Signed-off-by: Lucas Tanure --- sound/pci/hda/cs35l41_hda.c | 5 ++--- sound/pci/hda/cs35l41_hda_i2c.c | 1 + sound/pci/hda/cs35l41_hda_spi.c | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/sound/pci/hda/cs35l41_hda.c b/sound/pci/hda/cs35l41_hda.c index 509a380f9be7..c4f25e48dcc0 100644 --- a/sound/pci/hda/cs35l41_hda.c +++ b/sound/pci/hda/cs35l41_hda.c @@ -514,7 +514,7 @@ int cs35l41_hda_probe(struct device *dev, const char *device_name, int id, int i return ret; } -EXPORT_SYMBOL_GPL(cs35l41_hda_probe); +EXPORT_SYMBOL_NS_GPL(cs35l41_hda_probe, SND_HDA_SCODEC_CS35L41); int cs35l41_hda_remove(struct device *dev) { @@ -528,8 +528,7 @@ int cs35l41_hda_remove(struct device *dev) return 0; } -EXPORT_SYMBOL_GPL(cs35l41_hda_remove); - +EXPORT_SYMBOL_NS_GPL(cs35l41_hda_remove, SND_HDA_SCODEC_CS35L41); MODULE_DESCRIPTION("CS35L41 HDA Driver"); MODULE_AUTHOR("Lucas Tanure, Cirrus Logic Inc, "); diff --git a/sound/pci/hda/cs35l41_hda_i2c.c b/sound/pci/hda/cs35l41_hda_i2c.c index 4a9462fb5c14..eeb387853ee3 100644 --- a/sound/pci/hda/cs35l41_hda_i2c.c +++ b/sound/pci/hda/cs35l41_hda_i2c.c @@ -62,5 +62,6 @@ static struct i2c_driver cs35l41_i2c_driver = { module_i2c_driver(cs35l41_i2c_driver); MODULE_DESCRIPTION("HDA CS35L41 driver"); +MODULE_IMPORT_NS(SND_HDA_SCODEC_CS35L41); MODULE_AUTHOR("Lucas Tanure "); MODULE_LICENSE("GPL"); diff --git a/sound/pci/hda/cs35l41_hda_spi.c b/sound/pci/hda/cs35l41_hda_spi.c index 77426e96c58f..15345a72b9d1 100644 --- a/sound/pci/hda/cs35l41_hda_spi.c +++ b/sound/pci/hda/cs35l41_hda_spi.c @@ -59,5 +59,6 @@ static struct spi_driver cs35l41_spi_driver = { module_spi_driver(cs35l41_spi_driver); MODULE_DESCRIPTION("HDA CS35L41 driver"); +MODULE_IMPORT_NS(SND_HDA_SCODEC_CS35L41); MODULE_AUTHOR("Lucas Tanure "); MODULE_LICENSE("GPL"); From patchwork Thu Jan 13 17:07:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas Tanure X-Patchwork-Id: 12712991 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C1349C433EF for ; Thu, 13 Jan 2022 17:09:44 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id E4A531FFF; Thu, 13 Jan 2022 18:08:52 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E4A531FFF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1642093783; bh=mAAyaxlp4jmuRqwwzAWU3XzO3CghP0szHvaAc00MZTE=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=N5GNEJeOmndhIqrtEibaSMWvdjxZGv5yL/rGA3PbjQnXefHMM1Tu5iddw8AsaDJHX igiMi4xHVOuyFn3fzStXfaEf1yc70ZRPwYfaBi8tV87n0xdLMQSEKdfQfgvKm+ls1P lbk5sCi0O01RawcRyY6rVLDCGvtiaKuD2L3f1+D8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id F1502F80511; Thu, 13 Jan 2022 18:07:45 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 72939F804F2; Thu, 13 Jan 2022 18:07:44 +0100 (CET) Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 02015F80141 for ; Thu, 13 Jan 2022 18:07:36 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 02015F80141 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b="D4ohoHiw" 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 20DGAV42020998; Thu, 13 Jan 2022 11:07:35 -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=K6AuF+RjMil6+/0ThjKZ4Rh00Akizg/P1nMqOVzITu4=; b=D4ohoHiwIToUc5ZvvW3mqpiViCHgbO8fatHmWuvYJrVRvcmPgrY2rSmRh4dYsnR6ipx+ nHNGCKX5Bx0NO/V0ibJTBbZVuZ6BCpIBCg5vgk03R6T6Ju3IofORWpuaYxAzNkIEVuyP Z+gdUhvYvsjQMtOTO+OCPyeahkloeHLfJqhMPd/5AX+UxRoQOTJv9PE7bA0bcbg6x+ko cqXD0Xlt012XexJtkbFf2SZxE6tJXzGDfuQ5bLl/5xvS0y5gPFV0iu9rckXSdTO5T0ON 0Rg4+FsK1WRR/4Ihavr1J41Vu0tNSF4ajmxDH1/YHNmXAXUw4pEAg1V5lGMqZmI5P/Ct Tg== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3djqcb026y-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Thu, 13 Jan 2022 11:07:34 -0600 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, 13 Jan 2022 17:07:32 +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, 13 Jan 2022 17:07:32 +0000 Received: from aryzen.ad.cirrus.com (unknown [198.61.65.50]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id B36FA11D8; Thu, 13 Jan 2022 17:07:31 +0000 (UTC) From: Lucas Tanure To: "Rafael J . Wysocki" , Len Brown , Hans de Goede , Mark Gross , Jaroslav Kysela , Takashi Iwai Subject: [PATCH 4/5] ALSA: hda: cs35l41: Tidyup code and add default cases Date: Thu, 13 Jan 2022 17:07:27 +0000 Message-ID: <20220113170728.1953559-4-tanureal@opensource.cirrus.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220113170728.1953559-1-tanureal@opensource.cirrus.com> References: <20220113170728.1953559-1-tanureal@opensource.cirrus.com> MIME-Version: 1.0 X-Proofpoint-GUID: 5tLMwNYK6dS_nHsRK5vpZY1a5J8A-Byv X-Proofpoint-ORIG-GUID: 5tLMwNYK6dS_nHsRK5vpZY1a5J8A-Byv X-Proofpoint-Spam-Reason: safe Cc: alsa-devel@alsa-project.org, Lucas Tanure , patches@opensource.cirrus.com, linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-acpi@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Clean up the code, plus adding default cases for switch and dev_err_probe use. Signed-off-by: Lucas Tanure --- sound/pci/hda/cs35l41_hda.c | 109 ++++++++++++++++---------------- sound/pci/hda/cs35l41_hda.h | 2 +- sound/pci/hda/cs35l41_hda_i2c.c | 1 - sound/pci/hda/cs35l41_hda_spi.c | 1 - 4 files changed, 57 insertions(+), 56 deletions(-) diff --git a/sound/pci/hda/cs35l41_hda.c b/sound/pci/hda/cs35l41_hda.c index c4f25e48dcc0..cb8331587c17 100644 --- a/sound/pci/hda/cs35l41_hda.c +++ b/sound/pci/hda/cs35l41_hda.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 // -// cs35l41.c -- CS35l41 ALSA HDA audio driver +// CS35l41 ALSA HDA audio driver // // Copyright 2021 Cirrus Logic, Inc. // @@ -17,19 +17,19 @@ #include "cs35l41_hda.h" static const struct reg_sequence cs35l41_hda_config[] = { - { CS35L41_PLL_CLK_CTRL, 0x00000430 }, //3200000Hz, BCLK Input, PLL_REFCLK_EN = 1 - { CS35L41_GLOBAL_CLK_CTRL, 0x00000003 }, //GLOBAL_FS = 48 kHz - { CS35L41_SP_ENABLES, 0x00010000 }, //ASP_RX1_EN = 1 - { CS35L41_SP_RATE_CTRL, 0x00000021 }, //ASP_BCLK_FREQ = 3.072 MHz - { CS35L41_SP_FORMAT, 0x20200200 }, //24 bits, I2S, BCLK Slave, FSYNC Slave - { CS35L41_DAC_PCM1_SRC, 0x00000008 }, //DACPCM1_SRC = ASPRX1 - { CS35L41_AMP_DIG_VOL_CTRL, 0x00000000 }, //AMP_VOL_PCM 0.0 dB - { CS35L41_AMP_GAIN_CTRL, 0x00000084 }, //AMP_GAIN_PCM 4.5 dB - { CS35L41_PWR_CTRL2, 0x00000001 }, //AMP_EN = 1 + { CS35L41_PLL_CLK_CTRL, 0x00000430 }, // 3200000Hz, BCLK Input, PLL_REFCLK_EN = 1 + { CS35L41_GLOBAL_CLK_CTRL, 0x00000003 }, // GLOBAL_FS = 48 kHz + { CS35L41_SP_ENABLES, 0x00010000 }, // ASP_RX1_EN = 1 + { CS35L41_SP_RATE_CTRL, 0x00000021 }, // ASP_BCLK_FREQ = 3.072 MHz + { CS35L41_SP_FORMAT, 0x20200200 }, // 24 bits, I2S, BCLK Slave, FSYNC Slave + { CS35L41_DAC_PCM1_SRC, 0x00000008 }, // DACPCM1_SRC = ASPRX1 + { CS35L41_AMP_DIG_VOL_CTRL, 0x00000000 }, // AMP_VOL_PCM 0.0 dB + { CS35L41_AMP_GAIN_CTRL, 0x00000084 }, // AMP_GAIN_PCM 4.5 dB + { CS35L41_PWR_CTRL2, 0x00000001 }, // AMP_EN = 1 }; static const struct reg_sequence cs35l41_hda_start_bst[] = { - { CS35L41_PWR_CTRL2, 0x00000021 }, //BST_EN = 10, AMP_EN = 1 + { CS35L41_PWR_CTRL2, 0x00000021 }, // BST_EN = 10, AMP_EN = 1 { CS35L41_PWR_CTRL1, 0x00000001, 3000}, // set GLOBAL_EN = 1 }; @@ -60,7 +60,7 @@ static const struct reg_sequence cs35l41_stop_ext_vspk[] = { { 0x00000040, 0x00000055 }, { 0x00000040, 0x000000AA }, { 0x00007438, 0x00585941 }, - { 0x00002014, 0x00000000, 3000}, //set GLOBAL_EN = 0 + { 0x00002014, 0x00000000, 3000}, // set GLOBAL_EN = 0 { 0x0000742C, 0x00000009 }, { 0x00007438, 0x00580941 }, { 0x00011008, 0x00000001 }, @@ -78,7 +78,7 @@ static const struct reg_sequence cs35l41_safe_to_active[] = { { 0x0000742C, 0x0000000F }, { 0x0000742C, 0x00000079 }, { 0x00007438, 0x00585941 }, - { CS35L41_PWR_CTRL1, 0x00000001, 2000 }, //GLOBAL_EN = 1 + { CS35L41_PWR_CTRL1, 0x00000001, 2000 }, // GLOBAL_EN = 1 { 0x0000742C, 0x000000F9 }, { 0x00007438, 0x00580941 }, { 0x00000040, 0x000000CC }, @@ -89,8 +89,8 @@ static const struct reg_sequence cs35l41_active_to_safe[] = { { 0x00000040, 0x00000055 }, { 0x00000040, 0x000000AA }, { 0x00007438, 0x00585941 }, - { CS35L41_AMP_DIG_VOL_CTRL, 0x0000A678 }, //AMP_VOL_PCM Mute - { CS35L41_PWR_CTRL2, 0x00000000 }, //AMP_EN = 0 + { CS35L41_AMP_DIG_VOL_CTRL, 0x0000A678 }, // AMP_VOL_PCM Mute + { CS35L41_PWR_CTRL2, 0x00000000 }, // AMP_EN = 0 { CS35L41_PWR_CTRL1, 0x00000000 }, { 0x0000742C, 0x00000009, 2000 }, { 0x00007438, 0x00580941 }, @@ -161,11 +161,13 @@ static void cs35l41_hda_playback_hook(struct device *dev, int action) if (reg_seq->close) ret = regmap_multi_reg_write(reg, reg_seq->close, reg_seq->num_close); break; + default: + ret = -EINVAL; + break; } if (ret) dev_warn(cs35l41->dev, "Failed to apply multi reg write: %d\n", ret); - } static int cs35l41_hda_channel_map(struct device *dev, unsigned int tx_num, unsigned int *tx_slot, @@ -182,20 +184,19 @@ static int cs35l41_hda_bind(struct device *dev, struct device *master, void *mas struct cs35l41_hda *cs35l41 = dev_get_drvdata(dev); struct hda_component *comps = master_data; - if (comps && cs35l41->index >= 0 && cs35l41->index < HDA_MAX_COMPONENTS) - comps = &comps[cs35l41->index]; - else + if (!comps || cs35l41->index < 0 || cs35l41->index >= HDA_MAX_COMPONENTS) return -EINVAL; - if (!comps->dev) { - comps->dev = dev; - strscpy(comps->name, dev_name(dev), sizeof(comps->name)); - comps->playback_hook = cs35l41_hda_playback_hook; - comps->set_channel_map = cs35l41_hda_channel_map; - return 0; - } + comps = &comps[cs35l41->index]; + if (comps->dev) + return -EBUSY; + + comps->dev = dev; + strscpy(comps->name, dev_name(dev), sizeof(comps->name)); + comps->playback_hook = cs35l41_hda_playback_hook; + comps->set_channel_map = cs35l41_hda_channel_map; - return -EBUSY; + return 0; } static void cs35l41_hda_unbind(struct device *dev, struct device *master, void *master_data) @@ -235,6 +236,8 @@ static int cs35l41_hda_apply_properties(struct cs35l41_hda *cs35l41, regmap_update_bits(cs35l41->regmap, CS35L41_GPIO_PAD_CONTROL, CS35L41_GPIO1_CTRL_MASK, 2 << CS35L41_GPIO1_CTRL_SHIFT); break; + default: + return -EINVAL; } switch (hw_cfg->gpio2_func) { @@ -242,6 +245,8 @@ static int cs35l41_hda_apply_properties(struct cs35l41_hda *cs35l41, regmap_update_bits(cs35l41->regmap, CS35L41_GPIO_PAD_CONTROL, CS35L41_GPIO2_CTRL_MASK, 2 << CS35L41_GPIO2_CTRL_SHIFT); break; + default: + return -EINVAL; } if (internal_boost) { @@ -256,11 +261,7 @@ static int cs35l41_hda_apply_properties(struct cs35l41_hda *cs35l41, cs35l41->reg_seq = &cs35l41_hda_reg_seq_ext_bst; } - ret = cs35l41_hda_channel_map(cs35l41->dev, 0, NULL, 1, (unsigned int *)&hw_cfg->spk_pos); - if (ret) - return ret; - - return 0; + return cs35l41_hda_channel_map(cs35l41->dev, 0, NULL, 1, (unsigned int *)&hw_cfg->spk_pos); } static struct cs35l41_hda_hw_config *cs35l41_hda_read_acpi(struct cs35l41_hda *cs35l41, @@ -269,7 +270,7 @@ static struct cs35l41_hda_hw_config *cs35l41_hda_read_acpi(struct cs35l41_hda *c struct cs35l41_hda_hw_config *hw_cfg; u32 values[HDA_MAX_COMPONENTS]; struct acpi_device *adev; - struct device *acpi_dev; + struct device *physdev; char *property; size_t nval; int i, ret; @@ -280,11 +281,11 @@ static struct cs35l41_hda_hw_config *cs35l41_hda_read_acpi(struct cs35l41_hda *c return ERR_PTR(-ENODEV); } - acpi_dev = get_device(acpi_get_first_physical_node(adev)); + physdev = get_device(acpi_get_first_physical_node(adev)); acpi_dev_put(adev); property = "cirrus,dev-index"; - ret = device_property_count_u32(acpi_dev, property); + ret = device_property_count_u32(physdev, property); if (ret <= 0) goto no_acpi_dsd; @@ -294,7 +295,7 @@ static struct cs35l41_hda_hw_config *cs35l41_hda_read_acpi(struct cs35l41_hda *c } nval = ret; - ret = device_property_read_u32_array(acpi_dev, property, values, nval); + ret = device_property_read_u32_array(physdev, property, values, nval); if (ret) goto err; @@ -311,7 +312,9 @@ static struct cs35l41_hda_hw_config *cs35l41_hda_read_acpi(struct cs35l41_hda *c goto err; } - /* No devm_ version as CLSA0100, in no_acpi_dsd case, can't use devm version */ + /* To use the same release code for all laptop variants we can't use devm_ version of + * gpiod_get here, as CLSA010* don't have a fully functional bios with an _DSD node + */ cs35l41->reset_gpio = fwnode_gpiod_get_index(&adev->fwnode, "reset", cs35l41->index, GPIOD_OUT_LOW, "cs35l41-reset"); @@ -322,46 +325,46 @@ static struct cs35l41_hda_hw_config *cs35l41_hda_read_acpi(struct cs35l41_hda *c } property = "cirrus,speaker-position"; - ret = device_property_read_u32_array(acpi_dev, property, values, nval); + ret = device_property_read_u32_array(physdev, property, values, nval); if (ret) goto err_free; hw_cfg->spk_pos = values[cs35l41->index]; property = "cirrus,gpio1-func"; - ret = device_property_read_u32_array(acpi_dev, property, values, nval); + ret = device_property_read_u32_array(physdev, property, values, nval); if (ret) goto err_free; hw_cfg->gpio1_func = values[cs35l41->index]; property = "cirrus,gpio2-func"; - ret = device_property_read_u32_array(acpi_dev, property, values, nval); + ret = device_property_read_u32_array(physdev, property, values, nval); if (ret) goto err_free; hw_cfg->gpio2_func = values[cs35l41->index]; property = "cirrus,boost-peak-milliamp"; - ret = device_property_read_u32_array(acpi_dev, property, values, nval); + ret = device_property_read_u32_array(physdev, property, values, nval); if (ret == 0) hw_cfg->bst_ipk = values[cs35l41->index]; property = "cirrus,boost-ind-nanohenry"; - ret = device_property_read_u32_array(acpi_dev, property, values, nval); + ret = device_property_read_u32_array(physdev, property, values, nval); if (ret == 0) hw_cfg->bst_ind = values[cs35l41->index]; property = "cirrus,boost-cap-microfarad"; - ret = device_property_read_u32_array(acpi_dev, property, values, nval); + ret = device_property_read_u32_array(physdev, property, values, nval); if (ret == 0) hw_cfg->bst_cap = values[cs35l41->index]; - put_device(acpi_dev); + put_device(physdev); return hw_cfg; err_free: kfree(hw_cfg); err: - put_device(acpi_dev); + put_device(physdev); dev_err(cs35l41->dev, "Failed property %s: %d\n", property, ret); return ERR_PTR(ret); @@ -370,18 +373,18 @@ static struct cs35l41_hda_hw_config *cs35l41_hda_read_acpi(struct cs35l41_hda *c /* * Device CLSA0100 doesn't have _DSD so a gpiod_get by the label reset won't work. * And devices created by i2c-multi-instantiate don't have their device struct pointing to - * the correct fwnode, so acpi_dev must be used here + * the correct fwnode, so acpi_dev must be used here. * And devm functions expect that the device requesting the resource has the correct - * fwnode + * fwnode. */ if (strncmp(hid, "CLSA0100", 8) != 0) return ERR_PTR(-EINVAL); /* check I2C address to assign the index */ cs35l41->index = id == 0x40 ? 0 : 1; - cs35l41->reset_gpio = gpiod_get_index(acpi_dev, NULL, 0, GPIOD_OUT_HIGH); + cs35l41->reset_gpio = gpiod_get_index(physdev, NULL, 0, GPIOD_OUT_HIGH); cs35l41->vspk_always_on = true; - put_device(acpi_dev); + put_device(physdev); return NULL; } @@ -416,8 +419,7 @@ int cs35l41_hda_probe(struct device *dev, const char *device_name, int id, int i if (ret == -EBUSY) { dev_info(cs35l41->dev, "Reset line busy, assuming shared reset\n"); } else { - if (ret != -EPROBE_DEFER) - dev_err(cs35l41->dev, "Failed to get reset GPIO: %d\n", ret); + dev_err_probe(cs35l41->dev, ret, "Failed to get reset GPIO: %d\n", ret); goto err; } } @@ -437,7 +439,8 @@ int cs35l41_hda_probe(struct device *dev, const char *device_name, int id, int i ret = regmap_read(cs35l41->regmap, CS35L41_IRQ1_STATUS3, &int_sts); if (ret || (int_sts & CS35L41_OTP_BOOT_ERR)) { - dev_err(cs35l41->dev, "OTP Boot error\n"); + dev_err(cs35l41->dev, "OTP Boot status %x error: %d\n", + int_sts & CS35L41_OTP_BOOT_ERR, ret); ret = -EIO; goto err; } @@ -489,7 +492,7 @@ int cs35l41_hda_probe(struct device *dev, const char *device_name, int id, int i if (cs35l41->reg_seq->probe) { ret = regmap_multi_reg_write(cs35l41->regmap, cs35l41->reg_seq->probe, - cs35l41->reg_seq->num_probe); + cs35l41->reg_seq->num_probe); if (ret) { dev_err(cs35l41->dev, "Fail to apply probe reg patch: %d\n", ret); goto err; diff --git a/sound/pci/hda/cs35l41_hda.h b/sound/pci/hda/cs35l41_hda.h index 76c69a8a22f6..640afc98b686 100644 --- a/sound/pci/hda/cs35l41_hda.h +++ b/sound/pci/hda/cs35l41_hda.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0 * - * cs35l41_hda.h -- CS35L41 ALSA HDA audio driver + * CS35L41 ALSA HDA audio driver * * Copyright 2021 Cirrus Logic, Inc. * diff --git a/sound/pci/hda/cs35l41_hda_i2c.c b/sound/pci/hda/cs35l41_hda_i2c.c index eeb387853ee3..c2397dc53e78 100644 --- a/sound/pci/hda/cs35l41_hda_i2c.c +++ b/sound/pci/hda/cs35l41_hda_i2c.c @@ -58,7 +58,6 @@ static struct i2c_driver cs35l41_i2c_driver = { .probe = cs35l41_hda_i2c_probe, .remove = cs35l41_hda_i2c_remove, }; - module_i2c_driver(cs35l41_i2c_driver); MODULE_DESCRIPTION("HDA CS35L41 driver"); diff --git a/sound/pci/hda/cs35l41_hda_spi.c b/sound/pci/hda/cs35l41_hda_spi.c index 15345a72b9d1..36815ab4e461 100644 --- a/sound/pci/hda/cs35l41_hda_spi.c +++ b/sound/pci/hda/cs35l41_hda_spi.c @@ -55,7 +55,6 @@ static struct spi_driver cs35l41_spi_driver = { .probe = cs35l41_hda_spi_probe, .remove = cs35l41_hda_spi_remove, }; - module_spi_driver(cs35l41_spi_driver); MODULE_DESCRIPTION("HDA CS35L41 driver"); From patchwork Thu Jan 13 17:07:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas Tanure X-Patchwork-Id: 12712990 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4B7C7C433EF for ; Thu, 13 Jan 2022 17:09:26 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 8ACC92010; Thu, 13 Jan 2022 18:08:34 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8ACC92010 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1642093764; bh=iKeK+QqRAHqhorJkx9Ay1XJnrqOvVZ/FeiwNL7DGehg=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=lJa+mYnVeOTYltozzqxGkLadOo6R60Juc0Kw3GmgFQVOLP831mAHaslIPIsHACZYd jl4G0J7vupuAHEH2BxyxcPklC/rWwAZ5aBuz8FPNQRpqJZb4fnmIkNQXLqtZ4Wznxe kYRYmYB/cqrDkD1PBbkJwd32ZDw0M2rYidRI7W9c= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 6AE11F804FE; Thu, 13 Jan 2022 18:07:45 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id DE482F804FB; Thu, 13 Jan 2022 18:07:43 +0100 (CET) Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 05346F8013F for ; Thu, 13 Jan 2022 18:07:37 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 05346F8013F Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b="VHybBKuH" 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 20DGAV43020998; Thu, 13 Jan 2022 11:07:36 -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=GSiBkVP9UmloE0oIArp77dF5D6A7HQmpsTBzlpdvMyY=; b=VHybBKuHOuMu13cAI/5M7TPpZbLvYs2eSzykmjI8f57kUHaif2g9ZViibiMJjkb0P19u aBOg+nOF+esO59I+eH6mB9c54P/ISMrj8nrh17LWstrUucXs5kvUKRCpE11pdHzaniJB lOQYhp4hv7H+RFqjhoL7NS0mkbaivQEZ0kxBXjl7FwKEEt5cT93OYrHyyWACbqT2JUqo IFwtaUTjuCrtFGjzHhSKYqFFD9/gZOAk+ndrNzHkuUe6H01z2BsK0iae3nnXgIuv37pz RNafqMxCfNakLoUdA2e2znNnnZWW/HnPHPxEK4XquZqNkLmBBwBOs2M90PSIFfL6Ger8 hQ== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3djqcb026y-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Thu, 13 Jan 2022 11:07:35 -0600 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, 13 Jan 2022 17:07:32 +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, 13 Jan 2022 17:07:32 +0000 Received: from aryzen.ad.cirrus.com (unknown [198.61.65.50]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 23A6AB0E; Thu, 13 Jan 2022 17:07:32 +0000 (UTC) From: Lucas Tanure To: "Rafael J . Wysocki" , Len Brown , Hans de Goede , Mark Gross , Jaroslav Kysela , Takashi Iwai Subject: [PATCH 5/5] ACPI / scan: Create platform device for CLSA0100 Date: Thu, 13 Jan 2022 17:07:28 +0000 Message-ID: <20220113170728.1953559-5-tanureal@opensource.cirrus.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220113170728.1953559-1-tanureal@opensource.cirrus.com> References: <20220113170728.1953559-1-tanureal@opensource.cirrus.com> MIME-Version: 1.0 X-Proofpoint-GUID: 6hGjFieOBt8Dt08GJJouyJ77KoV70pmi X-Proofpoint-ORIG-GUID: 6hGjFieOBt8Dt08GJJouyJ77KoV70pmi X-Proofpoint-Spam-Reason: safe Cc: alsa-devel@alsa-project.org, Lucas Tanure , patches@opensource.cirrus.com, linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-acpi@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The ACPI device with CLSA0100 is a sound card with multiple instances of CS35L41 connected by I2C to the main CPU. We add an ID to the i2c_multi_instantiate_idsi list to enumerate all I2C slaves correctly. Signed-off-by: Lucas Tanure --- drivers/acpi/scan.c | 2 ++ drivers/platform/x86/i2c-multi-instantiate.c | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index c215bc8723d0..2a68031d953e 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -1753,6 +1753,8 @@ static bool acpi_device_enumeration_by_parent(struct acpi_device *device) */ {"BCM4752", }, {"LNV4752", }, + /* Non-conforming _HID for Cirrus Logic already released */ + {"CLSA0100", }, {} }; diff --git a/drivers/platform/x86/i2c-multi-instantiate.c b/drivers/platform/x86/i2c-multi-instantiate.c index 4956a1df5b90..a51a74933fa9 100644 --- a/drivers/platform/x86/i2c-multi-instantiate.c +++ b/drivers/platform/x86/i2c-multi-instantiate.c @@ -147,6 +147,12 @@ static const struct i2c_inst_data int3515_data[] = { {} }; +static const struct i2c_inst_data cs35l41_hda[] = { + { "cs35l41-hda", IRQ_RESOURCE_GPIO, 0 }, + { "cs35l41-hda", IRQ_RESOURCE_GPIO, 0 }, + {} +}; + /* * Note new device-ids must also be added to i2c_multi_instantiate_ids in * drivers/acpi/scan.c: acpi_device_enumeration_by_parent(). @@ -155,6 +161,8 @@ static const struct acpi_device_id i2c_multi_inst_acpi_ids[] = { { "BSG1160", (unsigned long)bsg1160_data }, { "BSG2150", (unsigned long)bsg2150_data }, { "INT3515", (unsigned long)int3515_data }, + /* Non-conforming _HID for Cirrus Logic already released */ + { "CLSA0100", (unsigned long)cs35l41_hda }, { } }; MODULE_DEVICE_TABLE(acpi, i2c_multi_inst_acpi_ids);