From patchwork Thu Jul 25 11:23:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 814432 Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.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 B3D901991A8 for ; Thu, 25 Jul 2024 11:23:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721906639; cv=none; b=C6lxtBmJPtKJ9utjURCrlNm6dOxFK/YL8KA59p7U5iNGw5QF6sf9ZETU43DdEy75uCKM2cjqkiUJYcPNm+DYuSadjXC8k9F9gBRW3QPsNhwTY1qwreqZ/1IZwFhvECNWHyLpS0o/zCJW0d0L2xyCaQSmdBKTGx4iaTM9KnBMqFs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721906639; c=relaxed/simple; bh=H3zPQHTWirqb+YKkh6z42j305IWpTK+pFRf3UJIfZsM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=LD/2s4+76bpVoVAh2kp0T/AXo4UrXQR+luaGyZZoFg0oYLTDad2oEs2nN8cSIspuosIuAeBqTIIo60TSfsUw0A5JvaiEzgcbel8gCOmwEgoVwWuPwnfXmcumrblTBPVPbhOils6T006x39mQSuuVfxFu+X4Zs7jx67GHw/zB/HU= 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=sF6vM8BS; arc=none smtp.client-ip=209.85.221.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="sF6vM8BS" Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-3687f91af40so509871f8f.0 for ; Thu, 25 Jul 2024 04:23:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721906636; x=1722511436; 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=gTBSTTOkb+WSl1iUVchSrVeyD6kc7gtLT8y+Hn/zjv8=; b=sF6vM8BSZsZ7bHiI7FGF/WZDpwJQIc7k2JVUfZV9QcRbSWcDOo1iJOs4HgqswoYZul uGoqwU5G1/umg3edUr40YFjXqH8m9XNyVwflPOofrUttp7t+rG6GJ+y289R+Isg5oDsS nc21Mq3QbcDmBAyS+hfMgmXEaapW+iVr7n4FQkcpFB49+mCu9f0dbVf4h6EavRUTaV9r pNiTmsMTcayz5p61Mk3Mk/Xt5q3iJ7YnCNylICKnGpxL5QIg96vlASMDizZRv6K551WX /B+s9gzz7OfNLZWX6pxZdE+yziZjECmDa6TX4F+QQUWItMU/MPLwabNu41KUrqGzNfD4 IRNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721906636; x=1722511436; 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=gTBSTTOkb+WSl1iUVchSrVeyD6kc7gtLT8y+Hn/zjv8=; b=CwcRlc12VzNwOYqeKjR9pddEHarY8CVK4z/XZ5mUI1Nk+IAvWtkA8USkXrKNzeFcjk +e+9JybIWyeDvGx7kip0GdYzfDX8YanrDOH2LzQbYh6BaGyM+baNsgUWQDuqUtLsqHEi /HsDLKP1EW5ebpIHsmoCOvNlcEoVvgxlU1iwmaW7c2G1z9fr1VNPkv9AvXdrcbxRXcQL ikhfN6vZSRVHmjRA6kLP17iUx8bn+tPELG8ZQXtF3KC2wrbIfOHq6DcvNdBs1MfSq/3S eCxh9XKBG+Mf9cp36g3tyF7TEsBGrOSYRnU2EppASl0kOdhFWGYKu9lEhPdrP+76/eaJ K4Mw== X-Forwarded-Encrypted: i=1; AJvYcCVOJzM1IWwxIhLw2h+MehdjlOVPUR/VQJPTJJikGKbVK8XOxSBdMOZ1jE4xSFUzkVAJA/sMGa7ICDS+ShZhJ5mZdbZlaC6+JCLE3f5Pvw== X-Gm-Message-State: AOJu0YxctP7HdL3DA8Y99TglcFyDf4HnWLgm9Wv7RwFoScFpo6k1nhwK AP3MhAwzaI/y76ip9DqKzQW0Od5ftUOAK6ouWAURYmpf4xemlymxKIyqiDImRz0= X-Google-Smtp-Source: AGHT+IHAfTlo9M6e5r9HgMHgdhErs0TlhZtiXo/7lrlvfs1/razJ48JKVhDyFjVXqWYom0Upw/26mQ== X-Received: by 2002:a05:6000:e02:b0:368:3b1f:fe40 with SMTP id ffacd0b85a97d-36b319df228mr1806585f8f.20.1721906636120; Thu, 25 Jul 2024 04:23:56 -0700 (PDT) Received: from [127.0.1.1] ([178.197.219.137]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36b367e072asm1823607f8f.42.2024.07.25.04.23.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 04:23:55 -0700 (PDT) From: Krzysztof Kozlowski Date: Thu, 25 Jul 2024 13:23:43 +0200 Subject: [PATCH 1/7] ASoC: codecs: wsa881x: Use designator array initializers for Soundwire ports Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240725-asoc-wsa88xx-port-arrays-v1-1-80a03f440c72@linaro.org> References: <20240725-asoc-wsa88xx-port-arrays-v1-0-80a03f440c72@linaro.org> In-Reply-To: <20240725-asoc-wsa88xx-port-arrays-v1-0-80a03f440c72@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=2540; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=H3zPQHTWirqb+YKkh6z42j305IWpTK+pFRf3UJIfZsM=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBmojXD18kJb1J8ilpNX0TqXikxBBqVB+AYDoX3s ofz9k9fE5eJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZqI1wwAKCRDBN2bmhouD 10rxD/oDw2zy6A5vr/mf1lFcmwK5FKJCWh5Fk9QW6Xgt5ZPo0Z9CEooxuhCynFyOQ2ZpFiWVVCA zQjbNrj4nOoHuwcmmFAXkBLRbybce9FHqoLQ9U2rxOyrTOqjh15OV7G9cpbncYtWGWEfNBm0NTI GE4W4e+9s3ERSChCy6Mc5rTP5bhB/c3JYg3mpI7Olx3C+ZcYqwjmf33TxmQW2wL/+zkHO7qf9Nc G2WpUQpxY+HpAslqcFienRtcGthZSTBVNSX3OvSV4Tdyug9owWh3rt5bHIwwUf2tzkIwnVJMrnI xgPHcGu8oYNk6bSGWpUkLQy4xQ5/svZuhHZ8cbEUt7wkiWpE3cjb945wXYwAOP1+bKYGHk7Y/2Z vqSk0qY6tyVwAtHYIBfFtFR/4+iEptZ6yqe4NTEGjWOfnLc5g7IBRgb5RurvqssAwY3jIl5bO4M OM6Qqtu4HulnwD2aX2otXE7WgAxyV29k+4Rv1WdUV0jRklzDmcYFWiapRofQrGQBS5L0PkyzjQ9 wFpYqJmouMApelh/fUq2V+ypxUrXfUkas6hZm/KEdAhMjTLSZVS+UkKCbioo4sYd0UpJoCXRIOs H3QccdYt6Dz991XlRfQTZ23lIGq6EqyEOJfT2o2akCNp9R3QsJf/5gCgCQVvPUcpuvGjRJwDE/T 3/cJvitndAM0LqQ== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B Two arrays (with 'struct sdw_dpn_prop' and 'struct sdw_port_config') store configuration of Soundwire ports, thus each of their element is indexed according to the port number (enum wsa_port_ids, e.g. WSA881X_PORT_DAC). Except the indexing, they also store port number offset by one in member 'num'. Entire code depends on that correlation between array index and port number, thus make it explicit by using designators. The code is functionally the same, but more obvious for reading. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Dmitry Baryshkov --- sound/soc/codecs/wsa881x.c | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/sound/soc/codecs/wsa881x.c b/sound/soc/codecs/wsa881x.c index 0478599d0f35..a5e05c05fd3d 100644 --- a/sound/soc/codecs/wsa881x.c +++ b/sound/soc/codecs/wsa881x.c @@ -386,33 +386,32 @@ enum wsa_port_ids { /* 4 ports */ static struct sdw_dpn_prop wsa_sink_dpn_prop[WSA881X_MAX_SWR_PORTS] = { - { - /* DAC */ - .num = 1, + [WSA881X_PORT_DAC] = { + .num = WSA881X_PORT_DAC + 1, .type = SDW_DPN_SIMPLE, .min_ch = 1, .max_ch = 1, .simple_ch_prep_sm = true, .read_only_wordlength = true, - }, { - /* COMP */ - .num = 2, + }, + [WSA881X_PORT_COMP] = { + .num = WSA881X_PORT_COMP + 1, .type = SDW_DPN_SIMPLE, .min_ch = 1, .max_ch = 1, .simple_ch_prep_sm = true, .read_only_wordlength = true, - }, { - /* BOOST */ - .num = 3, + }, + [WSA881X_PORT_BOOST] = { + .num = WSA881X_PORT_BOOST + 1, .type = SDW_DPN_SIMPLE, .min_ch = 1, .max_ch = 1, .simple_ch_prep_sm = true, .read_only_wordlength = true, - }, { - /* VISENSE */ - .num = 4, + }, + [WSA881X_PORT_VISENSE] = { + .num = WSA881X_PORT_VISENSE + 1, .type = SDW_DPN_SIMPLE, .min_ch = 1, .max_ch = 1, @@ -422,17 +421,20 @@ static struct sdw_dpn_prop wsa_sink_dpn_prop[WSA881X_MAX_SWR_PORTS] = { }; static const struct sdw_port_config wsa881x_pconfig[WSA881X_MAX_SWR_PORTS] = { - { - .num = 1, + [WSA881X_PORT_DAC] = { + .num = WSA881X_PORT_DAC + 1, .ch_mask = 0x1, - }, { - .num = 2, + }, + [WSA881X_PORT_COMP] = { + .num = WSA881X_PORT_COMP + 1, .ch_mask = 0xf, - }, { - .num = 3, + }, + [WSA881X_PORT_BOOST] = { + .num = WSA881X_PORT_BOOST + 1, .ch_mask = 0x3, - }, { /* IV feedback */ - .num = 4, + }, + [WSA881X_PORT_VISENSE] = { + .num = WSA881X_PORT_VISENSE + 1, .ch_mask = 0x3, }, }; From patchwork Thu Jul 25 11:23:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 814619 Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.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 0295019922A for ; Thu, 25 Jul 2024 11:23:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721906640; cv=none; b=NZIWN0LcNpQxBbdCrVW3mlDQsh/W1BROqi4ORhlgPblTQRvdzmhUbQ54nv6yf/STqrxeaGZ6zUeePcEOm8WWE9ZEuhmErf2RAttl7yNYRhkVgOoVmq7RRwy6KfGv7QQ5XfYlQD8UBBXuoqzQgrxg5HBkSaEk+jEKJTk6F0Dx708= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721906640; c=relaxed/simple; bh=5bfQhydr9tMLNetcsEZz+hbSCdoeA4DrLZ/v+dMoi3A=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ebw0aM4TrnBilye2dUSdGhIVdlPArBShonbbSaI2Btw765JWleF2fNn+XWmXJGa2wbRLedl4fslaUkZdLPHThOBfQ2kEO9zGfdLS8TljWjfP/pxhWqk2OUtcmVEhAAqtGrOwkfH5D2K1HoJT1Qvi8T7I0VJ5i33nQuuHXGmoI58= 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=UFp/k77c; arc=none smtp.client-ip=209.85.221.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="UFp/k77c" Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-3686b285969so493350f8f.0 for ; Thu, 25 Jul 2024 04:23:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721906637; x=1722511437; 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=hFlLzwLRceHnWpJnvPhTnE02ITLGjL6VJSNAT7ByPwI=; b=UFp/k77cD8VG+Pl2V8sXS+RDd9gvJn4WRK+HdqiknmVBiS91x5UcqsiQi4XeUIObMX L5nsyg7sfIh+AtJ9Cv800VSu3UVYtBDeZ/N6Zqf3kJmhElpLsH0S81jZxB0K4mFq/APL HKY/+5upxy/9lL3w8Glkjf8hrS2+yhA4Evezx6D9NEkxYM2xz39XO+vvxphEZw4fYyMP PxRor4WrOeOdkSa271st5RcU4fLWmzCRGyG0VvVAPMqnCExZKMtsRGSSXVoNzAiZ4fcI /FU4p/Wz8yEf4rbNaQ2snqkZGVEgAHi90OPxZvnD78UjwrwHbl6/Ue9JKHLwTlx/H5zU XZjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721906637; x=1722511437; 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=hFlLzwLRceHnWpJnvPhTnE02ITLGjL6VJSNAT7ByPwI=; b=nQ+cxbJ+r/cxU10ZxPH1edveVdXEO0tVzK+pdgfJ6dTcetgHT+flyH/wAF3x0Fjh+f N22Fv2NktPxDAkvU2RHv3hMI56TsUVdyupRXxCDd+YonP2kHkq7jVmNerdVZddwLrvAv NHQ0Nowgb5Bp0mOeg6OFSgvALXFXtZS83gS+6M0ad2zjzeHeJsBhkQj/M5MTC8N3Pcbq YuRzEzL47Gwfu/suAzq4Rtlow3F2I04oQjlJS5hJvtlVY8u01MXVjBBpRbp7qAQqmJcb t83g1oJE/xFTejVNKPJoorJm7xI5KPhHHAMiuJoaqzTy3TCrDMfuLDVdGXoctk+k2A/w CZHg== X-Forwarded-Encrypted: i=1; AJvYcCV0s0Zt2sIhRpFrwa7VWXI84eedhiXxlcTWSan2RZYzbjZarcFu2/jGSmQVp3F58bkDm4Zhh9smk6boIs/Jq8b8DDiVt9c+QWmUO0N78Q== X-Gm-Message-State: AOJu0YwqwXNdC7Dz2SZMkY0OYFlNYS/kE3puuIZsGowWPWuQVAirQcMh IMC3XPC27MGjt4hSD2HjD7An/N+q1s4EOC2d7A9xqvoPokCE0oOjiW4FkYgMLyE= X-Google-Smtp-Source: AGHT+IHI+UfhUfC5IdbfjZbkmX32phYaaUoqE0Hf3dZqYfF6Agh382b8dMvAJQrIcQK8MCKaSP5q+w== X-Received: by 2002:a05:6000:1942:b0:368:3038:8290 with SMTP id ffacd0b85a97d-36b36421ac8mr1441762f8f.39.1721906637372; Thu, 25 Jul 2024 04:23:57 -0700 (PDT) Received: from [127.0.1.1] ([178.197.219.137]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36b367e072asm1823607f8f.42.2024.07.25.04.23.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 04:23:56 -0700 (PDT) From: Krzysztof Kozlowski Date: Thu, 25 Jul 2024 13:23:44 +0200 Subject: [PATCH 2/7] ASoC: codecs: wsa883x: Use designator array initializers for Soundwire ports Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240725-asoc-wsa88xx-port-arrays-v1-2-80a03f440c72@linaro.org> References: <20240725-asoc-wsa88xx-port-arrays-v1-0-80a03f440c72@linaro.org> In-Reply-To: <20240725-asoc-wsa88xx-port-arrays-v1-0-80a03f440c72@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=2569; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=5bfQhydr9tMLNetcsEZz+hbSCdoeA4DrLZ/v+dMoi3A=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBmojXE6P6roRkXoVY/K1xVHnF3/DmAhMbfXU/SW rdbGLXNlCiJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZqI1xAAKCRDBN2bmhouD 16GGD/oDVLyKmM0xSiNmRbDucXD4aBD0aY6ODnIpmZQ7/lnlpWOuPXgV2Q3c3djzlRym60/IOVP zmoUqNu2LiOecq/VdyyfFx7yNyn4VgQbu66YmVuMbwItvpbj+UF2KHUKElSMQoiu2FVHgrLthYg kf8VOeEMXFQ73IhWpygDAaBVFUMKT1pnMEsg5sJEvdC0oNOvU8/oOTK0SLmHC7HMfUw0PbXi+Cj BJwVj72PlXzdnIDc6oD+yQfbFy02TriW1i1iIeBrAfvneOKuNZQIHaz4f73cZpwhrlKzCl82r7k TvTXQv8nbRD9IU61S9SrKW/SfJWCMdHpU1htnkll82L2T1EcWtOgjB3TXkEmJYaI6ELSJtD04D3 V1qxlXeT4P5gDhbE18tQm4xAxl1v8PsCBtmKg+6XkOmaKH/Wyw1uPGIQ8ia/rPlTbtciymTMh2s RZHljfhesgLD4wOsv0Cs0pla7hwsz6rS3Po9EfOZa6M9+wjHX44l2ti+JG7K/RKVMq7T0E88p9/ UhVlhgEkm8TsPnK3vCegGOcZgCm4gn79xWpShxhnZL75+FTrNb7pQLRkA0Xo0zIdCO1k1DxCO3b 4OqwGY/7N4fIufujHwb62cTuUukR9d5YITK7mLF75iPqj/23JqCfzLf7Axn6V4aLWrLmkwi7/pt s6cdJ6Tnbp69mMA== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B Two arrays (with 'struct sdw_dpn_prop' and 'struct sdw_port_config') store configuration of Soundwire ports, thus each of their element is indexed according to the port number (enum wsa_port_ids, e.g. WSA883X_PORT_DAC). Except the indexing, they also store port number offset by one in member 'num'. Entire code depends on that correlation between array index and port number, thus make it explicit by using designators. The code is functionally the same, but more obvious for reading. Signed-off-by: Krzysztof Kozlowski --- sound/soc/codecs/wsa883x.c | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/sound/soc/codecs/wsa883x.c b/sound/soc/codecs/wsa883x.c index d0ab4e2290b6..9dc2e4d96b10 100644 --- a/sound/soc/codecs/wsa883x.c +++ b/sound/soc/codecs/wsa883x.c @@ -482,33 +482,32 @@ static const struct soc_enum wsa_dev_mode_enum = /* 4 ports */ static struct sdw_dpn_prop wsa_sink_dpn_prop[WSA883X_MAX_SWR_PORTS] = { - { - /* DAC */ - .num = 1, + [WSA883X_PORT_DAC] = { + .num = WSA883X_PORT_DAC + 1, .type = SDW_DPN_SIMPLE, .min_ch = 1, .max_ch = 1, .simple_ch_prep_sm = true, .read_only_wordlength = true, - }, { - /* COMP */ - .num = 2, + }, + [WSA883X_PORT_COMP] = { + .num = WSA883X_PORT_COMP + 1, .type = SDW_DPN_SIMPLE, .min_ch = 1, .max_ch = 1, .simple_ch_prep_sm = true, .read_only_wordlength = true, - }, { - /* BOOST */ - .num = 3, + }, + [WSA883X_PORT_BOOST] = { + .num = WSA883X_PORT_BOOST + 1, .type = SDW_DPN_SIMPLE, .min_ch = 1, .max_ch = 1, .simple_ch_prep_sm = true, .read_only_wordlength = true, - }, { - /* VISENSE */ - .num = 4, + }, + [WSA883X_PORT_VISENSE] = { + .num = WSA883X_PORT_VISENSE + 1, .type = SDW_DPN_SIMPLE, .min_ch = 1, .max_ch = 1, @@ -518,17 +517,20 @@ static struct sdw_dpn_prop wsa_sink_dpn_prop[WSA883X_MAX_SWR_PORTS] = { }; static const struct sdw_port_config wsa883x_pconfig[WSA883X_MAX_SWR_PORTS] = { - { - .num = 1, + [WSA883X_PORT_DAC] = { + .num = WSA883X_PORT_DAC + 1, .ch_mask = 0x1, - }, { - .num = 2, + }, + [WSA883X_PORT_COMP] = { + .num = WSA883X_PORT_COMP + 1, .ch_mask = 0xf, - }, { - .num = 3, + }, + [WSA883X_PORT_BOOST] = { + .num = WSA883X_PORT_BOOST + 1, .ch_mask = 0x3, - }, { /* IV feedback */ - .num = 4, + }, + [WSA883X_PORT_VISENSE] = { + .num = WSA883X_PORT_VISENSE + 1, .ch_mask = 0x3, }, }; From patchwork Thu Jul 25 11:23:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 814431 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (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 7352619925B for ; Thu, 25 Jul 2024 11:24:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721906642; cv=none; b=n+v/X6qAVAIR38eTB2d7zIAxO+c5mvegqwCMWzQqxOdj3f/whwoubPjWL2QA4AkXX8bPp3YIZY1byn5ZLLEPcKdhWypkUXRkI9lj9G1aLzTFMkPXqjARhvOy1jBE9LDBHGD0jiJaN/G7temVNh7LDoFEQoDAreYjpnMwAXFm7P0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721906642; c=relaxed/simple; bh=5CQP3ouvzVeAmZXDUgxf/wEYJYDXjNwSjcV+BJjz67M=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=GcaLcwdh9mTL1V6oq6Oiq35XDEn/WO9hNpJ7CnmsF08/lvg+pr4m0Uq7qeobqeRx1fxzYAQPduzoaf7GkLN+NKEd0VaeACIXqiZrBzcODMUjgt4Yv7mkuqC3PVVoI8jc2tsBuxK6SK7op7mBQS+J99SHVs96JAUCSr4YwIxUXD8= 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=inNj7b9T; arc=none smtp.client-ip=209.85.221.48 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="inNj7b9T" Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-36865a516f1so625045f8f.0 for ; Thu, 25 Jul 2024 04:24:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721906639; x=1722511439; 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=6fToOtqS0kKV1Bi4vu3PvCh9iIoxoPkBbmgMcbIcPlE=; b=inNj7b9TMyydzxALBr9y26sGdUgitxPWiBFYR14gy93ymjO4MJATJBwwQgRlKypE6g tWV6BhCQTJfqdnKnvezl592VAEQG3eXUHSVzMSLdiyQ9FSrtB+TYqK9tXftPrphILzSY lBeVD2EqNEiyvw74FJAMZPQxJHc0XXmmYbiIBbpaogX5zHhmwgbMdCqhu3TnLZhq4taP 6zYJTttywCtjV6fp/f6IQFm7j8hBhNKeSt7hhdJjmSL+qcTZCoasFIqyp1xu5XOPRBsf jMKdfE2UezS7FjErGnmaGF+SNdt5qpFvWN6VH4QWpcISI8ZwmosITmBOJ6RHRAJGhRfQ Jy6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721906639; x=1722511439; 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=6fToOtqS0kKV1Bi4vu3PvCh9iIoxoPkBbmgMcbIcPlE=; b=H3Xp5yhU2sBT/QbE0GgIiaICn4XwNCYJVHjAMsa39Jsbvt3HUWvZG9RJT+teMKdzVF Mhk7fjMDrZnLgrcjUq3r802aSwg1mlWQuisMYiHg92wVU10Gm3vY0OMrk/maGlRaoWxe 6ybnhF/ts6lZmaXZV84j0jaPS52ayWUf++dL9ychX/r4SBkOvQA+H98O/fOGcWvbHcau ANo6yC7WHa36Bx/Wu6CkyZgG9gPzjh0XN+gtM4o5XDoEypznPtipnaRnAvoxo5rtwS5t zd/f9u9OVW0uUIsoFdThYFiKoQ9kvQEzZtTaMWWhSQwIbp5gUGDDJxfaqLpip+hQfAhx osGQ== X-Forwarded-Encrypted: i=1; AJvYcCUDeUjAEppgVP1ZiYe6+4GlUQ4JXj6rc+hCHwmZzpIGRKNnTKzgvzL0RO2OVKE8Fh78SiQ5L47JigmR0Wu7dvuIrponPqnbn106xz4AWA== X-Gm-Message-State: AOJu0YwmURnJG2DM+Cj9FgHxr4NoNlX4YuVyGUGeayZsXPt1AG0rZ2o4 5OvY/n9wsLoEGr+T1hvIVqzPDT4u4OVngSvHov0xVHgBF5a15S/LGMXKwxFabBxtdJ7+aQcDV/S F X-Google-Smtp-Source: AGHT+IEuxlhuA47wx7C8GCGxX+LExydeHoLlCtkkUP5qNZTPhq3tlYtBxbrdnheckT8irzJPS6ef+Q== X-Received: by 2002:adf:f38a:0:b0:368:4def:921a with SMTP id ffacd0b85a97d-36b3643cb45mr1498960f8f.48.1721906638645; Thu, 25 Jul 2024 04:23:58 -0700 (PDT) Received: from [127.0.1.1] ([178.197.219.137]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36b367e072asm1823607f8f.42.2024.07.25.04.23.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 04:23:58 -0700 (PDT) From: Krzysztof Kozlowski Date: Thu, 25 Jul 2024 13:23:45 +0200 Subject: [PATCH 3/7] ASoC: codecs: wsa884x: Use designator array initializers for Soundwire ports Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240725-asoc-wsa88xx-port-arrays-v1-3-80a03f440c72@linaro.org> References: <20240725-asoc-wsa88xx-port-arrays-v1-0-80a03f440c72@linaro.org> In-Reply-To: <20240725-asoc-wsa88xx-port-arrays-v1-0-80a03f440c72@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=3014; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=5CQP3ouvzVeAmZXDUgxf/wEYJYDXjNwSjcV+BJjz67M=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBmojXFWrIz3WtjJoBOP8BBCNGDTmV3JawrbHX3x ChTfPiw6ASJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZqI1xQAKCRDBN2bmhouD 10kSD/9V2Bpj7WduD14hnA0+M6g8eql4Si1kTreQJK/xO5Qof4b8A6QvqSF8i0iNaAbhdgNH21G /GnyBMV8sQL5iGWX9BlwiA6Hf3Ja6ucNBawP+941K1Q8W0Oqbb1XeDnU8FQsK8UAFCckuzewdn3 gY/XUmn0mcQiTtjzgI1gaWX7/w8LCXE+z9lq81jyw9Cfyd4tasAGCOahNG/VpkIFdGVGi0KwCZq WFk0T6VvJs0j7cXpDKsxneGwtFuepjO/f46GRPgLSnY0D43A50/fgRcStZ655LsammpUi37OT8R CyTRcwUdgWtidpv+DfSlr/VzBfLwlwMqUmaPcMhqWBx1cRTHCFWk4SedaF/OWFUSYPvxalW88+1 6dpGjBYYBUMeAwPpBbhzQkR9GGd/5+ExpVlOrkh4j3ZRWDRMGIP9sMgOKJXIB/OlbGcTJY95BOn ttI8OAR9Irn02fatjs/aTdgZblVm5cI8ShzKXouXDOFmFXX2rj8UTVTjYsdiNBFKKk1FQFG6N5B DdwHI9HfNpD9g0tJmtKdTLu4FBGD5PNNYNPhVLqkCBGhtNOe5fNlbVIXQUx4Q5Dsuk+q6VVqXz4 PpKk4cOu9XapWiBZ6l2aEf/JPkPgQ4hsGIO2JkC7j8hS3O9qC4Gcj5kJV0vF7yRtRGYcHuaiehX aMmdTKZ2UvSfA4A== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B Two arrays (with 'struct sdw_dpn_prop' and 'struct sdw_port_config') store configuration of Soundwire ports, thus each of their element is indexed according to the port number (enum wsa884x_port_ids, e.g. WSA884X_PORT_DAC). Except the indexing, they also store port number offset by one in member 'num'. Entire code depends on that correlation between array index and port number, thus make it explicit by using designators. The code is functionally the same, but more obvious for reading. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Dmitry Baryshkov --- sound/soc/codecs/wsa884x.c | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/sound/soc/codecs/wsa884x.c b/sound/soc/codecs/wsa884x.c index d17ae17b2938..d3d09c3bab2d 100644 --- a/sound/soc/codecs/wsa884x.c +++ b/sound/soc/codecs/wsa884x.c @@ -782,42 +782,47 @@ static const struct soc_enum wsa884x_dev_mode_enum = SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(wsa884x_dev_mode_text), wsa884x_dev_mode_text); static struct sdw_dpn_prop wsa884x_sink_dpn_prop[WSA884X_MAX_SWR_PORTS] = { - { + [WSA884X_PORT_DAC] = { .num = WSA884X_PORT_DAC + 1, .type = SDW_DPN_SIMPLE, .min_ch = 1, .max_ch = 1, .simple_ch_prep_sm = true, .read_only_wordlength = true, - }, { + }, + [WSA884X_PORT_COMP] = { .num = WSA884X_PORT_COMP + 1, .type = SDW_DPN_SIMPLE, .min_ch = 1, .max_ch = 1, .simple_ch_prep_sm = true, .read_only_wordlength = true, - }, { + }, + [WSA884X_PORT_BOOST] = { .num = WSA884X_PORT_BOOST + 1, .type = SDW_DPN_SIMPLE, .min_ch = 1, .max_ch = 1, .simple_ch_prep_sm = true, .read_only_wordlength = true, - }, { + }, + [WSA884X_PORT_PBR] = { .num = WSA884X_PORT_PBR + 1, .type = SDW_DPN_SIMPLE, .min_ch = 1, .max_ch = 1, .simple_ch_prep_sm = true, .read_only_wordlength = true, - }, { + }, + [WSA884X_PORT_VISENSE] = { .num = WSA884X_PORT_VISENSE + 1, .type = SDW_DPN_SIMPLE, .min_ch = 1, .max_ch = 1, .simple_ch_prep_sm = true, .read_only_wordlength = true, - }, { + }, + [WSA884X_PORT_CPS] = { .num = WSA884X_PORT_CPS + 1, .type = SDW_DPN_SIMPLE, .min_ch = 1, @@ -828,22 +833,27 @@ static struct sdw_dpn_prop wsa884x_sink_dpn_prop[WSA884X_MAX_SWR_PORTS] = { }; static const struct sdw_port_config wsa884x_pconfig[WSA884X_MAX_SWR_PORTS] = { - { + [WSA884X_PORT_DAC] = { .num = WSA884X_PORT_DAC + 1, .ch_mask = 0x1, - }, { + }, + [WSA884X_PORT_COMP] = { .num = WSA884X_PORT_COMP + 1, .ch_mask = 0xf, - }, { + }, + [WSA884X_PORT_BOOST] = { .num = WSA884X_PORT_BOOST + 1, .ch_mask = 0x3, - }, { + }, + [WSA884X_PORT_PBR] = { .num = WSA884X_PORT_PBR + 1, .ch_mask = 0x1, - }, { + }, + [WSA884X_PORT_VISENSE] = { .num = WSA884X_PORT_VISENSE + 1, .ch_mask = 0x3, - }, { + }, + [WSA884X_PORT_CPS] = { .num = WSA884X_PORT_CPS + 1, .ch_mask = 0x3, }, From patchwork Thu Jul 25 11:23:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 814618 Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (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 714191993A7 for ; Thu, 25 Jul 2024 11:24:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721906643; cv=none; b=ilpLUQpEX3KmZ9n3wlwwP+vpFmAjXUFwJUgySLJwkyJiLbH8lW4Le0R0LpQ4DkZKQ1K03X3VfQR7of82E507NBGlpgz7p+5+iz8TDUuHulA3wcLhOraFMSkkpigEPi1C2VNuoznNcxNFrC0UpCtV7H+HGTWJbxON3qYsQS0+uAk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721906643; c=relaxed/simple; bh=wCaY3kZbkwPEwo1WVvpupNrkPaJVQt2eCab1H4lT8xs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=HgpmRjgITscS5f8SwV9ID7GWj2L6wS29Gt2pj+hfkQJrXGKFRwY5Y5WUR19Vlkme/xy3PwdF9xIfDNHYMF4QAw1A+isFRLprInC+x6GBFj5pYWc8NxwMvX6cPy/rgh263zBLxwuz+cyPhSLzRfZP05LCogsoc1BcKKfvnp04WTk= 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=KLIVjdvU; arc=none smtp.client-ip=209.85.221.43 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="KLIVjdvU" Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-368313809a4so1182752f8f.0 for ; Thu, 25 Jul 2024 04:24:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721906640; x=1722511440; 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=Xv4gNohsSEkyCVH7/4Ky3TaKWmsSwASlKN9kZ+B7LDs=; b=KLIVjdvUsmoG/FObLzxC5Hxcya+Q1olKP40UvNPNQwIQNNIyP3tcaS9BxQF7/+MdC/ PLS/y+JVSFF1lagxu+e8wE7dSrPSaygi2Bg4sm1s/+m4ktbqgNnOlLy3iGvSUnbGrGbQ 1Z38vYhauq5lbDgp/+W76BB2Xslw25RV7buNuFSnxBfANoePXgcX1FF9ZOFKklvdCOSL AlxFCJYYZ6z8XAMrpy7PAzw3jfrvXY51IHLGyjollCtNfVFUwZI6NaaP47swcXsC1DMk WM+Owcx1jgxIf18G6DZDHUUD1lsMtt3uLW+vd+7Uf2aLpHAozH1KfJ/1m5Bp0uAwJ40T SEGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721906640; x=1722511440; 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=Xv4gNohsSEkyCVH7/4Ky3TaKWmsSwASlKN9kZ+B7LDs=; b=cxbjeNDxhc0aO79Dxc4RbTnfhNjsknkC/vNr7H0nqtj6MjHvqhfaOqz6ghgurGsDak orHoNZL6In1PWOjsc5JqnMPNI52HXm2vg5QVIuNqK5QTcKg/0ZeAmRvaMxcZBTMoZy6R G9qZka6ce6peYiUtN9CE2Sj5yj84d3IaSu6lGU2tHN6tro8y2K/OuwxIFqs/iSzOFsqN WbZ7ezSCfFV0h2cQFbgHCja+2qNS2SEudq9avHkfIK7t0DFcQP8Wycnw3X6cH2k8g1Lf 0CLuqEy5ex7S25PyaPdHg8fmnm1o7c1EP+XoTSPYFRUPNlTaw9cxWZFKIbpkrCbqEelg MhiA== X-Forwarded-Encrypted: i=1; AJvYcCUa6njzS+rTSZGLp/cR6gpAL0WsazWok5MSA3wc9HsSbHWEMX8k+V8IVXHvLvpuRxE5oqnGQHFuvR5+Wmy32YNWXAVgC3yOVkxstR6f4Q== X-Gm-Message-State: AOJu0Yzius9bDfs3zuQEd0bmilYGsvWh5ts6Xe2wq/QVZvyAcQQR4mlo iVPXbGLcfPQGyh+/4xP6IqeBQ6h1A16gwzI8J3QYveVap+2HEAN6kmSoOnKFn/U= X-Google-Smtp-Source: AGHT+IGm/CIUyj3+IUxZZKmv3H0osV1MgXdLb9MIQ274YozSOERMoI7OrS7UBo8OSd0d2d84LnemvA== X-Received: by 2002:a05:6000:104b:b0:368:3ac6:1fff with SMTP id ffacd0b85a97d-36b31b4e832mr1771595f8f.20.1721906639826; Thu, 25 Jul 2024 04:23:59 -0700 (PDT) Received: from [127.0.1.1] ([178.197.219.137]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36b367e072asm1823607f8f.42.2024.07.25.04.23.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 04:23:59 -0700 (PDT) From: Krzysztof Kozlowski Date: Thu, 25 Jul 2024 13:23:46 +0200 Subject: [PATCH 4/7] ASoC: codecs: wcd938x: Drop unused defines and enums Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240725-asoc-wsa88xx-port-arrays-v1-4-80a03f440c72@linaro.org> References: <20240725-asoc-wsa88xx-port-arrays-v1-0-80a03f440c72@linaro.org> In-Reply-To: <20240725-asoc-wsa88xx-port-arrays-v1-0-80a03f440c72@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=1947; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=wCaY3kZbkwPEwo1WVvpupNrkPaJVQt2eCab1H4lT8xs=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBmojXGE1G/y/P+dD388yi2q67mlhwNSH55Ia5ue J5SAo6TxlGJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZqI1xgAKCRDBN2bmhouD 1+PMD/sFQvp0fm4/dgfL44ISNSNtPIJ7RtxpANkZKBEwpAWzGQSQkefWW9CsZA8BDIlWUUYhlZV yuDp+BuM0J2cRJuiIxoe+h4pVvk9ijZhZ/HUbJl8Zn96fIj4iBwTgKDAj1v9Gojlm715UiO09Ym 79VxPoA3GGiUnqFApEknQU3e8IhPNT1ggN5Qtaa6BN3E3qlXDhhNzCek3rUyw7np4xZTKdXLI4P 38TsivcJnOC3YyhSfTrxlz+XISWJUQMgcVkU3SgZ6+zGNIHvZmygrsWJdfnLZMhll0IvJRjjLFC 9TtRqYeSTfudmgY8bIXPpD1+At+hnKzVqm+7xF6dTldfCiyxr8xXi7nKNeFqEPm1dTbM7uRugH9 ewGgaUabGqqqMuw6OvuMPWrxS/r3AVHxrJJCfYZyFLT49oeEhMHIqQqnHT6iaimZ2BFFOSOCL7S dThi1bR5uh+J0V72HQKBDyznrkN01sUzgGCLIcEu+PxvBoE7laxHY0sB1anxQ8MbtL1YR49UgIc PYBDYsTvnJnVZV1aI+w+5OKqcHoHIALGrqdwJ7hAGtZEgCL4uMzjnoDZmHTzjKZx9HHvQU0aJCn 12OD7k++dFbbnL+orZmmO20nLtyBxYreAA8WH5diGk2yG40iZTH2TT7MhaS9kCme+y4QB+OljfA +erd/NoxFy5UjOw== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B Drop defines and enums not used in the driver. Signed-off-by: Krzysztof Kozlowski --- sound/soc/codecs/wcd938x.c | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/sound/soc/codecs/wcd938x.c b/sound/soc/codecs/wcd938x.c index 12b32d5dc580..aa92f1bfc921 100644 --- a/sound/soc/codecs/wcd938x.c +++ b/sound/soc/codecs/wcd938x.c @@ -29,7 +29,6 @@ #define WCD938X_MAX_SUPPLY (4) #define WCD938X_MBHC_MAX_BUTTONS (8) #define TX_ADC_MAX (4) -#define WCD938X_TX_MAX_SWR_PORTS (5) #define WCD938X_RATES_MASK (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 |\ SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_48000 |\ @@ -39,8 +38,6 @@ SNDRV_PCM_RATE_176400) #define WCD938X_FORMATS_S16_S24_LE (SNDRV_PCM_FMTBIT_S16_LE | \ SNDRV_PCM_FMTBIT_S24_LE) -/* Convert from vout ctl to micbias voltage in mV */ -#define WCD_VOUT_CTL_TO_MICB(v) (1000 + v * 50) #define SWR_CLK_RATE_0P6MHZ (600000) #define SWR_CLK_RATE_1P2MHZ (1200000) #define SWR_CLK_RATE_2P4MHZ (2400000) @@ -48,8 +45,6 @@ #define SWR_CLK_RATE_9P6MHZ (9600000) #define SWR_CLK_RATE_11P2896MHZ (1128960) -#define WCD938X_DRV_NAME "wcd938x_codec" -#define WCD938X_VERSION_1_0 (1) #define EAR_RX_PATH_AUX (1) #define ADC_MODE_VAL_HIFI 0x01 @@ -72,7 +67,6 @@ /* Z value compared in milliOhm */ #define WCD938X_MBHC_IS_SECOND_RAMP_REQUIRED(z) ((z > 400000) || (z < 32000)) #define WCD938X_MBHC_ZDET_CONST (86 * 16384) -#define WCD938X_MBHC_MOISTURE_RREF R_24_KOHM #define WCD_MBHC_HS_V_MAX 1600 #define WCD938X_EAR_PA_GAIN_TLV(xname, reg, shift, max, invert, tlv_array) \ @@ -89,18 +83,6 @@ enum { WCD9385 = 5, }; -enum { - TX_HDR12 = 0, - TX_HDR34, - TX_HDR_MAX, -}; - -enum { - WCD_RX1, - WCD_RX2, - WCD_RX3 -}; - enum { /* INTR_CTRL_INT_MASK_0 */ WCD938X_IRQ_MBHC_BUTTON_PRESS_DET = 0, From patchwork Thu Jul 25 11:23:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 814430 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (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 C33E1199E92 for ; Thu, 25 Jul 2024 11:24:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721906644; cv=none; b=bgOhs8BQ9psUs0ztiSZCiqOFBDYM0MZP9P5zTSGuw4DUJhbz/ZmrX+6LUn+jhUKTAyZ9fMLQ9tV/pbe+5FWTYUnZSYoZ3YXc3zQPCyMgRvXXxwKVJQ+6Id7bT5PJ9BtDOMdYhtXzN/1Fv0o9PxB/odIr2NhKvmikuGApP6BOu4s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721906644; c=relaxed/simple; bh=V8vd4iZFObHif1p5HOQA8sXHu2YEJwGEScZnEYASwyc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=p1QrvRdcWiHtEzdZGJIw+E+80b2bYYlvwlQu3BoM67h2cDCBwTcKugrGzbUoIYZZQzBBdrLZNXLjodR1DIiwN4Q6+mvTHqwbrvIL7c9Dj5KL0OlAXFHlkf4P1LNLQr7bsyksmVJUrPJbTIn9KSmJJCc0V+FR05QKQfgE9+iZypE= 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=TuK5iHPh; arc=none smtp.client-ip=209.85.128.54 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="TuK5iHPh" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-42660b8dd27so6364955e9.3 for ; Thu, 25 Jul 2024 04:24:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721906641; x=1722511441; 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=him59Jh0Za/FpncLD54ryW3nFixGnrEeRbEKdwDMQEw=; b=TuK5iHPhU+Ocqou7m8QUUH4OCsb8HBY45iJR2KJ2LPF8vjS7YVYe7koUHyrnMVDugY YrBznCTPF+iwFPxc8CT/4ai3WLQ46HBLezOXipr22MKR4n1hkuOvdTAD++xdhHy1T9Fp A730blIF+c1QCC2UrwS0rLsJQwNbY5kWSl9D/o1EZB02+9NNdngtn6dEX8vI6uR5wbl7 +zsKc3JFoCyPU0tj4y2dHt90NWUO5Bngof+eWRaiHA52L6s69SZw77G5QvfPskHpq93c BUu1djzTGOdto39++VEnmp7MXn/fKV/oHp/MVMglj4HitWSgzvpp8HxpdmTxYZ03wkrZ MLiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721906641; x=1722511441; 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=him59Jh0Za/FpncLD54ryW3nFixGnrEeRbEKdwDMQEw=; b=cnKlA3brZ7NqfcUkg2sDO2wd79/XT/CpkfJKtPftbZprRM/+cxVhR+7idJoErmmHyI q0Up4WKdRClHchMVTPlA3LwFGKlKn7MYhIxiwQqLNQd/pIjkMbQ5ZbzzZ09jH0rq0Onj qLuOv6edydknxytZk7jpbX26pHZ7X015wNiFg48io8sDiM2ujGl8rCOLpCfO8U//wkL/ hVgPP81kxJq6uIwoCflXABrCtxs1WgUxu3uTGwCX4r5NOj5W2vSIOwGw3+kctRfxc7DI HV9KgmpxuaX1WlQTWxVibkG9hrvRcdn3TN2TrRco3acKM0y5Opjqgp2+QHiosHnIz+aZ ac7A== X-Forwarded-Encrypted: i=1; AJvYcCVC3d75K3Z9NHwxulPALjaQxw34WX2UCE+t5E6Px04IUBQ70WX62c1YL+n2FGTC562R5g+vlw2XTbLEugazN9YufqzLlkfDYFuUzPRkrg== X-Gm-Message-State: AOJu0Yzx5PE/aK7lHPPXlEt2nAzfikuD21KleHbAztNbwkXfADiFg2c5 XrdZUjVI4J4Hujf/6XGN2aKKn8V+8uWRPPd5LnEZNc68QgUcCIUVDSPY4XMm6r4= X-Google-Smtp-Source: AGHT+IE2/MDS0EvvoNMsY4tzNjk68cr5dxij8RbWrbzM/zyGhZ/Yw33L8LYx0zf/UyaMoZNqXyZL0g== X-Received: by 2002:a5d:6a51:0:b0:367:9904:e6b9 with SMTP id ffacd0b85a97d-36b36421ab2mr1215212f8f.44.1721906641227; Thu, 25 Jul 2024 04:24:01 -0700 (PDT) Received: from [127.0.1.1] ([178.197.219.137]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36b367e072asm1823607f8f.42.2024.07.25.04.23.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 04:24:00 -0700 (PDT) From: Krzysztof Kozlowski Date: Thu, 25 Jul 2024 13:23:47 +0200 Subject: [PATCH 5/7] ASoC: codecs: wcd937x: Move max port number defines to enum Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240725-asoc-wsa88xx-port-arrays-v1-5-80a03f440c72@linaro.org> References: <20240725-asoc-wsa88xx-port-arrays-v1-0-80a03f440c72@linaro.org> In-Reply-To: <20240725-asoc-wsa88xx-port-arrays-v1-0-80a03f440c72@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=2085; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=V8vd4iZFObHif1p5HOQA8sXHu2YEJwGEScZnEYASwyc=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBmojXHiWSSUY3gTrQtwvbi3XTqFF5y9M+V6TBdA UjzT+daecWJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZqI1xwAKCRDBN2bmhouD 10BoD/9s4CyMl1vgd0j2Wq1A1AtT/gXwWXp0KYUGAtiYtOHBYxeqlx3cigfTNWTPVh/nSVaRmQr Fsdau1R9aTSu2uGyVHaqRk9V9V/Zg9tMQ3IOwzX6HZqgdwgBjQ89kstBVfsIwr5wQ4Xd2g04fcN lwA3Yed9dKQXJdkx20InzbWvK8YtuS4fvjU5t/rbLwDzrwgfHjlVLcFurBdHyhi+ubvFjCLxXiJ VEbYYDtAE3+CKRl+YLuZeqclG7zbkj3+vSHBatrEzwICkF8x2MARCH4tdKnvwC4lkJP1mLfEi9p yk5psVzerdgGGIKEGOINLAjA7vBNeZCrWeEcswBQGu0wkqA7gqPI1+I1wDdTZRGiiQkWWXQGMKz iHDXbdTobDgxjcDtQAqUGK4Ioz/NfmIwJWkJooFevfSqbMYivOJG/V2Jtj13G/F6aoXrxiSE4DS jPwOvKNQl0kmOqUawrTw+Nsvd4fn5CUAm4agfba9Xs8fxAjCzZgdBi1vn0VihKFiI5p64zfgIoD GmBo1ytrBslM8x/1o8+iLXNib07en48TsLulNL23bAHPp0+l6VsCiNfJsyqy2jDTTyV9CA+5wIr C0yKnVstuVTUkv3lES2ereAS4UrGpCknu6F8Wwmel9YC8kKHeXwZNDsMBPu6rUBv5AO6oR5P2G7 f2vn3sq0fsshdvA== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B Instead of having separate define to indicate number of TX and RX Soundwire ports, move it to the enums defining actual port indices/values. This makes it more obvious why such value was chosen as number of TX/RX ports. Note: the enums start from 1, thus number of ports equals to the last vaue in the enum. WCD937X_MAX_SWR_PORTS is used in one of structures in the header, so entire enum must be moved to the top of the header file. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Dmitry Baryshkov --- sound/soc/codecs/wcd937x.h | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/sound/soc/codecs/wcd937x.h b/sound/soc/codecs/wcd937x.h index 37bff16e88dd..35f3d48bd7dd 100644 --- a/sound/soc/codecs/wcd937x.h +++ b/sound/soc/codecs/wcd937x.h @@ -484,10 +484,25 @@ #define WCD937X_MAX_MICBIAS 3 #define WCD937X_MAX_BULK_SUPPLY 4 -#define WCD937X_MAX_TX_SWR_PORTS 4 -#define WCD937X_MAX_SWR_PORTS 5 #define WCD937X_MAX_SWR_CH_IDS 15 +enum wcd937x_tx_sdw_ports { + WCD937X_ADC_1_PORT = 1, + WCD937X_ADC_2_3_PORT, + WCD937X_DMIC_0_3_MBHC_PORT, + WCD937X_DMIC_4_6_PORT, + WCD937X_MAX_TX_SWR_PORTS = WCD937X_DMIC_4_6_PORT, +}; + +enum wcd937x_rx_sdw_ports { + WCD937X_HPH_PORT = 1, + WCD937X_CLSH_PORT, + WCD937X_COMP_PORT, + WCD937X_LO_PORT, + WCD937X_DSD_PORT, + WCD937X_MAX_SWR_PORTS = WCD937X_DSD_PORT, +}; + struct wcd937x_sdw_ch_info { int port_num; unsigned int ch_mask; @@ -581,13 +596,6 @@ enum { WCD937X_NUM_IRQS, }; -enum wcd937x_tx_sdw_ports { - WCD937X_ADC_1_PORT = 1, - WCD937X_ADC_2_3_PORT, - WCD937X_DMIC_0_3_MBHC_PORT, - WCD937X_DMIC_4_6_PORT, -}; - enum wcd937x_tx_sdw_channels { WCD937X_ADC1, WCD937X_ADC2, @@ -602,14 +610,6 @@ enum wcd937x_tx_sdw_channels { WCD937X_DMIC6, }; -enum wcd937x_rx_sdw_ports { - WCD937X_HPH_PORT = 1, - WCD937X_CLSH_PORT, - WCD937X_COMP_PORT, - WCD937X_LO_PORT, - WCD937X_DSD_PORT, -}; - enum wcd937x_rx_sdw_channels { WCD937X_HPH_L, WCD937X_HPH_R, From patchwork Thu Jul 25 11:23:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 814617 Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (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 1D6F3199EB6 for ; Thu, 25 Jul 2024 11:24:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721906645; cv=none; b=lrzUAWijSnNhaCn3g2jdjVAN4oqg3gAM9igKxZA+KPRteFRsbNMO8vJivtFIEx5yfGnlNHW3H5st4tJmNGXmvHP3uODLswYxwwXWoNdIdxGfa1AXE+z0cGtFvXcyZSj+pyYqYYKGma7uNXu+yoFnghIuKI3d26klb75VDN2qwtw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721906645; c=relaxed/simple; bh=Z4sl3UsaDoDW0qIaCARjl/i/ur/SZTyjyXlvlMhISio=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=pb/HgsEzRw1YGiS6be/DG3On4kgOxvYEVusVWYS1kSjLxCkl/SRxxevoLP182klHWKQHiGg+P8rKnv/fEwvjfIrzXCe788lWSsi1dyqMfwuUjIq54crk1ilbwk9m0RgOW7zE5pKQaoUopy7kNMKTDZMakkIQaZt4i00STX1Wh4s= 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=JbpkpJTX; arc=none smtp.client-ip=209.85.221.46 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="JbpkpJTX" Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-369f68f63b1so463012f8f.2 for ; Thu, 25 Jul 2024 04:24:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721906642; x=1722511442; 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=T8qPNmhqMV5uO1WWAeGcfg+Xje+HVJGnsDnxifCQEj4=; b=JbpkpJTXWan/nRQjHIHFXYwexKFJsDxsrWCurkJkD8EDtRkpUJ2AEbFiPvyzRKgaFp snoMjDsDnv9TDBmygSifP46Q5Y5zGz7ZQHr6Ilsp2fUNgBezCYVvzoo5SG8kcyu6by3/ OpcQzmIQfVJjtHLWvFQSHBVZZb5gOeJlynfqg9GBZqBcqSZ0ciPmvTMWqBDy7jY5tN27 eMfuI+fyVk9uAwe3ppZFN+P66X7DiqwrxTwBX+CskkeLzSQ5P1/aiZL5AA2NktgYJJ0F zs8P0TTgb+4CC6KL+k1ZGIIKl5I4vBZnR7x5fL7AoRj1e2oGZvmjN5HLewcGVL9Y4s9L uCSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721906642; x=1722511442; 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=T8qPNmhqMV5uO1WWAeGcfg+Xje+HVJGnsDnxifCQEj4=; b=JKFBSFjdRJtf15pjuTplUH1lWHx+kyITf+Q9r3J12XIT2prRkRGx0zyYiwe1J2NrJw 25MpF3YR9szFBU3k/UeQCuZxo4uG8lGxAuGeIUKNXMPjDbE+MYYLTF4H2HrXMY4Ogdcy 1RH32VcORpCO5gS9EwmubJOLD1m8MASDkwSdo3VGazgYrV1/NqmD2H7/RP2RWc05+a43 4MsJ49BLajHxgoXpmqpyGDZd5+6aJ9cl3WivyigMNkx31hRcwkuHz6gVlYq6HDUYuRKU SxMXrUhyP0LAm9VcDfZ88qogNeyGo1v/Ip8n7pImIXi8lebwO0hfCBkzkdC8sBBhugen fPcw== X-Forwarded-Encrypted: i=1; AJvYcCWyIo50Gl3Btl+vUch/NWBSOmhfui9nYEvPBrXz0myBtZtnOW9Q+55upHtogy2SSzCSw3DzgfscByQj7cujFPaojhIbkMpJlp6a8MNJTQ== X-Gm-Message-State: AOJu0Yzxc3Q+9pWgP8U4FpCIsCgarqhzvyGGIa1FEGLXg1nTMWko7KGY LETlbYLqqAsbJ8eexDVPl8P1Lg7V9M7UWtbN8RM8Y1BYIUH7hKD4VZo1sw5NDg8= X-Google-Smtp-Source: AGHT+IFHswFHg9qmycJf/sCn7iOfKPi40kcr6NaDof8fg3mdrjY/DuoYO/J2eafkoWqxIU+1HxAapA== X-Received: by 2002:a5d:5491:0:b0:367:94a7:12c8 with SMTP id ffacd0b85a97d-36b3637efaemr1166676f8f.6.1721906642614; Thu, 25 Jul 2024 04:24:02 -0700 (PDT) Received: from [127.0.1.1] ([178.197.219.137]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36b367e072asm1823607f8f.42.2024.07.25.04.24.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 04:24:01 -0700 (PDT) From: Krzysztof Kozlowski Date: Thu, 25 Jul 2024 13:23:48 +0200 Subject: [PATCH 6/7] ASoC: codecs: wcd938x: Move max port number defines to enum Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240725-asoc-wsa88xx-port-arrays-v1-6-80a03f440c72@linaro.org> References: <20240725-asoc-wsa88xx-port-arrays-v1-0-80a03f440c72@linaro.org> In-Reply-To: <20240725-asoc-wsa88xx-port-arrays-v1-0-80a03f440c72@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=1409; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=Z4sl3UsaDoDW0qIaCARjl/i/ur/SZTyjyXlvlMhISio=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBmojXHFok6viGl1t4tqCGW8JGde7k+DNzVVWwgU 3NqGUpxprCJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZqI1xwAKCRDBN2bmhouD 1wdtD/9b3CBdXYwVtROD9UQpPesni0OskgB0SQJW7DEily9DHVNcaKvnwyguS7HHt6uoRedT09y 0w2vb7l1TxEms5pi1ntoFI05ZHtU12m23kxLITMfYOFshfCL/4rz38IFgstCyWEJOY7qvecqC0m bPMv0eynywhZdWD/kn6z+IzdtRfUmxVL6ann7pvf+ELOmn5xl2Dui4YwAFzIPwhwV4M8G96MLj7 NF3cvmIbE1tNr2eJbGIlJV8aZJkcV9eaGVFwUdeHxQ1kQMGhmvlbbzGJfgCHCiZfi3tf4XDECPe BGP+VhExGXM7DzhrMlHG3cg7H6dE8lrg4222cgvDiE7r5QwO2MTKVpwW2H4h+2Es5yEOafabJ3C vcUxFmpkZmfaQIu1O/NpjGyX2Z2NQLmYjDhFJYyL7W6IYVAEajpWoU/QLA+7Gn23WrJH9wfs7IW emOew4ct4ILK46h4qCLfGXtIiiGEpHMD9gIig4HvVxiKcTw3ZyrWjA1SNMkV4/igeHVzbj4ycei LmOjWh3I9P/QAD7KIsSPg0uEtcJFdiGvWAywG2BtrudfE/SaIivPaiPBq6umH7A9f7Fj1xhidQr eBFyBvYxheeshYPAH+/5GIGP8hePYktBgEPoV6nBXuM8rUXCHwoxSztqMZPf8ZKcynUCDLW7tlG iMZ7OHWB8i8ZzaQ== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B Instead of having separate define to indicate number of TX and RX Soundwire ports, move it to the enums defining actual port indices/values. This makes it more obvious why such value was chosen as number of TX/RX ports. Note: the enums start from 1, thus number of ports equals to the last vaue in the enum. Signed-off-by: Krzysztof Kozlowski --- sound/soc/codecs/wcd938x.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/wcd938x.h b/sound/soc/codecs/wcd938x.h index b2ad98026ae2..fb6a0e4ef337 100644 --- a/sound/soc/codecs/wcd938x.h +++ b/sound/soc/codecs/wcd938x.h @@ -585,8 +585,6 @@ #define WCD938X_DIGITAL_DEM_BYPASS_DATA3 (0x34D8) #define WCD938X_MAX_REGISTER (WCD938X_DIGITAL_DEM_BYPASS_DATA3) -#define WCD938X_MAX_SWR_PORTS 5 -#define WCD938X_MAX_TX_SWR_PORTS 4 #define WCD938X_MAX_SWR_CH_IDS 15 struct wcd938x_sdw_ch_info { @@ -606,6 +604,7 @@ enum wcd938x_tx_sdw_ports { /* DMIC0_0, DMIC0_1, DMIC1_0, DMIC1_1 */ WCD938X_DMIC_0_3_MBHC_PORT, WCD938X_DMIC_4_7_PORT, + WCD938X_MAX_TX_SWR_PORTS = WCD938X_DMIC_4_7_PORT, }; enum wcd938x_tx_sdw_channels { @@ -630,6 +629,7 @@ enum wcd938x_rx_sdw_ports { WCD938X_COMP_PORT, WCD938X_LO_PORT, WCD938X_DSD_PORT, + WCD938X_MAX_SWR_PORTS = WCD938X_DSD_PORT, }; enum wcd938x_rx_sdw_channels { From patchwork Thu Jul 25 11:23:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 814429 Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (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 64E41199E91 for ; Thu, 25 Jul 2024 11:24:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721906647; cv=none; b=qpO7QcBHdJONwoNJN1MrPmjULLDm5GMDYg5uwpWX/74XvwnbTNoBuwQuuf4IEkFzkcxgxcTSU2HQpgzDT9fDvy2AYeMTus06mO0zd8KDBdjs4yvVbityCZuqt7on1Cty2Db/HTGhjZIIPtpbDOVvnRDFFhYVPzJPnQWKZ8RQrGI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721906647; c=relaxed/simple; bh=IezU2W8rytHN1+OJjzdCLOScjz5OOSUaMHzxu2FqxSk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=b08Mekx2Pn0ai6Oz9kx/GRIHK6p01Hq5mNRVAe0z7+ijoB46vrMBVZIhECCoDqRFvvAef8BRHxUHe/VzSnpq4Oz4q8HWsqdwFGT8NJGiN3XsT4AAMSUDDsZ5FdigYhUaAnMf5/KGgkG4fu5twGZe+teF/6LH6YidqJECb8Srv+c= 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=XkH2aDr9; arc=none smtp.client-ip=209.85.221.42 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="XkH2aDr9" Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-3683f56b9bdso435812f8f.1 for ; Thu, 25 Jul 2024 04:24:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721906644; x=1722511444; 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=fuc1obU/KvJR69EdA4JL3jyV+SdcVptiD/ClFtmUvzY=; b=XkH2aDr9HNOLJdQOaumUwwY+YYe/r55sg2VQkWcL0aQGwBpzd9YMfxik78XDHlokjW YR9p0JNd1ymN9VhtDRUb8dAZU6+09I3MNds2vi7RPZPv0wVUp0lP0y7B6sfIIhs4V9oM 7VC4NDgxSBrKhw8PNV4+MeO8f5bKG7E1vBY+EgJiIH81e8Shz6J6IHtbNuWTNvV4dGP4 UzwuTuKaJ+DcH8RynLb6OrMC0h4IMSn4zQQIeqN7+b3fWumDBerdvz2e/Wv/LFbhLsT6 kHpq30q0lHC2zvU2yTIxlOO3yTnptxtB7fqbpJ0afuI9HgOgqJEslosW9lP5mUW+yo45 +OYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721906644; x=1722511444; 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=fuc1obU/KvJR69EdA4JL3jyV+SdcVptiD/ClFtmUvzY=; b=MzCMT6IzcpN/VNHshaR61TGKZmmlT41tl7eU9GTF3H2jYQ9UqXE/Yo5I7iojM347eu 6u+up+pGk5+grblgDos1zqvEmJTRYi1vOyQq+mY3OaoCPXjHpp+ZVvzYAMFLHk0vgj/Q q+6v0Nrg6d/th9drjCkacxQ4fhLvC1vY2dK/BioK+0RvIoY4KthnY2BOvah4U+UC9Zeb gO8C2cUmOIlpZGOdGHB4qZsUjbS4/bXOmPxIeSNX5R7NVbtxrP4dxfALW896WrGXmuYI oKDcP/dhX/E4X2yerz2spVs6v2Mki75DdzrE5PbmjvKyigK6xdP6XZzpfU7cOvjIyaDg 0ZJw== X-Forwarded-Encrypted: i=1; AJvYcCWfzTbdtahP6ikyWj7sDcMNJo4gEBiEpMs1V1dm6UY5bxe0mavNl65Wxxhkb19i+z2819r9l9oGJ2LarIe4dqT8PjTU9BBMUpYSgw0awg== X-Gm-Message-State: AOJu0YwO2P9fXPDG/XHB/FCbM+l5LoQ8uKO209ZAACcYh0C3ENylHDkw +cEv96ecIopBdTllnKF+HT0WJQ+Ko856jnCmuf7HROkzHPcg21ma6HRH3HEaBow= X-Google-Smtp-Source: AGHT+IEpQs3fxfrt410fx954ueUVYLvEFG6tI5ahSFyUrB+n2S+LTUldQrepCDb1PHiuZbAbge4L7Q== X-Received: by 2002:adf:f64f:0:b0:367:9828:f42d with SMTP id ffacd0b85a97d-36b31a4acd9mr1754985f8f.53.1721906643810; Thu, 25 Jul 2024 04:24:03 -0700 (PDT) Received: from [127.0.1.1] ([178.197.219.137]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36b367e072asm1823607f8f.42.2024.07.25.04.24.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 04:24:03 -0700 (PDT) From: Krzysztof Kozlowski Date: Thu, 25 Jul 2024 13:23:49 +0200 Subject: [PATCH 7/7] ASoC: codecs: wcd939x: Move max port number defines to enum Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240725-asoc-wsa88xx-port-arrays-v1-7-80a03f440c72@linaro.org> References: <20240725-asoc-wsa88xx-port-arrays-v1-0-80a03f440c72@linaro.org> In-Reply-To: <20240725-asoc-wsa88xx-port-arrays-v1-0-80a03f440c72@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=1490; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=IezU2W8rytHN1+OJjzdCLOScjz5OOSUaMHzxu2FqxSk=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBmojXIk1Qbl0Iz5KBaJYKuj2Qh1UtAtZ0R+L4Iu QPHwZbXeJyJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZqI1yAAKCRDBN2bmhouD 1zGvD/9lV+y+SrlBfQ7yOLDLv7oPdnM38VM/viNyVIT0BCtBO1cQIqak1MpJ+VzgJFg7wxm45xJ rzbYHIQXM4rVzd6z3x4i7KjJqs/tW7gB4UyuLT173BKU0ScNuU01SaoIQvzkGJT7Xs8v4M2ht40 jQR1xGzufBOfFmJwMgiArP58KcGok2mjx2PHdu3WScEqxlbPCPPovxjQwIyutXPNUMx0PaTsDOK 33605E8o9Gt4i+E2tTBYCTzJcH5LQjdIFFSySsx8MY6s5vyKbytntCyxaahQZV9Qf8J7dBFX6ug RzPLtwP2/LfnGFvngYU64mDvC38Dv4rpl+T7Ufrae4K7Lq4kFkiCa8rRdY3/ActDCYaIVHuG+Hn oUS5UvvtETkK0B2oiu1nxWO0U6yR4PWthV+F1KGLANunnSvQio25Pus7sp5PVTHRzbTkC4ngEeG tQ6NPBnqrmeOEoQK/v0I0q/FaRAWB3+hGMvUPreQQwKJ0ajNnLDCrQzRXqihzFW0CQf+P6Tpu6D RjGbwC/retdTGBnZV03iQKXOAjBuqaGCT6v27jWvCA2d/RT1ven4liULuTqlkWL/lgTFKoTVf7Y 9ZTfJ3LezBmVls/gHDRczKT3Djr23nUwoIVomyLCZg6OpBtBUD3FLswFdKVX3V5QNXIV8r2Eukw g2PsqiVBMnqYuTA== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B Instead of having separate define to indicate number of TX and RX Soundwire ports, move it to the enums defining actual port indices/values. This makes it more obvious why such value was chosen as number of TX/RX ports. Note: the enums start from 1, thus number of ports equals to the last vaue in the enum. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Dmitry Baryshkov --- sound/soc/codecs/wcd939x.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/codecs/wcd939x.h b/sound/soc/codecs/wcd939x.h index 1571c2120cfc..3204fb10b58d 100644 --- a/sound/soc/codecs/wcd939x.h +++ b/sound/soc/codecs/wcd939x.h @@ -842,9 +842,6 @@ #define WCD939X_DSD_HPHR_CFG5 (0x35a6) #define WCD939X_MAX_REGISTER (WCD939X_DSD_HPHR_CFG5) -#define WCD939X_MAX_SWR_PORTS (6) -#define WCD939X_MAX_RX_SWR_PORTS (6) -#define WCD939X_MAX_TX_SWR_PORTS (4) #define WCD939X_MAX_SWR_CH_IDS (15) struct wcd939x_sdw_ch_info { @@ -863,6 +860,7 @@ enum wcd939x_tx_sdw_ports { WCD939X_ADC_DMIC_1_2_PORT, WCD939X_DMIC_0_3_MBHC_PORT, WCD939X_DMIC_3_7_PORT, + WCD939X_MAX_TX_SWR_PORTS = WCD939X_DMIC_3_7_PORT, }; enum wcd939x_tx_sdw_channels { @@ -888,6 +886,8 @@ enum wcd939x_rx_sdw_ports { WCD939X_LO_PORT, WCD939X_DSD_PORT, WCD939X_HIFI_PCM_PORT, + WCD939X_MAX_RX_SWR_PORTS = WCD939X_HIFI_PCM_PORT, + WCD939X_MAX_SWR_PORTS = WCD939X_MAX_RX_SWR_PORTS, }; enum wcd939x_rx_sdw_channels {