Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp656443lqb; Wed, 29 May 2024 07:03:43 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU3NdrAq+aRMUTg3RR8emTfZobmvO4fyARdBr1PKspn/JwYP2qDIXpa50/LvzR3erU2b531kC5D8hxFNFamsm2I3fYBTBRfb2/xsUruEA== X-Google-Smtp-Source: AGHT+IH29Bl+xyqGJwadCyvJDtfKgh7xXaenEeTfpVqFcw6hld+Nh9qZ7wAO3QFydrGs63aOWJ/x X-Received: by 2002:ac8:7e8e:0:b0:43d:e16b:d8fb with SMTP id d75a77b69052e-43fb0ef0c43mr202900571cf.54.1716991422732; Wed, 29 May 2024 07:03:42 -0700 (PDT) Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d75a77b69052e-43fdb7284b8si37790041cf.319.2024.05.29.07.03.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 May 2024 07:03:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-194220-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=VxNOqsOR; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-194220-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-194220-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (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 ny.mirrors.kernel.org (Postfix) with ESMTPS id B972F1C2191E for ; Wed, 29 May 2024 14:03:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D23EC1CAB9; Wed, 29 May 2024 14:03:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VxNOqsOR" Received: from mail-ed1-f43.google.com (mail-ed1-f43.google.com [209.85.208.43]) (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 81B2012B95; Wed, 29 May 2024 14:03:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716991414; cv=none; b=C2bdksmd61A7hSbiMIfOm8KLNngSzg5qsOknt8qq4WnzRSRXidXcx4L5DurvyV41cL6KqXfG02B6vV1rnYC49k7DZr5/QSOBEm8vp5zf4+mnQ2qf+J74iZBj9bYA0LxgCvUuZSsbQjlcYcsKDBhXc8a5bRdwgVrgx3+nvJ8lj08= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716991414; c=relaxed/simple; bh=WjdW1FP762sEgNbUJdyYCjRIv0VEhWJXADENEQ+EJdM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=FnCbXCveLNRTvbSDgOcysVjhIoY8zMgIknlk2JdIGxlQVxYPmiKm+CbLZz24CR8vHoIq42ufg0nCkHbAWTCXylzvaXG29B2cWRUujXm/H0C0j5Gv/P8TTonObp04oBuk/QQUPv/0EsX5Yt2NMIHVlb31hImBO2LYqcPyBzFcras= 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=VxNOqsOR; arc=none smtp.client-ip=209.85.208.43 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-ed1-f43.google.com with SMTP id 4fb4d7f45d1cf-5785c1e7448so2121717a12.2; Wed, 29 May 2024 07:03:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716991410; x=1717596210; 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=F1ujdDEYUIIkAJTFHWvU9CFPTnOkFnbvdnN/RkQMKsY=; b=VxNOqsOR2+Wv2aPaUyuqALu/rEiZG0u8IlrrZMZGJ3DouUVUE0AKugwiMNhtRwLq3d 1EbB6CP4riSiOZ7Ynvd/t/IAHEQYHrOiCO3cHnd3BpjfprgeziDHZVLvQTzhPskfCjPY ZItaqq5OIPkSYvoAqp6/R303W1C7i3TzW0VGWivH+TiK96pJbHAahfV4+u5mjAsAfs7E NRKhxthsQGkaz3CLkCQjWhe0IgE00ktWg2Qrb6MhhRSU4CntP9X9MvdZEm0EXvBoEyK5 4LUoAE6fLVDxPVdu4nWJawuBjo6n/o9m2rAruguLWukP15TCNOP8Zq0/FOoaW91gYba8 lfow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716991410; x=1717596210; 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=F1ujdDEYUIIkAJTFHWvU9CFPTnOkFnbvdnN/RkQMKsY=; b=kFzeu3R3Vyjtd8xFovHRS7i+IVHxVX3To0VmO7PWVVpgDsD9q89XC0LegMOrQYlytg JlzxjWrBnmOHYRGucJcGexyz7pKKZurWv/NefwNM9o5dYc41tIz4RUh80UK+fGX+fQIm ljluXI1s7s4g6Xgv3Rks2FYSKU354q3p6+1N83IZQGEh/Cn1NyHOYwKb+WXDEM2txHhZ P4Ucu+EWMdrZc5Gpfc2JXBnRpLn673MQ2TedTubT4FGHIMouE1ZggS+v8TAGnziCPi+1 WykS2HfNJzu3SdmEdI75KcsMmw60YgEwkJsIz/vE5adyQrcf6/aE43F5jd4V9Gr0K4aS HlQQ== X-Forwarded-Encrypted: i=1; AJvYcCUVwxyzngXBcajkaJaCixg/IM+9FKTgvyKZ9ftvJvRgUoPyeLQRW6Njh2M/072KMiT5NfhxMBfk979q9tv2JxZhxV+qYy6SUnS6ZPQ7er1FgF3HW9po9hQt9nWew957j8NA9VWkX+zdl8K+Hy2hLkw5VdOqlq4yCPy9UiXczvPb2wdywQ== X-Gm-Message-State: AOJu0YyVpofDRxmj4Gq2wgwlsDKCiuOKZrwK4R7q0cgS1n46m7U0O7Xo iL6JCK+TAS2bNsMbvLHr2Cxi6I5xt/oOToH3qapPqJAD6Op6IZO8 X-Received: by 2002:a50:c359:0:b0:578:5ee4:921f with SMTP id 4fb4d7f45d1cf-5785ee495f6mr9808278a12.13.1716991409673; Wed, 29 May 2024 07:03:29 -0700 (PDT) Received: from [192.168.0.137] ([188.24.75.156]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5785234a7efsm8555915a12.4.2024.05.29.07.03.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 29 May 2024 07:03:29 -0700 (PDT) Message-ID: <917bc1d9-fbdc-4ca2-a156-813b57c8201e@gmail.com> Date: Wed, 29 May 2024 17:03:27 +0300 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: =?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 , David Lechner , 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> Content-Language: en-US From: "Ceclan, Dumitru" In-Reply-To: <6f18184de4a37993baedc15b44ecf0a6834a24d1.camel@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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? .. >> + ret = fwnode_property_match_property_string(child, >> +     "adi,channel-type", >> +     ad7173_channel_types, >> +     >> ARRAY_SIZE(ad7173_channel_types)); >> + chan->differential = (ret < 0 || ret == AD7173_CHAN_DIFFERENTIAL) >> + ? 1 : 0; > > I don't think we should treat 'ret < 0' has a differential channel. Any reason for > it? For me, it's just an invalid property value given by the user... > Yes, as that would be the default value if it's missing or invalid > - Nuno Sá >