From nobody Sat Oct 4 11:10:15 2025 Received: from mail-lj1-f175.google.com (mail-lj1-f175.google.com [209.85.208.175]) (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 0D13F28641B; Mon, 18 Aug 2025 08:12:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755504750; cv=none; b=S7dOnOnvCqBT69HQFiI89jXzE9vbmrylhPrOwJYXkNUIYMHZNYTv5o70H+tpq8sRTCr+kXv+LD1oLOebRlIj/CniRNm/0S55MZ1K5/GSIg4ONQw8XxP3BhTzKQUDbTCPxsOEA5GQyqTfSzAknODbB2YkKgrK3fx4bcOvzzaPc28= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755504750; c=relaxed/simple; bh=4ABHj6VAXeSyXwZ+yP22j3tygSX4cygpeR/cL2IUG48=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=DJah6NvpPBh8mJTYPtUk+GpvqD2f9+WDifORCIPeeRGXV6ArtaJ9RSqehT4MDgfOFV8Nhwu/9Tpvo+w9zuuKKzAp5MCurag4Dd9YeLbCq4acAD30rxMcQ7k1xV/F3Y6VF9VICWaxmJf2bu4KijoYlA9P2Pvd6Oj0kSBR2PsFuZQ= 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=T3HY8D1h; arc=none smtp.client-ip=209.85.208.175 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="T3HY8D1h" Received: by mail-lj1-f175.google.com with SMTP id 38308e7fff4ca-3352212fefdso3392611fa.3; Mon, 18 Aug 2025 01:12:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755504747; x=1756109547; 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=ZQz57nvIkwA+D4BmZRYE4VBVr2zoK7JTVtvhkG580uU=; b=T3HY8D1hGP8cbixm7LPcfUgbaEv5YXRjsSNrs39vGGrPimaHzPg1iTbYzZYF5Y9KCf 2U2+EhTnFfvYgJJAvXn/BS3BdEUVLiBNfWnO8xkKK4YS98k5x1778LdAmfaN506QQ3nR PUls333pSQa9am2odA2v/R+a3eP6znZitDIIuoWs8TNew+Gnuol+wmr0GQe/tIih6m+P 0EzyAW3WhNv0lzytraJaoTTchgNrS8Mepwf68s8eSZC20p+HppM8Y/I/+Tx6Ccs8s7T5 tPc+4sCfGhcZ2WuXczXpyRdzA/Z813JhSHXLxcV/jSz1PvdO48VzfTHXAL/tsq8MTGqZ jEHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755504747; x=1756109547; 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=ZQz57nvIkwA+D4BmZRYE4VBVr2zoK7JTVtvhkG580uU=; b=hhbYZtr+1VGXjy0mLFP7NBF6lLlBR5rBOaHZ1HGm6t3RCNST80LEzNxbpebgseDfLP WTvvrLthzjrftTLKu/NRRMOKTigdWs+sgkNTSSseZtjdBh5Xm/mraJk4dP1M+Nbf39Hk 4nFVJxEjKQiQbwI2m9yoCMl7k4ArRCLE4CcNo4hew0G3FkbBKR3V5ZrUbMgM8ox5lcBB anFKZaKSqxULIgqKm/2YHHapyccs+B9TtzA2M+T4MGgKTIIQ0jhiemI12rW2O58oT6hX Pn2KO4Knuzw/H6dWzYhJdPSX2dACcxDLWF1FupJEi864fL4ROXLaIr1zjKTPWEyHitUc S3KA== X-Forwarded-Encrypted: i=1; AJvYcCUN1UnCiolfMg5+Z8SvtIrtaNlQFZDWU+HsXvUAvBxYYYVciFrMWW2e3v65/tOET/xX3qY3+ryP3y+G2S+v@vger.kernel.org, AJvYcCVZBEHm4GYxxfDaLHNfu2agua80w/jhVT2k7mZ9wI5sadcgyBtMIdq/fI/K1cRPbJHSXiwjuEJTZ5Y4@vger.kernel.org, AJvYcCVpet+ZEBZjk1ayjjE/AM594g5GkFwotIVjLqwlmXEiJHHp9ypC7y0u8pFMuAkgKKH3UOGro9e4TXzK@vger.kernel.org X-Gm-Message-State: AOJu0YzeklAJPnrwj81pS7+zOATeLBYQsbvUVORYUdFDss3t8j+OiLE0 UK1R5fykMMurbZMMJYIAHwxxhqHRw+4++c88NfOvbZ69I0DyMP4PgVR4+6JzBQ== X-Gm-Gg: ASbGncvMKdB2KNe7ZjNyB5PvhRvTnsejkFGoJpIpdc12O640tuE4Yzz0QhAo0wvg/RH li0WW/ItFb1uPSGpwPyx3sMNe6KsI5884ui4PnwOPetCK/fOOyFTpfCJjvzQ7mfsrHi0UKDr2/c u0LNJ1FPvs2c7RnVD3o0DOMx5QQmvOL5mn5GkkTmqxFsR2H8ZtnyWSL7cXxaHzUL5U2796ttsi+ FTj/WCpRW1pWvu3SRJL34TrhODVQhh8wO7P7rQ3U+Zuo8un9wNvYFkTaqXKvAS+aWsRRxBJZBXi YLqWQXrpk2u6CXozGBP5jgw3QO23rZCTN3uajHAFFvSr1DseGaKyDCdgIqsCUSET3lfIQjxOuMS jIktyAkpdXd2EdNv+ogyLKdUyS+/1Dfxnoa3u2zs= X-Google-Smtp-Source: AGHT+IFVxpIxMEFJpF/C0VDQ7Afg+kD72Xwu6itr+8x+RXWXXZZ5OvEf6ZJPbr0LHy9S5hUPxEx53A== X-Received: by 2002:a05:6512:2c8a:b0:55c:da6f:82c1 with SMTP id 2adb3069b0e04-55ceebadf33mr3173643e87.56.1755504746839; Mon, 18 Aug 2025 01:12:26 -0700 (PDT) Received: from mva-rohm ([2a10:a5c0:800d:dd00:8fdf:935a:2c85:d703]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-55cef368eb8sm1552230e87.59.2025.08.18.01.12.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Aug 2025 01:12:25 -0700 (PDT) Date: Mon, 18 Aug 2025 11:12:22 +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 v2 1/4] dt-bindings: iio: adc: Add BD7910[0,1,2,3] Message-ID: <0874c5933cf56430b9440d19ff46f746e4897952.1755504346.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="4UlmBtt+ITE11agR" Content-Disposition: inline In-Reply-To: --4UlmBtt+ITE11agR 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 Acked-by: Conor Dooley Reviewed-by: David Lechner --- Revision history: v1 =3D> v2: - Drop unnecessary "items" - Fix the order of fallback compatible for the bd79103 --- .../devicetree/bindings/iio/adc/rohm,bd79104.yaml | 10 +++++++++- 1 file changed, 9 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..d5192ec58f59 100644 --- a/Documentation/devicetree/bindings/iio/adc/rohm,bd79104.yaml +++ b/Documentation/devicetree/bindings/iio/adc/rohm,bd79104.yaml @@ -14,7 +14,15 @@ description: | =20 properties: compatible: - const: rohm,bd79104 + oneOf: + - enum: + - rohm,bd79100 + - rohm,bd79101 + - rohm,bd79102 + - rohm,bd79104 + - items: + - const: rohm,bd79103 + - const: rohm,bd79104 =20 reg: maxItems: 1 --=20 2.50.1 --4UlmBtt+ITE11agR Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEIx+f8wZb28fLKEhTeFA3/03aocUFAmii4GYACgkQeFA3/03a ocW4mQf+JsnQolDCptpk6B0bcDya2MS1WrYYI7nq4SbhFeLx3ehQvx7sS6lcOgmx Wtgcf8XrpLUS0SPdmEBzE1xUk1KBmtV9ch297a62XDifeYmhaCWY3eMYJWsD68OD Nh6YORFjXBNR8knV0Oe6eDYBsoExwUNBTYnMUSxVwnUQifvYc26aft/7fDCfEu57 FGw/a3j06DhaFKTu+ZjIHRs5UTrDKVYHkKgRQt8xhd1HkoIJWxWtCnjWFlvAYjnO JYOL/W8lePkhhI85LS9y1dwJ80oOy9lOL0r8LOAa6rcr9c0kWiPArLkwCdWG5Pbm vyCigxBRQZKS8Yu4IXxdeV2k7ounvw== =dDZ1 -----END PGP SIGNATURE----- --4UlmBtt+ITE11agR-- From nobody Sat Oct 4 11:10:15 2025 Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com [209.85.208.180]) (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 4BA232EA74F; Mon, 18 Aug 2025 08:12:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755504768; cv=none; b=iJe4atMHPdpjGlam4vn6+OXmPrMQ8IcC7e7sbxGPZOCMpYp7ERZaw9kcBckwwf83aGfWuF+kG4QMLFsILDKmkUtF2yCCMC9LWUqMIKqjUSPSEEEWub+yOV9WsemU9BJzLBPAtgQ4mTzmejcKUgdFhVwfCh8hSMCZqvSvj4nebkM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755504768; c=relaxed/simple; bh=D05oO0fD74hI+WlMh1LMrTI4BUEhezUuJab60OrX3mw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=YB3tYZVhWoeXBKl18OUsGrNYQaijBEvRmdJXiGLhgEdEX2oo9f82w3WG61MwB+5eD+0di+ZTQnY9Y9iC0y5aD72X8JZAKnX1V4ZzT5F21HoX5+jziYMHbeBFDqpVtzxOFgVI0uHiUQMH/BRHXC36DGqJqSUNcokS7v+FjJecJjg= 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=Mn4RabAY; arc=none smtp.client-ip=209.85.208.180 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="Mn4RabAY" Received: by mail-lj1-f180.google.com with SMTP id 38308e7fff4ca-333f8f9ace5so28998751fa.1; Mon, 18 Aug 2025 01:12:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755504764; x=1756109564; 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=S8yswSF7jRcfzb2zJvzxPF4kutDoBtkeZJQha1Cg7kw=; b=Mn4RabAYjEgiSKmIL/gEHL58EN9AYHKzhQP5qhkUONJnlj03wtewEyKBfuRqChMIrW tWtni74+p7wTXxSL/6IchNSi782N+iEdNh1Jw91DUbg0ZVftIkEFkvLIrJ7VnykuU338 6YiEVtsRTxcUQO9GZAEPCqxNFK+OVhOzhOrsEv8RPRKPw0ZET+LonM3GJleKcgQy7aV6 Sb13rajRXYGmGIquHSQYy5hk0ye4KSNA7tJ0PnZX7ZVYlKZAC32eD5P1GNR6wQ2OwnN6 zqsAm1MFl21dhMKmYg1/QJl5xNjjuMPQQRSlBCUwX6llXt8fj5xAH3OFa6lWlT4b6rcJ O1bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755504764; x=1756109564; 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=S8yswSF7jRcfzb2zJvzxPF4kutDoBtkeZJQha1Cg7kw=; b=rNPertV+bMeON22l1JWR0cLGerDaNjazCrBxs9cSCWuJRKT6A1hyOTcBDHKKzH6Hbg GDuwJH8xPxKAlh6ivJT2p6jEFNhV6i1yRkFQMgGHASegyOpBdCqg5SLEfttkdCgXvCAu oKM5Bg3XPL255MpCcmblQKa7LBzMkEto79KgPMYUAKWZ9ohyfI307+2JdhDzvPJ0F8fI 8ep2dsrvxhKguu1V9Ym9R3eknqkaHzL1n020KPhiEGVSI7Pc9PK0kBGgi7ur1C65KWSh g3cxwFKClqm+spifLkuewTzc7SSgggo4Y4m/RTFf396sv34vNL8uvY8C2+ayls9baGtH nhGQ== X-Forwarded-Encrypted: i=1; AJvYcCU7a4C4mLeENPfnoE05JevGREMX7n63dtSRCJnzEfu4V4Lmn4Vl23sIePsiiQLneAlV/BJqmy1yMTjM@vger.kernel.org, AJvYcCVqEp/kewqi4fRcgIPo/XMPVU/zAaOp5id70HZ167iTDj530IPExwIvaurDlFVHzbrp9gMZSmQ9HHOhAYxF@vger.kernel.org, AJvYcCWJNQUMYVp9eIE7b/3Sb9YH0TWz5wJMhH6lmkNwpomaXs8o4ylgbkLoudDzRic7Ek2P7O+E4B89EIuS@vger.kernel.org X-Gm-Message-State: AOJu0YyXz8S2o1hce/qux/DR/90ln6lTkL50vg9auS6RVDgWfEuDBCYi AB2wSr7A6JrcxDX/owvFORUQKVKc1w1La9bh8aFruUTZz8zozfU9NwmW X-Gm-Gg: ASbGncsxaqce+cqzfYZ0FRLRZPnIH2/hMjxO2FRV0rPjT38+mTaDfPRWYc/lIuUrMfw yKFr/1NgUvP3B/wpFJiq3fCUqzU2Vimn4nqwxuETEjDrCfL2c72mwhiMOzv6TO0F0+eCVoDEyf8 je5MM8T9SdX7NyKzv2qpMJG44LUrYSXj7nAWn41AmzBc9N3vVvEVU3eaRT4pdYdT/6CR2cc7wUt dcbJ0tzcRiJGEWoIVNz5q8fLDcjy/oiGAOEH2/WjYZYfIXch8V1dtYcNJrek6IJQHncxcEg0moe DmEyrx77R3kFJ0VdTF0qtFpOXoIPR+jslriaWBdxgRkEtqBxAGm5IbscaTUv6WbIXhUBaHup+F/ sTTu6zl8zeO7/YSZFWZJfWcvb3yzrRoo9Wny+zL4= X-Google-Smtp-Source: AGHT+IGduwXuRAIwSfNnUB0OdjGQv3E/HKE4y++8Bp7Idp8Gd6xwmW2Ug+5wzpFtBlqj8NbWJQ6FtA== X-Received: by 2002:a05:651c:1509:b0:333:bab4:aa73 with SMTP id 38308e7fff4ca-334099d6b3dmr29626991fa.37.1755504764107; Mon, 18 Aug 2025 01:12:44 -0700 (PDT) Received: from mva-rohm ([2a10:a5c0:800d:dd00:8fdf:935a:2c85:d703]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-3340a41e3b8sm16493891fa.14.2025.08.18.01.12.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Aug 2025 01:12:43 -0700 (PDT) Date: Mon, 18 Aug 2025 11:12:39 +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 v2 2/4] iio: adc: adc128s052: Simplify matching chip_data Message-ID: <943b6f4852ff0944eeaa0366cbe3b5aaf440cf23.1755504346.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="ZPR6NG/dRz/5kmSD" Content-Disposition: inline In-Reply-To: --ZPR6NG/dRz/5kmSD 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 --- Revision history: v1 =3D> - No changes 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 --ZPR6NG/dRz/5kmSD Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEIx+f8wZb28fLKEhTeFA3/03aocUFAmii4HcACgkQeFA3/03a ocWb+wf7BW6eyO/+ScpdGlorOrBB1wo03ZrkhqgJpP9b/RiPjld5P7mcFtweiy7D d4Wx2cJ8+wytCN1D5V+5qZ4onzql+JyObFCussh0TeUcNHZiUhwRjczxh7mio3q6 chiePY7TGXNwxQITHyLXOY6HJirB5uKkSfxnJ2+dwHGETbB0TSV29zPywbf8OPf1 h04MsGDmHM4VbTI30Z5iczBKbZY7e36vOJx4CEv5HsXQxflgJ2vy0+bfd5HlyVNN YJ8sbgr9ThGgHOM9PuhMBER8g2xXbevdW1vAPM20R7iJvIKJXi82ZqHebJ0EXjAw MbrgFrGUjqKxcWFRp2iZwfZmToKXkA== =5Q8x -----END PGP SIGNATURE----- --ZPR6NG/dRz/5kmSD-- From nobody Sat Oct 4 11:10:15 2025 Received: from mail-lj1-f175.google.com (mail-lj1-f175.google.com [209.85.208.175]) (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 CD9BC2FC883; Mon, 18 Aug 2025 08:12:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755504780; cv=none; b=Tmajj3WJNlEBdiAWw/pWERxfIdBp6+YCzy8+WAYzCA9H72tFHwRboMcQC0gqYEh60AgzBrIC9R551S4PHQDm9fICCSxhf1hNUQZ09i/ra+djpQlP4ZV8JG4rC0cJyNJbPlE40d3aFENPBdPth0BYTYKqqeyfp4WrWip3+5Kqgnw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755504780; c=relaxed/simple; bh=+3fux5TYQMl0CnfslHMRzzKpPDbHdLeNW4ibcyerxjQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=QOG82HUoy/3StQQSzaj7M9IFJeIKwJkv2eyExaT0DtC17oKzZDri3gGq5/DAK2zKc8LCfSxd388ibGizDPz2bGV5DWv2HYIcE+3nHQHOK9inaPfMJQ0O2RN4Mhw8hCUQzh6xEHtTOhFlRtaAolgdXxweKVSCWnGxGZ10u5zMJ68= 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=ga/HiIgT; arc=none smtp.client-ip=209.85.208.175 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="ga/HiIgT" Received: by mail-lj1-f175.google.com with SMTP id 38308e7fff4ca-33418dde187so9486711fa.3; Mon, 18 Aug 2025 01:12:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755504777; x=1756109577; 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=oytV71oYo3Ji3+fsVU3mYtfEMJVu7iWh8Nkyt2wLFOM=; b=ga/HiIgTOYzEX+j70nmB6CvrokvDhKRDDmV2+O5aB+JFhmm0OsSb5bYJkSeVq+YcOs YZazaRUHf+pxMN8Q3qwt64Imgpi9iqTK6+/drqmDVXOJsA+i97Po5qS6E8NKvK0/2QCO rpvKIO23UcH/56P6NWSqpf4OCAVOJzy3eERQHyjmHAyXZ5AZoWipkf2kn9+r4aCZIykl PkvAm68YbXSfxmSswFBzumACCOuf2tO209pBFJ8mBtBAbM2bLXaM07Vv9wBpVD0i7u1L dwxKbWA0q/IBJJKtMfgkcZoJTZrHYPJ05rJYX3OOkPIRVetfxW70V1z3A3uGOqGvlNb/ gKoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755504777; x=1756109577; 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=oytV71oYo3Ji3+fsVU3mYtfEMJVu7iWh8Nkyt2wLFOM=; b=FU/osMSDQjNWfzS9zJt5J5M2B/Nk+u6iAvoZtfcOUWBt48WwJhUBSC0b2EggvongPp Kjq+YiOQbFEau25plCwflyCwyosssQaj5S0DV0QJptZPzYaK1xWI4t1UeEGEMD0Ac40I FBYzeuhKRJm57q1AFF5nMMg2v9Goo2uVg4aaLBWVX5thBKz7B8pvYPchv34g6e60u5Oj qrmgVjU0gB7W9LK/kJTg3AiXt10EOk/rWoLZ+eVOsjNsKdUsRMGiyjLN1RdjnHTJe9z2 MBkGsU6fiLoh6cuKd6Yk93ehVa0LuRlph3nGBeTWuTucA/MyihYmRpfb4frPK0DKXTu8 sIIA== X-Forwarded-Encrypted: i=1; AJvYcCUd7nD7SanGhP4sk74pHPgw9eHNzIYFSs0Lpc6aeC4WCgPwk30+eAkfkEs8YVEPwmFKZwRwWQyd3vQc@vger.kernel.org, AJvYcCV8o4m6Bc2W1n5Ln8NYAN4hPaWakZ2XhJotug/Xw1GdTEZ1uifK7o6fKeIyxmceD078JfE2XGgORTLm@vger.kernel.org, AJvYcCWyJ+FW8a44MxjWKMBIDTcyuHkGHj7zoj2DyOm9nj3pf+GVFbR6jpYUU4FOiWQ3+vzEPpgljos/sFxi254Q@vger.kernel.org X-Gm-Message-State: AOJu0Yyp96qRn78+OjxmNz3W5fNbRy2eAIEmdPJZAWsiHyoSJjguMgJ2 rcJ1/uyBrIK/NPeV8MFyKCiGFXDFZANvOV6ZPYDLM4q0Rqwi1YinKbK2 X-Gm-Gg: ASbGnctNX2D6Etj9lZmApSMYvkmGqA6hnqMxiXTkTRadkjfI8+/BwK90tVFWVVosRnt V8CCApWGBVTP+Mj3oPoszVwO5/YT+TMlo789Y6uYlnTgkZ12v4q45Es01Uw9i4mNigslJUZ8f5W rp5vRwV57oVKOtHwzve5YQTF6qpA++MS5P8DX7hJi/gkNSgWjjTvoUNwTxlJOpGNdoVIWaKFMBu NOigD8thvApDhsTSF9Bp03vnX29eNrqai231sy6/z5cCUJ/T9wth5P93TBcxQKcNOX7doycjlHY qsXvySijK2mEL5Y/hV4Zhje7nfX4wBRZMewfo3gkwdx5I4GmQ90YcPqo7m9th+ttA4KKHdXhT8l Wc+zFbGOj/Sn6Rnsur3Wl+pSLdTobXVhkJrouuB4= X-Google-Smtp-Source: AGHT+IE/k4pDMCkWaKA/2pcYu00B4xTZ6Y1FA+RB+3ptMRKE/YqtkKu6pcQq8KEeFMNSe4Vm3cgJEw== X-Received: by 2002:a05:651c:41c5:20b0:332:1de5:c516 with SMTP id 38308e7fff4ca-33409869ed5mr18304371fa.8.1755504776768; Mon, 18 Aug 2025 01:12:56 -0700 (PDT) Received: from mva-rohm ([2a10:a5c0:800d:dd00:8fdf:935a:2c85:d703]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-3340a645fcbsm17184091fa.69.2025.08.18.01.12.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Aug 2025 01:12:55 -0700 (PDT) Date: Mon, 18 Aug 2025 11:12:52 +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 v2 3/4] iio: adc: adc128s052: Rename channel structs 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="2kzuUwWZROA1J8BY" Content-Disposition: inline In-Reply-To: --2kzuUwWZROA1J8BY Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The adc128s052 can be used to drive a few other ADCs but the TI's ADCs it was originally intended for. The TI's IC variants model numbers don't (trivially) explain the channel configuration (for a reader working with other than TI's ICs). Rename the channel configuration structures to explicitly explain they are used for simple ADCs, having 2, 4 or 8 channels. Signed-off-by: Matti Vaittinen Reviewed-by: David Lechner --- Revision history: v1 =3D> v2: - Rename channel configuration structs as discussed during review round 1. --- drivers/iio/adc/ti-adc128s052.c | 34 ++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/iio/adc/ti-adc128s052.c b/drivers/iio/adc/ti-adc128s05= 2.c index 81153253529e..9b8ecaca01ed 100644 --- a/drivers/iio/adc/ti-adc128s052.c +++ b/drivers/iio/adc/ti-adc128s052.c @@ -99,52 +99,52 @@ static int adc128_read_raw(struct iio_dev *indio_dev, .info_mask_shared_by_type =3D BIT(IIO_CHAN_INFO_SCALE) \ } =20 -static const struct iio_chan_spec adc128s052_channels[] =3D { +static const struct iio_chan_spec simple_2chan_adc_channels[] =3D { ADC128_VOLTAGE_CHANNEL(0), ADC128_VOLTAGE_CHANNEL(1), - ADC128_VOLTAGE_CHANNEL(2), - ADC128_VOLTAGE_CHANNEL(3), - ADC128_VOLTAGE_CHANNEL(4), - ADC128_VOLTAGE_CHANNEL(5), - ADC128_VOLTAGE_CHANNEL(6), - ADC128_VOLTAGE_CHANNEL(7), }; =20 -static const struct iio_chan_spec adc122s021_channels[] =3D { +static const struct iio_chan_spec simple_4chan_adc_channels[] =3D { ADC128_VOLTAGE_CHANNEL(0), ADC128_VOLTAGE_CHANNEL(1), + ADC128_VOLTAGE_CHANNEL(2), + ADC128_VOLTAGE_CHANNEL(3), }; =20 -static const struct iio_chan_spec adc124s021_channels[] =3D { +static const struct iio_chan_spec simple_8chan_adc_channels[] =3D { ADC128_VOLTAGE_CHANNEL(0), ADC128_VOLTAGE_CHANNEL(1), ADC128_VOLTAGE_CHANNEL(2), ADC128_VOLTAGE_CHANNEL(3), + ADC128_VOLTAGE_CHANNEL(4), + ADC128_VOLTAGE_CHANNEL(5), + ADC128_VOLTAGE_CHANNEL(6), + ADC128_VOLTAGE_CHANNEL(7), }; =20 static const char * const bd79104_regulators[] =3D { "iovdd" }; =20 static const struct adc128_configuration adc122s_config =3D { - .channels =3D adc122s021_channels, - .num_channels =3D ARRAY_SIZE(adc122s021_channels), + .channels =3D simple_2chan_adc_channels, + .num_channels =3D ARRAY_SIZE(simple_2chan_adc_channels), .refname =3D "vref", }; =20 static const struct adc128_configuration adc124s_config =3D { - .channels =3D adc124s021_channels, - .num_channels =3D ARRAY_SIZE(adc124s021_channels), + .channels =3D simple_4chan_adc_channels, + .num_channels =3D ARRAY_SIZE(simple_4chan_adc_channels), .refname =3D "vref", }; =20 static const struct adc128_configuration adc128s_config =3D { - .channels =3D adc128s052_channels, - .num_channels =3D ARRAY_SIZE(adc128s052_channels), + .channels =3D simple_8chan_adc_channels, + .num_channels =3D ARRAY_SIZE(simple_8chan_adc_channels), .refname =3D "vref", }; =20 static const struct adc128_configuration bd79104_config =3D { - .channels =3D adc128s052_channels, - .num_channels =3D ARRAY_SIZE(adc128s052_channels), + .channels =3D simple_8chan_adc_channels, + .num_channels =3D ARRAY_SIZE(simple_8chan_adc_channels), .refname =3D "vdd", .other_regulators =3D &bd79104_regulators, .num_other_regulators =3D 1, --=20 2.50.1 --2kzuUwWZROA1J8BY Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEIx+f8wZb28fLKEhTeFA3/03aocUFAmii4IQACgkQeFA3/03a ocW8TQf/bE/y8Ej3kipfPZsIVwsakqFZqPDEV+nrSGF6AhhWdj2Uynh7e31L1H55 16udmRK+4xPsB06OaxM3APmHc6rEgC4F9FZqYgZQn3yFxu/PTUjpmY18z11sIR1C V5OGul+z78w1ZSTYiRd7Lm/nt1kDEV3333JiyfjddK8MTRAWRhireEDEbj7Vf9Qu 2LaGqmhWe5mZUOO+VnI6wihWAOs2jJqYb7t35+xDYkSbOuC3PqZGJ41hpb0di+MY aw7mrQs8R77rEZXc3TAW6md7PMN7gvtT456zHQf1rQJEead5dpykg4/R1i/gs67l f3dIvAa6IzEK9OKkL7GqVXvA1HQkgQ== =0O3D -----END PGP SIGNATURE----- --2kzuUwWZROA1J8BY-- From nobody Sat Oct 4 11:10:15 2025 Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) (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 9361029B8E8; Mon, 18 Aug 2025 08:13:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755504793; cv=none; b=NmizGjXSKGZ3743kqUHfZ5VIvfmbBabdrDx6j3kiFe1zVB6rnwKWh4uhFHxKABTj6y8e/lGQj9CKGIKtl2FHHfo/cMTQSh0+Dc7XEYMRSNG7JM1Ytkjwk90hSbQ2gjP3tlG52tRhy7hRAkuX4BtEUPP0RZc9Mp4QQBMmhHy/adU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755504793; c=relaxed/simple; bh=cDspve00JkSSRewIpWUs+J183I8NCCc4Mrdww7zgQ8E=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=hTt9lu9EfLTMXSkUTqREitiWkblkMlEz7qssGpp53yY73jq6K6UxgQFH9BEQx+Ox4XssYQswbwlc5vROmTyx8iKRa8nERQPTxDk881cwP1chJQQQqfr5wr3CHmnNG/sD7L2UNWHVvoPqjgrIdHF+GH0oyTRtQvS8Wyy+PAtOru4= 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=bhdFxWw9; arc=none smtp.client-ip=209.85.167.41 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="bhdFxWw9" Received: by mail-lf1-f41.google.com with SMTP id 2adb3069b0e04-55ce52658a7so3667858e87.2; Mon, 18 Aug 2025 01:13:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755504790; x=1756109590; 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=IYRgAQUvxLKNi4PbWgiLV7X80YSaNGAIcr48EAtGXXw=; b=bhdFxWw9DmDRElRR8R6thEIWiqdrtAoob3Xl8kbUfkNy64EhZfYzVc+aMr0wb2OGpL +oURvotGuIcojub1hl4XEighB71Kn4UuIegHeoAxo48bAWBYPqCLlnArfZC3AmYZJnx8 rqQEE8eTiPFbsKYZDVuCUD5oOuxWvLDdaoT+t+b62/yyVMZG4Hpbj/8j0zU5MHXER+1v dIRsE6KOrv2yRBvc0qLkQPsQbbxIaCTHaCqggigKLGaCy3gugObhjSiuSjvCdNzkQrYA SRxIy1YruF+SNmzCj6Z6kYg8gNwYaOsp5Sws807l/y0/t0uMsHZHePJtGBqRwZzEwnu2 81Aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755504790; x=1756109590; 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=IYRgAQUvxLKNi4PbWgiLV7X80YSaNGAIcr48EAtGXXw=; b=W/KTGLbDMnQ9Eci4e5PCTK5Gzp4OyeJc3Df+BapxI78A/GtccTRVEIoRi857qyP+NC fodCEe2SaMDtfYuCafW1akrxX6yiWEu2kpReeMzMO2dlibbNRrugoF635dQSwBJ0Ui6G RAyPgqQiWYkUoUvcFg1QUpKK9u4rf9+TULbmEH50CSWIlRbYRpgj42JYChWe6WT/bDOj PLA0VLHLFW1l8nVXAjdMihvAJ0dzttLwcS3RAE5jhaMCjik5dPkrlZstABfuEHsYgNrf tIs+poNPrrTTS4pO+p4OSgFYkxytakzefu1HR+gVr/zFSmhavhYbRp+iS1jsiXztAUtI xJxA== X-Forwarded-Encrypted: i=1; AJvYcCUFxIkMbhEs/5VKii7h9ap8xrHtqVWc55skJ4m4zMveb7FISr3DUDxdid4XonlBYxTkPt/sNmgVcrNEFBDO@vger.kernel.org, AJvYcCUPmwzDVPC4SZ5qnIvI5N5YylsoK2nqXdvRBbPEz/B+pOGFKM0LAGActwTsmwblX9BMnwdx5/b8xI3C@vger.kernel.org, AJvYcCWY6vIv0m14zk1NkfGqZiDtHZ3OslXk9MzwwiijsaJHaawmoUcwWCCeIcPwaGWjTH3wil7gqS1BqyM1@vger.kernel.org X-Gm-Message-State: AOJu0Yyk474x0sTghpPJb2lMFceChGcM9+3Be0Aw2pBor0Bm2PggNC8q QB4ndedwrT620WONUJpmk4+bdj7+GPkCjKRu1mArIdGpSHMWhh9I9liw X-Gm-Gg: ASbGncvv1iVKdJHwJpD3NVwHxxcHJLZLvAQv53Q0wTu83iLC8eXO0RIt6xsxLbwwqZu PqhUY84kVACPLvxaN/DQL8exZHzhLYOW8aNsGnC1W6O6RSLJqIJE45rQXzeXZ9DCXAijAmJUxT9 /9wUUL1/eaBVz7vLhgS64x2oItrVj6ZFthg49FPbHXEEZTSRouv/By29xollpNx2zGJ7VC+mKCL lvH+Nh+JMXEMifywcimsetMstVuOVZVt29uZ/LunDu9JL1lZk/73Ulxw+dS0kKOQ0WyuT7M5AXa FMJomCBteJZFpltL8MpdVhvd2ShWBlZz++T4iqSPNI/5Ev0oL6iXxQqnwu/NL68/TObV50LEeEo kps9y1QpjbBLLkqu0WKRpSQX2LmfidW2l5SpWb4A= X-Google-Smtp-Source: AGHT+IFGPfr9SQPFZB+G55QonwIJAX1krxFzDIx+0BD6Qf1mcJ187Ej4f4KvKZztE5CpSVYaHCtlPQ== X-Received: by 2002:a05:6512:340a:b0:55c:e594:ff94 with SMTP id 2adb3069b0e04-55ceebb9343mr2488267e87.49.1755504789477; Mon, 18 Aug 2025 01:13:09 -0700 (PDT) Received: from mva-rohm ([2a10:a5c0:800d:dd00:8fdf:935a:2c85:d703]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-55cef369d83sm1586556e87.67.2025.08.18.01.13.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Aug 2025 01:13:08 -0700 (PDT) Date: Mon, 18 Aug 2025 11:13:05 +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 v2 4/4] 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="stQVvdqvZQ7uOc1t" Content-Disposition: inline In-Reply-To: --stQVvdqvZQ7uOc1t 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 --- Revision history: v1 =3D> v2 - Rename channel structs as discussed in review round 1. 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 9b8ecaca01ed..4ae65793ad9b 100644 --- a/drivers/iio/adc/ti-adc128s052.c +++ b/drivers/iio/adc/ti-adc128s052.c @@ -99,6 +99,10 @@ static int adc128_read_raw(struct iio_dev *indio_dev, .info_mask_shared_by_type =3D BIT(IIO_CHAN_INFO_SCALE) \ } =20 +static const struct iio_chan_spec simple_1chan_adc_channels[] =3D { + ADC128_VOLTAGE_CHANNEL(0), +}; + static const struct iio_chan_spec simple_2chan_adc_channels[] =3D { ADC128_VOLTAGE_CHANNEL(0), ADC128_VOLTAGE_CHANNEL(1), @@ -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 simple_1chan_adc_channels, + .num_channels =3D ARRAY_SIZE(simple_1chan_adc_channels), + .refname =3D "vdd", + .other_regulators =3D &bd79104_regulators, + .num_other_regulators =3D 1, +}; + +static const struct adc128_configuration bd79101_config =3D { + .channels =3D simple_2chan_adc_channels, + .num_channels =3D ARRAY_SIZE(simple_2chan_adc_channels), + .refname =3D "vdd", + .other_regulators =3D &bd79104_regulators, + .num_other_regulators =3D 1, +}; + +static const struct adc128_configuration bd79102_config =3D { + .channels =3D simple_4chan_adc_channels, + .num_channels =3D ARRAY_SIZE(simple_4chan_adc_channels), + .refname =3D "vdd", + .other_regulators =3D &bd79104_regulators, + .num_other_regulators =3D 1, +}; + static const struct adc128_configuration bd79104_config =3D { .channels =3D simple_8chan_adc_channels, .num_channels =3D ARRAY_SIZE(simple_8chan_adc_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 --stQVvdqvZQ7uOc1t Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEIx+f8wZb28fLKEhTeFA3/03aocUFAmii4JEACgkQeFA3/03a ocXYcwf/W2Qd3O6/fc/iY1FVO+L23BNP9uJJcySfQqdCsT8UKfu8My3UfkUq6WaV QmPgfhRmQYcf5A8JTgX4m8E6ll7pRJ/MfbYgXN4ZdgDyPa1Zbz/hf8NbM7rw0f5D t8KkZ2DY/EVQv5DC5Y/225Y5iCbHEntY/qot8eWGb7C85lPgZLUUgPhEQ8dVubSI 4tQLYfOBeSiGKxA5wJrsStHaGWjbP+zSB8U91NIn/B4D0GPnElcghKdJdjnzfRn2 DymDCyhwFZIqVOb8LrgNSVu0Vgm/mYgIn0w+eCYEp3cQTICVvgARLaKX0mjAE+S3 Efl7JtN3xgB9dtzEM4HKyL6Vi9wt/Q== =Ngj8 -----END PGP SIGNATURE----- --stQVvdqvZQ7uOc1t--