summaryrefslogtreecommitdiff
path: root/drivers/staging/iio/magnetometer
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-05-02 18:48:07 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-05-02 18:48:07 (GMT)
commitd210267741fb2a8b6d741d9040703683a39087f4 (patch)
treebfc1cdf7925644367cec4c82f2a5fb6d4c51a8eb /drivers/staging/iio/magnetometer
parent69964ea4c7b68c9399f7977aa5b9aa6539a6a98a (diff)
parent5bb196ad29c58c3e69dde8ed34b99a07c0719e7f (diff)
downloadlinux-d210267741fb2a8b6d741d9040703683a39087f4.tar.xz
Merge 3.4-rc5 into staging-next
This resolves the conflict in: drivers/staging/vt6656/ioctl.c Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/iio/magnetometer')
-rw-r--r--drivers/staging/iio/magnetometer/ak8975.c15
-rw-r--r--drivers/staging/iio/magnetometer/hmc5843.c15
2 files changed, 16 insertions, 14 deletions
diff --git a/drivers/staging/iio/magnetometer/ak8975.c b/drivers/staging/iio/magnetometer/ak8975.c
index ebc2d08..93026c5 100644
--- a/drivers/staging/iio/magnetometer/ak8975.c
+++ b/drivers/staging/iio/magnetometer/ak8975.c
@@ -30,8 +30,8 @@
#include <linux/gpio.h>
-#include "../iio.h"
-#include "../sysfs.h"
+#include <linux/iio/iio.h>
+#include <linux/iio/sysfs.h>
/*
* Register definitions, as well as various shifts and masks to get at the
* individual fields of the registers.
@@ -431,7 +431,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];
@@ -445,7 +445,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, \
}
@@ -505,7 +506,7 @@ static int ak8975_probe(struct i2c_client *client,
}
/* Register with IIO */
- indio_dev = iio_allocate_device(sizeof(*data));
+ indio_dev = iio_device_alloc(sizeof(*data));
if (indio_dev == NULL) {
err = -ENOMEM;
goto exit_gpio;
@@ -536,7 +537,7 @@ static int ak8975_probe(struct i2c_client *client,
return 0;
exit_free_iio:
- iio_free_device(indio_dev);
+ iio_device_free(indio_dev);
exit_gpio:
if (gpio_is_valid(eoc_gpio))
gpio_free(eoc_gpio);
@@ -554,7 +555,7 @@ static int ak8975_remove(struct i2c_client *client)
if (gpio_is_valid(data->eoc_gpio))
gpio_free(data->eoc_gpio);
- iio_free_device(indio_dev);
+ iio_device_free(indio_dev);
return 0;
}
diff --git a/drivers/staging/iio/magnetometer/hmc5843.c b/drivers/staging/iio/magnetometer/hmc5843.c
index e00b416..3ec6518 100644
--- a/drivers/staging/iio/magnetometer/hmc5843.c
+++ b/drivers/staging/iio/magnetometer/hmc5843.c
@@ -22,8 +22,8 @@
#include <linux/i2c.h>
#include <linux/slab.h>
#include <linux/types.h>
-#include "../iio.h"
-#include "../sysfs.h"
+#include <linux/iio/iio.h>
+#include <linux/iio/sysfs.h>
#define HMC5843_I2C_ADDRESS 0x1E
@@ -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 \
}
@@ -545,7 +546,7 @@ static int hmc5843_probe(struct i2c_client *client,
struct iio_dev *indio_dev;
int err = 0;
- indio_dev = iio_allocate_device(sizeof(*data));
+ indio_dev = iio_device_alloc(sizeof(*data));
if (indio_dev == NULL) {
err = -ENOMEM;
goto exit;
@@ -573,7 +574,7 @@ static int hmc5843_probe(struct i2c_client *client,
goto exit_free2;
return 0;
exit_free2:
- iio_free_device(indio_dev);
+ iio_device_free(indio_dev);
exit:
return err;
}
@@ -585,7 +586,7 @@ static int hmc5843_remove(struct i2c_client *client)
iio_device_unregister(indio_dev);
/* sleep mode to save power */
hmc5843_configure(client, MODE_SLEEP);
- iio_free_device(indio_dev);
+ iio_device_free(indio_dev);
return 0;
}