diff mbox series

[v3,07/13] iio: imu: add Kconfig and Makefile for inv_icm42600 driver

Message ID 20200608204250.3291-8-jmaneyrol@invensense.com (mailing list archive)
State New, archived
Headers show
Series iio: imu: new inv_icm42600 driver | expand

Commit Message

Jean-Baptiste Maneyrol June 8, 2020, 8:42 p.m. UTC
Add 3 modules: inv-icm42600, inv-icm42600-i2c, inv-icm42600-spi.

Signed-off-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
---
 drivers/iio/imu/Kconfig               |  1 +
 drivers/iio/imu/Makefile              |  1 +
 drivers/iio/imu/inv_icm42600/Kconfig  | 28 +++++++++++++++++++++++++++
 drivers/iio/imu/inv_icm42600/Makefile | 13 +++++++++++++
 4 files changed, 43 insertions(+)
 create mode 100644 drivers/iio/imu/inv_icm42600/Kconfig
 create mode 100644 drivers/iio/imu/inv_icm42600/Makefile

Comments

kernel test robot June 8, 2020, 11:03 p.m. UTC | #1
Hi Jean-Baptiste,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on iio/togreg]
[also build test WARNING on robh/for-next linus/master v5.7 next-20200608]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Jean-Baptiste-Maneyrol/iio-imu-new-inv_icm42600-driver/20200609-044917
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>, old ones prefixed by <<):

drivers/iio/imu/inv_icm42600/inv_icm42600_core.c: In function 'inv_icm42600_get_mount_matrix':
>> drivers/iio/imu/inv_icm42600/inv_icm42600_core.c:91:63: warning: passing argument 1 of 'iio_device_get_drvdata' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
91 |  const struct inv_icm42600_state *st = iio_device_get_drvdata(indio_dev);
|                                                               ^~~~~~~~~
In file included from drivers/iio/imu/inv_icm42600/inv_icm42600_core.c:15:
include/linux/iio/iio.h:672:60: note: expected 'struct iio_dev *' but argument is of type 'const struct iio_dev *'
672 | static inline void *iio_device_get_drvdata(struct iio_dev *indio_dev)
|                                            ~~~~~~~~~~~~~~~~^~~~~~~~~

vim +91 drivers/iio/imu/inv_icm42600/inv_icm42600_core.c

632e967c33fb32 Jean-Baptiste Maneyrol 2020-06-08  86  
632e967c33fb32 Jean-Baptiste Maneyrol 2020-06-08  87  const struct iio_mount_matrix *
632e967c33fb32 Jean-Baptiste Maneyrol 2020-06-08  88  inv_icm42600_get_mount_matrix(const struct iio_dev *indio_dev,
632e967c33fb32 Jean-Baptiste Maneyrol 2020-06-08  89  			      const struct iio_chan_spec *chan)
632e967c33fb32 Jean-Baptiste Maneyrol 2020-06-08  90  {
632e967c33fb32 Jean-Baptiste Maneyrol 2020-06-08 @91  	const struct inv_icm42600_state *st = iio_device_get_drvdata(indio_dev);
632e967c33fb32 Jean-Baptiste Maneyrol 2020-06-08  92  
632e967c33fb32 Jean-Baptiste Maneyrol 2020-06-08  93  	return &st->orientation;
632e967c33fb32 Jean-Baptiste Maneyrol 2020-06-08  94  }
632e967c33fb32 Jean-Baptiste Maneyrol 2020-06-08  95  

:::::: The code at line 91 was first introduced by commit
:::::: 632e967c33fb32bb0a2a2f85a2a8d2e6d2b125f3 iio: imu: inv_icm42600: add core of new inv_icm42600 driver

:::::: TO: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
:::::: CC: 0day robot <lkp@intel.com>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Jonathan Cameron June 14, 2020, 1:52 p.m. UTC | #2
For anyone curious, this is an artefact of me failing to push the iio tree
out last weekend which included a patch to make iio_device_get_drvdata
take a const.

Sorry for the noise

Jonathan

On Tue, 9 Jun 2020 07:03:53 +0800
kernel test robot <lkp@intel.com> wrote:

> Hi Jean-Baptiste,
> 
> Thank you for the patch! Perhaps something to improve:
> 
> [auto build test WARNING on iio/togreg]
> [also build test WARNING on robh/for-next linus/master v5.7 next-20200608]
> [if your patch is applied to the wrong git tree, please drop us a note to help
> improve the system. BTW, we also suggest to use '--base' option to specify the
> base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
> 
> url:    https://github.com/0day-ci/linux/commits/Jean-Baptiste-Maneyrol/iio-imu-new-inv_icm42600-driver/20200609-044917
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
> config: ia64-allmodconfig (attached as .config)
> compiler: ia64-linux-gcc (GCC) 9.3.0
> reproduce (this is a W=1 build):
>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # save the attached .config to linux build tree
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64 
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
> 
> All warnings (new ones prefixed by >>, old ones prefixed by <<):
> 
> drivers/iio/imu/inv_icm42600/inv_icm42600_core.c: In function 'inv_icm42600_get_mount_matrix':
> >> drivers/iio/imu/inv_icm42600/inv_icm42600_core.c:91:63: warning: passing argument 1 of 'iio_device_get_drvdata' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]  
> 91 |  const struct inv_icm42600_state *st = iio_device_get_drvdata(indio_dev);
> |                                                               ^~~~~~~~~
> In file included from drivers/iio/imu/inv_icm42600/inv_icm42600_core.c:15:
> include/linux/iio/iio.h:672:60: note: expected 'struct iio_dev *' but argument is of type 'const struct iio_dev *'
> 672 | static inline void *iio_device_get_drvdata(struct iio_dev *indio_dev)
> |                                            ~~~~~~~~~~~~~~~~^~~~~~~~~
> 
> vim +91 drivers/iio/imu/inv_icm42600/inv_icm42600_core.c
> 
> 632e967c33fb32 Jean-Baptiste Maneyrol 2020-06-08  86  
> 632e967c33fb32 Jean-Baptiste Maneyrol 2020-06-08  87  const struct iio_mount_matrix *
> 632e967c33fb32 Jean-Baptiste Maneyrol 2020-06-08  88  inv_icm42600_get_mount_matrix(const struct iio_dev *indio_dev,
> 632e967c33fb32 Jean-Baptiste Maneyrol 2020-06-08  89  			      const struct iio_chan_spec *chan)
> 632e967c33fb32 Jean-Baptiste Maneyrol 2020-06-08  90  {
> 632e967c33fb32 Jean-Baptiste Maneyrol 2020-06-08 @91  	const struct inv_icm42600_state *st = iio_device_get_drvdata(indio_dev);
> 632e967c33fb32 Jean-Baptiste Maneyrol 2020-06-08  92  
> 632e967c33fb32 Jean-Baptiste Maneyrol 2020-06-08  93  	return &st->orientation;
> 632e967c33fb32 Jean-Baptiste Maneyrol 2020-06-08  94  }
> 632e967c33fb32 Jean-Baptiste Maneyrol 2020-06-08  95  
> 
> :::::: The code at line 91 was first introduced by commit
> :::::: 632e967c33fb32bb0a2a2f85a2a8d2e6d2b125f3 iio: imu: inv_icm42600: add core of new inv_icm42600 driver
> 
> :::::: TO: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
> :::::: CC: 0day robot <lkp@intel.com>
> 
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
diff mbox series

Patch

diff --git a/drivers/iio/imu/Kconfig b/drivers/iio/imu/Kconfig
index fc4123d518bc..f02883b08480 100644
--- a/drivers/iio/imu/Kconfig
+++ b/drivers/iio/imu/Kconfig
@@ -91,6 +91,7 @@  config KMX61
 	  To compile this driver as module, choose M here: the module will
 	  be called kmx61.
 
+source "drivers/iio/imu/inv_icm42600/Kconfig"
 source "drivers/iio/imu/inv_mpu6050/Kconfig"
 source "drivers/iio/imu/st_lsm6dsx/Kconfig"
 
diff --git a/drivers/iio/imu/Makefile b/drivers/iio/imu/Makefile
index 88b2c4555230..13e9ff442b11 100644
--- a/drivers/iio/imu/Makefile
+++ b/drivers/iio/imu/Makefile
@@ -20,6 +20,7 @@  obj-$(CONFIG_FXOS8700) += fxos8700_core.o
 obj-$(CONFIG_FXOS8700_I2C) += fxos8700_i2c.o
 obj-$(CONFIG_FXOS8700_SPI) += fxos8700_spi.o
 
+obj-y += inv_icm42600/
 obj-y += inv_mpu6050/
 
 obj-$(CONFIG_KMX61) += kmx61.o
diff --git a/drivers/iio/imu/inv_icm42600/Kconfig b/drivers/iio/imu/inv_icm42600/Kconfig
new file mode 100644
index 000000000000..22390a72f0a3
--- /dev/null
+++ b/drivers/iio/imu/inv_icm42600/Kconfig
@@ -0,0 +1,28 @@ 
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+config INV_ICM42600
+	tristate
+
+config INV_ICM42600_I2C
+	tristate "InvenSense ICM-426xx I2C driver"
+	depends on I2C
+	select INV_ICM42600
+	select REGMAP_I2C
+	help
+	  This driver supports the InvenSense ICM-426xx motion tracking
+	  devices over I2C.
+
+	  This driver can be built as a module. The module will be called
+	  inv-icm42600-i2c.
+
+config INV_ICM42600_SPI
+	tristate "InvenSense ICM-426xx SPI driver"
+	depends on SPI_MASTER
+	select INV_ICM42600
+	select REGMAP_SPI
+	help
+	  This driver supports the InvenSense ICM-426xx motion tracking
+	  devices over SPI.
+
+	  This driver can be built as a module. The module will be called
+	  inv-icm42600-spi.
diff --git a/drivers/iio/imu/inv_icm42600/Makefile b/drivers/iio/imu/inv_icm42600/Makefile
new file mode 100644
index 000000000000..48965824f00c
--- /dev/null
+++ b/drivers/iio/imu/inv_icm42600/Makefile
@@ -0,0 +1,13 @@ 
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+obj-$(CONFIG_INV_ICM42600) += inv-icm42600.o
+inv-icm42600-y += inv_icm42600_core.o
+inv-icm42600-y += inv_icm42600_gyro.o
+inv-icm42600-y += inv_icm42600_accel.o
+inv-icm42600-y += inv_icm42600_temp.o
+
+obj-$(CONFIG_INV_ICM42600_I2C) += inv-icm42600-i2c.o
+inv-icm42600-i2c-y += inv_icm42600_i2c.o
+
+obj-$(CONFIG_INV_ICM42600_SPI) += inv-icm42600-spi.o
+inv-icm42600-spi-y += inv_icm42600_spi.o