From patchwork Wed Jul 10 13:52:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 812634 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 20EA2C3DA42 for ; Wed, 10 Jul 2024 13:53:38 +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 5ED77839; Wed, 10 Jul 2024 15:53:26 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 5ED77839 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1720619616; bh=+8JLB/iozDF8e+w8VM/0NLmlF4J+t2rdpXXcSD/AIOA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=iUjD+1hFCjwEJCCSkWmF/1G5JyijdJbXhIawtCQPqA8cNoCqB4db2X52AJc5Z7zOn up3Lr/inkTt0trmDMc3hubNoCsKk8tsF/BOY8UO0EIE28zfTLD5V2jQWaQ0NSvEnHO lqvlmiroYvc8cb4yU7EhQi/kraNXWC/IEJjd/DcM= Received: by alsa1.perex.cz (Postfix, from userid 50401) id DB7AEF805E1; Wed, 10 Jul 2024 15:52:55 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id A89FDF801F5; Wed, 10 Jul 2024 15:52:55 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 40FF0F805C1; Wed, 10 Jul 2024 15:52:51 +0200 (CEST) Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 57473F8013D for ; Wed, 10 Jul 2024 15:52:43 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 57473F8013D Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=wn03woi1 Received: by mail-lj1-x22f.google.com with SMTP id 38308e7fff4ca-2ee77db6f97so90126111fa.2 for ; Wed, 10 Jul 2024 06:52:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1720619562; x=1721224362; darn=alsa-project.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=8uHg8nYQlfxcs66nXgVo70Ul5Ax0CFj0CeSrnoDDNAc=; b=wn03woi10lI1IALcXWT181kVdmvSPFc3XGZVn6MBHRmdRpFqdqCTSdvebT1K4Ae15U nD6OHL+TYAk22GQGrzhQ0dY2vmzXlD9gTXUdwUr2I38FSbvgFpmJmtf78VzbPciff2uT AeunZzMhOJqVv+gerGRPpxqkZysvkSiPDllYN7T96zkW/8CWF/WWSabkXu28FxD2tOIl yVShmP6dZxv7ODwYCBGJ0vrqxR35ngdMavodso83b5mndCgmtg700BSgHG8QSweexJZv PIV4H4eHZZLsXx5J/xdZ4QlOH8kShu1VXcjruB4bpzRWD3TFmWCGNf6EHsAcK4uipfkF yglg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720619562; x=1721224362; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8uHg8nYQlfxcs66nXgVo70Ul5Ax0CFj0CeSrnoDDNAc=; b=MOaJ59o+TGKHhw5O2olNOenukwEF1IVADAlGM4B+u6LMF0+98TkGIHKXrkY+1oyU3v OugITa5fg4ifoZ8ikv2pg86Gi1URcidPz1pazepgkxXUVPbH1f7O0zOnA3iFxuIr4Nup ldSn9Eh9FVHMH5cD7ruGvRLFUfLnPOkfzn6czWD5a/SY07KmqIOpbZ1JxnJ+sjNK2Ejo SFW1Y2wsg09h34QOq7b5YuIKfN/yuWfsXaRW0LtgozEw584mtzD8ZA8LKlMM2E7DQiX0 hbI4xsTHwMQHTlKeqMf6sboK29HIXuqD21SJ+hW5Qdk5iXxypgfa11cLnb/zP+t0axUB lVaQ== X-Gm-Message-State: AOJu0YwuLzvRxXlnwY4yQqk8Bfgl21O5iRg4klMCoCbVxtzjd1HltF15 Mh8gnRveSQpVGcbADkkjU7+R8B5ADI1LYVL3/3I7hYHP+8mgL0Xog4HTvdLRYzM= X-Google-Smtp-Source: AGHT+IHQ3wTw06WNOicBulp0LREDgkQYwv8xz/Jvw664H5KQ2mPhohhSVRmLd/HfsG+DjZXAvFB4aQ== X-Received: by 2002:a2e:9852:0:b0:2ec:5843:2fb8 with SMTP id 38308e7fff4ca-2eeb316affamr46824141fa.42.1720619562504; Wed, 10 Jul 2024 06:52:42 -0700 (PDT) Received: from [127.0.1.1] ([178.197.219.137]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a780a8551afsm160440366b.166.2024.07.10.06.52.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jul 2024 06:52:41 -0700 (PDT) From: Krzysztof Kozlowski Date: Wed, 10 Jul 2024 15:52:30 +0200 Subject: [PATCH 1/4] ASoC: codecs: wsa881x: Drop unused version readout MIME-Version: 1.0 Message-Id: <20240710-asoc-wsa88xx-version-v1-1-f1c54966ccde@linaro.org> References: <20240710-asoc-wsa88xx-version-v1-0-f1c54966ccde@linaro.org> In-Reply-To: <20240710-asoc-wsa88xx-version-v1-0-f1c54966ccde@linaro.org> To: Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai Cc: alsa-devel@alsa-project.org, linux-arm-msm@vger.kernel.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1000; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=+8JLB/iozDF8e+w8VM/0NLmlF4J+t2rdpXXcSD/AIOA=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBmjpIkusTqm9cHV9sziB2w+LwJj8kGVAW/ZbhjT NACmdqp9yaJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZo6SJAAKCRDBN2bmhouD 1ymCD/9iwi9TkwR7xPLUX40Mlnv4dq9p3GKVP1NC0C2tDNGbYpr7aM/EGwdodgWD5CWNsZnw9BT gxDyZ1xojOFS1zTZGyfCfkPrK1S2rBM1nn+h0oyGVWZ4JUZMAq6TMqVkOSY5ugS/Aq2JIzGc1Lf 9Oea9NGDKvvVxnY5t85fRmHhiUbSSjpIpdu67FVamw1fO7hzJ8Fz1mqcoyrkuqG5RCqgRCimvC1 FPbOOSrkL9GElTjBP59MN2rR1W84dg5JtV+LLetvzb3B2mWSvNofgqovM6U6/gov4Zmqz+FbeCb cx6T3OOBWFjn3iamR+JzoRtyWNugjagb4+qafu1ANK9p6HI5igQH4Vs+QSgOQFTEWKn39WDUSVO Ozj1vUoNPw5IjqScYXaGAVWMUsRis0tMN/jQTdGowWj3HEQSfgRckDQDSoDE0m3G0MqFTEzB3LB lEE+GJk/Ud52A6DQ757eWlBPXzWIY/uQVhwx0mgSH9uVBzHp8QTxj1ZqhGQqwiIlJgq+7P2QwAY XQ8YMa9kPSDjwrBqiZq4kc652/WHJxEHQ+vPqJF1MTh6QLOnR5Uijo5xmBaJg9iSUwS7CVaoZHP hY/d4ilfUNOLFu1LWv6C8NNROB08OLpNYQyQSO2k5FLsRPTPQzNaMseS6U0C7rw5ipF2AwrLYM/ F6RWcahzYIK+4Fg== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B Message-ID-Hash: ADXLDYHKR5GXB4EXEOY6RLGECUKJCDR6 X-Message-ID-Hash: ADXLDYHKR5GXB4EXEOY6RLGECUKJCDR6 X-MailFrom: krzysztof.kozlowski@linaro.org 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: Driver does not use the device version after reading it from the registers, so simplify by dropping unneeded code. Signed-off-by: Krzysztof Kozlowski --- sound/soc/codecs/wsa881x.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sound/soc/codecs/wsa881x.c b/sound/soc/codecs/wsa881x.c index 1253695bebd8..22df50041104 100644 --- a/sound/soc/codecs/wsa881x.c +++ b/sound/soc/codecs/wsa881x.c @@ -680,7 +680,6 @@ struct wsa881x_priv { * For backwards compatibility. */ unsigned int sd_n_val; - int version; int active_ports; bool port_prepared[WSA881X_MAX_SWR_PORTS]; bool port_enable[WSA881X_MAX_SWR_PORTS]; @@ -691,7 +690,6 @@ static void wsa881x_init(struct wsa881x_priv *wsa881x) struct regmap *rm = wsa881x->regmap; unsigned int val = 0; - regmap_read(rm, WSA881X_CHIP_ID1, &wsa881x->version); regmap_register_patch(wsa881x->regmap, wsa881x_rev_2_0, ARRAY_SIZE(wsa881x_rev_2_0)); From patchwork Wed Jul 10 13:52:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 811794 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 1DABDC3DA42 for ; Wed, 10 Jul 2024 13:53:54 +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 19477B65; Wed, 10 Jul 2024 15:53:42 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 19477B65 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1720619632; bh=y1tKqfTQODlGyfn1SRpCW1SmdAuFgMAc1xdfgaUEBtw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=sxEWzLx8sIy732ab+AwixllpIlAfhI0E4ZbmkGX2EdBmB54ikAWfHOD2LCHNI22xL ERhqX2b6IJx0uEAKdbiSCwOzL1lkusXxok8hXNGXdprR4l8bgaWRrh2DAKv3auRXvf O5xTdt3pyhHd8dQylTfkjcNUEbPYwhMX24SJwm8k= Received: by alsa1.perex.cz (Postfix, from userid 50401) id A2801F80601; Wed, 10 Jul 2024 15:52:57 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 3D8C4F805E8; Wed, 10 Jul 2024 15:52:57 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 3CA1FF8019B; Wed, 10 Jul 2024 15:52:52 +0200 (CEST) Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 9D66AF8019B for ; Wed, 10 Jul 2024 15:52:45 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 9D66AF8019B Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=jBLgBf4O Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2eea8ea8bb0so57138381fa.1 for ; Wed, 10 Jul 2024 06:52:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1720619564; x=1721224364; darn=alsa-project.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=gLywJr+VNuRQ+9S3fLtdyBw83gsTKbfJTEcv1fSuZtY=; b=jBLgBf4OXC4sN2SvG8JBEYSHYU+1McN+vpZuVPX4PwFjOE9lTubz//zx0yItsQTa8v 5eRvUcsIGm1/leQgSqHdIl3Gs1XSEBMvuzybXCtF3OCVCVCpDnVf/I/lBImRgqCKSH8G qa+Zn8ufwylIG9zX4qvyO6/+DPWYkiZo917SMNfm9f3nvrxkXYnO8zkUGTESiquhk5rs x03DQEaiy+moOayH4BkpXeEsrVIraEuVPIBBgzxhC7SiQd2RsBJOzV5PZdypmiEi/c4u TRkq3Z9sIzXiRdLXnVYy4+4GEfEFik+TsocahoFP/PqYT3xCL3S65qrgbiYcI5RuxcOs Zfdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720619564; x=1721224364; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gLywJr+VNuRQ+9S3fLtdyBw83gsTKbfJTEcv1fSuZtY=; b=BolgvQDQf2YIBHCSvSDQ6puhk2ytw12dwJwnjDbKfG919IXbFdXrsiy3CAZXNLSl3E hxtvhCTCCCgJGI5Q4q7eed1TnAbY+UIKeiWsX8Kx5Jf1dIDlhRp2jPMJwsEIYvNJxMI/ JGZ0Lm7aVgIx6nAd+ABmupRWIHltd6gIaFUL7vcQWaARYjWtFivtkCzlhfvPtbp6RYof sJMwkyPGCPgveIFwZXEWs3iOddCGsos3uI+SCU9gutR6lZ1/7+44Yc3kLSDEU0o0HfDh i6bbGK9fJoqiZt4k1Jf3Q0A8utLtLbomorRnXWBu13d78jijjgXeVU+d3YjocISr/J17 c/sw== X-Gm-Message-State: AOJu0YyDnrXuDus9w3O0anR9jjHCfsQp+jlmiX/zwDJ+745SfoI1oput c8DmNCtChb8ygDIcXW7AZDXSWnY8+dVQLS63ku1ahWGX6YfCqyupv1AmwzrQawA= X-Google-Smtp-Source: AGHT+IFqsU+9eqU1waHlBXBgmqcGfO+uxS9Acg7qmmXJvRuEpZxNjPxpb/48w2Lrj9d7Bgw79lvchA== X-Received: by 2002:a05:651c:23b:b0:2ec:56b9:258b with SMTP id 38308e7fff4ca-2eeb316b00amr44160151fa.33.1720619563982; Wed, 10 Jul 2024 06:52:43 -0700 (PDT) Received: from [127.0.1.1] ([178.197.219.137]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a780a8551afsm160440366b.166.2024.07.10.06.52.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jul 2024 06:52:43 -0700 (PDT) From: Krzysztof Kozlowski Date: Wed, 10 Jul 2024 15:52:31 +0200 Subject: [PATCH 2/4] ASoC: codecs: wsa883x: Handle reading version failure MIME-Version: 1.0 Message-Id: <20240710-asoc-wsa88xx-version-v1-2-f1c54966ccde@linaro.org> References: <20240710-asoc-wsa88xx-version-v1-0-f1c54966ccde@linaro.org> In-Reply-To: <20240710-asoc-wsa88xx-version-v1-0-f1c54966ccde@linaro.org> To: Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai Cc: alsa-devel@alsa-project.org, linux-arm-msm@vger.kernel.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1944; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=y1tKqfTQODlGyfn1SRpCW1SmdAuFgMAc1xdfgaUEBtw=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBmjpIkh3GaGP31lPefvm22QfD6kHlnJErM6N9g1 wYvWVt/ubaJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZo6SJAAKCRDBN2bmhouD 15bWEACAaf3dT5VsD8GZ8Rbqic9br3Rncjy5nt82JwTLjCKlaG0ZWMvXtguF9r6P9t4oFBNtwbP lf7vdP6ZNULbwxGP8b154ZMSIhTMCuTV6GXPdinTz1xspQbsy7YYqBPwUZT9eY8hpNbDHlIsoAa XXxJ7rhTj+u0fhCC7i+vhYJi0HB2MAg0PulIKW15FmingqlbFYokHmI2ubPcylDYCkk9V160icV 1fxrRCOpVs5aYqaov5AfVsvqZjQHgQiVLqpRNdOWSUKxok/UoaRmQR2Y4ONBvx1+SeZaWw/g7K6 l5nYzrfHx/yECm7CGdS5Zujm44tCpyWfOU6pUL1F+ryg5i5EFr7s//ehL+9xyOB4EkfXq5HHK++ zO0H/b7+zdMW7wyryHpgr828JNlLDnhDRpz8zYCpUHKIMGUe4LKyRcC7p7LoyYT69J7H6OpZqcU cJXusUwEjdcjB7dYqcnAUHCnnWSIFkGTNcOe8zEsSxkxJ0QP4CcElnC51P+BmfDcB0nUDVjLp4r Z7ZAFhzeKCgHbYvGoaZ51gci/dsjh2b49QtT4MzP3SE3+LL+rIo2Dwd7wsxu4AXt/BX8h372/od sAZl0TU1JekeEyLxykRCRpG6DIB3+gZKI9An/uMIDnAkhNB29jZcPI7l96LzybL+bTDmV4mxf3p jJKcqTrxGtdYbPg== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B Message-ID-Hash: 7PT4XPZTGSBAFN7XR2RURLBBWBO3CKRL X-Message-ID-Hash: 7PT4XPZTGSBAFN7XR2RURLBBWBO3CKRL X-MailFrom: krzysztof.kozlowski@linaro.org 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: If reading version and variant from registers fails (which is unlikely but possible, because it is a read over bus), the driver will proceed and perform device configuration based on uninitialized stack variables. Handle it a bit better - bail out without doing any init and failing the update status Soundwire callback. Signed-off-by: Krzysztof Kozlowski --- sound/soc/codecs/wsa883x.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/sound/soc/codecs/wsa883x.c b/sound/soc/codecs/wsa883x.c index f5a15f0e891e..60b78560f4b7 100644 --- a/sound/soc/codecs/wsa883x.c +++ b/sound/soc/codecs/wsa883x.c @@ -997,15 +997,19 @@ static const struct reg_sequence reg_init[] = { {WSA883X_GMAMP_SUP1, 0xE2}, }; -static void wsa883x_init(struct wsa883x_priv *wsa883x) +static int wsa883x_init(struct wsa883x_priv *wsa883x) { struct regmap *regmap = wsa883x->regmap; - int variant, version; + int variant, version, ret; - regmap_read(regmap, WSA883X_OTP_REG_0, &variant); + ret = regmap_read(regmap, WSA883X_OTP_REG_0, &variant); + if (ret) + return ret; wsa883x->variant = variant & WSA883X_ID_MASK; - regmap_read(regmap, WSA883X_CHIP_ID0, &version); + ret = regmap_read(regmap, WSA883X_CHIP_ID0, &version); + if (ret) + return ret; wsa883x->version = version; switch (wsa883x->variant) { @@ -1040,6 +1044,8 @@ static void wsa883x_init(struct wsa883x_priv *wsa883x) WSA883X_DRE_OFFSET_MASK, wsa883x->comp_offset); } + + return 0; } static int wsa883x_update_status(struct sdw_slave *slave, @@ -1048,7 +1054,7 @@ static int wsa883x_update_status(struct sdw_slave *slave, struct wsa883x_priv *wsa883x = dev_get_drvdata(&slave->dev); if (status == SDW_SLAVE_ATTACHED && slave->dev_num > 0) - wsa883x_init(wsa883x); + return wsa883x_init(wsa883x); return 0; } From patchwork Wed Jul 10 13:52:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 812633 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 4808FC3DA42 for ; Wed, 10 Jul 2024 13:54:19 +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 8AED8A4D; Wed, 10 Jul 2024 15:54:07 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8AED8A4D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1720619657; bh=jEk16JQFT0IAvURH2BypgqgsTIx/BJn3KXaiR2tgfp4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=otyu8lxjbpu7hDGWhMxY0AuohoKL0lmPkYtODmzDj8iXFad0ugl7FDFJOYuTDjgDy EMWHeeBVZJHrfmsBIcFS8VOs7K55+b1gLBGcBnAocUBCVOvJCxQkZJKfc0roQyGHck WI2r/OSed1HFZHRpYQjsUbwDuzXYfSXq8850wM2Y= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 41F9AF80568; Wed, 10 Jul 2024 15:53:00 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id B704BF80620; Wed, 10 Jul 2024 15:53:00 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id F2533F805D7; Wed, 10 Jul 2024 15:52:55 +0200 (CEST) Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 0F75BF801F5 for ; Wed, 10 Jul 2024 15:52:46 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 0F75BF801F5 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=viyhyJb4 Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-57cf8880f95so8352050a12.3 for ; Wed, 10 Jul 2024 06:52:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1720619565; x=1721224365; darn=alsa-project.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=slbrxxj5rb9E58CEYCsM+P7UiVj11eTUBnO9G+P7KZc=; b=viyhyJb4iW5uf0JkbY/bWTfC401wez1FtJugtHcISt6mncceJVWAaBpnf2MSLRBjsc VLrI9gLa826GZuk6ns3Zyqz9FJQcI4wlhp1v6bw/oTjd0oUb+mhHj9sZWhbZC8hFpd8M peMdvSuNdaRNcVIuG5mAlwX8b9z8x7yUTkl7j0eyrLv2PLorLgqpdOlYqmzkQcVCV2P1 TbY5/PDdLzSJWfFAZiPNKdXAezOWaJ4bZo4S22kE7d2yVf54OSh6dkW1eVn+9067w/go jt/92oJ0viuDZJNMkLHrqn4dXA/sGtZp7jpIPPk+hfQHBQwFJ6TmBcwO0wFTGFfm69x7 jBRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720619565; x=1721224365; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=slbrxxj5rb9E58CEYCsM+P7UiVj11eTUBnO9G+P7KZc=; b=e31b9AQH+2OZng6z4Z0yExu63YogrfjXILOS55+bjoTFVHgkl7P5tjNhnPB8fiWi+j S6AxENDPJ8Sajrc9lupB/QuSc5AFd+M1wqE6DSY9CGoRyxBBcuVTQW0piNnMTeeZsq+b t15eJTnR9J7KvF5WXLlZ/0fyjvnzXEML32ZAYjQkI7yDBTfS6tjCz5fRMV7+xHHD3KpP I1Sa4CZAFqHiYsCHsvgOCYx/1N6iO3DzFmdhz4Q6SdgFQde5wAwAfOEm16ltNS0hBD84 uMnkSFs5KAOlmilvPCPsjTfRuOazykUV3rwyLnIEePUgZamrDXHiI1yDOpVxlfZhsyjt h3NA== X-Gm-Message-State: AOJu0YxETx5xLfu0jZo2MKzj7ypqg1HMJsvzH+iiKClYe82xYpjrEZtC AUMeDdMTzMoIq9stWaoA54E7sTNjkwnqeo6muU6/ZlBDaySLRSE1X1c4l7E1pu4= X-Google-Smtp-Source: AGHT+IEKMN2BAmzuOkKYboabNS9K1iF67rmPiNfGv71WggM/iASILIt6zY8AU4pXkJL1/oEkdkd06A== X-Received: by 2002:a17:906:f592:b0:a77:cf9d:f495 with SMTP id a640c23a62f3a-a780b7010a0mr599191166b.40.1720619565419; Wed, 10 Jul 2024 06:52:45 -0700 (PDT) Received: from [127.0.1.1] ([178.197.219.137]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a780a8551afsm160440366b.166.2024.07.10.06.52.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jul 2024 06:52:44 -0700 (PDT) From: Krzysztof Kozlowski Date: Wed, 10 Jul 2024 15:52:32 +0200 Subject: [PATCH 3/4] ASoC: codecs: wsa883x: Simplify handling variant/version MIME-Version: 1.0 Message-Id: <20240710-asoc-wsa88xx-version-v1-3-f1c54966ccde@linaro.org> References: <20240710-asoc-wsa88xx-version-v1-0-f1c54966ccde@linaro.org> In-Reply-To: <20240710-asoc-wsa88xx-version-v1-0-f1c54966ccde@linaro.org> To: Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai Cc: alsa-devel@alsa-project.org, linux-arm-msm@vger.kernel.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2199; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=jEk16JQFT0IAvURH2BypgqgsTIx/BJn3KXaiR2tgfp4=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBmjpIlOgCYWfv4QovLUr9t2eeUmCY7lvvKDS73A VovMzO7Si2JAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZo6SJQAKCRDBN2bmhouD 19O3EACDQ8/ZgiJhxAwvdrYT9Y2yfZkcfzRJ2uk1DlBttj+8mn4kHwjx/iLc7H/P5lTj30Wu8NT Kaey6f2Q0xWYAxn+yx/nDwJwtY2ZKb5xmdf4Hko7bSsXDDL3VJRpV5kg6whjscNB8jmd1uraTVA cbdnHVXfICieiv+Ixsykpx94arFN5WsaAAynMv6hNwv3HT7d19ZUFFrqPnndTX0TAa2f/sWzbaF Dp/dsk/oUufHNz/X+C1PkKIQNCNMDkNmBqL8mUrymEHcb5BrFaSvYIIAdyNFt0FBOIizc0L+xE0 U7dLgJnJifAz+vhqPJCHBWM/DCmTQue7ezM/P78hHj92oGcNidqlM7RGMhc+pJQ69/6wS3JMk9K 2tamTHAsZ/JGa4bWBfqJ3eWf0atekroeY5xmfkfIyCNCORkgFCPhbnhntCjVgAox8ZB1beblCzQ Z7cZC4o2WvAOzROymQz3GrgLpB4NuO4I9vwIKVgwjGxXSuS9N94fsWZtJRI3F1PP5VKjsyrDmWv apyqKSVAyseJP+HqRHWIlWFioigECh8ZvnR2jXmiYRzF9tI5Mac0UC70pW/lV+JTL88+QA+wtbg 5FQf5ARkfSONAFlt/QW91s+MqPui5LEFFoqLiQRVwIXITx+7FhFgPQXqR27WJxmumNXZR2of/Uv 7zTxJXk/P9DlhKQ== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B Message-ID-Hash: DFJYIFX77BG3DVVKUDQIRTLUAMRA3ZSP X-Message-ID-Hash: DFJYIFX77BG3DVVKUDQIRTLUAMRA3ZSP X-MailFrom: krzysztof.kozlowski@linaro.org 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: Driver does not use detected variant/version variables past the init function, so do not store them in the state container structure. Signed-off-by: Krzysztof Kozlowski --- sound/soc/codecs/wsa883x.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/sound/soc/codecs/wsa883x.c b/sound/soc/codecs/wsa883x.c index 60b78560f4b7..0692bc39308f 100644 --- a/sound/soc/codecs/wsa883x.c +++ b/sound/soc/codecs/wsa883x.c @@ -438,8 +438,6 @@ struct wsa883x_priv { struct gpio_desc *sd_n; bool port_prepared[WSA883X_MAX_SWR_PORTS]; bool port_enable[WSA883X_MAX_SWR_PORTS]; - int version; - int variant; int active_ports; int dev_mode; int comp_offset; @@ -1005,29 +1003,28 @@ static int wsa883x_init(struct wsa883x_priv *wsa883x) ret = regmap_read(regmap, WSA883X_OTP_REG_0, &variant); if (ret) return ret; - wsa883x->variant = variant & WSA883X_ID_MASK; + variant = variant & WSA883X_ID_MASK; ret = regmap_read(regmap, WSA883X_CHIP_ID0, &version); if (ret) return ret; - wsa883x->version = version; - switch (wsa883x->variant) { + switch (variant) { case WSA8830: dev_info(wsa883x->dev, "WSA883X Version 1_%d, Variant: WSA8830\n", - wsa883x->version); + version); break; case WSA8835: dev_info(wsa883x->dev, "WSA883X Version 1_%d, Variant: WSA8835\n", - wsa883x->version); + version); break; case WSA8832: dev_info(wsa883x->dev, "WSA883X Version 1_%d, Variant: WSA8832\n", - wsa883x->version); + version); break; case WSA8835_V2: dev_info(wsa883x->dev, "WSA883X Version 1_%d, Variant: WSA8835_V2\n", - wsa883x->version); + version); break; default: break; @@ -1038,7 +1035,7 @@ static int wsa883x_init(struct wsa883x_priv *wsa883x) /* Initial settings */ regmap_multi_reg_write(regmap, reg_init, ARRAY_SIZE(reg_init)); - if (wsa883x->variant == WSA8830 || wsa883x->variant == WSA8832) { + if (variant == WSA8830 || variant == WSA8832) { wsa883x->comp_offset = COMP_OFFSET3; regmap_update_bits(regmap, WSA883X_DRE_CTL_0, WSA883X_DRE_OFFSET_MASK, From patchwork Wed Jul 10 13:52:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 811793 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 DDA0CC3DA42 for ; Wed, 10 Jul 2024 13:54:31 +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 60BAEB60; Wed, 10 Jul 2024 15:54:20 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 60BAEB60 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1720619670; bh=WB7TReeuz9p2xJwiha6GQMNAWLN4DRCFhtae1ITPqrU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=iEZvClFJqL74WaUlOI6fKJHXXBxQkDNmDHzjuP1WQ3cC6SDYxa7T2Nrz5n/ny0soF FsS7nECCM8whi09YJtw2hgQRkHP30Pw+SQ38T3gQc/otvPvrH+85j0K4ulO3gxcdEb VEQ8hnfloYXtkzGYzPp4FkMXhi6HiDT20VKrOMGE= Received: by alsa1.perex.cz (Postfix, from userid 50401) id C6CFAF8062F; Wed, 10 Jul 2024 15:53:04 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 3CFCBF8062F; Wed, 10 Jul 2024 15:53:04 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 692FDF800FA; Wed, 10 Jul 2024 15:53:00 +0200 (CEST) Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 89BC9F8020D for ; Wed, 10 Jul 2024 15:52:47 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 89BC9F8020D Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=jbBKPNim Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-a728f74c23dso796250066b.1 for ; Wed, 10 Jul 2024 06:52:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1720619566; x=1721224366; darn=alsa-project.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=4OC8QeR0kGY9dWOXLH/zkl7I9eWhOVZEAFq6fczOPCU=; b=jbBKPNim2+MbIg06Ej4Wi2+WNzpIfjcS8Nteu7xyKgxToFLTtZL0bymA4qsAx8F6ug YXsclgYaCWyG8uLECghYy/il7GGcRBZpIwu17n0BsuVsui39+TITt8DAhkuxy1umskX1 YMicRv5s0pbJKhQSWBcasJkbQsc5WG1B/ynMyv7V7cP6QBkHPrGsFQUlzHTtvMS0vQbq 3Of5XZLnd/fCyA3ES4Z2KZvNVJZQ2zlYPHFB0lgdsHSrPuO4Z4gllyzd4fL+OHF/t1Ek KLbUMDA/i5so8Ac0XEQhJZO4OJHLaOLa3s4guISX9M7EAEwbXuQj0ew5qSrFhPXHRquf t81g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720619566; x=1721224366; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4OC8QeR0kGY9dWOXLH/zkl7I9eWhOVZEAFq6fczOPCU=; b=Rd0Qm2gK0dUKIfIyzk7jjOcoTt76db95jRGxQd5to5hzGT0kBzf7zQa3uX0uRbyyXE Z7sGBNo7pUr07bYHQNiJ6WzV+OdfLZ/zAxh56UUoK6WaBk7S91FBM69Ufe0IvKqJ2keC yMqpSUA2j22lslEIGzCffUNL1OY+mmxJ/SMQYaF4QG7nIxrDUpaW07fjJtlchYgFPtsQ XhIZOvcEqaFPxM4qqjZRS/rz/BoJTS12vQ1DSZxZzlIryqOTr1K2MC62jNk/xGYXTJLi ishSp37LWa9GdwKT3dg3s4AhcAgC2gEu9+e6tE1HUxprejHByHGqi1a7+uof0HI8hzJa FS0Q== X-Gm-Message-State: AOJu0Yzs5/4596l6XjacJ9ZD4ad9O/3FzIycklOA0NUfcQ+J5Oft4x5n NJdnzEYuCqDl4DMGYbP7iAzQl2SPqZ4pC6sBctqVQ1SZzAn+OTb3auq7Q7A7/HM= X-Google-Smtp-Source: AGHT+IHgtY+jl1RRnFIQyLNJ97fWPscsE9ZarFQHgaMGp518nrfXgsChqvgkK2KRYnMJVo21PLAlww== X-Received: by 2002:a17:906:40e:b0:a77:c824:b4c5 with SMTP id a640c23a62f3a-a780b6b18ccmr394586466b.18.1720619566685; Wed, 10 Jul 2024 06:52:46 -0700 (PDT) Received: from [127.0.1.1] ([178.197.219.137]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a780a8551afsm160440366b.166.2024.07.10.06.52.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jul 2024 06:52:46 -0700 (PDT) From: Krzysztof Kozlowski Date: Wed, 10 Jul 2024 15:52:33 +0200 Subject: [PATCH 4/4] ASoC: codecs: wsa884x: Simplify handling variant MIME-Version: 1.0 Message-Id: <20240710-asoc-wsa88xx-version-v1-4-f1c54966ccde@linaro.org> References: <20240710-asoc-wsa88xx-version-v1-0-f1c54966ccde@linaro.org> In-Reply-To: <20240710-asoc-wsa88xx-version-v1-0-f1c54966ccde@linaro.org> To: Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai Cc: alsa-devel@alsa-project.org, linux-arm-msm@vger.kernel.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1636; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=WB7TReeuz9p2xJwiha6GQMNAWLN4DRCFhtae1ITPqrU=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBmjpIm7n6j5rSUbIfZVj7o449ncopexzUhu5/AH QhMa+YOvCOJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZo6SJgAKCRDBN2bmhouD 14ApEACN2oL1zIaMFQ6Ucxm9eW4neIeeG+DeSn0dTmGO/kaA7yYrMtBe2eKxURAmT+3Ijv1mPxY +P3cezRBgIYmjOZB9h1HC5sVa03qi8uxDTWEt/bS4Cv6MgiLCcO6PPDQ6x1soaa84/UnJTqhhQt O72gTTfh43MgNod0IdVxZwzKGSnszys0xnz8cFfV63ufqG15yAxEIxE7ZAY36AMD9X+9FiLZI/S uWJaUEikPGXGqgx+Wprq3XuRsfY2GiC0IrrUQ5WywC5tLMtT/mBusRx5qCGw6WFB1gzYq1n5RDP 1Kgz+3i8DrXB82SmohXpH7+qct5J1JZr4hgdwQj4EwrCBLTP92RSUTtFdiYgIRvrxzTTr8xm72U mC++PSeRb3/5oW36Z0CODwjstoWljyXx2J0avKPzA4Ks+KSRX5CtrUPGmDABiK9lkphYDP8rKDd q1rOAebtS1VNdlqBMRpFxDm9xPpt7/scouggv/f5IJotxnzBK7nhm+WvcHUTfy323HcaGQLYhOJ sEcQ4B6nRfoHs89zpeu5NorK8TpaGtSxDr+1rClWFFSacX6/DlTqoU+vDvUi6XT4h24KTmrCcBm yvb8RG3sWBUu8KXRGmEPF4od0ljjHUy8mb/lHM4UONia/GzRWn6w7MT3t/OyIgDVCFrYcX5HeAd Ywz3QTiBnCWhrVg== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B Message-ID-Hash: IIXDTHNTU57VY7O5GHBB56CLNFYUR4GE X-Message-ID-Hash: IIXDTHNTU57VY7O5GHBB56CLNFYUR4GE X-MailFrom: krzysztof.kozlowski@linaro.org 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: Driver does not use detected variant variable past the init function, so do not store it in the state container structure. Signed-off-by: Krzysztof Kozlowski --- sound/soc/codecs/wsa884x.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sound/soc/codecs/wsa884x.c b/sound/soc/codecs/wsa884x.c index a6034547b4f3..7b19df9c1728 100644 --- a/sound/soc/codecs/wsa884x.c +++ b/sound/soc/codecs/wsa884x.c @@ -703,7 +703,6 @@ struct wsa884x_priv { struct reset_control *sd_reset; bool port_prepared[WSA884X_MAX_SWR_PORTS]; bool port_enable[WSA884X_MAX_SWR_PORTS]; - unsigned int variant; int active_ports; int dev_mode; bool hw_init; @@ -1465,7 +1464,7 @@ static void wsa884x_init(struct wsa884x_priv *wsa884x) unsigned int variant = 0; if (!regmap_read(wsa884x->regmap, WSA884X_OTP_REG_0, &variant)) - wsa884x->variant = variant & WSA884X_OTP_REG_0_ID_MASK; + variant = variant & WSA884X_OTP_REG_0_ID_MASK; regmap_multi_reg_write(wsa884x->regmap, wsa884x_reg_init, ARRAY_SIZE(wsa884x_reg_init)); @@ -1474,7 +1473,7 @@ static void wsa884x_init(struct wsa884x_priv *wsa884x) wo_ctl_0 |= FIELD_PREP(WSA884X_ANA_WO_CTL_0_DAC_CM_CLAMP_EN_MASK, WSA884X_ANA_WO_CTL_0_DAC_CM_CLAMP_EN_MODE_SPEAKER); /* Assume that compander is enabled by default unless it is haptics sku */ - if (wsa884x->variant == WSA884X_OTP_ID_WSA8845H) + if (variant == WSA884X_OTP_ID_WSA8845H) wo_ctl_0 |= FIELD_PREP(WSA884X_ANA_WO_CTL_0_PA_AUX_GAIN_MASK, WSA884X_ANA_WO_CTL_0_PA_AUX_18_DB); else