From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.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 3A8F537A3A0 for ; Thu, 30 Oct 2025 14:01:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761832913; cv=none; b=IizIqf4stsz78DQmcbKJHhRiW+2xp1KVnalIjlxleEL144nG/J8JvTgtt8swFEu4zV2eGO8gQ/NlD/3GP8TrfUbkqbuD5Npwc4239RrB2sV/i14MyZCQ8ytpNXvQgZ4XXdOwyuGATMiQxl86ZAuHkXuPCd6bb07hJjBkvam6xk4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761832913; c=relaxed/simple; bh=Ez9Ck8a0vFDjWaFW7yQc/XxQm/vx9CpdxqOM5+Cz0DU=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=dRDL/P9duZMQOIlrEjs2KQFU+hEyegQZyKv92P9UzkygM7EaFf0u5yi/Es7zKUzPCRNx/XkpKkoGCBpfnpH2CTW6ChStGTVfPf59HDjVWrBtrLAPYiR3i0CmS4M81PzLOCsEfIol4WOWRFIQ9UsCvxwVJyA0GQRnlVX5Pb7qmns= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=IieA8myW; arc=none smtp.client-ip=209.85.218.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="IieA8myW" Received: by mail-ej1-f48.google.com with SMTP id a640c23a62f3a-b64cdbb949cso53702966b.1 for ; Thu, 30 Oct 2025 07:01:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1761832911; x=1762437711; darn=vger.kernel.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=K9kue/PqLi5iz0mudeRJtK6kDoEwYvI49bfICJqSOLY=; b=IieA8myWdu/Dpkf2LmoO7mbEJ2XAkeT964T1IyDbrinoKqFdC20pRkj/2i6nlcFe8W 8i5VUydkYR34bsUk3qMeXXfFjbBljDqdHv3TmY2uPxl1vmiWsiTgfRs+LpbvUKIZQPEQ DE1iLOnmwtc8NA8h+1srB67KfeDqpGfm9HSqrMBbIqlg2JzkR1Q15DjcroGQrvPHTbLH zwWfd3Jw+S/LR6jjweGDJfa0I4MJLBfPBj30VK99IF5LzOwM+d95j8A7zEyR8RxPyXsj u6bykVc09rfZ46FV7QeBMcW/0fLt0RZgnn+RhsZJgIsxydoufZGUI/GhFmLcihj8ZPTX Ta0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761832911; x=1762437711; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=K9kue/PqLi5iz0mudeRJtK6kDoEwYvI49bfICJqSOLY=; b=MBOCfRiWi0tUHp7IEPm/bbY0M2jeGu2Z17/tCtO0+7t/nYnPySz9BTegKYIGMojPBs 7v2trsoVibrfb6fPKxvaRJXmpim5t72QdQjeN4iL8yklnADHhGAdYCO9V5xoZUiHrZ7v uI4QzL+yX8Y6tylBCCOmZDlxluLReulIaYvCEnFQ3jVsdIXNl1e1zyOQKXMHnsX2xx5j 5ceK5C1WQH/7mvMCordISRFg6RQelceXpy4QNGTctm1zlXV1Gek0TqbPhaZTCCuQFCZr 2VmwjTOvzevw0o1WXvxUJvhdxa0CYn5cRociXMDBq8IyFVxf/DkZo3hA9aa9d26hqY1D zRkw== X-Forwarded-Encrypted: i=1; AJvYcCXhTWG5N43hbA8GFraz9aDYQdf3z0+b9GGmWhm86lD8J8u9YeBpu1/P03Wj+mZA3Nh0GPXwkiS6w9wR@vger.kernel.org X-Gm-Message-State: AOJu0YxfrazminSowjEhT8s8SP0WhEWlmCOvzVcOjbMlcuSzta/ITsc2 0zGA17ya2W5Vmvv+6GtveX/etOyt3qXN/JIbUNPPhffNPnbE8yUnYlJD X-Gm-Gg: ASbGncthdFi9vRKmR94ucqRI+dAyzaOIaH2QLrDKXOQps0WLpRwKDoFYoUk01G8Q6n9 64FWw0kG/6l2XTwsnYWs0oXO7QZkAzsxeGFd+y5FX2T6UnGdn+mIa7n0GupjJmhjkUfAIYxoImp YyA93Ho0TlahdfWJGSLnkuv5JB1glHv4bj+2b9ImOfwQjgK4p2lLmP/xazSdA4mXAT33k44XTFH ic0yDhm0V6bJxOoeM+KTmuUmWqAOFscbdW8bdhP7ubYl9qLXC0UXqcXZcAm9ms6hQCuWT+T0skl KNeJtP06HT5fS+VhfMZpX8Jb+X+v3S6F5/2UHmq6Be7KKOXgeXy4yacn4hFH0PzXLnSslCsCU5G unttcgPO5p5fAFP8/UQMZsO37APPgKpIdmQabIaMlwR2XGWAAaM6ttEgr/AMoSSNukE4nL12l9b PGWeHtgZuKZ3Q7mDePzoZasurV9j+92mHHy/NUO+5KQnrRn58iVGAqIMO7E2O1OC28GFzAhPxbR W2WRg== X-Google-Smtp-Source: AGHT+IEm/43E4DI3T9Mp95lEihYPBVcNw0U7rk31oqk75XSv6jtyEKE8zvqZTUVdwgKohlYmGEoTqA== X-Received: by 2002:a17:906:6a2a:b0:b0a:aa7e:a191 with SMTP id a640c23a62f3a-b703d5fa89dmr803764766b.57.1761832910405; Thu, 30 Oct 2025 07:01:50 -0700 (PDT) Received: from 0.1.2.1.2.0.a.2.dynamic.cust.swisscom.net ([2a02:1210:8642:2b00:82ee:73ff:feb8:99e3]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b6d85398439sm1769963966b.36.2025.10.30.07.01.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Oct 2025 07:01:50 -0700 (PDT) Message-ID: <40cf6de07208cdc624f71e276bfbff1e00079aef.camel@gmail.com> Subject: Re: [PATCH v2 1/4] ASoC: cs4271: Fix cs4271 I2C and SPI drivers automatic module loading From: Alexander Sverdlin To: Herve Codina , Mark Brown Cc: David Rhodes , Richard Fitzgerald , Liam Girdwood , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jaroslav Kysela , Takashi Iwai , Nikita Shubin , Axel Lin , Brian Austin , linux-sound@vger.kernel.org, patches@opensource.cirrus.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Thomas Petazzoni , stable@vger.kernel.org Date: Thu, 30 Oct 2025 15:01:48 +0100 In-Reply-To: <1ae385ba6000fc5e90adadc6dcdc2fa8b19d5783.camel@gmail.com> References: <20251029093921.624088-1-herve.codina@bootlin.com> <20251029093921.624088-2-herve.codina@bootlin.com> <06766cfb10fd6b7f4f606429f13432fe8b933d83.camel@gmail.com> <20251030144319.671368a2@bootlin.com> <1ae385ba6000fc5e90adadc6dcdc2fa8b19d5783.camel@gmail.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.58.0 Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Hi Herve, On Thu, 2025-10-30 at 14:54 +0100, Alexander Sverdlin wrote: > > > > --- a/sound/soc/codecs/cs4271-spi.c > > > > +++ b/sound/soc/codecs/cs4271-spi.c > > > > @@ -23,11 +23,24 @@ static int cs4271_spi_probe(struct spi_device *= spi) > > > > =C2=A0 return cs4271_probe(&spi->dev, devm_regmap_init_spi(spi, &co= nfig)); > > > > =C2=A0} > > > > =C2=A0 > > > > +static const struct spi_device_id cs4271_id_spi[] =3D { > > > > + { "cs4271", 0 }, > > > > + {} > > > > +}; > > > > +MODULE_DEVICE_TABLE(spi, cs4271_id_spi); > > > > + > > > > +static const struct of_device_id cs4271_dt_ids[] =3D { > > > > + { .compatible =3D "cirrus,cs4271", }, > > > > + { } > > > > +}; > > > > +MODULE_DEVICE_TABLE(of, cs4271_dt_ids);=C2=A0=20 > > >=20 > > > So currently SPI core doesn't generate "of:" prefixed uevents, theref= ore this > > > currently doesn't help? However, imagine, you'd have both backends en= abled > > > as modules, -spi and -i2c. udev/modprobe currently load just one modu= le it > > > finds first. What is the guarantee that the loaded module for the "of= :" > > > prefixed I2C uevent would be the -i2c module? > > >=20 > >=20 > > I hesitate to fully remove cs4271_dt_ids in the SPI part. > >=20 > > I understood having it could lead to issues if both SPI and I2C parts > > are compiled as modules but this is the pattern used in quite a lot of > > drivers. > >=20 > > Maybe this could be handle globally out of this series instead of intro= ducing > > a specific pattern in this series. > >=20 > > But well, if you and Mark are ok to fully remove the cs4271_dt_ids from= the > > SPI part and so unset the of_match_table from the cs4271_spi_driver, I = can > > do the modification. > >=20 > > Let me know if I should send a new iteration with cs4271_dt_ids fully r= emoved > > from the SPI part. > >=20 > > Also, last point, I don't have any cs4271 connected to a SPI bus. > > I use only the I2C version and will not be able to check for correct > > modifications on the SPI part. >=20 > I'd propose to drop SPI modifications in this case, because by doing this > you actually introduce yet another problem for the I2C case you are inter= ested > in (namely if you'd enable both modules). sorry again for the confusion, I meant only to drop "MODULE_DEVICE_TABLE(of= , " from SPI... But seems that Mark actually has different opinion... Indeed=20 $ grep -F "MODULE_DEVICE_TABLE(of, " *spi*.c | wc -l currently reports "17" out of 23 SPI-capable CODECs. I just don't see how you are helping the I2C use case by doing this... --=20 Alexander Sverdlin.