Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp1350385lqs; Sat, 15 Jun 2024 05:25:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVXULaSXMnxVaLqQLv6mZ/4aluJ2uSFPJuQWzo3FzpNytat+Aw+RUJCotLqMJ45t8fa1qdU4tknybb5oDuDlMjeVOyq32x+3AXfCQoK1w== X-Google-Smtp-Source: AGHT+IFtMbQnDH50s+pnw/Gp7jMmiU5OSWrvJxxbCZkLtimbTVNXxeJRqBo60hprxNkOaySNsjn7 X-Received: by 2002:a17:907:76c2:b0:a6f:5b98:bfa5 with SMTP id a640c23a62f3a-a6f60dc3636mr341498966b.52.1718454330954; Sat, 15 Jun 2024 05:25:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718454330; cv=pass; d=google.com; s=arc-20160816; b=JOUYPjbo4wPwt82348U/QjEEIoDtOVYU4xOLPT46F9nWFXK3V2xjkNjJJbM7A1qa6V ajq32c0bvH+ScjjTLK8rWKAD0ivgRwEy+P7Z637cOpOMa5VmkuiBEKaAJ3RJ52fPHDAG 4HFJhFXgcNqqu0vZAPRKoOQMXRXNjgIaus48whehbKXv2wYNKJJTyFubQ1HalRShEZrr zpX7yHULzQLs1P23hjHMWLsDBJRXdfZHal4XVQIN6WEybe1NCw2Fq/FvVDvZjpZSmxcF N3lKKwnhy8d6Zpy75MwpzpnTHDrC+FrXeVnbtw2fxFRrlht5T0DCobEe8YSXFbpR8gPF /YKA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=i09NhHA0eE6lKDfmj+xJWh1Gc/pf5+TIbIp74wanX4U=; fh=Sy5pbK/p4nDok58JSDVKFYsvxmPw0ncwD10tjSrbRRE=; b=BUhOpF8VaT+1Ku+MfEEvkHOMNMXXdr0lS0xnSgEVr4Yzev2WxHpOucygUKmbrwA9il Rv4oqK9Tb7q5HNCGWQGU/nf43ym+5TEyV3k+yQPkMeGkqUgFkBecns0PrFCR08cuYYMy pS8ZTNZMlywgBERhJCCepjY491H+0XrzDmaW5bOB0X5jjMbnQ5bRvJkYqXeKTCPQiy/n QjNQtZBs071EmAYdTG4xCU/bonfNzgG+pfY1O6LcvtGGj5nVHLdltdhuNg4d+Qp0INaj cZ3+d91NIyTtKBAwhxcsnd63XNERRrAwB8PJmir4FZZkEz9s6sD6Y6aDHurPB8q6bFug O3cw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tNBwABJ2; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-215881-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215881-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a6f56d210a5si284645866b.196.2024.06.15.05.25.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Jun 2024 05:25:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-215881-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tNBwABJ2; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-215881-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215881-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 720B61F21BCF for ; Sat, 15 Jun 2024 12:25:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9762347F41; Sat, 15 Jun 2024 12:25:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="tNBwABJ2" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A1F453C062; Sat, 15 Jun 2024 12:25:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718454320; cv=none; b=LAUUYXQ89XIvEkoYtXxifxR1rzzob40fcHvwiTl/zQLOxv2Qe5qdDAzOGp2IYVa7sEnEgCQpRZyiWvNy/sjl7RlDSvwsBVXmdREuMrii42TVAAp5UxzbnxgFuGFeJtxuq714NaavldYAHXmWb5WcxW27voHcTIYKET+Kg+g8jAk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718454320; c=relaxed/simple; bh=ISVbu2fxZ1eV2uEqGAczzn9y7Z8gAktw7YuOOBLJ0/E=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Q5eyTMqfOol8AFaBwTC4Q1E/IBjJYKKC5JP2brbJoh1fs+YGJtAInjYeRIKkMOm/eZcimOjGwRNp3EgpkUJPMJTKp4Fbl5XAGv8RezORh9UlWdxc6Fo6SzBs/JLlPf3+nNrPExMjEk2oQR+8lD/wawZn16yzhc++UWMzCwgZ7HA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=tNBwABJ2; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 749AAC116B1; Sat, 15 Jun 2024 12:25:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718454320; bh=ISVbu2fxZ1eV2uEqGAczzn9y7Z8gAktw7YuOOBLJ0/E=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=tNBwABJ2oDk9VHb+Z0px0Kw7I7IDolqlz/RlhNdk5Scfth6uJX/MjndFF5MnzWiv2 7PuMRFdxklKAqxN272F8XBrWQgunsSa5x80VTCr1okVpkjub3Z7immYWPrY2ou4f7W ueWqgb8tdne8zvFFqTK7zDdjlH7YjGlkX6slkbjhuHiL26Ss9awVaFsQLi+BQi7OIP oFwD7QYYz/GIfEnQYzpYwRYrXqbMFJbiAvDsx/4FlshZMXO3AwTPMNjKK4KsuWfyTx ChCaxri55Dx1TdW6I6VYJVYEXYLK+jcJSqwexyYhG0kGJEZRRIREnUeU7X9Fa1Dxh2 wYpGDoMMa5ckw== Date: Sat, 15 Jun 2024 13:25:10 +0100 From: Jonathan Cameron To: David Lechner Cc: Rob Herring , Nuno =?UTF-8?B?U8Oh?= , Krzysztof Kozlowski , Krzysztof Kozlowski , Conor Dooley , Michael Hennerich , Nuno =?UTF-8?B?U8Oh?= , Jonathan Corbet , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Subject: Re: [PATCH 1/3] dt-bindings: iio: adc: add AD4695 and similar ADCs Message-ID: <20240615132510.2575b65a@jic23-huawei> In-Reply-To: References: <20240612-iio-adc-ad4695-v1-0-6a4ed251fc86@baylibre.com> <20240612-iio-adc-ad4695-v1-1-6a4ed251fc86@baylibre.com> <94448c2c-e7b2-4191-858c-529b254994f1@kernel.org> <5f0776ba5163578453e26352763ff1b4687bcf87.camel@gmail.com> <20240613194324.GA2352022-robh@kernel.org> X-Mailer: Claws Mail 4.3.0 (GTK 3.24.42; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Thu, 13 Jun 2024 15:09:40 -0500 David Lechner wrote: > On 6/13/24 2:43 PM, Rob Herring wrote: > > On Thu, Jun 13, 2024 at 05:11:48PM +0200, Nuno S=C3=A1 wrote: =20 > >> On Thu, 2024-06-13 at 09:39 -0500, David Lechner wrote: =20 > >>> On 6/13/24 9:18 AM, Krzysztof Kozlowski wrote: =20 > >>>> On 13/06/2024 15:57, David Lechner wrote: =20 > >>>>> =20 > >>>>>> =20 > >>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 - const: = adi,ad4695 > >>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 - items: > >>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 - const: = adi,ad4697-wlcsp > >>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 - const: = adi,ad4697 > >>>>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 # same chips with higher max samp= le rate =20 > >>>>> > >>>>> I suppose one could make the argument that the programming model is > >>>>> the same on these too, but the maximum sampling frequency does seem > >>>>> like an important bit of information so that you don't try to set > >>>>> the conversion trigger rate too high. > >>>>> =20 > >>>> > >>>> which property is that? I don't see differences in the driver, so I > >>>> don't get how these wlcsp compatibles allow you to control value of > >>>> conversion trigger. =20 > >>> > >>> This comment is unrelated to the package type (WLCSP or LFCSP). > >>> > >>> What I mean is that e.g. AD4695 and AD4696 are virtually identical > >>> other than the maximum allowable sample rate (500 kSPS or 1 MSPS). > >>> > >>> So my thinking was that it would make sense to have: > >>> > >>> compatible =3D "ad4695"; > >>> > >>> for the lower sample rate chip and > >>> > >>> compatible =3D "ad4696", "ad4695"; > >>> > >>> for the higher sample rate chip since ad4696 can do everything > >>> that ad4695 does plus a bit more. > >>> =20 > >> > >> IMO, that would make sense yes. If the higher sample rate chip fallsba= ck, it will > >> still work but not at full speed. The other way around is the one that= we can't allow > >> naturally. > >> > >> But possibly dumb question now... since both devices will be supported= at the same > >> time, do we actually care about having the fallback compatible? My und= erstanding of > >> the fallback story is that we may load a DTS in an older kernel where = chip A is > >> supported but chip B is not and it is ok for chip B to fallback to chi= p A. Since > >> these devices will be supported at the same time, do we need to care? = Unless out of > >> tree stuff enters the equation? =20 > >=20 > > Yeah, it doesn't really matter much in that case. > > =20 > >> Or is there another usecase that I'm not aware about (or maybe it just= makes sense to > >> document properly...)? =20 > >=20 > > Somewhat I guess. Perhaps if there's a 3rd chip with higher rate, then= =20 > > it will be more obvious what to do and we don't have to have this=20 > > discussion again for it. :) > >=20 > > Rob =20 >=20 > It sounds like maybe the best thing to do here then is just keep it simpl= e? >=20 > Like this: >=20 > compatible: > enum: > - adi,ad4695 > - adi,ad4696 > - adi,ad4697 > - adi,ad4698 >=20 Quick comments late in discussion.=20 Simply compatible list is fine as they are all coming together (though that may in theory not be true on some other OS!) I'm also fine with the fallback as you discussed so less capable chip is the one we fall back to. Definitely need to differentiate chips with different possible ranges of a parameter as that goes straight through to userspace as sampling_frequency_available and userspace is going to get confused if it gets told it can do things that silently don't work. This sort of thing is why I always want to see chip IDs listed even if we think they'll just work with another one. a) Documents hardware right and people expect to see the ID of the chip on the BoM b) Lets us deal with cases where we have missed subtle differences in capabilities because the driver didn't support them yet. So in conclusion either option you proposed is fine (as above, or fallback to the part we think is a subset of functionality.) Jonathan =20