From patchwork Wed Mar 6 16:14:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stuart Henderson X-Patchwork-Id: 778861 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 1C902C5475B for ; Wed, 6 Mar 2024 16:16:20 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id AD592DEE; Wed, 6 Mar 2024 17:16:07 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz AD592DEE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1709741777; bh=NL/0kJLMNB3af/nPrZVGA4zsieNtor+zdkiPluqcrOw=; h=From:To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=mpiwOQpTAHlijJzzMfgSYSbuhda0pQXlamIDyV2SkPkH1qL4j8E0CpDlhTyqXVD/B RGTIT/Pc2ktFSvdpaomSMaByD90ohefe/3DId52ubNJMNgHWA2VGqREcMqX5dklbXd BbT8CeMDHrZuFbHMQ3+bjoeOxNeIJgvt9BGAlTz0= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2822CF805F1; Wed, 6 Mar 2024 17:15:22 +0100 (CET) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 72692F805F9; Wed, 6 Mar 2024 17:15:22 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 04E07F805B1; Wed, 6 Mar 2024 17:15:16 +0100 (CET) Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) (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 B54A8F8058C for ; Wed, 6 Mar 2024 17:15:10 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B54A8F8058C Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=cirrus.com header.i=@cirrus.com header.a=rsa-sha256 header.s=PODMain02222019 header.b=WRxLoTK3 Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 4265UZQk010435; Wed, 6 Mar 2024 10:15:08 -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=VZNrVFRkfXL9w5uIYi/FRwxU+dWrhc/p57PfZFvalls=; b= WRxLoTK3l9ZH4Y7a6CbeC65EN2kWfgDWIcKEW6+y020QvLT7GRYPUFUSme9nDEKH nBBs9inOwKpGCm5Sc6CFVq6xX01GJYesK56CGjb4kvQ+t8HHsqpuA7+eRlN2TMeF NdjqrSZQK3Sx50M0gBK1/902hf+AhiUXH9xPmHryZe46N6/EQoLu0ATKhu8+HZrt rIfzqDESazRjC18IOLhN2B97Pc9bzZ3Zw2UPchcXCzKZ1ww7sn9zAAn6m6wu+rQr 53OOan5DC7EMuXLy8+zNBtOK67ohdPAd6w56owdnq4nLlWEra15HEni6gSQIXHa3 tmzMm28SY+VqGCQbOyyffQ== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 3wm2d2mwg1-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 06 Mar 2024 10:15:08 -0600 (CST) 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.1544.4; Wed, 6 Mar 2024 16:15:08 +0000 Received: from ediswmail9.ad.cirrus.com (198.61.86.93) 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.1544.4 via Frontend Transport; Wed, 6 Mar 2024 16:15:08 +0000 Received: from ediswws08.ad.cirrus.com (ediswws08.ad.cirrus.com [198.90.208.13]) by ediswmail9.ad.cirrus.com (Postfix) with ESMTP id EB68082024D; Wed, 6 Mar 2024 16:15:07 +0000 (UTC) From: Stuart Henderson To: , , CC: , , , , "Stuart Henderson" Subject: [PATCH 4/5] ASoC: wm8962: Fix wm8962_set_fll to use source instead of fll_id Date: Wed, 6 Mar 2024 16:14:38 +0000 Message-ID: <20240306161439.1385643-4-stuarth@opensource.cirrus.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240306161439.1385643-1-stuarth@opensource.cirrus.com> References: <20240306161439.1385643-1-stuarth@opensource.cirrus.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: fpMeca3XnbrZ1u6BZ8CozMD4xQPnsanN X-Proofpoint-GUID: fpMeca3XnbrZ1u6BZ8CozMD4xQPnsanN X-Proofpoint-Spam-Reason: safe Message-ID-Hash: LTNQNQDLCP4LUK6R7BYCLMO6WCQJ5EA3 X-Message-ID-Hash: LTNQNQDLCP4LUK6R7BYCLMO6WCQJ5EA3 X-MailFrom: prvs=079554e8cd=stuarth@opensource.cirrus.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: <> List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Previously wm8962_set_fll was using fll_id to configure the source. This change is problematic, but it looks like there's limited users of this driver, and luckily they all seem to be intending to use WM8962_FLL_MCLK as the source which happens to have the same value as WM8962_FLL. Signed-off-by: Stuart Henderson --- sound/soc/codecs/wm8962.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c index 2256cc0a37eb..24bd818c3345 100644 --- a/sound/soc/codecs/wm8962.c +++ b/sound/soc/codecs/wm8962.c @@ -2890,6 +2890,14 @@ static int wm8962_set_fll(struct snd_soc_component *component, int fll_id, int s int ret; int fll1 = 0; + switch (fll_id) { + case WM8962_FLL: + break; + default: + dev_err(component->dev, "Unknown FLL ID %d\n", fll_id); + return -EINVAL; + } + /* Any change? */ if (source == wm8962->fll_src && Fref == wm8962->fll_fref && Fout == wm8962->fll_fout) @@ -2916,13 +2924,13 @@ static int wm8962_set_fll(struct snd_soc_component *component, int fll_id, int s /* Parameters good, disable so we can reprogram */ snd_soc_component_update_bits(component, WM8962_FLL_CONTROL_1, WM8962_FLL_ENA, 0); - switch (fll_id) { + switch (source) { case WM8962_FLL_MCLK: case WM8962_FLL_BCLK: - fll1 |= (fll_id - 1) << WM8962_FLL_REFCLK_SRC_SHIFT; + fll1 |= (source - 1) << WM8962_FLL_REFCLK_SRC_SHIFT; break; case WM8962_FLL_OSC: - fll1 |= (fll_id - 1) << WM8962_FLL_REFCLK_SRC_SHIFT; + fll1 |= (source - 1) << WM8962_FLL_REFCLK_SRC_SHIFT; snd_soc_component_update_bits(component, WM8962_PLL2, WM8962_OSC_ENA, WM8962_OSC_ENA); break;