Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp1101535lqb; Wed, 29 May 2024 23:26:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVyMTlKoahJ4yw6tBUaSwDmTXo+MVJl24LI95UK9N5YGNcxS4cCvnDm+0QurYYBMcJTrl95dTdZtltvhSSydnjynSqa56JlmYTG0AQSUw== X-Google-Smtp-Source: AGHT+IHvom0JZrd6UhftjMJEcoqjpTNMzkvQPZ8jhd0GgAGPOmGjjTiC5jOqKKm/IxD4+u5E5kCN X-Received: by 2002:a17:90a:2ecb:b0:2c0:11d4:b2dc with SMTP id 98e67ed59e1d1-2c1abc39372mr1191856a91.24.1717050362547; Wed, 29 May 2024 23:26:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717050362; cv=pass; d=google.com; s=arc-20160816; b=hj3gFzx6kyXk5joJMXxa96BvVfyy1FLKSfJe8xcqreAlfN9+PXzDaHSujV4YOQpil9 9msrzZH0bP4X9f7Q06oQU2M53u1KR+kf7MAVoskH+YZ8vQNqc/OggPQBXEwqfLivqgb+ hZQXG9YZzIvNdIRygAUsn+ybZgsvOQ4+lP0gp34zLJWvqC7TWw3YWBW/e4otPYxTNzcg xh2s9gYsx4EblXRnHtk+EZtWkf4X7iXmDhvKYtP7aI5QhyWRaDVVRZpfDb7DBlV4pMI0 Lrm/czUZpUuVJBYu/FQhRn/IhwSeLn9Mb8HmrltuirfMm2Y6O069VXsQQUQr4cqlrRLk kMew== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:references:in-reply-to:date:cc :to:from:subject:message-id:dkim-signature; bh=nGB5azc1AWOxeIywWywVSQOrQTdtCakw86KhzarLqxg=; fh=dwScmTz4odqtM/OIglDw47Uf1ZrIcFWJ7Imgwra7b6U=; b=Vlu+iioRO2wi2VnBkSgUXZX2kfkIo04/09wsLQwk2SBADTw2A3JtYxW1yz4QbSeZyY aXRZUx4KX5W+aFX81G9wvbjL+ZgMM55nn6SVDSE5X5pyGl+GpVHBc/l1bWPF00C9xc4Q 5RQ3UEq83ARBN8AYgnNHkyTXiaawF3o3M8BPwjNQpjhgJTCjyVWJIAXYuJUmIHctKgde /mWshRyHrw7nPUVwKLlfetzite0c7KX79NeINbmRE7USAFnl5arCk9HF88I21tcAtmJs jBMzTWyy13NgNYE3bctgfMtnnIHaND/nVKW9LBsgIkbgc92Q1VVdqEnuAKs9K0UztbyN MtAg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=W1i+QwSG; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-194984-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-194984-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2c1a779712dsi1038145a91.114.2024.05.29.23.26.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 May 2024 23:26:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-194984-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=W1i+QwSG; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-194984-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-194984-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 4CE5128613C for ; Thu, 30 May 2024 06:20:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E548D155386; Thu, 30 May 2024 06:20:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="W1i+QwSG" Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.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 7B082143897; Thu, 30 May 2024 06:20:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717050002; cv=none; b=eDZ4DvARdvHf/bzw3OCakK82Qvc0yS2UgmKWLEXe0Z1oJhxKq4SZag8I2TQcAMUJZySFYZFMeXGijUaW84Xwu+eEM84uA9mI9nGippnecR+qhX0ncoreWO50vWv6ulWArvHjMLg+ta738N2dtg29mkb0aX8ok//EiQb5Em9vuAQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717050002; c=relaxed/simple; bh=Fe2d2A4z7f9CwxyiKX6pKntbe4v643xdTxApAlhvcfg=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=BwMSevkHR/QfUjCQtwp+sREzJJQ3Zj3YJBU5d4mu37v+/jNScWCauKtw8i0wOkQzC1ppKSiGMNjxuOS8FVOttA8H7IbPuOSXE4HV2SCmSEsIMoIZmQnMJdIVE5G6el6I2WGkLV5uAv1AX5MDdKc+l1F2HbKSu2QpVAX4/OcmMzs= 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=W1i+QwSG; arc=none smtp.client-ip=209.85.128.53 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 Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-420180b59b7so6505745e9.0; Wed, 29 May 2024 23:20:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717049999; x=1717654799; 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=nGB5azc1AWOxeIywWywVSQOrQTdtCakw86KhzarLqxg=; b=W1i+QwSGN0HgnNPZ8BxXcjVbdsKkyGXSRk5CNxB6fJWc4XjmzPyQalJHonpeLGG9lm S1ubpsJQ2lm5zdMnxqyUoWi248yYJcYu4ndLBVwA/aNDya5IPcU0mwKNROgJwHPMBfrq rU5SpI/3iePD5pbvk3zew+sk+ZGCASs5g47FG8tLx+ysYd/0pnnD7/KSSkw+ZuObsDRN HAVbaotSr0NDd/7EYMceq23dRTIBG0hQUI1b/ykL9M9DBVcWwEJJ2166YoQMe23/lxIj 2SHAVVW3OLluSzpYiY1YIYEEoip5VKHDHQG0Mzc/8aQmx4vGdStKlP6qPQv2Ug4kBiyH rwwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717049999; x=1717654799; 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=nGB5azc1AWOxeIywWywVSQOrQTdtCakw86KhzarLqxg=; b=esc35zJmbiM1Y7n/2/MOktQjDghGmCi8fKVnd+Uau+MjC2bTKc8Xm4wDsFBI7G4GbO CMEcDIp67wskhO8ut2rn4DGNsjNxI6Zrr+swFdwu84kpq5MvV6TPMGNcZP2iqmQ5A1er K9fOzstzel19JhlTIngD4C34qF5PI7qPXOGlJyQs6J/MvDXTGQecyT63QCaS9TAFqAeL XB2/Al2SdCnsNl3Io0NlAVNawhnVfS9oI75EQ0Al+smhKcFBsGe0mq7Wi4tk2mccQ6OM zYKng9ATOimSKEGziyceI3yELXjUMFDsj8FLpBp1tG+BQU+N9vWJuhBps7A8lYl+5iEK 7zFQ== X-Forwarded-Encrypted: i=1; AJvYcCXdQ7a5Xbx7kmBBSyyY2EpivHfKUj/Cm7J8iqKCX85ZAY+5zg5iE+A9h55z1Q3vacXYDVURwQ1O/PeM+P+yreOwzNH4mTgaQacU97oGU2VEVK2jtKr4KHWu5ghvNu3vnfaHumyvVfES18RomxYsol8qzql9HtNE05gUlufByziCheDRhA== X-Gm-Message-State: AOJu0Yw7i5pNT4/ialbdZh0MdkY/gezW3iF+l7XC9c6yYyyjLMZyvFG+ IIyGo+M7tC2LhlQIKj8hZQ/5PGgAuuEb1MOmxijqtlzWdI0VDHOx X-Received: by 2002:a05:6000:364:b0:34c:9a04:466f with SMTP id ffacd0b85a97d-35dc00be96cmr710514f8f.50.1717049998317; Wed, 29 May 2024 23:19:58 -0700 (PDT) Received: from ?IPv6:2001:a61:35f9:9001:40df:88bb:5090:7ab6? ([2001:a61:35f9:9001:40df:88bb:5090:7ab6]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35b1d7a496asm6704409f8f.87.2024.05.29.23.19.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 May 2024 23:19:58 -0700 (PDT) Message-ID: Subject: Re: [PATCH v3 5/6] iio: adc: ad7173: Add support for AD411x devices From: Nuno =?ISO-8859-1?Q?S=E1?= To: David Lechner , "Ceclan, Dumitru" , 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 Date: Thu, 30 May 2024 08:19:57 +0200 In-Reply-To: <30192c2a-5275-41ac-bc20-aa5f436846a3@baylibre.com> 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> <30192c2a-5275-41ac-bc20-aa5f436846a3@baylibre.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.52.1 (3.52.1-1.fc40) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Wed, 2024-05-29 at 15:59 -0500, David Lechner wrote: > On 5/29/24 9:03 AM, Ceclan, Dumitru wrote: > > On 29/05/2024 15:46, Nuno S=C3=A1 wrote: > > > On Mon, 2024-05-27 at 20:02 +0300, Dumitru Ceclan via B4 Relay wrote: > > > > From: Dumitru Ceclan > >=20 > > ... > >=20 > > > > =C2=A0static const struct ad7173_device_info ad7173_device_info[] = =3D { > > > > + [ID_AD4111] =3D { > > > > + .name =3D "ad4111", > > > > + .id =3D AD7173_AD4111_AD4112_AD4114_ID, > > > > + .num_voltage_inputs_with_divider =3D 8, > > > > + .num_channels =3D 16, > > > > + .num_configs =3D 8, > > > > + .num_voltage_inputs =3D 8, > > > > + .num_gpios =3D 2, > > > > + .higher_gpio_bits =3D true, > > > > + .has_temp =3D true, > > > > + .has_vcom_input =3D true, > > > > + .has_input_buf =3D true, > > > > + .has_current_inputs =3D true, > > > > + .has_int_ref =3D true, > > > > + .clock =3D 2 * HZ_PER_MHZ, > > > > + .sinc5_data_rates =3D ad7173_sinc5_data_rates, > > > > + .num_sinc5_data_rates =3D ARRAY_SIZE(ad7173_sinc5_data_rates), > > > > + }, > > >=20 > > > At some point it would be nice to drop the ad7173_device_info array..= . > > >=20 > > What are good alternatives to this? >=20 > 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. >=20 > It would let us get rid of enum ad7173_ids, have one level less > indent on each static const struct ad7173_device_info and=20 >=20 > { .compatible =3D "adi,ad7172-2", .data =3D &ad7173_device_info }, >=20 > would now fit on one line since we no longer need the array > index. >=20 Exactly... But up to you to do it now or defer it to a later patch. - Nuno S=C3=A1