linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jean-Baptiste Maneyrol <JManeyrol@invensense.com>
To: "jic23@kernel.org" <jic23@kernel.org>
Cc: "linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	Jean-Baptiste Maneyrol <JManeyrol@invensense.com>
Subject: [PATCH 1/8] iio: imu: inv_mpu6050: disable i2c mux for 925x under Kconfig
Date: Thu, 29 Aug 2019 15:18:35 +0000	[thread overview]
Message-ID: <20190829151801.13014-2-jmaneyrol@invensense.com> (raw)
In-Reply-To: <20190829151801.13014-1-jmaneyrol@invensense.com>

Disable i2c mux for supported 9xxx chips when a Kconfig option
is enabled.
Add the new Kconfig option for enabling control of 9xxx
magnetometer using the i2c master of the chip. Since it has to be
explicitly enabled, we assure retro-compatibility with existing
configuration.

Signed-off-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
---
 drivers/iio/imu/inv_mpu6050/Kconfig       | 9 +++++++++
 drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c | 5 +++++
 2 files changed, 14 insertions(+)

diff --git a/drivers/iio/imu/inv_mpu6050/Kconfig b/drivers/iio/imu/inv_mpu6050/Kconfig
index e4c4c12236a7..a92b723c6b32 100644
--- a/drivers/iio/imu/inv_mpu6050/Kconfig
+++ b/drivers/iio/imu/inv_mpu6050/Kconfig
@@ -31,3 +31,12 @@ config INV_MPU6050_SPI
 	  over SPI.
 	  This driver can be built as a module. The module will be called
 	  inv-mpu6050-spi.
+
+config INV_MPU6050_MAGN
+	bool "Invensense 9-axis magnetometer support"
+	depends on INV_MPU6050_IIO
+	help
+	  For 9xxx chips add support of 9-axis in the driver using chip
+	  i2c master to drive the integrated magnetometer.
+	  Beware that this is disabling access to the i2c auxiliary bus!
+	  Support only MPU925x.
diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c
index 4b8b5a87398c..4c318304f9c6 100644
--- a/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c
+++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c
@@ -121,6 +121,11 @@ static int inv_mpu_probe(struct i2c_client *client,
 	case INV_ICM20608:
 	case INV_ICM20602:
 		/* no i2c auxiliary bus on the chip */
+#ifdef CONFIG_INV_MPU6050_MAGN
+	case INV_MPU9250:
+	case INV_MPU9255:
+		/* i2c auxiliary bus used for driving magnetometer */
+#endif
 		break;
 	default:
 		/* declare i2c auxiliary bus */
-- 
2.17.1


  reply	other threads:[~2019-08-29 15:42 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-29 15:18 [PATCH 0/8] add magnetometer support for MPU925x Jean-Baptiste Maneyrol
2019-08-29 15:18 ` Jean-Baptiste Maneyrol [this message]
2019-08-29 15:18 ` [PATCH 2/8] iio: imu: inv_mpu6050: add header include protection macro Jean-Baptiste Maneyrol
2019-08-29 15:18 ` [PATCH 3/8] iio: imu: inv_mpu6050: add defines for supporting 9-axis chips Jean-Baptiste Maneyrol
2019-08-29 15:18 ` [PATCH 4/8] iio: imu: inv_mpu6050: fix objects syntax in Makefile Jean-Baptiste Maneyrol
2019-08-29 15:18 ` [PATCH 5/8] iio: imu: inv_mpu6050: helpers for using i2c master on auxiliary bus Jean-Baptiste Maneyrol
2019-09-08 11:57   ` Jonathan Cameron
2019-08-29 15:18 ` [PATCH 6/8] iio: imu: inv_mpu6050: add magnetometer implementation for MPU925x Jean-Baptiste Maneyrol
2019-09-08 11:57   ` Jonathan Cameron
2019-08-29 15:18 ` [PATCH 7/8] iio: imu: inv_mpu6050: add magnetometer support inside mpu driver Jean-Baptiste Maneyrol
2019-09-08 12:05   ` Jonathan Cameron
2019-09-09 16:18     ` Jean-Baptiste Maneyrol
2019-08-29 15:18 ` [PATCH 8/8] iio: imu: inv_mpu6050: add fifo support for magnetometer data Jean-Baptiste Maneyrol
2019-09-08 12:07   ` Jonathan Cameron
2019-09-08 11:42 ` [PATCH 0/8] add magnetometer support for MPU925x Jonathan Cameron
2019-09-09  9:55   ` Jean-Baptiste Maneyrol
2019-09-10 13:39     ` 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=20190829151801.13014-2-jmaneyrol@invensense.com \
    --to=jmaneyrol@invensense.com \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).