iio: imu: Invensense: Update 5.3.0.K-52 to latest tool chain.
Robert Collins [Thu, 23 Jun 2016 20:47:56 +0000 (13:47 -0700)]
Bug 1767467

Change-Id: I6056ae308cbd07ab5434d3b9da2a528e53df118b
Signed-off-by: Robert Collins <rcollins@nvidia.com>
Reviewed-on: http://git-master/r/1177674
(cherry picked from commit a115bce5238023dfff706cade1036eeae28c83c3)
Reviewed-on: http://git-master/r/1189579
Reviewed-by: Akhilesh Khumbum <akhumbum@nvidia.com>
Reviewed-by: Erik Lilliebjerg <elilliebjerg@nvidia.com>
Tested-by: Erik Lilliebjerg <elilliebjerg@nvidia.com>
GVS: Gerrit_Virtual_Submit

drivers/iio/imu/inv_mpu/inv530/Makefile
drivers/iio/imu/inv_mpu/inv530/inv_compass/Makefile
drivers/iio/imu/inv_mpu/inv530/inv_mpu_common.c
drivers/iio/imu/inv_mpu/inv530/inv_mpu_core.c
drivers/iio/imu/inv_mpu/inv530/inv_mpu_i2c.c
drivers/iio/imu/inv_mpu/inv530/inv_mpu_iio.h
drivers/iio/imu/inv_mpu/inv530/inv_mpu_misc.c
drivers/iio/imu/inv_mpu/inv530/inv_mpu_ring.c
drivers/iio/imu/inv_mpu/inv530/inv_mpu_setup.c
drivers/iio/imu/inv_mpu/inv530/inv_mpu_trigger.c

index 6f37689..e10a8ce 100644 (file)
@@ -29,21 +29,24 @@ inv-mpu-iio-spi-objs += inv_slave_pressure.o
 inv-mpu-iio-spi-objs += inv_slave_als.o
 inv-mpu-iio-spi-objs += inv_mpu_trigger.o
 
-CFLAGS_inv_mpu_core.o      += -Idrivers/staging/iio
-CFLAGS_inv_mpu_i2c.o      += -Idrivers/staging/iio
-CFLAGS_inv_mpu_spi.o      += -Idrivers/staging/iio
-CFLAGS_inv_mpu_misc.o      += -Idrivers/staging/iio
-CFLAGS_inv_mpu_ring.o      += -Idrivers/staging/iio
-CFLAGS_inv_mpu_common.o    += -Idrivers/staging/iio
-CFLAGS_inv_mpu_selftest.o  += -Idrivers/staging/iio
-CFLAGS_inv_mpu_setup.o  += -Idrivers/staging/iio
-CFLAGS_inv_slave_compass.o += -Idrivers/staging/iio
-CFLAGS_inv_slave_pressure.o += -Idrivers/staging/iio
-CFLAGS_inv_slave_als.o += -Idrivers/staging/iio
-CFLAGS_inv_mpu_trigger.o   += -Idrivers/staging/iio
+CFLAGS_inv_mpu_core.o      += -Idrivers/iio
+CFLAGS_inv_mpu_i2c.o      += -Idrivers/iio
+CFLAGS_inv_mpu_spi.o      += -Idrivers/iio
+CFLAGS_inv_mpu_misc.o      += -Idrivers/iio
+CFLAGS_inv_mpu_ring.o      += -Idrivers/iio
+CFLAGS_inv_mpu_common.o    += -Idrivers/iio
+CFLAGS_inv_mpu_selftest.o  += -Idrivers/iio
+CFLAGS_inv_mpu_setup.o  += -Idrivers/iio
+CFLAGS_inv_slave_compass.o += -Idrivers/iio
+CFLAGS_inv_slave_pressure.o += -Idrivers/iio
+CFLAGS_inv_slave_als.o += -Idrivers/iio
+CFLAGS_inv_mpu_trigger.o   += -Idrivers/iio
 
 # compile Invensense MPU IIO driver as DTS
 ifeq ($(CONFIG_DTS_INV_MPU_IIO), y)
 inv-mpu-iio-objs += inv_mpu_dts.o
-CFLAGS_inv_mpu_dts.o   += -Idrivers/staging/iio
+CFLAGS_inv_mpu_dts.o   += -Idrivers/iio
 endif
+
+obj-y += inv_compass/
+obj-y += inv_test/
index adc7dd9..1d3415b 100644 (file)
@@ -9,9 +9,9 @@ inv_yas53x-objs := inv_yas53x_core.o
 inv_yas53x-objs += inv_yas53x_ring.o
 inv_yas53x-objs += inv_yas53x_trigger.o
 
-CFLAGS_inv_yas53x_core.o    += -Idrivers/staging/iio
-CFLAGS_inv_yas53x_ring.o    += -Idrivers/staging/iio
-CFLAGS_inv_yas53x_trigger.o += -Idrivers/staging/iio
+CFLAGS_inv_yas53x_core.o    += -Idrivers/iio
+CFLAGS_inv_yas53x_ring.o    += -Idrivers/iio
+CFLAGS_inv_yas53x_trigger.o += -Idrivers/iio
 
 # Aichi AMI306
 obj-$(CONFIG_INV_AMI306_IIO) += inv-ami306-iio.o
@@ -20,6 +20,6 @@ inv-ami306-iio-objs := inv_ami306_core.o
 inv-ami306-iio-objs += inv_ami306_ring.o
 inv-ami306-iio-objs += inv_ami306_trigger.o
 
-CFLAGS_inv_ami306_core.o    += -Idrivers/staging/iio
-CFLAGS_inv_ami306_ring.o    += -Idrivers/staging/iio
-CFLAGS_inv_ami306_trigger.o += -Idrivers/staging/iio
+CFLAGS_inv_ami306_core.o    += -Idrivers/iio
+CFLAGS_inv_ami306_ring.o    += -Idrivers/iio
+CFLAGS_inv_ami306_trigger.o += -Idrivers/iio
index b7a79a1..a0aa3d4 100644 (file)
@@ -27,7 +27,7 @@
 #include <linux/spinlock.h>
 
 #include "inv_mpu_iio.h"
-#include "sysfs.h"
+#include <linux/sysfs.h>
 #include "inv_test/inv_counters.h"
 
 /*--- Test parameters defaults --- */
index 0948da6..1f95dd3 100644 (file)
@@ -27,7 +27,7 @@
 #include <linux/spinlock.h>
 
 #include "inv_mpu_iio.h"
-#include "sysfs.h"
+#include <linux/iio/sysfs.h>
 #include "inv_test/inv_counters.h"
 
 #ifdef CONFIG_DTS_INV_MPU_IIO
@@ -1860,16 +1860,16 @@ int inv_check_chip_type(struct iio_dev *indio_dev, const char *name)
        result = mem_r(MPU_SOFT_REV_ADDR, 1, &v);
        if (result)
                return result;
-       if (v & MPU_SOFT_REV_MASK) {
-               pr_err("incorrect software revision=%x\n", v);
-               return -EINVAL;
-       }
+//     if (v & MPU_SOFT_REV_MASK) {
+//             pr_err("incorrect software revision=%x\n", v);
+//             return -EINVAL;
+//     }
        //set up the low power mode capability
     if (v & 0x04)
         st->chip_config.lp_en_mode = 1;
     else
         st->chip_config.lp_en_mode = 0;
-       
+
        t_ind = 0;
        memcpy(&inv_attributes[t_ind], inv_raw_attributes,
                                        sizeof(inv_raw_attributes));
index bd76271..589403a 100644 (file)
@@ -27,8 +27,9 @@
 #include <linux/miscdevice.h>
 #include <linux/spinlock.h>
 
+#include <linux/regulator/consumer.h>
 #include "inv_mpu_iio.h"
-#include "sysfs.h"
+#include <linux/iio/sysfs.h>
 #include "inv_test/inv_counters.h"
 
 #ifdef CONFIG_DTS_INV_MPU_IIO
@@ -269,7 +270,7 @@ static int inv_mpu_probe(struct i2c_client *client,
                pr_err("I2c function error\n");
                goto out_no_free;
        }
-       indio_dev = iio_allocate_device(sizeof(*st));
+       indio_dev = iio_device_alloc(sizeof(*st));
        if (indio_dev == NULL) {
                pr_err("memory allocation failed\n");
                result =  -ENOMEM;
@@ -360,7 +361,7 @@ out_remove_ring:
 out_unreg_ring:
        inv_mpu_unconfigure_ring(indio_dev);
 out_free:
-       iio_free_device(indio_dev);
+       iio_device_free(indio_dev);
 out_no_free:
        dev_err(&client->adapter->dev, "%s failed %d\n", __func__, result);
 
@@ -402,7 +403,7 @@ static int inv_mpu_remove(struct i2c_client *client)
                inv_mpu_remove_trigger(indio_dev);
        iio_buffer_unregister(indio_dev);
        inv_mpu_unconfigure_ring(indio_dev);
-       iio_free_device(indio_dev);
+       iio_device_free(indio_dev);
 
        dev_info(&client->adapter->dev, "inv-mpu-iio module removed.\n");
 
index 89863d2..069bde3 100644 (file)
@@ -21,8 +21,8 @@
 #include <linux/mpu.h>
 #include <linux/interrupt.h>
 
-#include "iio.h"
-#include "buffer.h"
+#include <linux/iio/iio.h>
+#include <linux/iio/buffer.h>
 #include "dmp3Default.h"
 
 //#define BIAS_CONFIDENCE_HIGH 1
index fb81c02..4969b9e 100644 (file)
@@ -478,7 +478,7 @@ ssize_t inv_soft_iron_matrix_write(struct file *fp, struct kobject *kobj,
                return -EINVAL;
        if (size != SOFT_IRON_MATRIX_SIZE) {
                pr_err("wrong size for soft iron matrix 0x%08x vs 0x%08x\n",
-                                               size, SOFT_IRON_MATRIX_SIZE);
+                                               (int)size, SOFT_IRON_MATRIX_SIZE);
                return -EINVAL;
        }
        n = st->current_compass_matrix;
index eee0ccb..e1593a0 100644 (file)
 #include <linux/poll.h>
 #include <linux/miscdevice.h>
 
-#include "iio.h"
-#include "kfifo_buf.h"
-#include "trigger_consumer.h"
-#include "sysfs.h"
+#include <linux/iio/iio.h>
+#include <linux/iio/kfifo_buf.h>
+#include <linux/iio/trigger_consumer.h>
+#include <linux/iio/sysfs.h>
 
 #include "inv_mpu_iio.h"
 
 static int inv_process_dmp_data(struct inv_mpu_state *st);
-static s8 iden[] = {1, 0, 0, 0, 1, 0, 0, 0, 1};
+static char iden[] = {1, 0, 0, 0, 1, 0, 0, 0, 1};
 
 static int inv_push_marker_to_buffer(struct inv_mpu_state *st, u16 hdr)
 {
@@ -41,7 +41,7 @@ static int inv_push_marker_to_buffer(struct inv_mpu_state *st, u16 hdr)
        u8 buf[IIO_BUFFER_BYTES];
 
        memcpy(buf, &hdr, sizeof(hdr));
-       iio_push_to_buffer(indio_dev->buffer, buf, 0);
+       iio_push_to_buffers(indio_dev, buf);
 
        return 0;
 }
@@ -124,12 +124,12 @@ static int inv_push_16bytes_buffer(struct inv_mpu_state *st, u16 hdr,
 
        memcpy(buf, &hdr, sizeof(hdr));
        memcpy(buf + 4, &q[0], sizeof(q[0]));
-       iio_push_to_buffer(indio_dev->buffer, buf, 0);
+       iio_push_to_buffers(indio_dev, buf);
        for (i = 0; i < 2; i++)
                memcpy(buf + 4 * i, &q[i + 1], sizeof(q[i]));
-       iio_push_to_buffer(indio_dev->buffer, buf, 0);
+       iio_push_to_buffers(indio_dev, buf);
        memcpy(buf, &t, sizeof(t));
-       iio_push_to_buffer(indio_dev->buffer, buf, 0);
+       iio_push_to_buffers(indio_dev, buf);
 
        return 0;
 }
@@ -144,12 +144,12 @@ static int inv_push_16bytes_buffer_accuracy(struct inv_mpu_state *st, u16 hdr,
        memcpy(buf, &hdr, sizeof(hdr));
        memcpy(buf + 2, &accur, sizeof(accur));
        memcpy(buf + 4, &q[0], sizeof(q[0]));
-       iio_push_to_buffer(indio_dev->buffer, buf, 0);
+       iio_push_to_buffers(indio_dev, buf);
        for (i = 0; i < 2; i++)
                memcpy(buf + 4 * i, &q[i + 1], sizeof(q[i]));
-       iio_push_to_buffer(indio_dev->buffer, buf, 0);
+       iio_push_to_buffers(indio_dev, buf);
        memcpy(buf, &t, sizeof(t));
-       iio_push_to_buffer(indio_dev->buffer, buf, 0);
+       iio_push_to_buffers(indio_dev, buf);
 
        return 0;
 }
@@ -164,9 +164,9 @@ static int inv_push_8bytes_buffer(struct inv_mpu_state *st, u16 hdr,
        memcpy(buf, &hdr, sizeof(hdr));
        for (i = 0; i < 3; i++)
                memcpy(&buf[2 + i * 2], &d[i], sizeof(d[i]));
-       iio_push_to_buffer(indio_dev->buffer, buf, 0);
+       iio_push_to_buffers(indio_dev, buf);
        memcpy(buf, &t, sizeof(t));
-       iio_push_to_buffer(indio_dev->buffer, buf, 0);
+       iio_push_to_buffers(indio_dev, buf);
 
        return 0;
 }
@@ -371,7 +371,7 @@ static int inv_push_accuracy(struct inv_mpu_state *st, int ind, u8 *d)
        }
        memcpy(buf, &hdr, sizeof(hdr));
        memcpy(buf + sizeof(hdr), &accur, sizeof(accur));
-       iio_push_to_buffer(indio_dev->buffer, buf, 0);
+       iio_push_to_buffers(indio_dev, buf);
 
        return 0;
 }
index 4eebd71..ad99a0c 100644 (file)
 #include <linux/poll.h>
 #include <linux/miscdevice.h>
 
-#include "iio.h"
-#include "kfifo_buf.h"
-#include "trigger_consumer.h"
-#include "sysfs.h"
+#include <linux/iio/iio.h>
+#include <linux/iio/kfifo_buf.h>
+#include <linux/iio/trigger_consumer.h>
+#include <linux/iio/sysfs.h>
 
 #include "inv_mpu_iio.h"
 struct inv_local_store {
index 878207c..0d6b9b6 100644 (file)
@@ -26,9 +26,9 @@
 #include <linux/miscdevice.h>
 #include <linux/spinlock.h>
 
-#include "iio.h"
-#include "sysfs.h"
-#include "trigger.h"
+#include <linux/iio/iio.h>
+#include <linux/iio/sysfs.h>
+#include <linux/iio/trigger.h>
 
 #include "inv_mpu_iio.h"
 
@@ -51,18 +51,18 @@ int inv_mpu_probe_trigger(struct iio_dev *indio_dev)
        int ret;
        struct inv_mpu_state *st = iio_priv(indio_dev);
 
-       st->trig = iio_allocate_trigger("%s-dev%d",
+       st->trig = iio_trigger_alloc("%s-dev%d",
                                        indio_dev->name,
                                        indio_dev->id);
        if (st->trig == NULL)
                return -ENOMEM;
        st->trig->dev.parent = st->dev;
-       st->trig->private_data = indio_dev;
+       //st->trig->private_data = indio_dev;
        st->trig->ops = &inv_mpu_trigger_ops;
        ret = iio_trigger_register(st->trig);
 
        if (ret) {
-               iio_free_trigger(st->trig);
+               iio_trigger_free(st->trig);
                return -EPERM;
        }
        indio_dev->trig = st->trig;
@@ -75,6 +75,6 @@ void inv_mpu_remove_trigger(struct iio_dev *indio_dev)
        struct inv_mpu_state *st = iio_priv(indio_dev);
 
        iio_trigger_unregister(st->trig);
-       iio_free_trigger(st->trig);
+       iio_trigger_free(st->trig);
 }