From: Jonathan Cameron <jic23@kernel.org>
To: Roan van Dijk <roan@protonic.nl>
Cc: Rob Herring <robh+dt@kernel.org>,
Tomasz Duszynski <tomasz.duszynski@octakon.com>,
linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, david@protonic.nl,
Lars-Peter Clausen <lars@metafoo.de>
Subject: Re: [PATCH v4 3/4] drivers: iio: chemical: Add support for Sensirion SCD4x CO2 sensor
Date: Sat, 2 Oct 2021 17:16:22 +0100 [thread overview]
Message-ID: <20211002171622.0f5d34d7@jic23-huawei> (raw)
In-Reply-To: <20211001070254.3940795-4-roan@protonic.nl>
On Fri, 1 Oct 2021 09:02:53 +0200
Roan van Dijk <roan@protonic.nl> wrote:
> This is a driver for the SCD4x CO2 sensor from Sensirion. The sensor is
> able to measure CO2 concentration, temperature and relative humdity.
> The sensor uses a photoacoustic principle for measuring CO2 concentration.
> An I2C interface is supported by this driver in order to communicate with
> the sensor.
>
> Signed-off-by: Roan van Dijk <roan@protonic.nl>
Hi Roan,
Looks like you sent out wrong version or similar as the trigger_handler
won't work as you have it here. Otherwise looks good to me.
...
> +static irqreturn_t scd4x_trigger_handler(int irq, void *p)
> +{
> + struct iio_poll_func *pf = p;
> + struct iio_dev *indio_dev = pf->indio_dev;
> + struct scd4x_state *state = iio_priv(indio_dev);
> + struct {
> + uint16_t data[3];
> + int64_t ts __aligned(8);
> + } scan;
> + int ret;
> + uint16_t buf[3];
> +
> + memset(&scan, 0, sizeof(scan));
> + mutex_lock(&state->lock);
> + ret = scd4x_read_poll(state, buf);
scan->data and drop the local variable buf as unused.
If I've interpreted the intent right here I'm happy to make this tweak
whilst applying. If you prefer to send a v5 with it fixed up that is
fine as well.
> + mutex_unlock(&state->lock);
> + if (ret)
> + goto out;
> +
> + iio_push_to_buffers_with_timestamp(indio_dev, &scan, iio_get_time_ns(indio_dev));
> +out:
> + iio_trigger_notify_done(indio_dev->trig);
> + return IRQ_HANDLED;
> +}
> +
...
next prev parent reply other threads:[~2021-10-02 16:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-01 7:02 [PATCH v4 0/4] iio: chemical: Add support for Sensirion SCD4x CO2 sensor Roan van Dijk
2021-10-01 7:02 ` [PATCH v4 1/4] dt-bindings: iio: chemical: sensirion,scd4x: Add yaml description Roan van Dijk
2021-10-01 7:02 ` [PATCH v4 2/4] MAINTAINERS: Add myself as maintainer of the scd4x driver Roan van Dijk
2021-10-01 7:02 ` [PATCH v4 3/4] drivers: iio: chemical: Add support for Sensirion SCD4x CO2 sensor Roan van Dijk
2021-10-02 16:16 ` Jonathan Cameron [this message]
2021-10-01 7:02 ` [PATCH v4 4/4] iio: documentation: Document scd4x calibration use Roan van Dijk
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=20211002171622.0f5d34d7@jic23-huawei \
--to=jic23@kernel.org \
--cc=david@protonic.nl \
--cc=devicetree@vger.kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=roan@protonic.nl \
--cc=robh+dt@kernel.org \
--cc=tomasz.duszynski@octakon.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;
as well as URLs for NNTP newsgroup(s).