[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aD3cK5PioN7Rw3pP@JSANTO12-L01.ad.analog.com>
Date: Mon, 2 Jun 2025 14:15:23 -0300
From: Jonathan Santos <jonath4nns@...il.com>
To: Andy Shevchenko <andy@...nel.org>
Cc: Jonathan Santos <Jonathan.Santos@...log.com>, linux-iio@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-gpio@...r.kernel.org, linux-acpi@...r.kernel.org,
nuno.sa@...log.com, Michael.Hennerich@...log.com,
marcelo.schmitt@...log.com, jic23@...nel.org, robh@...nel.org,
krzk+dt@...nel.org, conor+dt@...nel.org, marcelo.schmitt1@...il.com,
linus.walleij@...aro.org, brgl@...ev.pl, lgirdwood@...il.com,
broonie@...nel.org, dlechner@...libre.com, rafael@...nel.org,
djrscally@...il.com
Subject: Re: [PATCH v9 09/12] iio: adc: ad7768-1: add support for
Synchronization over SPI
On 05/30, Andy Shevchenko wrote:
> On Thu, May 29, 2025 at 07:50:29PM -0300, Jonathan Santos wrote:
> > +static int ad7768_trigger_sources_sync_setup(struct device *dev,
> > + struct fwnode_handle *dev_fwnode,
> > + struct ad7768_state *st)
> > +{
> > + struct fwnode_reference_args args;
> > +
> > + struct fwnode_handle *fwnode __free(fwnode_handle) =
> > + fwnode_find_reference_args(dev_fwnode, "trigger-sources",
> > + "#trigger-source-cells", 0,
> > + AD7768_TRIGGER_SOURCE_SYNC_IDX, &args);
>
> I don't see how args are being used. This puts in doubt the need of the first
> patch.
>
If the wrapper is the issue, maybe it is better doing this instead?
static int ad7768_trigger_sources_sync_setup(struct device *dev,
struct fwnode_handle *dev_fwnode,
struct ad7768_state *st)
{
struct fwnode_reference_args args;
struct fwnode_handle *fwnode __free(fwnode_handle) = NULL;
int ret;
ret = fwnode_property_get_reference_args(dev_fwnode, "trigger-sources",
"#trigger-source-cells", 0,
AD7768_TRIGGER_SOURCE_SYNC_IDX, &args);
if (ret)
return ret;
fwnode = args.fwnode;
> > + /* First, try getting the GPIO trigger source */
> > + if (fwnode_device_is_compatible(fwnode, "gpio-trigger")) {
> > + st->gpio_sync_in = devm_fwnode_gpiod_get_index(dev, fwnode,
> > + NULL,
> > + 0,
> > + GPIOD_OUT_LOW,
> > + "sync-in");
> > + return PTR_ERR_OR_ZERO(st->gpio_sync_in);
> > + }
> > +
> > + /*
> > + * TODO: Support the other cases when we have a trigger subsystem
> > + * to reliably handle other types of devices as trigger sources.
> > + *
> > + * For now, return an error message. For self triggering, omit the
> > + * trigger-sources property.
> > + */
> > + return dev_err_probe(dev, -EOPNOTSUPP, "Invalid synchronization trigger source\n");
> > +}
Then we can get rid of the first patch.
Regards,
Jonathan S.
Powered by blists - more mailing lists