From nobody Sat Oct 4 17:29:50 2025 Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) (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 7826821255E; Thu, 14 Aug 2025 08:35:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755160521; cv=none; b=kKgVmSrI7mxK2Vy8k0VR7aYb6QuJ3a3kHvrUGWdDPP2LtTHrZto+T/lOnBNhYhwyDo3q2SW1NBiwSu5pEzMIUzJpjYYjyVrNXSCK8R+pP40MsTGhq6crM2Y2ZaxsKydWm9LlDQ+D4AIf5DKhHOlKxmu9+glKBB2yvzvp/kBO1GY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755160521; c=relaxed/simple; bh=GrauMcqTptX20P3k/gQBfC4mz8ZlS1892uGLTze9knw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=XjV8XEN/sBlFNfocb0SssjdWCtqmE6S9ea9DxhDgZf2ETOiFDYjYyt9V3MFn6XpqYYYCx34wQnjaOIUbQa6e4JW3YF1fSFvPcOhDsEmukska8V9jS3blW5TCNUlrwD6DQ5nEjOs0ju1BNWMx5ULAY9WpU+bxF90SBkOZkp+Zl6E= 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=MqtSYFy9; arc=none smtp.client-ip=209.85.167.49 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="MqtSYFy9" Received: by mail-lf1-f49.google.com with SMTP id 2adb3069b0e04-55ce52807f8so630717e87.2; Thu, 14 Aug 2025 01:35:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755160516; x=1755765316; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=jQ9vfZoIQnPu8V4AGCiAple7OJw+lWEZqoNWuIXlFQ8=; b=MqtSYFy9MOfg169gEp9C39Gne8lq5EF6HLksXbKAxhW/Ep46Et0zmH38jWtCwCpAC/ wP5aU2DM4Ep8i4suoROGVnPhxyjGdLzwjAK6cQoNDFWjmvozOfYJKDHCExzCOY28A2/Z 45kmP6wO1ey0291Lszy2DK+oVUaJ2u4mEHBCukTVdA54jNT4C3BDadnG+M9oxxr46dgp j3bJ7HK/L4SoGBX2YSBGVvvqIZVth3FHYlcHeXJddfrRlUSd0WWAbBf8QekNDBQY37iP DPjofjDVEP6MzKPvQAtQwmWZ9pSgyAs7/NQmRjXFP9CL8buSpHiebJxIB66kNvTGWDda f6Sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755160516; x=1755765316; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=jQ9vfZoIQnPu8V4AGCiAple7OJw+lWEZqoNWuIXlFQ8=; b=TzYJKOT7oORb3yqS0icgHwaPtaIqdP0hZuZYS8Hm5O+ERyvFn9DGVU3XatJgtFSOtd CViUlZ2mzp35vBMQ+GTwwwyw5LXHZlureZPuKWxiuJWIN1WMCzbkNI5jVhQNuOwvk++C H+3THR8KPFjFS2t7SK5paOl0n6sTA8dcpkJ31BkkgXRKNJLl4yc6gv/E2ueNuIsr49AC iAmGcTsg3fdaVF9W2QPqgGydhqknwtGym3BQFK+VHQaex7grFcbZnP3ems/huuk0YtFX trMzuHa5HgOr5Svs6XbpNfIC1L5LsUL6xFhxRh3RIyh7eVH79YvC0e6XUVsO3IXYL00o 4RBw== X-Forwarded-Encrypted: i=1; AJvYcCU+JS9fnJ2h11uwPAG5fCt5HJNuA0n9tlBFxGDViBP7LWfRFHQG8emCTCAlcAEEuJTdRiYsagv5u6vB@vger.kernel.org, AJvYcCV/Cs3XBszPPMp6FlRTSQofRieUGgcDqEHUhTlHl+hYJ3zbFotx5hR+KYiR9NF2i0zLnW/t6S0JwmocbPn5@vger.kernel.org, AJvYcCVb3T0ERu+s6GwPk96mT63E+65BfPkn6gbegZ/vQ44J6XSS7AuHDp8//9yPJbI8frOLnN/oyXjiw1zT@vger.kernel.org X-Gm-Message-State: AOJu0Yye+yoUqNXFB5iFAO+UCLw5JsaVWaJCY0uumr30pMbvEGHfnWrs 9ot/Zj5OeGYwVyCuYlpgnB2gdPPPqi5SExda2OlbJ4oQVAacDXIsLqmU X-Gm-Gg: ASbGncv3igbmi5o/rVxX4xBD5JxLHWsjtUbUFaUlbicbBAqyFFk+N0SVh/jjDa1DvEd rNBI1Yet9Dzd71d+oP6neprhEgA5Etq5IfCdlfEQQ/5LHRxfUlATub+9fXNmHzgBI9ZyQKExyQb Z4lfes7gf7vEWdGd/j1jIJw4Oh3ikrl7Ba6YkA0rU/t536kEtooKDcQMAKmUr7OjIQX/tYDPCT1 RsyU8xvjXCx3a84iRC3j4AP5MWem7HJvKpfwMJDtYg0Bwhtonbf+BA3RnZgDMWiDpVeVOoYLSae RxWCyJ/6sSc6Mxz8UUsmNpDA5z8ylQ+SsU6z/uCfhyuffnE+y7bHHt3zAvNW13XQOKCb+ussN+/ ZKsrmvSZRRvtNAJABFAOxD4Lu X-Google-Smtp-Source: AGHT+IG0LqtwKE4lmtneN52Me6K3H+ZWEVkK8R3xRxq4Gb/UU3T4DZD6SkmnZS6pYKi8FhDm0mIceA== X-Received: by 2002:a05:6512:b99:b0:55a:26ae:56e1 with SMTP id 2adb3069b0e04-55ce501a97cmr647024e87.27.1755160516077; Thu, 14 Aug 2025 01:35:16 -0700 (PDT) Received: from mva-rohm ([213.255.186.46]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-55b9fd163dbsm4659496e87.156.2025.08.14.01.35.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Aug 2025 01:35:15 -0700 (PDT) Date: Thu, 14 Aug 2025 11:35:11 +0300 From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen Cc: Jonathan Cameron , David Lechner , Nuno =?iso-8859-1?Q?S=E1?= , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matti Vaittinen , David Heidelberg , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] dt-bindings: iio: adc: Add BD7910[0,1,2,3] Message-ID: <8ef78e3cffcfdf99153a3fcf57860771890f1632.1755159847.git.mazziesaccount@gmail.com> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="gDcFeKkCusZoWwZZ" Content-Disposition: inline In-Reply-To: --gDcFeKkCusZoWwZZ Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The ROHM BD79100, BD79101, BD79102, BD79103 are very similar ADCs as the ROHM BD79104. The BD79100 has only 1 channel. BD79101 has 2 channels and the BD79102 has 4 channels. Both BD79103 and BD79104 have 4 channels, and, based on the data sheets, they seem identical from the software point-of-view. Signed-off-by: Matti Vaittinen --- .../devicetree/bindings/iio/adc/rohm,bd79104.yaml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/iio/adc/rohm,bd79104.yaml b/= Documentation/devicetree/bindings/iio/adc/rohm,bd79104.yaml index f0a1347ba4db..6a6e6ab4aca3 100644 --- a/Documentation/devicetree/bindings/iio/adc/rohm,bd79104.yaml +++ b/Documentation/devicetree/bindings/iio/adc/rohm,bd79104.yaml @@ -14,7 +14,16 @@ description: | =20 properties: compatible: - const: rohm,bd79104 + oneOf: + - items: + - enum: + - rohm,bd79100 + - rohm,bd79101 + - rohm,bd79102 + - rohm,bd79104 + - items: + - const: rohm,bd79104 + - const: rohm,bd79103 =20 reg: maxItems: 1 --=20 2.50.1 --gDcFeKkCusZoWwZZ Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEIx+f8wZb28fLKEhTeFA3/03aocUFAmidn78ACgkQeFA3/03a ocUqWwf+MwpKHSS/SFqDncO5qLx8XUKgm8nVokZjUkPtDAqBgEDaCb1o5X9WkMMK r+Y4sRNPeMghThcMxHc1xSx9eJ71JPVq7IXg+C4NiboTGw/HVMwP6COJMRSt4iiQ /LFuteK4ZIaUOiyGcIbps7ZE7iVqUiHWH0XPdmpwKmhsmy3vXnDwpZV9GwAo26ny Dz7xi0BL8IBLPCKkFGSRHZR7kOIKJtIYmIngwEFeQWhO4oywXSyyINwZDKNTFd8M UsqMiRIEO7OQiwZNgZkrQoTxMUOliFBfhtgdRn5HW4DHetwT20X1wOIVDRlYRcb7 UClUzVOn84bbwqJlXFHzG3q3X2jADg== =ivEM -----END PGP SIGNATURE----- --gDcFeKkCusZoWwZZ-- From nobody Sat Oct 4 17:29:50 2025 Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.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 72B122741CD; Thu, 14 Aug 2025 08:35:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755160534; cv=none; b=aG+3foZl58lDuJSEnYy+7CnvgwMGjrwneciTigIRbOsCcVvneX+hYllYjcSOqX6CXNKNcQqPs3Qv2dMwOqsB059u9CdI8nMBJeAncpdvcRCX8ITn3g8gVABN2wc2s5MD0ixfgxbWfpbjXxcYynKNU4yvr4XkOgaLhiZm4V60Y6g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755160534; c=relaxed/simple; bh=3ac/Xc7fgF8lfWRT+fk8fetiAfhQTO190DDoUMaBTn0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=LPUt0vEpgHudTklGjPYcAnDLCVDuVH68jVXYiWQjK2cm1NLk4LIl/4tWpVU6kKXYuCJ6rvr2tT7pu1JuYegyF2Rm+Apt4mwDsN6sP6ijS5rjX8kextKtxBVLXO6IMHnfXq+Nt5daxQaG81Q4VW5omxn2FQbMScdyPPBfxrZv2Fw= 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=aDEBCR+N; arc=none smtp.client-ip=209.85.167.54 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="aDEBCR+N" Received: by mail-lf1-f54.google.com with SMTP id 2adb3069b0e04-55ce508cfe0so639409e87.0; Thu, 14 Aug 2025 01:35:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755160530; x=1755765330; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=lR/ews5VHtAWFVxZ89duQ7hHL80jD86WFV+5fPOgMaA=; b=aDEBCR+NjBZR5E/5JYipzS/K3IX8TWwoGC+zlbc383ZSMGk2cVzhtaq/tA+Jf4N1i7 rl9IkCrlX4LIMvtru75aZp6GMG4BnXkjP6LXMFNWmTE+/RucoFQTZyZD1V61k804Q/Uf 857dxGx8FwrzDRUecTrTWRdwDoANl3epaZRQiDX6y+T8qJs42WjRYCAEYidd9AMwTGTl Kek/oFzCMIc1FvvtB+YEz7GuFmy606BDD1tAFDsJGCv3NaOP9kjSJJnpLlJBj5CX+RGy qCdZCfo/Cd/I8xmzxdxdbEmixaAEw4/s9rkqUgWb89fN8OdsiiyfBmZTwnYV9ke3jHNO LNpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755160530; x=1755765330; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=lR/ews5VHtAWFVxZ89duQ7hHL80jD86WFV+5fPOgMaA=; b=ulgKPpc7wAlztJY/wCqr+txThYRR0qR7P4yhDDgDXy4w3EJ9Yfte7XB2g3L7ErTawj 6kyB46cTLT8+Iqgngb7Nhp57CxumDN0r4DZojwT2sG7Z7nc4l7Ln8toch9Q0oSQqQ+CB nsnlsmNQedQen6Z1rL8r0RP0hWxiztsq2j6eFajPmb2EYNeTNVbgxNMJ4AjvTVbr6em5 ZcfgqEpaDBt2QwU7hjnK/ZZoV+fHxtLoQyLHde3n7nLMa9/BoHw5AbkrmxsmzMuAWiaP 7xzQY1IgVRW8ZYGVQmEGyavchoPo4rS8HxjVddEDvxKPavyfd0nd+HuNib70faldy97b dJcA== X-Forwarded-Encrypted: i=1; AJvYcCVceXOtUGLjJG9/Krl8s7FsQfuqfe4m5Cze4Sn2jFphNMCMkppTzwAcRNJU9tumawAI/fwY+7aBEC6grqV6@vger.kernel.org, AJvYcCWYffuYstJgrSx+Re8MCuPsTiT7mUibUL66seAN4sJXP63jqrI8kzXS/etBBiYdz8bKBD5T0rejlB+T@vger.kernel.org, AJvYcCXpXwMt2W1jHRRSKgK8SdY/mL9/KhtBczrt4Z0TWbmqdlmjtk4Ah2v+QSyCQSIPSAekiYx0qtziqyPY@vger.kernel.org X-Gm-Message-State: AOJu0Yxw5vn9aJRizJOV9pwYsYJ4PQwxZjEeKPM7LCJK6cxXnVWVTzaE /4bQfVee1X0zDyq0ct7lWzEwT22UEUi2Fy4jE0dBTcsSM5iOgLdXAoot X-Gm-Gg: ASbGncuMVqd5U2yWiNCyOfJ6fQcko+/CbapNXdmxOaqOQHj9VIjgiztWtaJjE9lIpaQ nR81ew//0vzZxcgGv1/9zlGnSdag5eyyuLv2finf7zepq2lDBJ3nO+9WCp7grGO36yZwa7zSSrO sooHsRcAyMI3qigCjbrQauLurHuicS1uI+z3v+I1RCFA17L+6FjSAGIMHQw522VjGshCS6jGjF0 KknjVCSzx+PhuzPxNd+ykUbnUxU116Tjs/fWCti4kpeF+ne0LYV8JBZh3ztxoxEaBd4FehLIRf7 rfCxchF/TqI9NhZM1tqSUqkqCSyrG2Xyh/uhkBieXoVzzHk+dZiA88FYLWmgC2g0rS4DhY06Tcg Dbkzdc5j4SqQ6AIt/QtFieQgr4T7MzCqeL0s= X-Google-Smtp-Source: AGHT+IG2h+7SdsbtVCD6DTB8rXVF5r4gZczfVqNOhwZriAoODQYuFbiEbcRU3VHUOtbrbAg7rLU8Lg== X-Received: by 2002:a05:651c:20cd:10b0:334:97:1105 with SMTP id 38308e7fff4ca-334009728admr892441fa.32.1755160530198; Thu, 14 Aug 2025 01:35:30 -0700 (PDT) Received: from mva-rohm ([213.255.186.46]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-333f8ce95c7sm1954091fa.18.2025.08.14.01.35.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Aug 2025 01:35:29 -0700 (PDT) Date: Thu, 14 Aug 2025 11:35:23 +0300 From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen Cc: Jonathan Cameron , David Lechner , Nuno =?iso-8859-1?Q?S=E1?= , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matti Vaittinen , David Heidelberg , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Sukrut Bellary , Lothar Rubusch Subject: [PATCH 2/3] iio: adc: adc128s052: Simplify matching chip_data Message-ID: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="H3ro3QwRYAEPiWV/" Content-Disposition: inline In-Reply-To: --H3ro3QwRYAEPiWV/ Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The adc128s052 driver supports a few different ICs. IC specific configuration data is stored in an array. IC data, residing in a specific point of the array, is pointed from the SPI device match data. There is no need to have the chip config data structures in an array and splitting them out of an array has at least following benefits: - Chip-specific structures can be named after the chips they support. This makes referring them a tad cleaner, compared to using a generic array name with a numerical index. - Avoid all potential 'out of bounds' errors which can result if the array is changed. Split the chip configuration data array to individual structures. Signed-off-by: Matti Vaittinen Reviewed-by: David Lechner --- There are couple of other series[1][2] changing this driver ongoing. I haven't heard of those latelty (after JUN?) so those changes haven't been taken into account and will conflict if those serieses are re-spun. Please, let me know if I should rebase my changes. [1]: https://lore.kernel.org/all/20250614091504.575685-1-sbellary@baylibre.= com/ [2]: https://lore.kernel.org/all/20250625170218.545654-2-l.rubusch@gmail.co= m/ --- drivers/iio/adc/ti-adc128s052.c | 78 +++++++++++++++++---------------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/drivers/iio/adc/ti-adc128s052.c b/drivers/iio/adc/ti-adc128s05= 2.c index 1b46a8155803..81153253529e 100644 --- a/drivers/iio/adc/ti-adc128s052.c +++ b/drivers/iio/adc/ti-adc128s052.c @@ -124,26 +124,30 @@ static const struct iio_chan_spec adc124s021_channels= [] =3D { =20 static const char * const bd79104_regulators[] =3D { "iovdd" }; =20 -static const struct adc128_configuration adc128_config[] =3D { - { - .channels =3D adc128s052_channels, - .num_channels =3D ARRAY_SIZE(adc128s052_channels), - .refname =3D "vref", - }, { - .channels =3D adc122s021_channels, - .num_channels =3D ARRAY_SIZE(adc122s021_channels), - .refname =3D "vref", - }, { - .channels =3D adc124s021_channels, - .num_channels =3D ARRAY_SIZE(adc124s021_channels), - .refname =3D "vref", - }, { - .channels =3D adc128s052_channels, - .num_channels =3D ARRAY_SIZE(adc128s052_channels), - .refname =3D "vdd", - .other_regulators =3D &bd79104_regulators, - .num_other_regulators =3D 1, - }, +static const struct adc128_configuration adc122s_config =3D { + .channels =3D adc122s021_channels, + .num_channels =3D ARRAY_SIZE(adc122s021_channels), + .refname =3D "vref", +}; + +static const struct adc128_configuration adc124s_config =3D { + .channels =3D adc124s021_channels, + .num_channels =3D ARRAY_SIZE(adc124s021_channels), + .refname =3D "vref", +}; + +static const struct adc128_configuration adc128s_config =3D { + .channels =3D adc128s052_channels, + .num_channels =3D ARRAY_SIZE(adc128s052_channels), + .refname =3D "vref", +}; + +static const struct adc128_configuration bd79104_config =3D { + .channels =3D adc128s052_channels, + .num_channels =3D ARRAY_SIZE(adc128s052_channels), + .refname =3D "vdd", + .other_regulators =3D &bd79104_regulators, + .num_other_regulators =3D 1, }; =20 static const struct iio_info adc128_info =3D { @@ -199,33 +203,33 @@ static int adc128_probe(struct spi_device *spi) } =20 static const struct of_device_id adc128_of_match[] =3D { - { .compatible =3D "ti,adc128s052", .data =3D &adc128_config[0] }, - { .compatible =3D "ti,adc122s021", .data =3D &adc128_config[1] }, - { .compatible =3D "ti,adc122s051", .data =3D &adc128_config[1] }, - { .compatible =3D "ti,adc122s101", .data =3D &adc128_config[1] }, - { .compatible =3D "ti,adc124s021", .data =3D &adc128_config[2] }, - { .compatible =3D "ti,adc124s051", .data =3D &adc128_config[2] }, - { .compatible =3D "ti,adc124s101", .data =3D &adc128_config[2] }, - { .compatible =3D "rohm,bd79104", .data =3D &adc128_config[3] }, + { .compatible =3D "ti,adc128s052", .data =3D &adc128s_config }, + { .compatible =3D "ti,adc122s021", .data =3D &adc122s_config }, + { .compatible =3D "ti,adc122s051", .data =3D &adc122s_config }, + { .compatible =3D "ti,adc122s101", .data =3D &adc122s_config }, + { .compatible =3D "ti,adc124s021", .data =3D &adc124s_config }, + { .compatible =3D "ti,adc124s051", .data =3D &adc124s_config }, + { .compatible =3D "ti,adc124s101", .data =3D &adc124s_config }, + { .compatible =3D "rohm,bd79104", .data =3D &bd79104_config }, { } }; MODULE_DEVICE_TABLE(of, adc128_of_match); =20 static const struct spi_device_id adc128_id[] =3D { - { "adc128s052", (kernel_ulong_t)&adc128_config[0] }, - { "adc122s021", (kernel_ulong_t)&adc128_config[1] }, - { "adc122s051", (kernel_ulong_t)&adc128_config[1] }, - { "adc122s101", (kernel_ulong_t)&adc128_config[1] }, - { "adc124s021", (kernel_ulong_t)&adc128_config[2] }, - { "adc124s051", (kernel_ulong_t)&adc128_config[2] }, - { "adc124s101", (kernel_ulong_t)&adc128_config[2] }, - { "bd79104", (kernel_ulong_t)&adc128_config[3] }, + { "adc128s052", (kernel_ulong_t)&adc128s_config }, + { "adc122s021", (kernel_ulong_t)&adc122s_config }, + { "adc122s051", (kernel_ulong_t)&adc122s_config }, + { "adc122s101", (kernel_ulong_t)&adc122s_config }, + { "adc124s021", (kernel_ulong_t)&adc124s_config }, + { "adc124s051", (kernel_ulong_t)&adc124s_config }, + { "adc124s101", (kernel_ulong_t)&adc124s_config }, + { "bd79104", (kernel_ulong_t)&bd79104_config }, { } }; MODULE_DEVICE_TABLE(spi, adc128_id); =20 static const struct acpi_device_id adc128_acpi_match[] =3D { - { "AANT1280", (kernel_ulong_t)&adc128_config[2] }, + { "AANT1280", (kernel_ulong_t)&adc124s_config }, { } }; MODULE_DEVICE_TABLE(acpi, adc128_acpi_match); --=20 2.50.1 --H3ro3QwRYAEPiWV/ Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEIx+f8wZb28fLKEhTeFA3/03aocUFAmidn8sACgkQeFA3/03a ocWO3wf/ewNxDu+hf/K63Wzs8O9XONoiXTRgpNc/JLm4TUudAxIovXY0QVbveDlU M2YpALH+GXvpZ3w97AtCGDedVh2u2/tFpGjtS10A/Khonbn2gUu8dSHieKMZsKh6 w3nkZlpSnemQUY93InTOS1p/FhzQyLKZ2o34eJswNaXrB058PsbixZh7+kVlrHLh Z3GzLxMhv2w9sSJkgL1142tdwwbkRp/O4EJsNlsUMEixBDWvBabbZ8t1GIpGrvrO a66q6GuR60YWP9TX3m5v4rtDWdNCWWkTGFHq3FjOicrGgYkWBRp96rRmg3sEQYpv I7j262J2hNW5qcrQ22wlxqm45wU0jQ== =TDT9 -----END PGP SIGNATURE----- --H3ro3QwRYAEPiWV/-- From nobody Sat Oct 4 17:29:50 2025 Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.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 67ACA2580D7; Thu, 14 Aug 2025 08:35:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755160546; cv=none; b=kyJxr+vEneqVM0pvcxLft9fTvASTwOyao02TftHWJD7Mb3E2jv8yTNg6KK6OErYxr0jgmujC6ck4xCYat44EPrjzYzB+zZ8IOzrALGwDqVwxbGmcIE0g2sHXTiwGahNWZALPLPmymvqoAF+JL+Jm/XfsAxfKfcTgK42UTczwtR4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755160546; c=relaxed/simple; bh=WaOHZZiP2R3EwHbR/iA9SjuRqyg+X3URHBMmj281Ryg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=lDMFd9CEabDVemU7LBgQEEi4LWdvKUWiUXxXEpg0qaTpJt5XOuaeTOioI6WnYhFP2StRvji3ut/vEnZ5Rpn9kLD3mH3xU1Cs3jJqEk+KXlOWP+/JY9OXEU8xYWlFSLoMmTlGbF5PxjITUHZwSvKzvU6emR22qCfQhi8JYgn0MGI= 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=TH3QWULM; arc=none smtp.client-ip=209.85.167.46 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="TH3QWULM" Received: by mail-lf1-f46.google.com with SMTP id 2adb3069b0e04-55ce509127bso529666e87.0; Thu, 14 Aug 2025 01:35:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755160542; x=1755765342; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=Ht4+WuCclIjF62P/XUWWfv84cD1c1L3az5bzoDE1sSQ=; b=TH3QWULMb9/YnJVO0uUes49sjhm9sAF6Zc0Qpk4t9U+xpANzzOF3vi9T6+BH5bsEUQ e6b+Op9mhBFUoFiKhDXiDGQKdfbe5Kz1zk/2dCHBilHCUUwb0LK0pcunM4e4KOvHRj0+ Np2ScB0X8XhsV/jhnEmFCCvXScwNTj8I1qZfyOJlH+sQtcO2UDyHZTBEroyos0+avVl+ DylvWZXVpbKP19VBSK8p9ylV6hnS+8kyTRXqEgf0yVz0eoV5AqLy4odk8XGodEsmQ6rU YjCe3sJYKJLw4mzRBvdO9s6eANWH1EA3q8mgMFcBQb5jtX+jDvpju+0ptf66Hztt3zUB f0Cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755160542; x=1755765342; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Ht4+WuCclIjF62P/XUWWfv84cD1c1L3az5bzoDE1sSQ=; b=UNkB1eJDlVUgKe95fz6yfjBztpSe+KOgKpJCdH0Ox4W/9iItFI2JaRXkt1rQ2Xqsws TbBGR8hKTgqlDNfZ2sdEevB4PaRC1d0E+wutPw5zDq4NchnOT4KBcKY6XxZVTGf1T/9I ExXZIQmnjGXsc9IjkFUvOYeATkifnALoo2/lryOKPvu/FaBTbDWoAflmaFS+X4lW+jKP +31T4b2jaj8rM8ELLVTIlMuFeJdhnXLcJ6EPz+p3bfXK9Frmwm1wmXahP9eZ0WVX9ySS GUXIFo9cXozmiFUP5s4yfTLI9yCGUdXsJIOgza2DE6cEdp3zYIvlcJXNROzPK26mOZHD clqA== X-Forwarded-Encrypted: i=1; AJvYcCVj+5372a/Vn1FXU2DAb2ScpD3e59p3hON/9x8jhIY5UzFiShWsHQC2MfNlPClNjnzQBm2B8ZuDQWSz@vger.kernel.org, AJvYcCWM4dFGc+N51iNHRtgG+HTZz57NrKTUryRzt3kIOaPG9XD0P5dPFxArfr/zWaWmx6Aku3RHVujiFENWVq2q@vger.kernel.org, AJvYcCWvieeMaOo4UJXyC2ZEL3Sf2hASAKY4HlJpRjb+CYBzqrJRUUgIURx1UW6b3lOymVUdzrMieh9yCAL9@vger.kernel.org X-Gm-Message-State: AOJu0YydRGJDoiODtTD3a7ZbWwdsk+vx3eqcyJxLogTlMnIoE6T96qDk Q1B/OkHFg4YbmGwCbfA/YS7Im2k6aS5YeABbUHslCjW2OdWQ+jKpKF/I9Wtmqw== X-Gm-Gg: ASbGncuU0mCubIjhmchG8hYQ0jGscKvdMhJtZrQr7BnoqQLWJnSE6E268RbigruvtJX JdsChkALYtJyYbVKhTtQ09jt9CYbQ9FLLzKIyZQ4i5Qx7ppOM7nVFvLxjiBMODqS8BoevROxJQt xW+GdD2F9QKMCJEpy2hIQsF6V4JU2EoybgWq/OpmlhsDLtAomukcZYW2AFypKKsZBw8uGVJdpqC TgqxYaUYV23bGrlotsT56jp0jsDlxInjm7QpJzRaGRL9roFZayNZQGrAC1wD9TTE9axujWZYdjz FglM/ECQIGZgZO2tao5xT3oWahiQZRRQCtnSPezlht6qowtP1jbfGXlxAfZ9WIj6bpvgqFr1hQH qxFbxut75AtwwMahLXvFNF4yM X-Google-Smtp-Source: AGHT+IFx5zwb/Nodxv8hOdTbdKr/qi9nYS9WK66oxmazbUzRaJePPvUXSXJSUnrthUlk4i5mLboKhg== X-Received: by 2002:a05:6512:1302:b0:55b:885b:390d with SMTP id 2adb3069b0e04-55ce4fd6963mr852944e87.0.1755160542169; Thu, 14 Aug 2025 01:35:42 -0700 (PDT) Received: from mva-rohm ([213.255.186.46]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-55b88c99057sm5572085e87.91.2025.08.14.01.35.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Aug 2025 01:35:41 -0700 (PDT) Date: Thu, 14 Aug 2025 11:35:37 +0300 From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen Cc: Jonathan Cameron , David Lechner , Nuno =?iso-8859-1?Q?S=E1?= , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matti Vaittinen , David Heidelberg , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Sukrut Bellary , Lothar Rubusch Subject: [PATCH 3/3] iio: adc: adc128s052: Support ROHM BD7910[0,1,2,3] Message-ID: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="RBe/8Sbrp2Y9Vhm6" Content-Disposition: inline In-Reply-To: --RBe/8Sbrp2Y9Vhm6 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The ROHM BD79100, BD79101, BD79102, BD79103 are very similar ADCs as the ROHM BD79104. The BD79100 has only 1 channel. BD79101 has 2 channels and the BD79102 has 4 channels. Both BD79103 and BD79104 have 4 channels, and, based on the data sheets, they seem identical from the software point-of-view. Signed-off-by: Matti Vaittinen Reviewed-by: David Lechner --- Tested only using the BD79104. The ROHM hardware colleagues swore this testing should be sufficient... --- drivers/iio/adc/ti-adc128s052.c | 36 +++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/drivers/iio/adc/ti-adc128s052.c b/drivers/iio/adc/ti-adc128s05= 2.c index 81153253529e..2f2ed438cf4e 100644 --- a/drivers/iio/adc/ti-adc128s052.c +++ b/drivers/iio/adc/ti-adc128s052.c @@ -122,6 +122,10 @@ static const struct iio_chan_spec adc124s021_channels[= ] =3D { ADC128_VOLTAGE_CHANNEL(3), }; =20 +static const struct iio_chan_spec bd79100_channels[] =3D { + ADC128_VOLTAGE_CHANNEL(0), +}; + static const char * const bd79104_regulators[] =3D { "iovdd" }; =20 static const struct adc128_configuration adc122s_config =3D { @@ -142,6 +146,30 @@ static const struct adc128_configuration adc128s_confi= g =3D { .refname =3D "vref", }; =20 +static const struct adc128_configuration bd79100_config =3D { + .channels =3D bd79100_channels, + .num_channels =3D ARRAY_SIZE(bd79100_channels), + .refname =3D "vdd", + .other_regulators =3D &bd79104_regulators, + .num_other_regulators =3D 1, +}; + +static const struct adc128_configuration bd79101_config =3D { + .channels =3D adc122s021_channels, + .num_channels =3D ARRAY_SIZE(adc122s021_channels), + .refname =3D "vdd", + .other_regulators =3D &bd79104_regulators, + .num_other_regulators =3D 1, +}; + +static const struct adc128_configuration bd79102_config =3D { + .channels =3D adc124s021_channels, + .num_channels =3D ARRAY_SIZE(adc124s021_channels), + .refname =3D "vdd", + .other_regulators =3D &bd79104_regulators, + .num_other_regulators =3D 1, +}; + static const struct adc128_configuration bd79104_config =3D { .channels =3D adc128s052_channels, .num_channels =3D ARRAY_SIZE(adc128s052_channels), @@ -210,6 +238,10 @@ static const struct of_device_id adc128_of_match[] =3D= { { .compatible =3D "ti,adc124s021", .data =3D &adc124s_config }, { .compatible =3D "ti,adc124s051", .data =3D &adc124s_config }, { .compatible =3D "ti,adc124s101", .data =3D &adc124s_config }, + { .compatible =3D "rohm,bd79100", .data =3D &bd79100_config }, + { .compatible =3D "rohm,bd79101", .data =3D &bd79101_config }, + { .compatible =3D "rohm,bd79102", .data =3D &bd79102_config }, + { .compatible =3D "rohm,bd79103", .data =3D &bd79104_config }, { .compatible =3D "rohm,bd79104", .data =3D &bd79104_config }, { } }; @@ -223,6 +255,10 @@ static const struct spi_device_id adc128_id[] =3D { { "adc124s021", (kernel_ulong_t)&adc124s_config }, { "adc124s051", (kernel_ulong_t)&adc124s_config }, { "adc124s101", (kernel_ulong_t)&adc124s_config }, + { "bd79100", (kernel_ulong_t)&bd79100_config }, + { "bd79101", (kernel_ulong_t)&bd79101_config }, + { "bd79102", (kernel_ulong_t)&bd79102_config }, + { "bd79103", (kernel_ulong_t)&bd79104_config }, { "bd79104", (kernel_ulong_t)&bd79104_config }, { } }; --=20 2.50.1 --RBe/8Sbrp2Y9Vhm6 Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEIx+f8wZb28fLKEhTeFA3/03aocUFAmidn9kACgkQeFA3/03a ocUznwgAvCP4xHU3F2/KzfDwqTy7VJckfUH9qjtfncnPla8SWorSvSeEIBCiCQB/ z/L1l11/heB2OlnaheXWfhRQv06+vaq14/fDePG4qvgf4MgiLrkwVEtg6z5EYd+a rCfQw7dr3cfuyknLS/Um5GKtEq1vvMXF04Xh16JhVVANGQZEeKNNl/ck7z/Edtls aFoQWyLxYjAB8OrICcvjJDqMiY1B2twKROzoUJH37toOd8EfgJDUQyoCdU5dWeos UJ+rAc4Jy8URpb5FUi/TMmtHvIVVDunj+hfJOuaP+3hDC9Iw4uKTlU+Q3+9sFJq8 Zr95OOhqnCqzvs1HQJXb6prGjIldCA== =pioM -----END PGP SIGNATURE----- --RBe/8Sbrp2Y9Vhm6--