From: Jonathan Cameron Date: Sun, 15 Apr 2012 16:41:23 +0000 (+0100) Subject: staging:iio:magnetometer Add IIO_CHAN_INFO_RAW entries to all drivers. X-Git-Tag: upstream/snapshot3+hdmi~7439^2~229^2~172 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4d9948b36386ead790fecc0aad932a009dc51c90;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git staging:iio:magnetometer Add IIO_CHAN_INFO_RAW entries to all drivers. Precursor to making value read / write attribute optional. No processed values for magnetometers. Signed-off-by: Jonathan Cameron Acked-by: Lars-Peter Clausen Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/iio/magnetometer/ak8975.c b/drivers/staging/iio/magnetometer/ak8975.c index d5ddac3..000886f 100644 --- a/drivers/staging/iio/magnetometer/ak8975.c +++ b/drivers/staging/iio/magnetometer/ak8975.c @@ -429,7 +429,7 @@ static int ak8975_read_raw(struct iio_dev *indio_dev, struct ak8975_data *data = iio_priv(indio_dev); switch (mask) { - case 0: + case IIO_CHAN_INFO_RAW: return ak8975_read_axis(indio_dev, chan->address, val); case IIO_CHAN_INFO_SCALE: *val = data->raw_to_gauss[chan->address]; @@ -443,7 +443,8 @@ static int ak8975_read_raw(struct iio_dev *indio_dev, .type = IIO_MAGN, \ .modified = 1, \ .channel2 = IIO_MOD_##axis, \ - .info_mask = IIO_CHAN_INFO_SCALE_SEPARATE_BIT, \ + .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \ + IIO_CHAN_INFO_SCALE_SEPARATE_BIT, \ .address = index, \ } diff --git a/drivers/staging/iio/magnetometer/hmc5843.c b/drivers/staging/iio/magnetometer/hmc5843.c index 91dd3da..27c2629 100644 --- a/drivers/staging/iio/magnetometer/hmc5843.c +++ b/drivers/staging/iio/magnetometer/hmc5843.c @@ -459,7 +459,7 @@ static int hmc5843_read_raw(struct iio_dev *indio_dev, struct hmc5843_data *data = iio_priv(indio_dev); switch (mask) { - case 0: + case IIO_CHAN_INFO_RAW: return hmc5843_read_measurement(indio_dev, chan->address, val); @@ -476,7 +476,8 @@ static int hmc5843_read_raw(struct iio_dev *indio_dev, .type = IIO_MAGN, \ .modified = 1, \ .channel2 = IIO_MOD_##axis, \ - .info_mask = IIO_CHAN_INFO_SCALE_SHARED_BIT, \ + .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \ + IIO_CHAN_INFO_SCALE_SHARED_BIT, \ .address = add \ }