linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: "Michał Mirosław" <mirq-linux@rere.qmqm.pl>
Cc: Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	linux-iio@vger.kernel.org
Subject: Re: [PATCH v2 2/7] iio: accel: kxcjk1013: fix INT_CTRL/INT_SRC1 bit names
Date: Sun, 3 Sep 2017 12:50:26 +0100	[thread overview]
Message-ID: <20170903125026.5d3e700a@archlinux> (raw)
In-Reply-To: <e4809bae1406bc2e5dfc90644085352d5a5a9d61.1503352742.git.mirq-linux@rere.qmqm.pl>

On Tue, 22 Aug 2017 00:03:30 +0200
Michał Mirosław <mirq-linux@rere.qmqm.pl> wrote:

> Fix INT_CTRL1 bit names to match register name and add names
> for INT_SRC1 bits.
> 
> Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>

If I was being really picky I'd argue this is two changes that aren't all that
connected so should have been two patches.  I don't really care though so
don't bother updating!

Change looks fine to me.

Jonathan

> ---
>  drivers/iio/accel/kxcjk-1013.c | 23 ++++++++++++++---------
>  1 file changed, 14 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/iio/accel/kxcjk-1013.c b/drivers/iio/accel/kxcjk-1013.c
> index 33e4b98f39fc..7828570d87d2 100644
> --- a/drivers/iio/accel/kxcjk-1013.c
> +++ b/drivers/iio/accel/kxcjk-1013.c
> @@ -67,14 +67,19 @@
>  #define KXCJK1013_REG_CTRL1_BIT_GSEL1	BIT(4)
>  #define KXCJK1013_REG_CTRL1_BIT_GSEL0	BIT(3)
>  #define KXCJK1013_REG_CTRL1_BIT_WUFE	BIT(1)
> -#define KXCJK1013_REG_INT_REG1_BIT_IEA	BIT(4)
> -#define KXCJK1013_REG_INT_REG1_BIT_IEN	BIT(5)
> +
> +#define KXCJK1013_REG_INT_CTRL1_BIT_IEL	BIT(3)
> +#define KXCJK1013_REG_INT_CTRL1_BIT_IEA	BIT(4)
> +#define KXCJK1013_REG_INT_CTRL1_BIT_IEN	BIT(5)
>  
>  #define KXCJK1013_DATA_MASK_12_BIT	0x0FFF
>  #define KXCJK1013_MAX_STARTUP_TIME_US	100000
>  
>  #define KXCJK1013_SLEEP_DELAY_MS	2000
>  
> +#define KXCJK1013_REG_INT_SRC1_BIT_WUFS	BIT(1)
> +#define KXCJK1013_REG_INT_SRC1_BIT_DRDY	BIT(4)
> +
>  #define KXCJK1013_REG_INT_SRC2_BIT_ZP	BIT(0)
>  #define KXCJK1013_REG_INT_SRC2_BIT_ZN	BIT(1)
>  #define KXCJK1013_REG_INT_SRC2_BIT_YP	BIT(2)
> @@ -336,9 +341,9 @@ static int kxcjk1013_chip_init(struct kxcjk1013_data *data)
>  	}
>  
>  	if (data->active_high_intr)
> -		ret |= KXCJK1013_REG_INT_REG1_BIT_IEA;
> +		ret |= KXCJK1013_REG_INT_CTRL1_BIT_IEA;
>  	else
> -		ret &= ~KXCJK1013_REG_INT_REG1_BIT_IEA;
> +		ret &= ~KXCJK1013_REG_INT_CTRL1_BIT_IEA;
>  
>  	ret = i2c_smbus_write_byte_data(data->client, KXCJK1013_REG_INT_CTRL1,
>  					ret);
> @@ -444,9 +449,9 @@ static int kxcjk1013_setup_any_motion_interrupt(struct kxcjk1013_data *data,
>  	}
>  
>  	if (status)
> -		ret |= KXCJK1013_REG_INT_REG1_BIT_IEN;
> +		ret |= KXCJK1013_REG_INT_CTRL1_BIT_IEN;
>  	else
> -		ret &= ~KXCJK1013_REG_INT_REG1_BIT_IEN;
> +		ret &= ~KXCJK1013_REG_INT_CTRL1_BIT_IEN;
>  
>  	ret = i2c_smbus_write_byte_data(data->client, KXCJK1013_REG_INT_CTRL1,
>  					ret);
> @@ -504,9 +509,9 @@ static int kxcjk1013_setup_new_data_interrupt(struct kxcjk1013_data *data,
>  	}
>  
>  	if (status)
> -		ret |= KXCJK1013_REG_INT_REG1_BIT_IEN;
> +		ret |= KXCJK1013_REG_INT_CTRL1_BIT_IEN;
>  	else
> -		ret &= ~KXCJK1013_REG_INT_REG1_BIT_IEN;
> +		ret &= ~KXCJK1013_REG_INT_CTRL1_BIT_IEN;
>  
>  	ret = i2c_smbus_write_byte_data(data->client, KXCJK1013_REG_INT_CTRL1,
>  					ret);
> @@ -1039,7 +1044,7 @@ static irqreturn_t kxcjk1013_event_handler(int irq, void *private)
>  		goto ack_intr;
>  	}
>  
> -	if (ret & 0x02) {
> +	if (ret & KXCJK1013_REG_INT_SRC1_BIT_WUFS) {
>  		ret = i2c_smbus_read_byte_data(data->client,
>  					       KXCJK1013_REG_INT_SRC2);
>  		if (ret < 0) {


  reply	other threads:[~2017-09-03 11:50 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-21 22:03 [PATCH v2 0/7] iio: accel: kxcjk1003: support Kionix KXTF9 Michał Mirosław
2017-08-21 22:03 ` [PATCH v2 2/7] iio: accel: kxcjk1013: fix INT_CTRL/INT_SRC1 bit names Michał Mirosław
2017-09-03 11:50   ` Jonathan Cameron [this message]
2017-08-21 22:03 ` [PATCH v2 1/7] iio: accel: kxcjk1003: refactor ODR setting Michał Mirosław
2017-09-03 11:48   ` Jonathan Cameron
2017-08-21 22:03 ` [PATCH v2 3/7] iio: accel: kxcjk1013: extract report_motion_event() from interrupt handler Michał Mirosław
2017-09-03 11:51   ` Jonathan Cameron
2017-08-21 22:03 ` [PATCH v2 4/7] iio: accel: kxcjk1013: rename motion direction bits Michał Mirosław
2017-09-03 11:57   ` Jonathan Cameron
2017-08-21 22:03 ` [PATCH v2 7/7] iio: accel: kxcjk1013: add support for KXTF9 Michał Mirosław
2017-09-03 12:05   ` Jonathan Cameron
2017-08-21 22:03 ` [PATCH v2 5/7] iio: accel: kxcjk1013: make sysfs/sampling_frequency_avail dynamic Michał Mirosław
2017-09-03 11:58   ` Jonathan Cameron
2017-09-03 12:02     ` Jonathan Cameron
2017-08-21 22:03 ` [PATCH v2 6/7] iio: accel: kxcjk1013: make sampling_frequency_avail per-type Michał Mirosław
2017-09-03 11:59   ` Jonathan Cameron
2017-08-21 22:05 ` [PATCH v2 0/7] iio: accel: kxcjk1003: support Kionix KXTF9 Michał Mirosław
2017-09-03 11:43 ` Jonathan Cameron
2017-09-04 21:04   ` Michał Mirosław
2017-09-10 13:32     ` Jonathan Cameron
2017-09-06 15:10   ` Srinivas Pandruvada

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=20170903125026.5d3e700a@archlinux \
    --to=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=mirq-linux@rere.qmqm.pl \
    --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;
as well as URLs for NNTP newsgroup(s).