From: "Kurt Borja" <kuurtb@gmail.com>
To: "David Lechner" <dlechner@baylibre.com>,
"Kurt Borja" <kuurtb@gmail.com>,
"Jonathan Cameron" <jic23@kernel.org>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Tobias Sperling" <tobias.sperling@softing.com>
Cc: "Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org,
"Jonathan Cameron" <Jonathan.Cameron@huawei.com>
Subject: Re: [PATCH v3 2/2] iio: adc: Add ti-ads1018 driver
Date: Tue, 02 Dec 2025 11:52:59 -0500 [thread overview]
Message-ID: <DENVY6GZ4XZB.16W16KKSN1KXT@gmail.com> (raw)
In-Reply-To: <a01f95ba-23c0-4c4b-a6bc-31b316bb04ef@baylibre.com>
On Mon Dec 1, 2025 at 6:09 PM -05, David Lechner wrote:
...
>> +static int ads1018_buffer_preenable(struct iio_dev *indio_dev)
>> +{
>> + struct ads1018 *ads1018 = iio_priv(indio_dev);
>> + const struct ads1018_chip_info *chip_info = ads1018->chip_info;
>> + unsigned int pga, drate, addr;
>> + u16 cfg;
>> +
>> + addr = find_first_bit(indio_dev->active_scan_mask, iio_get_masklength(indio_dev));
>> + pga = ads1018_get_pga_mode(ads1018, addr);
>> + drate = ads1018_get_data_rate_mode(ads1018, addr);
>> +
>> + cfg = ADS1018_CFG_VALID;
>> + cfg |= FIELD_PREP(ADS1018_CFG_MUX_MASK, addr);
>> + cfg |= FIELD_PREP(ADS1018_CFG_PGA_MASK, pga);
>> + cfg |= FIELD_PREP(ADS1018_CFG_MODE_MASK, ADS1018_MODE_CONTINUOUS);
>> + cfg |= FIELD_PREP(ADS1018_CFG_DRATE_MASK, drate);
>> +
>> + if (chip_info->channels[addr].type == IIO_TEMP)
>> + cfg |= ADS1018_CFG_TS_MODE_EN;
>> +
>> + ads1018->tx_buf[0] = cpu_to_be16(cfg);
>> + ads1018->tx_buf[1] = 0;
>
> Seems like we could use 16-bit cycles here too?
>
Just realized, we can't use it here because we would need a CS de-assert
in between (16-bit) words and also keep it asserted after that for drdy
IRQ. The 32-bit cycle simplifies things a lot in buffer mode.
--
~ Kurt
prev parent reply other threads:[~2025-12-02 16:53 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-29 3:47 [PATCH v3 0/2] iio: Add support for TI ADS1X18 ADCs Kurt Borja
2025-11-29 3:47 ` [PATCH v3 1/2] dt-bindings: iio: adc: Add TI ADS1018/ADS1118 Kurt Borja
2025-11-29 9:25 ` Krzysztof Kozlowski
2025-11-30 3:32 ` Kurt Borja
2025-11-29 3:47 ` [PATCH v3 2/2] iio: adc: Add ti-ads1018 driver Kurt Borja
2025-11-29 14:21 ` Andy Shevchenko
2025-11-29 14:23 ` Andy Shevchenko
2025-11-30 3:31 ` Kurt Borja
2025-11-30 16:45 ` Andy Shevchenko
2025-12-01 16:07 ` David Lechner
2025-12-01 19:47 ` Kurt Borja
2025-12-01 21:53 ` David Lechner
2025-12-02 14:46 ` Kurt Borja
2025-12-06 19:27 ` Jonathan Cameron
2025-12-07 16:01 ` Kurt Borja
2025-11-29 17:08 ` kernel test robot
2025-12-01 23:09 ` David Lechner
2025-12-02 14:39 ` Kurt Borja
2025-12-02 14:59 ` Andy Shevchenko
2025-12-02 17:49 ` Kurt Borja
2025-12-02 18:04 ` Andy Shevchenko
2025-12-02 16:52 ` Kurt Borja [this message]
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=DENVY6GZ4XZB.16W16KKSN1KXT@gmail.com \
--to=kuurtb@gmail.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=andy@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=robh@kernel.org \
--cc=tobias.sperling@softing.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.