From: Jonathan Cameron <jic23@kernel.org>
To: Tomas Borquez <tomasborquez13@gmail.com>
Cc: "Andy Shevchenko" <andy.shevchenko@gmail.com>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Lars-Peter Clausen" <lars@metafoo.de>,
"Michael Hennerich" <Michael.Hennerich@analog.com>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org,
linux-staging@lists.linux.dev
Subject: Re: [PATCH v2 5/6] staging: iio: ad9832: convert to iio channels and ext_info attrs
Date: Sun, 11 Jan 2026 12:20:34 +0000 [thread overview]
Message-ID: <20260111122034.174c754c@jic23-huawei> (raw)
In-Reply-To: <kyjemsha276njt5h57xtpev2sgxpxxlk3msax7kbkof2vkg6nz@3whszjxmbil2>
On Wed, 31 Dec 2025 14:08:52 -0300
Tomas Borquez <tomasborquez13@gmail.com> wrote:
> On Wed, Dec 31, 2025 at 12:55:50AM +0200, Andy Shevchenko wrote:
> > On Tue, Dec 30, 2025 at 10:35 PM Tomas Borquez <tomasborquez13@gmail.com> wrote:
> > >
> > > Convert ad9832 from sysfs attributes to standard channel interface
> > > using a single IIO_ALTCURRENT channel with ext_info attributes, as this
> > > device is a current source DAC with one output.
>
> ...
>
> > > -static int ad9832_write_frequency(struct ad9832_state *st,
> > > - unsigned int addr, unsigned long fout)
> > > +static ssize_t ad9832_write_frequency(struct iio_dev *indio_dev,
> > > + uintptr_t private,
> >
> > Torvalds said that uintptr_t shouldn't be used in the Linux kernel,
> > the unsigned long suffice and enough. Why do we need it here?
>
> Copied it from the definition of iio_chan_spec_ext_info:
>
> struct iio_chan_spec_ext_info {
> const char *name;
> enum iio_shared_by shared;
> ssize_t (*read)(struct iio_dev *, uintptr_t private,
> struct iio_chan_spec const *, char *buf);
> ssize_t (*write)(struct iio_dev *, uintptr_t private,
> struct iio_chan_spec const *, const char *buf,
> size_t len);
> uintptr_t private;
> };
>
> But can change it
As Linus has been clear on his preferences on this, we should probably
clean that iio_chan_spec_ext_info up as well at some
point. Not urgent though and don't gate this patch on it. Better
to clean up all existing users in one go.
This will do as a reference for why:
https://lore.kernel.org/all/CAHk-=wgSvPVGZp56uFCjOZoKcgQp7xpsj3P-Hhg+NXvhPnzszg@mail.gmail.com/
Jonathan
>
> >
> > > +static IIO_DEVICE_ATTR(out_altcurrent0_frequency_symbol, 0644,
> > > + ad9832_show, ad9832_store, AD9832_FREQ_SYM);
> > > +static IIO_DEVICE_ATTR(out_altcurrent0_phase_symbol, 0644,
> > > + ad9832_show, ad9832_store, AD9832_PHASE_SYM);
> > > +static IIO_DEVICE_ATTR(out_altcurrent0_enable, 0644,
> > > + ad9832_show, ad9832_store, AD9832_OUTPUT_EN);
> >
> > Why not IIO_DEVICE_ATTR_RW()?
>
> Not any good reason just didn't know it existed.
>
> > ...
> >
> > > + &iio_dev_attr_out_altcurrent0_frequency_symbol.dev_attr.attr,
> > > + &iio_dev_attr_out_altcurrent0_phase_symbol.dev_attr.attr,
> > > + &iio_dev_attr_out_altcurrent0_enable.dev_attr.attr,
> > > + &iio_dev_attr_out_altcurrent0_pincontrol_en.dev_attr.attr,
> > > NULL,
> >
> > At some point we may also drop the comma in the terminator entry.
>
> Will remove it as part of V3
>
> > --
> > With Best Regards,
> > Andy Shevchenko
next prev parent reply other threads:[~2026-01-11 12:20 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-30 20:34 [PATCH v2 0/6] staging: ad9832: driver cleanup Tomas Borquez
2025-12-30 20:34 ` [PATCH v2 1/6] staging: iio: ad9832: cleanup dev_err_probe() Tomas Borquez
2025-12-30 22:47 ` Andy Shevchenko
2025-12-31 18:02 ` Jonathan Cameron
2025-12-30 20:34 ` [PATCH v2 2/6] staging: iio: ad9832: convert to guard(mutex) Tomas Borquez
2025-12-30 22:50 ` Andy Shevchenko
2025-12-31 17:01 ` Tomas Borquez
2025-12-30 20:34 ` [PATCH v2 3/6] staging: iio: ad9832: convert to devm_mutex_init() Tomas Borquez
2026-01-14 1:34 ` Marcelo Schmitt
2025-12-30 20:34 ` [PATCH v2 4/6] staging: iio: ad9832: remove dds.h dependency Tomas Borquez
2025-12-30 22:46 ` Andy Shevchenko
2026-01-04 5:25 ` Tomas Borquez
2026-01-05 15:52 ` Andy Shevchenko
2025-12-31 18:09 ` Jonathan Cameron
2025-12-31 18:11 ` Jonathan Cameron
2026-01-04 5:38 ` Tomas Borquez
2026-01-11 12:13 ` Jonathan Cameron
2025-12-30 20:34 ` [PATCH v2 5/6] staging: iio: ad9832: convert to iio channels and ext_info attrs Tomas Borquez
2025-12-30 22:55 ` Andy Shevchenko
2025-12-31 17:08 ` Tomas Borquez
2026-01-11 12:20 ` Jonathan Cameron [this message]
2025-12-31 18:21 ` Jonathan Cameron
2025-12-30 20:34 ` [PATCH v2 6/6] staging: iio: ad9832: add sysfs documentation Tomas Borquez
2025-12-30 22:57 ` Andy Shevchenko
2025-12-31 18:35 ` 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=20260111122034.174c754c@jic23-huawei \
--to=jic23@kernel.org \
--cc=Michael.Hennerich@analog.com \
--cc=andy.shevchenko@gmail.com \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=gregkh@linuxfoundation.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=nuno.sa@analog.com \
--cc=tomasborquez13@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox