linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: linux-iio@vger.kernel.org
Cc: jbrenner@TAOSinc.com, Jonathan Cameron <jic23@kernel.org>
Subject: [PATCH 1/4] staging:iio:light:tsl2563 channel spec buglet / always reading same adc.
Date: Tue, 10 Apr 2012 21:17:29 +0100	[thread overview]
Message-ID: <1334089052-22304-2-git-send-email-jic23@kernel.org> (raw)
In-Reply-To: <1334089052-22304-1-git-send-email-jic23@kernel.org>

The IIO_LIGHT channel was not marked as being a processed_val despite
clearly being in lux.

The IIO_INTENSITY channel reads were dependent on channel and that isn't
specified for either adc (as they now use modifiers).  Hence use the
modifier instead.

Reported-by: Jon Brenner <jbrenner@taosinc.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
---
 drivers/staging/iio/light/tsl2563.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/iio/light/tsl2563.c b/drivers/staging/iio/light/tsl2563.c
index 546c95a..beb51d71 100644
--- a/drivers/staging/iio/light/tsl2563.c
+++ b/drivers/staging/iio/light/tsl2563.c
@@ -465,7 +465,7 @@ static int tsl2563_write_raw(struct iio_dev *indio_dev,
 {
 	struct tsl2563_chip *chip = iio_priv(indio_dev);
 
-	if (chan->channel == 0)
+	if (chan->channel == IIO_MOD_LIGHT_BOTH)
 		chip->calib0 = calib_from_sysfs(val);
 	else
 		chip->calib1 = calib_from_sysfs(val);
@@ -534,6 +534,7 @@ static const struct iio_chan_spec tsl2563_channels[] = {
 	{
 		.type = IIO_LIGHT,
 		.indexed = 1,
+		.processed_val = 1,
 		.channel = 0,
 	}, {
 		.type = IIO_INTENSITY,
-- 
1.7.9.4


  reply	other threads:[~2012-04-10 20:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-10 20:17 [PATCH 0/4] IIO: Another set of buglets plus cleanups Jonathan Cameron
2012-04-10 20:17 ` Jonathan Cameron [this message]
2012-04-10 20:17 ` [PATCH 2/4] staging:iio:Documentation: Fix a cut and paste error Jonathan Cameron
2012-04-11  8:19   ` Maxime Ripard
2012-04-11  8:20     ` Jonathan Cameron
2012-04-10 20:17 ` [PATCH 3/4] staging:iio:iio_core.h make less dependent on other included headers Jonathan Cameron
2012-04-10 20:17 ` [PATCH 4/4] staging:iio: chan_spec - take extend_name constant Jonathan Cameron
  -- strict thread matches above, loose matches on Subject: below --
2012-04-13  9:24 [PATCH 0/4] IIO: Another set of buglets plus cleanups Jonathan Cameron
2012-04-13  9:24 ` [PATCH 1/4] staging:iio:light:tsl2563 channel spec buglet / always reading same adc 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=1334089052-22304-2-git-send-email-jic23@kernel.org \
    --to=jic23@kernel.org \
    --cc=jbrenner@TAOSinc.com \
    --cc=linux-iio@vger.kernel.org \
    /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).