[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231210123511.63ddd8b2@jic23-huawei>
Date: Sun, 10 Dec 2023 12:35:11 +0000
From: Jonathan Cameron <jic23@...nel.org>
To: Marcelo Schmitt <marcelo.schmitt@...log.com>
Cc: <apw@...onical.com>, <joe@...ches.com>, <dwaipayanray1@...il.com>,
<lukas.bulwahn@...il.com>, <paul.cercueil@...log.com>,
<Michael.Hennerich@...log.com>, <lars@...afoo.de>,
<robh+dt@...nel.org>, <krzysztof.kozlowski+dt@...aro.org>,
<conor+dt@...nel.org>, <dan.carpenter@...aro.org>,
<marcelo.schmitt1@...il.com>, <linux-iio@...r.kernel.org>,
<devicetree@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3 07/13] iio: adc: ad7091r: Set device mode through
chip_info callback
On Thu, 7 Dec 2023 15:41:03 -0300
Marcelo Schmitt <marcelo.schmitt@...log.com> wrote:
> AD7091R-5 devices have a few modes of operation (sample, command,
> autocycle) which are set by writing to configuration register fields.
> Follow up patches will add support for AD7091R-2/-4/-8 which don't have
> those operation modes nor the register fields for setting them.
> Make ad7091r_set_mode() a callback function of AD7091R chip_info struct
> so the base driver can appropriately handle each design without having
> to check which actual chip is connected.
>
> Signed-off-by: Marcelo Schmitt <marcelo.schmitt@...log.com>
Hi Marcelo,
> +
> #define AD7091R_CHANNEL(idx, bits, ev, num_ev) { \
> .type = IIO_VOLTAGE, \
> .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \
> @@ -52,6 +60,7 @@ struct ad7091r_chip_info {
> unsigned int num_channels;
> const struct iio_chan_spec *channels;
> unsigned int vref_mV;
> + int (*ad7091r_set_mode)(struct ad7091r_state *st, enum ad7091r_mode mode);
Given it's embedded in a driver specific structure, I'm not seeing a clear
reason to prefix the callback with ad7091r. set_mode is probably enough.
Same for the ones introduced in later patches.
Powered by blists - more mailing lists