Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2085897lqz; Tue, 2 Apr 2024 07:00:45 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXDVS2qxkgebbLauYMcDgMdUglf0zEoHuCqWy4HqeV7imc/pDRshmAEoiH7+88yO72WNzyRTFqxDG0OmVnohxYa/j/SheFq17SgGHPZ+w== X-Google-Smtp-Source: AGHT+IGkkumtwmVlrCnPs417aDNQrP/QVF7m+5F1yH2uVJanMr1oXjxSQU2d+vGtqiVc1pUjLeMU X-Received: by 2002:a05:622a:295:b0:432:b6ae:f68a with SMTP id z21-20020a05622a029500b00432b6aef68amr16841756qtw.53.1712066444571; Tue, 02 Apr 2024 07:00:44 -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 a10-20020a05622a064a00b00431826d1ac5si12037811qtb.310.2024.04.02.07.00.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 07:00:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-128090-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=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=RpaHx4tC; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-128090-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-128090-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 478CD1C22497 for ; Tue, 2 Apr 2024 14:00:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A7A9685651; Tue, 2 Apr 2024 14:00:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="RpaHx4tC" Received: from mail-lj1-f182.google.com (mail-lj1-f182.google.com [209.85.208.182]) (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 49C5982893 for ; Tue, 2 Apr 2024 14:00:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712066425; cv=none; b=SXEaslHtrYl+Q6YEo83H6WNURD7TOt6/6ODojegdTcolvWTbK5as2GxtcoPP0Gfsy4CeKuYlDzN+0iYRRLQDqNTHbQBx+tT2MYW/DYw7eDwW+MS6V/y/lzLGgeQTCMrIKFCISZGda69DZOF/gcaEumbkxlMGobJ0s5p4owONxFg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712066425; c=relaxed/simple; bh=zQsUVohe62XDCv8RPmVhbR0HOvcb2ANjyDfd2BTRSTA=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=dQMGQ3rle+rRgw9JmYXuOu45s7b+oQIWroB/3rUIqLFGJS4P7u+IlxzqIdR98WdQztEjaDy0eSmGpC4DtzuoNQjIQdbBPNFe4pqLjRtE/O+HwrYqdSFw0PTH+dBbetlpU443gqUje1mKJOEBOo5cPXwLXGlon4BLHazomUUQxJc= 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=RpaHx4tC; arc=none smtp.client-ip=209.85.208.182 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-lj1-f182.google.com with SMTP id 38308e7fff4ca-2d82713f473so17418421fa.3 for ; Tue, 02 Apr 2024 07:00:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1712066421; x=1712671221; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=8rDbZVm/05+TD8i00zno4F1FPbK9cGt0EA7D+/0NFvM=; b=RpaHx4tCJ3BDi1LLkthbtY6JG/Zklfc19v14leIe4bGroL1Y29/a9k9R3ZdmD7pZ0n U6Nnp5IqS6lJ6H93XpfLsjwovzdOG1INNTRZu5tXeyg7oRqAeDQxOqrqzXDrDFZMGXBy bZsytrh2FxMjzozGNVEgEUQskkDZ94Mj4oH01DybFJVEk1eSJe8GOwSTFN7JpL9UoI0d ZviYNMcovL0sRChW5cDxNzEsEgwTCAmIXqpDYldWUC/OkDYNEPcmZID9V62HLvAKHmVR X6V7S0brqQS+Q9gDrsR6MCSxuO37S0fbquuAsNnfw39Jgpu+okcAt8VQwdK6VmFEHfr9 h27g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712066421; x=1712671221; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8rDbZVm/05+TD8i00zno4F1FPbK9cGt0EA7D+/0NFvM=; b=TSSE3sJvkfeKEss4XKzfxZrm7r4Y6pgTW3GeBk8jubaBpBT3RkVAaWGCXXpcDzUxYL t6FmcdkNTWYCawG/uulNYJtqi5K6/SvCtLX9j4FtYU1H2UgeTA5LKqfhECxjCUfYw/Bz sm50lZm5se/da99o6W8IEcMe3nl7hbFjkv+dSvpGRH2rwlEFR/cbjxsRsukOWrLpCHRZ 9HrBIMJLwENdkrTES3yB8CCIxPSgJSjbwWMg+hK8hWMwhhN0NqnF9KZNnXz9e/ViDckY K4PllDIMzm3pQOvtAof7qLbv0QD3zOkHkL6FhVJfB9LV+QbZoy+tPmhSq6ecYrwBrYWq LNoQ== X-Forwarded-Encrypted: i=1; AJvYcCXKQohbD35h/1CDYHoTXTrVaXGQwViSvW3Xr2LFIqe/H2VZmJkg5Wd9fBXIWi4qv+ms2+dYgEYGSVm0W3m+5Y+BM2RxdstOodZGEzqL X-Gm-Message-State: AOJu0Ywxl79Tpz64zaJ8Hz6u/rRZTYUvQboI6KQ/g9x7uFIepPMoiwV2 98uZuBIO4lik30eSujwnKNu9VtLoViwluRCNcbv6F8WgGGKZbTmB1RwfefBwidUPsRLASW5dsbx QN088a/Yl67IUKlLuwFwEj2sMm5MtB8V4sjQKGg== X-Received: by 2002:a2e:8049:0:b0:2d6:8868:f1a6 with SMTP id p9-20020a2e8049000000b002d68868f1a6mr1601468ljg.43.1712066421456; Tue, 02 Apr 2024 07:00:21 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240401-ad4111-v1-0-34618a9cc502@analog.com> <20240401-ad4111-v1-6-34618a9cc502@analog.com> In-Reply-To: From: David Lechner Date: Tue, 2 Apr 2024 09:00:10 -0500 Message-ID: Subject: Re: [PATCH 6/6] iio: adc: ad7173: Add support for AD411x devices To: 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, Dumitru Ceclan Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Apr 1, 2024 at 2:45=E2=80=AFPM David Lechner wrote: > > On Mon, Apr 1, 2024 at 10:10=E2=80=AFAM Dumitru Ceclan via B4 Relay > wrote: > > > > From: Dumitru Ceclan > > > > Add support for AD4111/AD4112/AD4114/AD4115/AD4116. > > .. > > @@ -1028,15 +1204,22 @@ static int ad7173_fw_parse_channel_config(struc= t iio_dev *indio_dev) > > *chan =3D ad7173_channel_template; > > chan->address =3D chan_index; > > chan->scan_index =3D chan_index; > > - chan->channel =3D ain[0]; > > - chan->channel2 =3D ain[1]; > > - chan->differential =3D true; > > > > - chan_st_priv->ain =3D AD7173_CH_ADDRESS(ain[0], ain[1])= ; > > + if (reg >=3D AD4111_CURRENT_CHAN_CUTOFF) { > > + chan->type =3D IIO_CURRENT; > > + chan->channel =3D ain[0]; > > + chan_st_priv->ain =3D ad4111_current_channel_co= nfig[ain[0]]; > > + } else { > > + chan->channel =3D ain[0]; > > + chan->channel2 =3D ain[1]; > > + chan->differential =3D true; > > Expecting chan->differential =3D false when ADCIN15 is configured for > pseudo-differential inputs. > > Also, perhaps missed in previous reviews, I would expect > chan->differential =3D false when channels are used as single-ended. > After sleeping on it, I came to the concision that these parts are probably too complex to try to worry about differential vs. pseudo-differential/single-ended (what the datasheet calls single-ended is really pseudo-differential). So I take back my comments about expecting differential =3D false in those = cases.