Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp665900lqp; Wed, 12 Jun 2024 12:22:25 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW3k7hHD2Ebl39MPRCpCT5Zc7RIjL696ymQzX65eZdJsGYnH1+7QsY9UUTKc9H5muJlb1gcDdMV+Umdb472dz1mhYpXfgB/EFIBwxOnuQ== X-Google-Smtp-Source: AGHT+IFXjyW8dCq301yEqU6ds7u9+YQIOoTtvZCkEpsFhfdZrpKUn4Bz5ytXeabF+b6XtSc+Xm3P X-Received: by 2002:a05:651c:a07:b0:2eb:17fe:a144 with SMTP id 38308e7fff4ca-2ebfca33842mr25905591fa.34.1718220145610; Wed, 12 Jun 2024 12:22:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718220145; cv=pass; d=google.com; s=arc-20160816; b=NOQ+dcwFnkXD6FuqBEuBDI48f8c6sBBoxe+zT6BjEUlpJv3ym4PbIyb/wr+f8Cvzz8 QucDI3+SDjYJSuGh5iX5xnAAe7pLMT561obpU41lLpZoHrXE8mxcEZpq7Ce+f5rTnIVw jJlAe3589XN1lEU83BVRVntPoKgw2V3DjGzsAMdfYATEXNf5rM2IbyTsQ8hW+C59KtIK +QwknK+eWt9fyzuU0eeKH0gbLu8TaGbWvTKQaKnESvhauVt5WjfqU2So7bT3AG7P1NYu 29xIGdamAGBrV29me+IyFBbTbTBy/gjpAfy/3R6/j93HouX81z8zEsTuDgIeONZaOV1B F8Bw== 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 :date:subject:cc:to:from:dkim-signature; bh=nWjk00AKWLCCc2wBmuv0MRbs0RIV4aO29ZnuU1Z2jqM=; fh=Uf8an5+zbvIUogLFdNy2uCrk39fMs+kHhj70YiqyAOU=; b=Ru0hSrpFFCvzSOqwYSWUt7pT7FHKOK29WyKuyRHPQB87+t/fkYTbgf1D+W7snuE5xJ cl3GZmWVhPYQ689dU1LXm3mNRbB8RSi07iMKz/GpyFyu+M0/3YVCDftEFCiEKBX/jNs8 55jOJEdVG2FxfdpGHK3QtRv4T/lBLwmYfvG5yd+wBEaftaMUQGoTFay+FRqYSxQKB809 dOp7Ps5OyC6Wxqjo8PP12cwp+wenX99OJHC5fr0URG/TcvOkDfIhozbxPRl03MgC0MLa cZ0hCi/meHMxDSDPHxHQP6tyUs6AUK9ZTvd/b/CBhNexgWygoZvNWAxPbmajYjM3Ifm7 pxBQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=r74LmvTJ; arc=pass (i=1 spf=pass spfdomain=baylibre.com dkim=pass dkdomain=baylibre-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-212149-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212149-linux.lists.archive=gmail.com@vger.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 4fb4d7f45d1cf-57c6ddc7938si4998319a12.246.2024.06.12.12.22.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 12:22:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-212149-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=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=r74LmvTJ; arc=pass (i=1 spf=pass spfdomain=baylibre.com dkim=pass dkdomain=baylibre-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-212149-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212149-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 27A361F24B39 for ; Wed, 12 Jun 2024 19:22:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6829E84A56; Wed, 12 Jun 2024 19:21:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="r74LmvTJ" Received: from mail-oi1-f175.google.com (mail-oi1-f175.google.com [209.85.167.175]) (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 A938D82D9E for ; Wed, 12 Jun 2024 19:21:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718220108; cv=none; b=cE6K/LUq5zU4MtXvPwM6dPepC8Bl++4BDOC2sfQMzl+EE6NIi2ze9ECYs4mP0SYpr8EUkOwkmZfnkO9ib8r2Fga5KvmLeRdsr5hujR0o1B3l7+fl8d3ujLZQKc5fgeNgzXh9fmrKlsIq5Jz9tq5IIgxS6pHrc6FMMeIft/3ZDHU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718220108; c=relaxed/simple; bh=nYTAeIKAQnbfKWEqhRPle1j756SIOQpvdGbjJq8DHmA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=md77Ei//z9f7iLjwbs9V7aYDzlYtxnBqu9fcdznXjyjsJ3V0UqHb8b6GkvYwAIue4lHSvtP9zIDbcTsYhCOUD4vZ1S+zTX1J11ifq+DnL9Amdsw+bT6Tl1i4jJgOnl3/pek5Jz32ausV2limcIyX+FB1PaylS1xFIlus0IZDwOs= 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=r74LmvTJ; arc=none smtp.client-ip=209.85.167.175 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-oi1-f175.google.com with SMTP id 5614622812f47-3d23db75f5cso81662b6e.0 for ; Wed, 12 Jun 2024 12:21:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718220104; x=1718824904; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=nWjk00AKWLCCc2wBmuv0MRbs0RIV4aO29ZnuU1Z2jqM=; b=r74LmvTJEi786hdPB17H0FI7tI/8MNGocXBMnZ9ksdS5YT0fwHcTyuSvYITil3QlrQ QnakzZbNdfgxSURix0k493GYPiGEjj50jj44tofx5mwoiXHh/JD0dAbEX5LSGQ8xaCbY eo8tyATaWdqDpLcRIDd+jMR1XMxKDbagQ14rgPJDJ2NXDMMpiqJ4+Nrd/1d61ku2bPIe hlY6pWDAphNjUwfx/a6kQB25VLArjrgt5JFNKVnQbLp7Qm0CqaJ9iHZYJXSubFUol7Hl oLSKfDUrSvuZ87g2xCraIDiXqUJXoP9uwMUb9eV4Deu8eboSfvYO3ivPEw+1h9EtsWi9 2LBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718220104; x=1718824904; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nWjk00AKWLCCc2wBmuv0MRbs0RIV4aO29ZnuU1Z2jqM=; b=p9IwwS4RAd89KU5thLQ2iw8cuF9aanFePUs0wU80KBfOh6ATn9DzngvAW0ey50WXkc o8P3IiNRyHj3BQ8zrpvlRkP0FFEgwDbtScJnKgGe/qVmJp3K7NNVJAhPvVCn73XCidXs iBWFUb9Gbw1ZOoLfC5ttbrs1gR6vGPyXBFbuB85lqy4c0tekjvJBLyL7oOSqy04FTrkh RHFQLJG7naZEb38heww5wva97BViB5TBCS0RNiRuJzqqEoAVIJkjur6uDZ9S9HzFlom2 fqfHn8zBzdEasWFk00idGeaEdi+xU8Vf2ixJb6xIuJobSUn9gvL8FfNysI4fAkILSWIK QAMA== X-Forwarded-Encrypted: i=1; AJvYcCX4fTlgrLfKf9BzU0vHjxtPzFKt/FtFQbjMkZcPWUc9rX6JEe/BhIUtWIKpGStPlreq40LtFLIyl/Wm2D5YhmRMs7wiFqa7y/BNFSWK X-Gm-Message-State: AOJu0YzDPo6N9obWKTmIqRc+9HDmOY2z/zZvPiJcsMA3GWmIZbLiPAxK vWZkhG9sNEDVts+NVOK4YJNc9JFSX2oZ/4F6KRUT1jnRs+abjUxMlKlCXsO76rQ= X-Received: by 2002:a05:6808:138e:b0:3d2:29c2:9600 with SMTP id 5614622812f47-3d23e00b19fmr3371146b6e.23.1718220103587; Wed, 12 Jun 2024 12:21:43 -0700 (PDT) Received: from freyr.lechnology.com (ip98-183-112-25.ok.ok.cox.net. [98.183.112.25]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3d236676bfesm648795b6e.12.2024.06.12.12.21.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 12:21:43 -0700 (PDT) From: David Lechner To: Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Lechner , Michael Hennerich , =?utf-8?q?Nuno_S=C3=A1?= , Jonathan Corbet , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Subject: [PATCH 3/3] Documentation: iio: Document ad4695 driver Date: Wed, 12 Jun 2024 14:20:42 -0500 Message-ID: <20240612-iio-adc-ad4695-v1-3-6a4ed251fc86@baylibre.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240612-iio-adc-ad4695-v1-0-6a4ed251fc86@baylibre.com> References: <20240612-iio-adc-ad4695-v1-0-6a4ed251fc86@baylibre.com> 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" X-Mailer: b4 0.12.4 Content-Transfer-Encoding: 8bit The Analog Devices Inc. AD4695 (and similar chips) are complex ADCs that will benefit from a detailed driver documentation. This documents the current features supported by the driver. Signed-off-by: David Lechner --- Documentation/iio/ad4695.rst | 145 +++++++++++++++++++++++++++++++++++++++++++ Documentation/iio/index.rst | 1 + MAINTAINERS | 1 + 3 files changed, 147 insertions(+) diff --git a/Documentation/iio/ad4695.rst b/Documentation/iio/ad4695.rst new file mode 100644 index 000000000000..6e142561524e --- /dev/null +++ b/Documentation/iio/ad4695.rst @@ -0,0 +1,145 @@ +.. SPDX-License-Identifier: GPL-2.0-only + +============= +AD4695 driver +============= + +ADC driver for Analog Devices Inc. AD4695 and similar devices. The module name +is ``ad4695``. + + +Supported devices +================= + +The following chips are supported by this driver: + +* `AD4695 `_ +* `AD4696 `_ +* `AD4697 `_ +* `AD4698 `_ + + +Supported features +================== + +SPI wiring modes +---------------- + +The driver currently supports the following SPI wiring configuration: + +4-wire mode +^^^^^^^^^^^ + +In this mode, CNV and CS are tied together and there is a single SDO line. + +.. code-block:: + + +-------------+ +-------------+ + | CS |<-+------| CS | + | CNV |<-+ | | + | ADC | | HOST | + | | | | + | SDI |<--------| SDO | + | SDO |-------->| SDI | + | SCLK |<--------| SCLK | + +-------------+ +-------------+ + +To use this mode, in the device tree, omit the ``cnv-gpios`` and +``spi-rx-bus-width`` properties. + +Channel configuration +--------------------- + +Since the chip supports multiple ways to configure each channel, this must be +described in the device tree based on what is actually wired up to the inputs. + +There are three typical configurations: + +Single-ended where a pin is used with the ``REFGND`` pin, pseudo-differential +where a pin is used with the ``COM`` pin and differential where two ``INx`` +pins are used as a pair + +Single-ended input +^^^^^^^^^^^^^^^^^^ + +Each ``INx`` pin can be used as a single-ended input in conjunction with the +``REFGND`` pin. The device tree will look like this: + +.. code-block:: + + channel@2 { + reg = <2>; + }; + +This will appear on the IIO bus as the ``voltage2`` channel. The processed value +(*raw × scale*) will be the voltage between the ``INx`` relative to ``REFGND``. +(Offset is always 0 when pairing with ``REFGND``.) + +Pseudo-differential input +^^^^^^^^^^^^^^^^^^^^^^^^^ + +Each ``INx`` pin can be used as a pseudo-differential input in conjunction with +the ``COM`` pin. The device tree will look like this: + +.. code-block:: + + com-supply = <&vref_div_2>; + + channel@3 { + reg = <3>; + adi,pin-pairing = "com"; + bipolar; + }; + +This will appear on the IIO bus as the ``voltage3`` channel. The processed value +(*(raw + offset) × scale*) will be the voltage measured on ``INx`` relative to +``REFGND``. (The offset is determined by the ``com-supply`` voltage.) + +Differential input +^^^^^^^^^^^^^^^^^^ + +An even-numbered ``INx`` pin and the following odd-numbered ``INx`` pin can be +used as a differential pair. The device tree for using ``IN0`` as the positive +input and ``IN1`` as the negative input will look like this: + +.. code-block:: + + channel@0 { + reg = <0>; + adi,pin-pairing = "next"; + bipolar; + }; + +This will appear on the IIO bus as the ``voltage0-voltage1`` channel. The +processed value (*raw × scale*) will be the voltage difference between the two +pins. (Offset is always 0 for differential channels.) + +VCC supply +---------- + +The chip supports being powered by an external LDO via the ``VCC`` input or an +internal LDO via the ``LDO_IN`` input. The driver looks at the device tree to +determine which is being used. If ``ldo-supply`` is present, then the internal +LDO is used. If ``vcc-supply`` is present, then the external LDO is used and +the internal LDO is disabled. + +Reference voltage +----------------- + +The chip supports an external reference voltage via the ``REF`` input or an +internal buffered reference voltage via the ``REFIN`` input. The driver looks +at the device tree to determine which is being used. If ``ref-supply`` is +present, then the external reference voltage is used and the internal buffer is +disabled. If ``refin-supply`` is present, then the internal buffered reference +voltage is used. + +Unimplemented features +---------------------- + +- Additional wiring modes +- Buffered reads +- Threshold events +- Oversampling +- Gain/offset calibration +- GPIO support +- CRC support diff --git a/Documentation/iio/index.rst b/Documentation/iio/index.rst index 4c13bfa2865c..df69a76bf583 100644 --- a/Documentation/iio/index.rst +++ b/Documentation/iio/index.rst @@ -17,6 +17,7 @@ Industrial I/O Kernel Drivers .. toctree:: :maxdepth: 1 + ad4695 ad7944 adis16475 adis16480 diff --git a/MAINTAINERS b/MAINTAINERS index 611b7929e650..edd1a4e8f538 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1198,6 +1198,7 @@ L: linux-iio@vger.kernel.org S: Supported W: https://ez.analog.com/linux-software-drivers F: Documentation/devicetree/bindings/iio/dac/adi,ad3552r.yaml +F: Documentation/iio/index.rst F: drivers/iio/dac/ad3552r.c ANALOG DEVICES INC AD4130 DRIVER -- 2.45.2