From: Marcelo Schmitt <marcelo.schmitt@analog.com>
To: <broonie@kernel.org>, <lars@metafoo.de>,
<Michael.Hennerich@analog.com>, <jic23@kernel.org>,
<robh+dt@kernel.org>, <krzysztof.kozlowski+dt@linaro.org>,
<conor+dt@kernel.org>, <nuno.sa@analog.com>,
<dlechner@baylibre.com>, <corbet@lwn.net>,
<marcelo.schmitt1@gmail.com>
Cc: <linux-iio@vger.kernel.org>, <devicetree@vger.kernel.org>,
<linux-spi@vger.kernel.org>, <linux-doc@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: [PATCH v6 0/7] Add support for AD4000 series of ADCs
Date: Sat, 29 Jun 2024 16:04:00 -0300 [thread overview]
Message-ID: <cover.1719686465.git.marcelo.schmitt@analog.com> (raw)
This patch series extends the SPI bitbang, gpio, and spi-engine controllers to
support configurable MOSI line idle states.
It then introduces the ad4000 driver which uses the MOSI idle configuration to
provide improved support for the AD4000 series of ADCs.
Documentation is added describing the new extension to the SPI protocol.
The currently supported wiring modes for AD4000 devices were documented under
IIO documentation directory.
To apply this series, it requires the patches for SPI-Engine SPI_CS_HIGH feature
and the patches for devm_spi_optimize_message() helper.
89c2657429c4822a2697077bbb3a8d126d826ced "spi: axi-spi-engine: remove platform_set_drvdata()"
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git/commit/?h=for-6.11&id=89c2657429c4822a2697077bbb3a8d126d826ced
7e74a45c7afdd8a9f82d14fd79ae0383bbaaed1e "spi: add EXPORT_SYMBOL_GPL(devm_spi_optimize_message)"
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git/commit/?h=for-6.11&id=7e74a45c7afdd8a9f82d14fd79ae0383bbaaed1e
d4a0055fdc22381fa256e345095e88d134e354c5 "spi: add devm_spi_optimize_message() helper"
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git/commit/?h=for-6.11&id=d4a0055fdc22381fa256e345095e88d134e354c5
6ecdb0aa4dca62d236a659426e11e6cf302e8f18 "spi: axi-spi-engine: Add SPI_CS_HIGH support"
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git/commit/?h=for-6.11&id=6ecdb0aa4dca62d236a659426e11e6cf302e8f18
Change log v5 -> v6:
[SPI]
spi.h: Removed unused SPI_CONTROLLER_MOSI_IDLE_LOW and SPI_CONTROLLER_MOSI_IDLE_HIGH
spi-summay: Minor nit: inactive -> not asserted
spi-engine: Moved MOSI idle support check to IP core version check section
[IIO]
ad4000: Fixed ad4000_read_reg(). *val = st->tx_buf[1]; -> *val = st->rx_buf[1];
ad4000: Use devm_regulator_bulk_get_enable()
ad4000: Use iio_device_claim_direct_scoped() and guard() to protect scale update
ad4000: Fail probe if ad4000_config() fail
ad4000: Moved ad4000_prepare_..._message() closer to probe to reduce scope
ad4000: Added AD4000_SDI_GND and switch case for more accurate error msg
ad4000: Removed unused st->turbo_mode
ad4000: Removed old misleading comments in enum ad4000_sdi
ad4000: A few minor readability and code style nits
Link to v5: https://lore.kernel.org/linux-iio/cover.1719351923.git.marcelo.schmitt@analog.com/
Link to v4: https://lore.kernel.org/linux-iio/cover.1718749981.git.marcelo.schmitt@analog.com/
Link to v3: https://lore.kernel.org/linux-iio/cover.1717539384.git.marcelo.schmitt@analog.com/
Link to v2: https://lore.kernel.org/linux-iio/cover.1712585500.git.marcelo.schmitt@analog.com/
Link to v1: https://lore.kernel.org/linux-iio/cover.1711131830.git.marcelo.schmitt@analog.com/
Regard using spi_w8r8(), I tried it again and it doesn't work for ad4000.
Looks like the smallest transfer size for these devices is 16-bit.
From datasheets:
"The AD4000/AD4004/AD4008 configuration register is read from and written to
with a 16-bit SPI instruction."
Regarding the sample buffer size, I'm keeping it 32-bits long following
suggestion from Nuno and due to a bit of laziness from my side to re-test it.
Will change if required.
Thank you to everybody who reviewed these patches. I appreciate your support.
Thanks,
Marcelo
Marcelo Schmitt (7):
spi: Enable controllers to extend the SPI protocol with MOSI idle
configuration
spi: bitbang: Implement support for MOSI idle state configuration
spi: spi-gpio: Add support for MOSI idle state configuration
spi: spi-axi-spi-engine: Add support for MOSI idle configuration
dt-bindings: iio: adc: Add AD4000
iio: adc: Add support for AD4000
docs: iio: Add documentation for AD4000
.../bindings/iio/adc/adi,ad4000.yaml | 197 +++++
Documentation/iio/ad4000.rst | 131 ++++
Documentation/iio/index.rst | 1 +
Documentation/spi/spi-summary.rst | 83 ++
MAINTAINERS | 9 +
drivers/iio/adc/Kconfig | 12 +
drivers/iio/adc/Makefile | 1 +
drivers/iio/adc/ad4000.c | 708 ++++++++++++++++++
drivers/spi/spi-axi-spi-engine.c | 15 +-
drivers/spi/spi-bitbang.c | 24 +
drivers/spi/spi-gpio.c | 12 +-
drivers/spi/spi.c | 7 +
include/linux/spi/spi_bitbang.h | 1 +
include/uapi/linux/spi/spi.h | 5 +-
14 files changed, 1200 insertions(+), 6 deletions(-)
create mode 100644 Documentation/devicetree/bindings/iio/adc/adi,ad4000.yaml
create mode 100644 Documentation/iio/ad4000.rst
create mode 100644 drivers/iio/adc/ad4000.c
--
2.43.0
next reply other threads:[~2024-06-29 19:04 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-29 19:04 Marcelo Schmitt [this message]
2024-06-29 19:04 ` [PATCH v6 1/7] spi: Enable controllers to extend the SPI protocol with MOSI idle configuration Marcelo Schmitt
2024-06-30 10:47 ` Jonathan Cameron
2024-07-01 17:30 ` Marcelo Schmitt
2024-07-08 21:15 ` David Lechner
2024-06-29 19:05 ` [PATCH v6 2/7] spi: bitbang: Implement support for MOSI idle state configuration Marcelo Schmitt
2024-06-30 10:52 ` Jonathan Cameron
2024-07-08 21:19 ` David Lechner
2024-06-29 19:05 ` [PATCH v6 3/7] spi: spi-gpio: Add " Marcelo Schmitt
2024-06-30 10:53 ` Jonathan Cameron
2024-06-29 19:06 ` [PATCH v6 4/7] spi: spi-axi-spi-engine: Add support for MOSI idle configuration Marcelo Schmitt
2024-06-29 19:06 ` [PATCH v6 5/7] dt-bindings: iio: adc: Add AD4000 Marcelo Schmitt
2024-06-29 19:06 ` [PATCH v6 6/7] iio: adc: Add support for AD4000 Marcelo Schmitt
2024-06-30 11:17 ` Jonathan Cameron
2024-07-01 18:10 ` Marcelo Schmitt
2024-07-01 18:38 ` Mark Brown
2024-07-01 18:47 ` Jonathan Cameron
2024-07-08 21:34 ` David Lechner
2024-07-09 7:41 ` Nuno Sá
2024-06-29 19:07 ` [PATCH v6 7/7] docs: iio: Add documentation " Marcelo Schmitt
2024-07-08 21:25 ` David Lechner
2024-07-29 18:02 ` (subset) [PATCH v6 0/7] Add support for AD4000 series of ADCs Mark Brown
2024-07-29 19:40 ` Jonathan Cameron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1719686465.git.marcelo.schmitt@analog.com \
--to=marcelo.schmitt@analog.com \
--cc=Michael.Hennerich@analog.com \
--cc=broonie@kernel.org \
--cc=conor+dt@kernel.org \
--cc=corbet@lwn.net \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=lars@metafoo.de \
--cc=linux-doc@vger.kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=marcelo.schmitt1@gmail.com \
--cc=nuno.sa@analog.com \
--cc=robh+dt@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).