All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: linux-iio@vger.kernel.org
Cc: device-drivers-devel@blackfin.uclinux.org,
	michael.hennerich@analog.com, Jonathan Cameron <jic23@kernel.org>
Subject: [PATCH 07/10] staging:iio:light Add IIO_CHAN_INFO_VALUE entries to all drivers.
Date: Tue, 10 Apr 2012 21:27:40 +0100	[thread overview]
Message-ID: <1334089663-22900-8-git-send-email-jic23@kernel.org> (raw)
In-Reply-To: <1334089663-22900-1-git-send-email-jic23@kernel.org>

Precursor to making value read / write attribute optional.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
---
 drivers/staging/iio/light/isl29018.c |    7 +++++--
 drivers/staging/iio/light/tsl2563.c  |    9 ++++++---
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/iio/light/isl29018.c b/drivers/staging/iio/light/isl29018.c
index 38ec52b..f134d58 100644
--- a/drivers/staging/iio/light/isl29018.c
+++ b/drivers/staging/iio/light/isl29018.c
@@ -383,7 +383,7 @@ static int isl29018_read_raw(struct iio_dev *indio_dev,
 
 	mutex_lock(&chip->lock);
 	switch (mask) {
-	case 0:
+	case IIO_CHAN_INFO_VALUE:
 		switch (chan->type) {
 		case IIO_LIGHT:
 			ret = isl29018_read_lux(client, val);
@@ -420,14 +420,17 @@ static const struct iio_chan_spec isl29018_channels[] = {
 		.indexed = 1,
 		.channel = 0,
 		.processed_val = IIO_PROCESSED,
-		.info_mask = IIO_CHAN_INFO_CALIBSCALE_SEPARATE_BIT,
+		.info_mask = IIO_CHAN_INFO_VALUE_SEPARATE_BIT |
+		IIO_CHAN_INFO_CALIBSCALE_SEPARATE_BIT,
 	}, {
 		.type = IIO_INTENSITY,
 		.modified = 1,
+		.info_mask = IIO_CHAN_INFO_VALUE_SEPARATE_BIT,
 		.channel2 = IIO_MOD_LIGHT_IR,
 	}, {
 		/* Unindexed in current ABI.  But perhaps it should be. */
 		.type = IIO_PROXIMITY,
+		.info_mask = IIO_CHAN_INFO_VALUE_SEPARATE_BIT,
 	}
 };
 
diff --git a/drivers/staging/iio/light/tsl2563.c b/drivers/staging/iio/light/tsl2563.c
index beb51d71..859e211 100644
--- a/drivers/staging/iio/light/tsl2563.c
+++ b/drivers/staging/iio/light/tsl2563.c
@@ -485,7 +485,7 @@ static int tsl2563_read_raw(struct iio_dev *indio_dev,
 
 	mutex_lock(&chip->lock);
 	switch (m) {
-	case 0:
+	case IIO_CHAN_INFO_VALUE:
 		switch (chan->type) {
 		case IIO_LIGHT:
 			ret = tsl2563_get_adc(chip);
@@ -535,12 +535,14 @@ static const struct iio_chan_spec tsl2563_channels[] = {
 		.type = IIO_LIGHT,
 		.indexed = 1,
 		.processed_val = 1,
+		.info_mask = IIO_CHAN_INFO_VALUE_SEPARATE_BIT,
 		.channel = 0,
 	}, {
 		.type = IIO_INTENSITY,
 		.modified = 1,
 		.channel2 = IIO_MOD_LIGHT_BOTH,
-		.info_mask = IIO_CHAN_INFO_CALIBSCALE_SEPARATE_BIT,
+		.info_mask = IIO_CHAN_INFO_VALUE_SEPARATE_BIT |
+		IIO_CHAN_INFO_CALIBSCALE_SEPARATE_BIT,
 		.event_mask = (IIO_EV_BIT(IIO_EV_TYPE_THRESH,
 					  IIO_EV_DIR_RISING) |
 			       IIO_EV_BIT(IIO_EV_TYPE_THRESH,
@@ -549,7 +551,8 @@ static const struct iio_chan_spec tsl2563_channels[] = {
 		.type = IIO_INTENSITY,
 		.modified = 1,
 		.channel2 = IIO_MOD_LIGHT_IR,
-		.info_mask = IIO_CHAN_INFO_CALIBSCALE_SEPARATE_BIT,
+		.info_mask = IIO_CHAN_INFO_VALUE_SEPARATE_BIT |
+		IIO_CHAN_INFO_CALIBSCALE_SEPARATE_BIT,
 	}
 };
 
-- 
1.7.9.4


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

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-10 20:27 [PATCH 00/10] IIO: Make the value attribute optional for channels Jonathan Cameron
2012-04-10 20:27 ` [PATCH 01/10] staging:iio: add a value element to the info_mask Jonathan Cameron
2012-04-11  8:36   ` Lars-Peter Clausen
2012-04-11  9:02     ` Jonathan Cameron
2012-04-10 20:27 ` [PATCH 02/10] staging:iio:accelerometer Add IIO_CHAN_INFO_VALUE entries to all drivers Jonathan Cameron
2012-04-10 20:27 ` [PATCH 03/10] staging:iio:adc " Jonathan Cameron
2012-04-10 20:27 ` [PATCH 04/10] staging:iio:dac " Jonathan Cameron
2012-04-10 20:27 ` [PATCH 05/10] staging:iio:gyro " Jonathan Cameron
2012-04-10 20:27 ` [PATCH 06/10] staging:iio:imu " Jonathan Cameron
2012-04-10 20:27 ` Jonathan Cameron [this message]
2012-04-10 20:27 ` [PATCH 08/10] staging:iio:magnetometer " Jonathan Cameron
2012-04-10 20:27 ` [PATCH 10/10] staging:iio: Make read / write attributes for channel values optional 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=1334089663-22900-8-git-send-email-jic23@kernel.org \
    --to=jic23@kernel.org \
    --cc=device-drivers-devel@blackfin.uclinux.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=michael.hennerich@analog.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 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.