Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp412868rdb; Thu, 22 Feb 2024 07:34:40 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUn5AxnAJEcwSnNDebA3Ox5Bhx+exj1itFvLu8EIuYM+QxvtxqiUuxOOXlg86dV+LoCL5muNhsAiXBr35eo1Bpvsd62XvLXGQtCCIkefQ== X-Google-Smtp-Source: AGHT+IE+L2v/JrWxI3Z3Q7yH4thAFIBPygBIjjp7LlYN8NXIZZ3j5fmFMm8t0VaezPeOEkdO/Sbt X-Received: by 2002:a17:906:da0a:b0:a3e:a9a4:b97 with SMTP id fi10-20020a170906da0a00b00a3ea9a40b97mr7657715ejb.31.1708616080723; Thu, 22 Feb 2024 07:34:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708616080; cv=pass; d=google.com; s=arc-20160816; b=asofI47xXeyOB2383SWMtBEICGRFA+Xy90V6xkvZVqZjiBM72c0dArfGzHeaTukDzb TSFIjAZc0KBkEZsuVR75QOV2wxF92vTklesXMmTIjrYdxKQM7dKhinV5DVYXQSjKWLcK MnJRvELKdsWb3i+FTjgWQtgAr1a5pHI7Gxv4AxzYioVKGVbr+hvN+8mU0davKUqHgZsC 05iFbni5D3KRSFDZchtP8KcuNqosSgwSAOMbJcojixhSAWsmNlmq9aurJuo99DL76pRL eh790V0p1TsEIhW5mPtydxe2V6+UsGHRInGrV9wJLvomawL8rCKnaFxyCNWH+H+W99Yk 4ybQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=LWqO0pHCsNSjLyCG6MXeJUBlwR9dLb6mfb0rcFsObj0=; fh=2uBH3yKYlRlWmxxlc4mUKvPx5P9L2jCGGuB0eH9CF2M=; b=ebXhccn1YePiv8qes1lxyPRt7Qo1Y9/lJAj49/SmOJ2myKlXns12xpolDJygULXTfQ 9C18K46Z8KH12eIk+yV0oYmp2XTbsUk2NVLs4m8HMdL5NCKHb1PoH/j6VHVgN/1qOT1H vlMW5sSt+J6uZ2AFhKH4r78TBDG4f+d6ppT3F9ojD38+KmIaqBRwL39kGcjT2PJwKzqn hplb/NmtTcu5b+tdFDLxUV6E5B0SRvUeoCt8bIoUF/itdxcX7zmrUed0nIbd/DXUrLQa rOTTnL1maR+8/OczA3JKpS2jbM7ckrvY9+C0nMWEVSwg+EgxogwND/CVpncLw51edhH3 AC2A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bSBc2oNL; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-76781-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76781-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 f26-20020a1709062c5a00b00a3e91fccd17si3789689ejh.154.2024.02.22.07.34.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 07:34:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-76781-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=bSBc2oNL; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-76781-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76781-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 7893B1F25E87 for ; Thu, 22 Feb 2024 15:34:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1DD4814D44A; Thu, 22 Feb 2024 15:34:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="bSBc2oNL" 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 20E49482D4; Thu, 22 Feb 2024 15:34:31 +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=1708616072; cv=none; b=tgHU+k/I7uLtmz3ABKW4E7dQiHp8ITyzkIgq/6zgqpBem6Ej1IHtuz73fsKhRR/dcU/mT93sSKoSFlMykcka9lQFVmccQQHclKM3GtT8NU4hKEGwXKXClbmlroC3zASx2KNfb0N6ZbESLauKZT2x/qwblqhY9m1BzlcJteNs+jc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708616072; c=relaxed/simple; bh=hgxfsP2uprA1vuFpi6P+dbDSTCbhlaU5XxD8Li/ITTk=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=Me9PvnIatWo0OZua1OLpBenWX4qTX52jzhsS6bjsvLTCiLw5j0EebaklRU0g0f8qgHnh1N3L81tXV3Off8/6dOQq8zuSTBbCty4x7jAiI/u25gZRGJvR8SD7kUwiVpP8tvXdZmsQTUsL/8Lbl2zhEbf3NhtoiQGp9d82n+u7kyU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=bSBc2oNL; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id ABABDC433C7; Thu, 22 Feb 2024 15:34:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708616071; bh=hgxfsP2uprA1vuFpi6P+dbDSTCbhlaU5XxD8Li/ITTk=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=bSBc2oNLRFmbQIRlCpTLIsOFniG6X/9lQjpBl+sgZs1ftQRbrwubjgyBGC5BRmtk4 BTGMofh5DM7mLd4m+Xrf43sSqezKos2E7XJw/cGXTQd9g8/fAFSkfhDaBOnnnlPGSQ QfC6dBNm2kfMNBVp8Bq9PcBEi4tgme20p8JhBwTD/tYAFFKvEG95FWd8Dr6iF13jcG vV2kw3+eIrx08urnq8Qr9OMtxbnTvTnlZlpQvubrq88hAuBfNXTiznp5LJ4LYLzqHE rqaEMSf3ScvZWmtLIFgwirVzQrtPCllp6Stt0e/+KpI7qsj2XP3aGhvSCargZJrwuK DDM1q6La43olw== Received: by mail-lj1-f180.google.com with SMTP id 38308e7fff4ca-2d09cf00214so92055051fa.0; Thu, 22 Feb 2024 07:34:31 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCVSQ+TXgBFrbe2p2Ki4aEm3I/is4DqLy6gEYsfI1jhfpMzrH00hnPzojX+k2bJobrWoTfY4KvMszNUTq36vQ2vbsZ8H1tyTqfTg2VotX6BB/lFGpJ6q5OxY6kLW+bjjD4MaM7lYNvwcaA== X-Gm-Message-State: AOJu0YzLJ0zGK+8yT/UVwA3uSPzv/tz0cSjyBX/566e5N6ci1uLmi6re CY05wRC6qlMyws/Nmha+M4dezjQkb/4ZYGQOrt83Ddssub7DzFztZmzLgRY1mop7RMon5WHsT9d lW4xLVuUsrm6nUrUOLst30z0g0A== X-Received: by 2002:a05:651c:9:b0:2d2:555f:b4ae with SMTP id n9-20020a05651c000900b002d2555fb4aemr3219787lja.51.1708616069766; Thu, 22 Feb 2024 07:34:29 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240216-ad7944-mainline-v2-0-7eb69651e592@baylibre.com> <20240216-ad7944-mainline-v2-1-7eb69651e592@baylibre.com> <20240221152226.GA2868707-robh@kernel.org> In-Reply-To: From: Rob Herring Date: Thu, 22 Feb 2024 08:34:16 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 1/2] dt-bindings: iio: adc: add ad7944 ADCs To: David Lechner Cc: linux-iio@vger.kernel.org, Michael Hennerich , Jonathan Cameron , Krzysztof Kozlowski , Conor Dooley , =?UTF-8?B?TnVubyBTw6E=?= , Liam Girdwood , Mark Brown , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Feb 21, 2024 at 8:44=E2=80=AFAM David Lechner wrote: > > On Wed, Feb 21, 2024 at 9:22=E2=80=AFAM Rob Herring wro= te: > > > > On Fri, Feb 16, 2024 at 01:46:18PM -0600, David Lechner wrote: > > ... > > > > + adi,spi-mode: > > > + $ref: /schemas/types.yaml#/definitions/string > > > + enum: [ single, multi, chain ] > > > + default: multi > > > + description: | > > > + * single: The datasheet calls this "3-wire mode". It is often = used when > > > + the ADC is the only device on the bus. In this mode, SDI is = tied to VIO, > > > + and the CNV line can be connected to the CS line of the SPI = controller > > > + or to a GPIO, in which case the CS line of the controller is= unused. > > > > We have a standard property for this. > > As discussed in v1 [1], the datasheet's definition of "3-wire mode" is > _not_ the same as the standard spi-3wire property. I can add that to > the description here to clarify (I hoped changing the enum name was > enough, but perhaps not). Or is there a different property you are > referring to? > > [1]: https://lore.kernel.org/all/20240216140826.58b3318d@jic23-huawei/ > > > > > > + * multi: The datasheet calls this "4-wire mode". This is the c= onvential Also, typo. > > > + SPI mode used when there are multiple devices on the same bu= s. In this > > > + mode, the CNV line is used to initiate the conversion and th= e SDI line > > > + is connected to CS on the SPI controller. > > > > That's "normal" mode. > > That was my first choice, but the datasheet uses the term "normal > mode" to mean not TURBO mode which is something else unrelated to the > SPI mode. What I mean is this should be conveyed by the absence of any property. You don't need a property for "normal SPI mode". > > > > > + * chain: The datasheet calls this "chain mode". This mode is u= sed to save > > > + on wiring when multiple ADCs are used. In this mode, the SDI= line of > > > + one chip is tied to the SDO of the next chip in the chain an= d the SDI of > > > + the last chip in the chain is tied to GND. Only the first ch= ip in the > > > + chain is connected to the SPI bus. The CNV line of all chips= are tied > > > + together. The CS line of the SPI controller is unused. > > > > Don't you need to know how many chips are chained? In any case, you jus= t > > need a property for chain mode. There's some existing properties for > > chained devices I think. Standard logic shift register based GPIO IIRC. > > Thanks, I see #daisy-chained-devices now. I missed that before. > > > > > CNV are tied together, but must be driven by something? I suppose > > cnv-gpios? > > Yes. > > > But wouldn't that be the same as the SPI controller GPIO CS? > > Does a SPI controller CS line connected to CNV not work in this case? > > Maybe technically possible if CS is inverted on the bus since the line > has to be high to trigger the conversion and during the xfer. That's supported by the binding. Seems like it would simplify the driver if you went that route and better support other devices on the SPI bus. Also, we require 'reg', so I don't know what you'd put in it in the no CS case. Though, we probably already have that case with CS tied active. Shrug. Rob