From: Matti Vaittinen <mazziesaccount@gmail.com>
To: Marek Vasut <marex@denx.de>, linux-iio@vger.kernel.org
Cc: Alexander Stein <alexander.stein@ew.tq-group.com>,
Andre Werner <andre.werner@systec-electronic.com>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Bjorn Helgaas <bhelgaas@google.com>,
Conor Dooley <conor+dt@kernel.org>,
Fabio Estevam <festevam@denx.de>,
Guenter Roeck <linux@roeck-us.net>,
Jonathan Cameron <jic23@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Lars-Peter Clausen <lars@metafoo.de>,
Luca Ceresoli <luca.ceresoli@bootlin.com>,
Mark Brown <broonie@kernel.org>,
Naresh Solanki <naresh.solanki@9elements.com>,
Patrick Rudolph <patrick.rudolph@9elements.com>,
Rob Herring <robh+dt@kernel.org>,
Stefan Windfeldt-Prytz <stefan.windfeldt-prytz@axis.com>,
Vincent Tremblay <vincent@vtremblay.dev>,
devicetree@vger.kernel.org
Subject: Re: [PATCH 2/2] iio: light: isl76682: Add ISL76682 driver
Date: Thu, 16 Nov 2023 18:45:15 +0200 [thread overview]
Message-ID: <f2ca7f12-4a4c-441e-932d-5f03057e4c5d@gmail.com> (raw)
In-Reply-To: <493c138c-ca67-4244-bcd7-c1c3d596048d@gmail.com>
On 11/16/23 18:25, Matti Vaittinen wrote:
>> +
>> +static int isl76682_write_raw(struct iio_dev *indio_dev,
>> + struct iio_chan_spec const *chan,
>> + int val, int val2, long mask)
>> +{
>> + struct isl76682_chip *chip = iio_priv(indio_dev);
>> + int ret;
>> +
>> + if (chan->type != IIO_LIGHT)
>> + return -EINVAL;
>> +
>> + if (mask != IIO_CHAN_INFO_SCALE)
>> + return -EINVAL;
>> +
>> + mutex_lock(&chip->lock);
>> + ret = isl76682_set_als_scale(chip, val);
>> + mutex_unlock(&chip->lock);
>
> This looks a bit odd to me. I was under impression that the values would
> by default be IIO_VAL_INT_PLUS_MICRO unless the format is given in
> iio_info struct. If so, I'd expect the val to be zero for all of the
> scales because all scales are smaller than 1. (I may be wrong though).
> Eg, I'd expect that when range 1000 is set (scale 1000 / 65535), val =
> 0, val1 roughly 15259 (to mean 0.015259).
I mean val2 is 15259. There is no val1. Well, as you see you can trust
me, numbers are my strong "thing" :rolleyes:
next prev parent reply other threads:[~2023-11-16 16:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-16 13:13 [PATCH 1/2] dt-bindings: iio: light: isl76682: Document ISL76682 Marek Vasut
2023-11-16 13:13 ` [PATCH 2/2] iio: light: isl76682: Add ISL76682 driver Marek Vasut
2023-11-16 14:32 ` Alexander Stein
2023-11-16 16:25 ` Matti Vaittinen
2023-11-16 16:45 ` Matti Vaittinen [this message]
2023-11-16 14:03 ` [PATCH 1/2] dt-bindings: iio: light: isl76682: Document ISL76682 Conor Dooley
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=f2ca7f12-4a4c-441e-932d-5f03057e4c5d@gmail.com \
--to=mazziesaccount@gmail.com \
--cc=alexander.stein@ew.tq-group.com \
--cc=andre.werner@systec-electronic.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=bhelgaas@google.com \
--cc=broonie@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=festevam@denx.de \
--cc=jic23@kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=luca.ceresoli@bootlin.com \
--cc=marex@denx.de \
--cc=naresh.solanki@9elements.com \
--cc=patrick.rudolph@9elements.com \
--cc=robh+dt@kernel.org \
--cc=stefan.windfeldt-prytz@axis.com \
--cc=vincent@vtremblay.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.