lkml.org 
[lkml]   [2023]   [Dec]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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@analog.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@analog.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.

\
 
 \ /
  Last update: 2023-12-10 13:35    [W:1.752 / U:0.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site