[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <222c5fa7-283b-48ce-9d01-34ca633674eb@gmail.com>
Date: Mon, 17 Mar 2025 13:24:07 +0200
From: Matti Vaittinen <mazziesaccount@...il.com>
To: Jonathan Cameron <jic23@...nel.org>
Cc: Matti Vaittinen <matti.vaittinen@...rohmeurope.com>,
Lars-Peter Clausen <lars@...afoo.de>, Nuno Sa <nuno.sa@...log.com>,
David Lechner <dlechner@...libre.com>,
Javier Carrasco <javier.carrasco.cruz@...il.com>,
Olivier Moysan <olivier.moysan@...s.st.com>,
Guillaume Stols <gstols@...libre.com>,
Dumitru Ceclan <mitrutzceclan@...il.com>,
Trevor Gamblin <tgamblin@...libre.com>,
Matteo Martelli <matteomartelli3@...il.com>,
Alisa-Dariana Roman <alisadariana@...il.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
João Paulo Gonçalves <joao.goncalves@...adex.com>,
AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
linux-kernel@...r.kernel.org, linux-iio@...r.kernel.org
Subject: Re: [PATCH v7 06/10] iio: adc: Support ROHM BD79124 ADC
On 16/03/2025 13:02, Jonathan Cameron wrote:
> On Thu, 13 Mar 2025 09:19:03 +0200
> Matti Vaittinen <mazziesaccount@...il.com> wrote:
...
>> +static int bd79124_write_int_to_reg(struct bd79124_data *data, int reg,
>> + unsigned int val)
> ..
>> +static int bd79124_read_event_config(struct iio_dev *iio_dev,
>> + const struct iio_chan_spec *chan,
>> + enum iio_event_type type,
>> + enum iio_event_direction dir)
>> +{
>> + struct bd79124_data *data = iio_priv(iio_dev);
>> +
>> + if (chan->channel >= BD79124_MAX_NUM_CHANNELS)
>> + return -EINVAL;
>> +
>> + return (data->alarm_monitored[chan->channel] & BIT(dir));
>
> Drop the outer brackets as not adding anything.
I just noticed that the integer returned from here is directly provided
to the user-space. I don't know the history, but it feels a bit off to
me. I mean, I would expect the read from sysfs file "*_en" to return '1'
or '0' - not 0x04.
Oh well, I suppose it's too late to change this in the IIO core - but
I'll do:
return !!(data->alarm_monitored[chan->channel] & BIT(dir));
in v8.
Yours,
-- Matti
Powered by blists - more mailing lists