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: 811810 Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com [209.85.208.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E6760193095 for ; Wed, 10 Jul 2024 13:52:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720619566; cv=none; b=AFJixsuCBdcdyl9ASNGf+pjymVJME4q/0Llmd1b/+2XdbPVQMtdNJXigtJ9gimhEcQMn14NFL2X2QJGSqTxJHKetVtX1DvWJM1EvoERX/KcRU2p/PIqCkhc9bQkXic7ltK80EgCpHTjp5qCYU4inSyEqBqAllQnmywycq5iFmh4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720619566; c=relaxed/simple; bh=+8JLB/iozDF8e+w8VM/0NLmlF4J+t2rdpXXcSD/AIOA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=tYQjSIfiSjeNTK4AzQMv6U8ncvNZvVO3w92na81RKj0JIldc9EALQ9ZAwmunAeGfN2IsOPyCoq9N46XcClwj2ZFcl42XOPlTGycF4B2iZR24jSAMOVP3f8BhxC5+JCrA96gngrV9OyD/2lSoosSPHED5YUouMy2tKBKG9Ixccro= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=dDDsyaTF; arc=none smtp.client-ip=209.85.208.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="dDDsyaTF" Received: by mail-lj1-f169.google.com with SMTP id 38308e7fff4ca-2eea8ea8bb0so57137921fa.1 for ; Wed, 10 Jul 2024 06:52:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1720619562; x=1721224362; darn=vger.kernel.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=dDDsyaTFdctg+TjADLzQwAstTYQrCNOjD1OOpbXwjEV/zMihQei/fOA0rrxhApa9h/ XatdWNHQKFZkLylnXg8ToSsKiu+tuSvxuumSCWOkxiZaU5XvaRr60tE65E6qy2W0+AfM /L+iwYkAHZvevVyRAIS9H/Ri8MnHG+6N7DOZbEszH3LRSw9XqFbZPfTF8+y+GTRslMpa 7vTukgxDNbnMwdV7SqfL9lDVtXhufRtjuqYsb4+jmg6F/2RVL0gY7FhOzNSB8d2TJ+Vr WKF08Q6TtMoQd7lh2dXM5/Za/lgDBNTrR8e1KoTFaJ7pGU8vBOivoriOgjdsIN3GFI8Z Pj0w== 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=xFc5s3IDrhJyAhEQWYNe+fFmwMcy7KNgzjmQAGFYlrqqfR7dErrKRCh00POrklqGDu UMoeSVEdtCMLo3nIAmjIc/RKwk+KR4Z0TLO7UJb8EAptTT2qdAKN6ieo1ldKx1pGCj2u BAOZ391nYIBh9vyfPmatPw/he2j5RZg+8i3OWbADNG96Nh7qrWPzKD2Ay1nY7P0ICCKJ 02FcpEtvGHxZXUF6SI3ghVwhOnbQL4CNEnu0cxHGnoNVvYP4tK2xGaanMTiLAOFnVMzW mNhJkW0F4fvvxcZ3fDb2l1xjaXTF9ocOF3GdPoH8OmPynM8HBob2K2iOqIUbBncJcU87 nuZg== X-Forwarded-Encrypted: i=1; AJvYcCW1TsHnuQgBaTRsnlR8nhLxDU3vbB6D3QSnbFLwBEbyvajrv06x6H4OSGpzc8iC3EOPNa2zXPWRmBTEzmPVwlFhUSTjFihX4sTWF8WVWQ== X-Gm-Message-State: AOJu0Yy09nWAu/In2FNQP/Q5DPFgRpgRanP2UzRa+L9VBA+AiaPh8A9M l75y98WcXYs0+Cv4kWZ3EM07c9m4zUlpb1ZzCS3qSiV8OBN69zx3nXgxVTnCrjBtZjpxWckhjB8 5 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 Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 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: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: 811809 Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4C6CF193472 for ; Wed, 10 Jul 2024 13:52:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720619569; cv=none; b=YxtcCwNZm059gAxjad5OU8RLSiwS5u1jkucbDv3GGpUVG+gIfc/FyBlmJbcQ13/dok9iED66ZXdocF0Sg9bUzdOvRxBoaq///udCslF+QEJoVtcqWcHtVCIbIITE4iuLFFNUgrKby0JI5D8RI0Wnotgh0ciynuvaYas6bJB7WPc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720619569; c=relaxed/simple; bh=jEk16JQFT0IAvURH2BypgqgsTIx/BJn3KXaiR2tgfp4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=QRkVI4Ir7hi3bk3xtQAQZrEkMUih+UNEz7dkILq7ZnSCvznbYbxRSTRiibvgZUdPhMKMPnpFrepf7XUv7pbXAIanlGSj5M1qctFSy8LHU67KRE4KZxSy58K/Fv5NJO4jcDBVbrq9YG9BCrJpn+dhMfB7mnHfZ/iptlMz43zTzhY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=o/x69AqZ; arc=none smtp.client-ip=209.85.208.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="o/x69AqZ" Received: by mail-ed1-f53.google.com with SMTP id 4fb4d7f45d1cf-57cf8880f95so8352064a12.3 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=1720619565; x=1721224365; darn=vger.kernel.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=o/x69AqZJF19Xv2lLRmgsxJS/bXSTIBWJh3ABqIXe0c+gBrUC27NGxvi038yPgCvXn O8jjWZrDdTIEeMl/VC3RMUi41V5buJxez2leZ9b1eS13qeWsd2TOH3CS+ARzeRX0HtPp gIfMVA2MqWbx+yGJJcLBBYdReyevjyLkuFB5E7c9Nn6Ye3x4e9R+uhwhVPYX39mZWfa7 2zm8gn9smbOHtqfLFsQOkBH1YI2v7Oh/fz6uRu00XXaZaRypbE7Wrdrm1ND2LAIcmFw9 PEzYk+LmgKzJxe/0S2KfLC+YhsCCDWF794hf/+H5oF1AfIvQjNkZKVp9ZSO5JttVYPxD StfQ== 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=fnIDTHzrr6eVCKhYYm9zJusMCF8p8dZuQL/meJTLZ5hKQ2LzQvCBpI0nkiM5U+hCUp bDeHrP/rOkrlLfuVpcfp2md1l59QRMBLlv7Sf4SGb7D6ZLuiqvsUeVpqQCzux0oCSatR vNKJHdRp9lP3hNWR9xU9mYRzPh7NmwHDgbQue3id3g9Kest6juEO1IQCYTTQ2Zlr9evD tFMFKrAeYxHdenhI0Sclcmeun+ty+j4aYQmwzqU0ichDXzcY19cZwca1d4B+4ke2HR+Z 13443YCH7B8hYq9u2opZrWHg1AYdv8LvMCTjKFvKWJJczawkP+ZoYl7SujzRScSQ9GU/ yaXA== X-Forwarded-Encrypted: i=1; AJvYcCXY1FY5hRmXyenJI7xs9uOLKc7ZQhOHBstkoQ9nRCYavyAndeT+fGACMeHeVq0TXE8prRAbj+RO3p+AfEhbSbe3/mG2ANxTBJx8dGPA3w== X-Gm-Message-State: AOJu0YyOE0kGTI0v/JCn/P2RKQNd8tLa+MK0tPcuKwQbWChRthAFjPjj mnpjjUK6J8B3R1pLF9pA+J80mNjLR54Rbl7exewt4OnoQvDcougK40AKQE9nNaSRscEvJIdQF7O M 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 Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 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,