From patchwork Thu Aug 22 12:45:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Esteban Blanc X-Patchwork-Id: 13773310 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 A793F1C9DF4 for ; Thu, 22 Aug 2024 12:45:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724330751; cv=none; b=b90n9hB2Chew9gjYAFLBwEhoqyLqzBIMEckUnU1gzVMSQwAUFxCYcr1wUvqsYWI+dBj1mU40AyBhqqFN+w2yFVEZIoPN768fv9ruzQuKt49PLdcqeQFpH6yHQPhY42JtuhN+nLfa6ecWL65p3ufRAnLES5d3UiGlkffdFT4fUZI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724330751; c=relaxed/simple; bh=yoETc8josiIKxYd6PCEzQLh0A57oAlHqLJq3xfUOsqk=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=hK8OtsOk8WxOa8UDw1cQxF6M4OaakABtXPIqFHpT2NfB/875OgDsJxub/99GAn/Vig75/9jY+zSCqR+qph9Z6P6muZMtIXG8ZCcZ4l/YJFh2OREyWiZyc5zvzmUJ3IVPXjPC4EiEsYMPYvlVVAL1jFtikJqW6gfPdqJ5U1mVqPU= 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=K9Dr0N76; arc=none smtp.client-ip=209.85.128.41 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 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="K9Dr0N76" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-428ec6c190eso5496605e9.1 for ; Thu, 22 Aug 2024 05:45:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1724330747; x=1724935547; darn=vger.kernel.org; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=TziPBUOm9WXx2RorriSSxIgK2odcIsd7J/hDhpc2D5o=; b=K9Dr0N76uobB6o5KpDQbECDRii0wiHSWjTTPEQiUrfX2Yo/p1/npzJAbYAaOcosVE1 2FkIpmiMAehPjMZFXt8D+G7SpeHjI7T0ZlVBIcjB/W/KneNgQSFvPBsIEWb4rqlNSIxc lQPvRfLD9csBsD7cWKqAQ15KBL5YZCHHPuA+R45hlFh25F45ad2OiNZ/0oZD7T5DU/6b OzScG1NPG8LyxLe+lfz30VZyGwQw6m3ETaU3lWDVMlvEwlyphTCyblmgT+C5qD7vAMvJ gnYnCxCyXwi2N1FSWL/YIhTSTOXBoz1aknRiK43rpniOBTENEWwCzssnakVPZ9Zq36x2 0yIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724330747; x=1724935547; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=TziPBUOm9WXx2RorriSSxIgK2odcIsd7J/hDhpc2D5o=; b=X1/26+JeqYUoRsrFtxzaG07wi8XxEGo6rQmQUal2acVzySvhbFuGPZ9tR5gQ4oZA01 dKTHmp6Xeknn7RMp/mXP2FUEx46bvPSh6sQRjh+v+wPeivD/umAnrHufQdkWjVARei11 az+x9CFO2B3JuuZD2RD0LNdO0tc+d+QjI42Ta0fKJcUTIkz8gfux1Oe6txrPk0FoNEA/ /MQuj0i5C6/gTiJ61IdvOBDMtcPn20dCqXGVMyiyANonj7p7O7A8NJssJy6J0gWydoV8 UREutuLjrEsAssjur7mNMuF4yB/Td4+jeifxzNOpmM51iB21AT4muvOlJO4wxEnq5pLq uw4g== X-Forwarded-Encrypted: i=1; AJvYcCWQrC3XOfaJaRDkbvrr3HaLra2hgpe8MRoUOjzFuMntzuQpTw2umbn3WvqJDveRSMVu2HLjOh8kufc=@vger.kernel.org X-Gm-Message-State: AOJu0Yzd3tCNRfT4HOxc091/1kC/k09SLK72EiD2TiuRL1D1VHdi9Yfd HywYTe0UCIUsgBaoEpuMkzgeqQcHeDiSEaI6IsO2gKRO4lnvU4ABypX2vZl5dns= X-Google-Smtp-Source: AGHT+IH0tUq78bCn9f3nkkiY/CPIRenPfJA7C5++cEDXkitHmsonwTgrf4H0CBGWrdvPatL9StsXdg== X-Received: by 2002:a05:600c:1992:b0:426:6ee7:c05a with SMTP id 5b1f17b1804b1-42abd23061amr38113545e9.15.1724330746830; Thu, 22 Aug 2024 05:45:46 -0700 (PDT) Received: from [127.0.0.1] ([2a01:e0a:448:76e0:8da6:6d6d:c8ed:16c5]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42ac514e269sm24032195e9.2.2024.08.22.05.45.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Aug 2024 05:45:46 -0700 (PDT) From: Esteban Blanc Subject: [PATCH 0/6] iio: adc: ad4030: new driver for AD4030 and similar ADCs Date: Thu, 22 Aug 2024 14:45:16 +0200 Message-Id: <20240822-eblanc-ad4630_v1-v1-0-5c68f3327fdd@baylibre.com> Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIANwyx2YC/32NzQrCMBAGX6XkbGQ3DQn15HtIkfxsbaC2kkiwl L67afHiQWEv88HMLixRDJTYqVpYpBxSmMYCeKiY6814Ix58YSZASFBCcrKDGR03Xqoarhk5GtA SGk22QVa0R6QuvPbkpS3ch/Sc4rx/yLitf2LlgCtvlJYOayvpbM08BBvp6Kb7lv+4+ofbeQcKw Ynawrfbruv6BvomNZnvAAAA To: Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Nuno Sa , Jonathan Corbet Cc: Michael Hennerich , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, David Lechner , linux-doc@vger.kernel.org, Esteban Blanc X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openssh-sha256; t=1724330718; l=2951; i=eblanc@baylibre.com; s=yubikey; h=from:subject:message-id; bh=yoETc8josiIKxYd6PCEzQLh0A57oAlHqLJq3xfUOsqk=; b=U1NIU0lHAAAAAQAAAhcAAAAHc3NoLXJzYQAAAAMBAAEAAAIBALJZcW6pLD4ksSdWnXd5r65Ze 5Qc5pH7+DmmbKJasOXeVYRPFEmnORS7pwhURG11AMVFmnCVYWj+wPYrbCEeM7XKfO4oQzc66kYB 7y0RrFwjoWKofytjI026zV5b2pn1JAItgu0Ijth+TSa6KVOTSXqqiVzOTDM1WL0hAIIzpkhE3Vt AVJrFDsh/nWed9OpeSS+S6e3ZxyJtlnhqbVIemcDmjwMihtFgTKeJWlxP7KGY/RQKPF/Ef7pS+O AckOrxuqGKvpOiNVCmuQEUQM0+r4uvwtja4zRSl+huqW+g1nLyReoZPzFwfJWREd+89dtTJTXN7 xmmFNdX6KzRKBLVw1RY/R3mhAd+MkrdiNaRNKj+LO1QIxPoW90cPG9WpdVDUZf1VxhdciB6Hlxn lfEDFuCxU0n5H+kC4eiZvw+c9D4xX7iVdjPTMEaE6GBQNnMncdljBwA5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This is adding DT bindings and a new driver for AD4030, AD4630 and AD4632 ADCs. This work is being done in collaboration with Analog Devices Inc., hence they are listed as maintainers rather than me. The code has been tested on a Zedboard with an EVAL-AD4030-24FMCZ, an EVAL-AD4630-24FMCZ and an EVAL-AD4630-16FMCZ. As there is no eval board for AD4632 the support can't be tested at the moment. The main difference is the reduced throughput. To: Lars-Peter Clausen To: Michael Hennerich To: Jonathan Cameron To: Rob Herring To: Krzysztof Kozlowski To: Conor Dooley To: Nuno Sa To: Jonathan Corbet Cc: Michael Hennerich Cc: linux-iio@vger.kernel.org Cc: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: David Lechner Cc: linux-doc@vger.kernel.org Signed-off-by: Esteban Blanc Changes since RFC: - Reorder IIO channels to have the common byte channel next to its differential channel. - Extended names for IIO channels. - Diffrential data channels are marked as differential channels on IIO side. - Use get/put_unaligned_be24 for offset and sign extend it. - Common byte channel now has 32 realbits. This will be the same as what the FPGA will return, avoiding different channel layouts. - Fix missing newline in some error messages. - Add comment for the use of spi_sync_transfer instead of spi_write_then_read in ad4030_spi_read. - Use DMA safe buffers for regmap operations. - Clarify calculation for number of bytes to read from the device during conversion. - Formating fixes. - Add documentation page. - Link to RFC: https://lore.kernel.org/r/20240627-eblanc-ad4630_v1-v1-0-fdc0610c23b0@baylibre.com --- Esteban Blanc (6): dt-bindings: iio: adc: add ADI ad4030, ad4630 and ad4632 iio: adc: ad4030: add driver for ad4030-24 iio: adc: ad4030: add averaging support iio: adc: ad4030: add support for ad4630-24 and ad4630-16 iio: adc: ad4030: add support for ad4632-16 and ad4632-24 docs: iio: ad4030: add documentation .../devicetree/bindings/iio/adc/adi,ad4030.yaml | 113 ++ Documentation/iio/ad4030.rst | 129 +++ Documentation/iio/index.rst | 1 + MAINTAINERS | 10 + drivers/iio/adc/Kconfig | 13 + drivers/iio/adc/Makefile | 1 + drivers/iio/adc/ad4030.c | 1141 ++++++++++++++++++++ 7 files changed, 1408 insertions(+) --- base-commit: 3545ef5c627c761c76bbdf71e4b4d423fe30e51b change-id: 20240624-eblanc-ad4630_v1-1a074097eb91 Best regards,