From: Martin Fuzzey <mfuzzey@parkeon.com>
To: Peter Meerwald <pmeerw@pmeerw.net>
Cc: linux-iio@vger.kernel.org, Jonathan Cameron <jic23@kernel.org>
Subject: Re: [PATCH 3/8] iio: mma8452: Basic support for transient events.
Date: Mon, 28 Jul 2014 15:37:24 +0200 [thread overview]
Message-ID: <53D65214.2090201@parkeon.com> (raw)
In-Reply-To: <alpine.DEB.2.01.1407232006000.21518@pmeerw.net>
Hi Peter and thank you for the review.
On 23/07/14 20:12, Peter Meerwald wrote:
> +#define MMA8452_TRANSIENT_CFG_CHAN_MASK(chan) (BIT(1) << chan)
> could use GENMASK() macro
That would be
#define MMA8452_TRANSIENT_CFG_CHAN_MASK(chan) (GENMASK(chan + 1, chan + 1))
I don't really see that being better in the single bit case here.
> +
> +static irqreturn_t mma8452_interrupt(int irq, void *p)
> +{
> + struct iio_dev *indio_dev = p;
> + struct mma8452_data *data = iio_priv(indio_dev);
> + int ret = IRQ_NONE;
> + int src;
> save either ret or src
Ok, done for V2
>> +
>> + src = i2c_smbus_read_byte_data(data->client, MMA8452_INT_SRC);
>> + if (src < 0)
>> + goto out;
> return directly with IRQ_NONE
Ok, done for V2
>> +
>> + if (src & MMA8452_INT_TRANS) {
>> + mma8452_transient_interrupt(indio_dev);
>> + ret = IRQ_HANDLED;
> return directly with IRQ_HANDLED
Ok, done for V2
>> + }
>> +
>> +out:
> no need for goto/label
Ok, done for V2
> + /* By default set transient threshold to max to avoid events if
> + * enabling without configuring threshold */
> not a proper multiline comment
Ok, fixed for V2
>> + ret = i2c_smbus_write_byte_data(client, MMA8452_TRANSIENT_THS, 0x7f);
>> + if (ret < 0)
>> + return ret;
>> +
>> + if (client->irq) {
> I am always confused if 0 is a valid irq or not; I think it is, so
> client->irq >= 0
On my DT platform when I remove the interrupt definition from the device
tree
I get 0 for client->irq so I think it is not.
next prev parent reply other threads:[~2014-07-28 13:37 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-23 17:17 [PATCH 0/8] iio: mma8452 enhancements Martin Fuzzey
2014-07-23 17:17 ` [PATCH 1/8] iio: mma8452: Initialise before activating Martin Fuzzey
2014-07-23 18:05 ` Peter Meerwald
2014-07-28 15:53 ` Martin Fuzzey
2014-07-23 17:17 ` [PATCH 2/8] iio: mma8452: Add access to registers via DebugFS Martin Fuzzey
2014-07-23 17:17 ` [PATCH 3/8] iio: mma8452: Basic support for transient events Martin Fuzzey
2014-07-23 18:12 ` Peter Meerwald
2014-07-28 13:37 ` Martin Fuzzey [this message]
2014-07-28 19:34 ` Jonathan Cameron
2014-07-23 17:17 ` [PATCH 4/8] iio: mma8452: Add support for transient event debouncing Martin Fuzzey
2014-07-23 18:20 ` Peter Meerwald
2014-07-28 13:41 ` Martin Fuzzey
2014-07-23 17:17 ` [PATCH 5/8] iio: core: add high pass filter attributes Martin Fuzzey
2014-07-23 17:17 ` [PATCH 6/8] io: mma8452: Add highpass filter configuration Martin Fuzzey
2014-07-23 17:17 ` [PATCH 7/8] iio: mma8452: add an attribute to enable the highpass filter Martin Fuzzey
2014-07-23 18:36 ` Peter Meerwald
2014-07-28 13:59 ` Martin Fuzzey
2014-07-23 17:17 ` [PATCH 8/8] iio: mma8452: Add support for interrupt driven triggers Martin Fuzzey
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=53D65214.2090201@parkeon.com \
--to=mfuzzey@parkeon.com \
--cc=jic23@kernel.org \
--cc=linux-iio@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 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.