mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Crestez Dan Leonard <leonard.crestez@intel.com>
To: Jonathan Cameron <jic23@kernel.org>, linux-iio@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	Daniel Baluta <daniel.baluta@intel.com>
Subject: Re: [PATCH v3] iio: Add driver for Silabs si1132, si1141/2/3 and si1145/6/7 ambient light, uv index and proximity sensors
Date: Tue, 21 Jun 2016 17:37:57 +0300	[thread overview]
Message-ID: <916196ba-3ba1-9eac-12d5-0c512916f349@intel.com> (raw)
In-Reply-To: <1b9f19dc-4d86-9d0d-f630-0395b116738b@kernel.org>

On 06/19/2016 02:57 PM, Jonathan Cameron wrote:
> On 17/06/16 12:10, Crestez Dan Leonard wrote:
>> From: Peter Meerwald <pmeerw@pmeerw.net>
>>
>> The si114x supports x=1,2,3 IR LEDs for proximity sensing together with
>> visible and IR ambient light sensing (ALS).
>>
>> Newer parts (si1132, si1145/6/7) can measure UV light and compute an UV index
>>
>> Changes since v2:
>> * Add myself to copyright
>> * Remove TODO: power management.
>> It's fine because by default the device remains sleeping.
>> * Elaborate comments on si1145_data
>> * Adjust comment syntax
>> * Drop special case for reading single words.
>> * Use manual request_irq to ensure proper init/free ordering
>>
>> Changes since Peter's v1:
>> * Fix set_chlist returning positive value on success
>> * Do not assume channel addresses are in order of scan index
>> * Take lock in buffer_preenable
>> * Print part/rev/seq id at probe time
>> * Cleanup param query/update
>> * Poll for response when executing commands
>> * Allow writes even when buffer enabled
>> * Add interrupt support
>> * Rename new to uncompressed_meas_rate for clarity
>> * Fix handling IIO_CHAN_INFO_SCALE:
>> Make it so that when changing the scale the processed value remains
>> identical in identical conditions. The exposed value should be
>> proportional to 2 ** -ADC_GAIN.
>> * Initialize UCOEF registers to default values from datasheet
>> Otherwise by default the coefficients are zero and so are all the
>> values read back
>> * Fix reading in_uvindex_raw manually (not in buffer mode)
>> * Expose in_uvindex_scale=0.01
>> * Expose ADC offset, making zero values meaningful
>> This is not very well documented, for example the si1145/6/7 datasheet
>> lists register 0x1a as 'reserved'. It might make sense to just return a
>> constant on these models.
>>
>> This was tested on si1143 and si1145
>>
>> Link to v2: https://www.spinics.net/lists/linux-iio/msg25055.html
>>
> Can you explain what the autonomous stuff is about?  Has me confused.
> Is it an attempt to allow driving the device with a software trigger
> when no interrupt is provided?  (I think it is but correct me if I'm
> wrong).  I'm definitely not happy with this approach as a trigger 'in'
> should always result in data 'out'.  If you are running multiple
> sensors off one software trigger you'd expect to get the same amount of
> data from each.

That "bool autonomous" is true when the device is in "autonomous
measurement" mode rather than the default "on-demand" mode. I guess it
might even be possible to replace it with a macro that checks for
indio_dev flags?

The driver supports both hardware triggers (from the interrupt) and
software triggers. With software triggers the device is instructed to
make measurements automatically and the data is read at the frequency of
the software trigger.

I guess this would work a bit strange if the device sampling frequency
is too different from the software trigger sampling frequency. Since the
device has no internal fifo to drain at a specific rate it will not
misbehave. It's just that if the sw freq is higher than the hw freq you
will see a "square-ish" signal out.

I also don't think this issue is specific to this driver. It would
affect most devices with software triggers, right?

  reply	other threads:[~2016-06-21 14:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-17 11:10 Crestez Dan Leonard
2016-06-17 21:20 ` kbuild test robot
2016-06-17 21:20 ` [PATCH] iio: fix platform_no_drv_owner.cocci warnings kbuild test robot
2016-06-19 11:57 ` [PATCH v3] iio: Add driver for Silabs si1132, si1141/2/3 and si1145/6/7 ambient light, uv index and proximity sensors Jonathan Cameron
2016-06-21 14:37   ` Crestez Dan Leonard [this message]
2016-06-26 15:18     ` 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=916196ba-3ba1-9eac-12d5-0c512916f349@intel.com \
    --to=leonard.crestez@intel.com \
    --cc=daniel.baluta@intel.com \
    --cc=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    /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

all inboxes | Powered by JetHome®