Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp895299lqb; Wed, 29 May 2024 14:00:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU0nKz+oRJBOUe40RpHExFWA0K4h/6XFtAKdFaSB5aX0qU3r7UND9ET1i1UXip1hFWoG6ajveBaJcLBiCn9mkWZi4JR+M63s98rn8KWbA== X-Google-Smtp-Source: AGHT+IGP0PQ8Kh4h71gmTjEa9x7ETWYtq6ZafgiEDPM9ktnpcCZ6ufNdMKBaikasKRHpB/pccF4o X-Received: by 2002:a05:600c:4f82:b0:41a:f9db:88ac with SMTP id 5b1f17b1804b1-4212781e544mr3182445e9.14.1717016408119; Wed, 29 May 2024 14:00:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717016408; cv=pass; d=google.com; s=arc-20160816; b=ONfrqvZYt0Qb0sCMKlocs7F8AGt2m0U45LlHPYkQQhoMkG51/C06Mf2TM1ZEDu+rGV pBrqvRzNidnyTiiJGwPF/yz1N+QQ2SWvwQVDlK1+1FK7CkQw2gXRAjXEb7z1sc5K8k1D EqN7wgsh5UsIx5PE380cN56RQky1jEp5myBRSdyihATXgbI96nI+az8ceqqPLDDB2POB 5ycIvcw3Np04ZE0W3WYHztMfVW2qFZQL1rZ2NJFdhapzM9HDn60g2KafbnLbtr8LnQY9 fWCyOOw8/7M6j9vM3/BUSXNCt1Rt+O+khqyXgncjpsEEAhIenNttXOHVHw+HFK+Pya9R zVFQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=Xcrwlkn4PrmA7KBIZPAmKm202+tU7DhEeT3No0NEPIQ=; fh=vzNaARcT5U5XnqHB1CaPcJiPBKX92wSAPYx8djTZrKs=; b=y836jYiVBDZK0W885OGCd6zRxEPOdHOu84xnYH/cagvMQ60oSAwmCWDuRljJRYSFNk IAtBakRWGjVgXA3/2NrtuZmkVrCkpTmfhwGt62z4FULo5djiwbpZ7QYpf1J77lKL1dmS Ic4K2eVwU1p9c8wjR6CSBihmGXDH1vUwL85ObBhbXamK9xg+Cqe9/KGSw3R4hrnHdB5f pe/9YVgQ6sqHqG1IX0buSjlKR1o3E89KMj8dqvBelnEglHd3esHLOyLDXWEkI71Rtref eoE4PGsy9EDqHxbw183Ph/LbtF7hCAnaadD+/UV+JesIchvDVKJxvIE8lWM52A+jX84Y tQgA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=ajLQpywN; arc=pass (i=1 spf=pass spfdomain=baylibre.com dkim=pass dkdomain=baylibre-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-194684-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-194684-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a626cc68d3fsi700821966b.680.2024.05.29.14.00.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 May 2024 14:00:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-194684-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=ajLQpywN; arc=pass (i=1 spf=pass spfdomain=baylibre.com dkim=pass dkdomain=baylibre-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-194684-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-194684-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id B60A81F24965 for ; Wed, 29 May 2024 21:00:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 799A01C8FD0; Wed, 29 May 2024 20:59:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="ajLQpywN" Received: from mail-ot1-f42.google.com (mail-ot1-f42.google.com [209.85.210.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 AB8DB184125 for ; Wed, 29 May 2024 20:59:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717016398; cv=none; b=p2LXf07DghRxA/RSRhIJLV9/ZQuJZc3HNgNmS5ZnlIw4BXzeygvdNHxBpHTph09GguQEgILPTbzmPfBCnNu8WoTfDRG3itLQChvpkvre4t7qNmn7CK17i5sgHrGdKQ8GBG++rDbedu6/Q1Nc8iZnuR3NPBKAnlwupOg05OJdl4w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717016398; c=relaxed/simple; bh=0JIEoFJ3JrSuAxA+52iofxCdH9Ed8ss6mxR9tqmYJzI=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=ZwkYQVUaHyrnWdZcEkpd2bwtfxvn8jk7U+wCf3Ug0hbSltcR5i2vuMZWhCnKrAvCy3kt6Uw81qb45FQm8cWyN9X+7cQez7hOy92i1+D8awkSqCLwLqX/EWIfB9FsbAbQZwELEdoD9K7xkGodDs3j1R/iIAChJtfVssfXm+cx+7o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=ajLQpywN; arc=none smtp.client-ip=209.85.210.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Received: by mail-ot1-f42.google.com with SMTP id 46e09a7af769-6f8ef894ecdso138824a34.1 for ; Wed, 29 May 2024 13:59:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1717016396; x=1717621196; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Xcrwlkn4PrmA7KBIZPAmKm202+tU7DhEeT3No0NEPIQ=; b=ajLQpywNx4mBdSL/A2qg8MNLiT2shdinHllQOOjGtOJqmhnfgrfMO2ypF8Ux7HklyU 9kVUyp5tSCYssmT2JWSl0GxXMfZT5T6c1jHFIM1ucyhydbbalnnA+/NWSOtN9bkK7pEu Qd7Z3dgVMbm2SURteI1Oxm7U03kGOB5hZxSqV1MAu0G+QFcvWyFVmCJ7ZzoRX9totJwu 07AhoYSGV15yG7D+kHvdhOuF5vAXhvKjZtmw/lnv22qIUHWJSRbhpJ0LcP1GTnFzhVFs ZUaYb5FiNyErwL1buBbetavGZ1e0RywVxlJZJ8+6WHxFFOI1EUQL0Fs9tDq6ysg/kmDV 8cfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717016396; x=1717621196; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Xcrwlkn4PrmA7KBIZPAmKm202+tU7DhEeT3No0NEPIQ=; b=Bgk5iWTqQtWq6lPLIGx4FCRg8bYRSkmAoWvLt8ws0D4Y07k9UMP7krnl8X4KDBzoy+ JshgtkNC4f22RtW5jylJy+yCBjZp68eOlL5JalWacKyLRqWRXcnbdrA4eShbgLt3gjOD R9Oz0uL0v/UqhlWSw1glqJ4HNjtgVL9dsv5JNsMb5hGHEb8+7mfePTop+TDpr2rvbUYl eGcOdjOoTV/wVNYcHu5q48lo0mYyPQ5kPlTn91yBHjCpt7ibLotgUGs5dVb9JPIVLwcr odBIjd2wZqhHTam3d8hPd92WtTwXYFElIAB9y1VHPMfJKK0QbRl5kGFALiaKJ+/U27E0 MZ8g== X-Forwarded-Encrypted: i=1; AJvYcCXjn9WFijU75OJ7ua0HrxJyUg8U8g3DKduHYzEZ3iMQyUnCP0nrKpWvR8iT3DPYiCC5p3317WfG+k2csTbqnVNYnG9ndFZoTf8bsR84 X-Gm-Message-State: AOJu0YyVkWJvqAq4yjOI7zV0B+5K0OPzi1qfQPOgjIVDTd3bmUWr5XSS h+psDppSacrcAFbNXc3yEWDe8q/WdATa0ixoTQUiUohodg9hc/Sg+FZRxxql9MM= X-Received: by 2002:a05:6830:4490:b0:6f0:47a2:c1ab with SMTP id 46e09a7af769-6f90aeaf329mr354404a34.16.1717016395753; Wed, 29 May 2024 13:59:55 -0700 (PDT) Received: from [192.168.0.142] (ip98-183-112-25.ok.ok.cox.net. [98.183.112.25]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-6f8d11ea076sm2413525a34.58.2024.05.29.13.59.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 29 May 2024 13:59:55 -0700 (PDT) Message-ID: <30192c2a-5275-41ac-bc20-aa5f436846a3@baylibre.com> Date: Wed, 29 May 2024 15:59:54 -0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 5/6] iio: adc: ad7173: Add support for AD411x devices To: "Ceclan, Dumitru" , =?UTF-8?Q?Nuno_S=C3=A1?= , dumitru.ceclan@analog.com Cc: Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: <20240527-ad4111-v3-0-7e9eddbbd3eb@analog.com> <20240527-ad4111-v3-5-7e9eddbbd3eb@analog.com> <6f18184de4a37993baedc15b44ecf0a6834a24d1.camel@gmail.com> <917bc1d9-fbdc-4ca2-a156-813b57c8201e@gmail.com> Content-Language: en-US From: David Lechner In-Reply-To: <917bc1d9-fbdc-4ca2-a156-813b57c8201e@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 5/29/24 9:03 AM, Ceclan, Dumitru wrote: > On 29/05/2024 15:46, Nuno Sá wrote: >> On Mon, 2024-05-27 at 20:02 +0300, Dumitru Ceclan via B4 Relay wrote: >>> From: Dumitru Ceclan > > ... > >>>  static const struct ad7173_device_info ad7173_device_info[] = { >>> + [ID_AD4111] = { >>> + .name = "ad4111", >>> + .id = AD7173_AD4111_AD4112_AD4114_ID, >>> + .num_voltage_inputs_with_divider = 8, >>> + .num_channels = 16, >>> + .num_configs = 8, >>> + .num_voltage_inputs = 8, >>> + .num_gpios = 2, >>> + .higher_gpio_bits = true, >>> + .has_temp = true, >>> + .has_vcom_input = true, >>> + .has_input_buf = true, >>> + .has_current_inputs = true, >>> + .has_int_ref = true, >>> + .clock = 2 * HZ_PER_MHZ, >>> + .sinc5_data_rates = ad7173_sinc5_data_rates, >>> + .num_sinc5_data_rates = ARRAY_SIZE(ad7173_sinc5_data_rates), >>> + }, >> >> At some point it would be nice to drop the ad7173_device_info array... >> > What are good alternatives to this? Drivers like ad7091r8 have individual static struct ad7091r_init_info instead of putting them all in an array. I like doing it that way because it makes less code to read compared to having the array. It would let us get rid of enum ad7173_ids, have one level less indent on each static const struct ad7173_device_info and { .compatible = "adi,ad7172-2", .data = &ad7173_device_info }, would now fit on one line since we no longer need the array index.