linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Akinobu Mita <akinobu.mita@gmail.com>
Cc: linux-iio@vger.kernel.org, Peter Meerwald <pmeerw@pmeerw.net>
Subject: Re: [PATCH 1/2] iio: light: tcs3472: fix ATIME register write
Date: Wed, 21 Jun 2017 20:29:43 +0100	[thread overview]
Message-ID: <20170621202943.214986fd@kernel.org> (raw)
In-Reply-To: <1497279909-11197-2-git-send-email-akinobu.mita@gmail.com>

On Tue, 13 Jun 2017 00:05:08 +0900
Akinobu Mita <akinobu.mita@gmail.com> wrote:

> The integration time is controlled by the ATIME register only.  However,
> this register is written by i2c_smbus_write_word_data() in write_raw().
> 
> We actually don't need to write a subsequent register.  So just use
> i2c_smbus_write_byte_data() instead.
> 
> Cc: Peter Meerwald <pmeerw@pmeerw.net>
> Cc: Jonathan Cameron <jic23@kernel.org>
> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
As I read the datasheet, this looks like it won't cause any actual
harm (where the top byte is written is unused).

Hence I'm going to apply this as part of the normal merge path
rather than as a fix as such.

Well worth cleaning up though!

Applied to the togreg branch of iio.git and pushed out as testing
for the autobuilders to play with it.

Thanks,

Jonathan
> ---
>  drivers/iio/light/tcs3472.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/light/tcs3472.c b/drivers/iio/light/tcs3472.c
> index 3aa71e3..a9e153b 100644
> --- a/drivers/iio/light/tcs3472.c
> +++ b/drivers/iio/light/tcs3472.c
> @@ -169,7 +169,7 @@ static int tcs3472_write_raw(struct iio_dev *indio_dev,
>  		for (i = 0; i < 256; i++) {
>  			if (val2 == (256 - i) * 2400) {
>  				data->atime = i;
> -				return i2c_smbus_write_word_data(
> +				return i2c_smbus_write_byte_data(
>  					data->client, TCS3472_ATIME,
>  					data->atime);
>  			}


  reply	other threads:[~2017-06-21 19:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-12 15:05 [PATCH 0/2] iio: light: tcs3472: bug fix and iio event handling support Akinobu Mita
2017-06-12 15:05 ` [PATCH 1/2] iio: light: tcs3472: fix ATIME register write Akinobu Mita
2017-06-21 19:29   ` Jonathan Cameron [this message]
2017-06-21 20:38     ` Peter Meerwald-Stadler
2017-06-12 15:05 ` [PATCH 2/2] iio: light: tcs3472: support out-of-threshold events Akinobu Mita
2017-06-21 19:33   ` Jonathan Cameron
2017-06-21 20:38     ` Peter Meerwald-Stadler

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=20170621202943.214986fd@kernel.org \
    --to=jic23@kernel.org \
    --cc=akinobu.mita@gmail.com \
    --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 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).