From: Daniel Baluta <daniel.baluta@intel.com>
To: jic23@kernel.org
Cc: knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net,
daniel.baluta@intel.com, matt.ranostay@intel.com,
lucas.demarchi@intel.com, cmo@melexis.com,
linux-iio@vger.kernel.org, ggao@invensense.com,
srinivas.pandruvada@linux.intel.com, adi.reus@gmail.com
Subject: [PATCH 2/3] iio: imu: mpu6050: Move request IRQ outside of probe trigger
Date: Thu, 17 Mar 2016 18:32:45 +0200 [thread overview]
Message-ID: <1458232366-12773-3-git-send-email-daniel.baluta@intel.com> (raw)
In-Reply-To: <1458232366-12773-1-git-send-email-daniel.baluta@intel.com>
Besides signalling data ready, IRQ line of Invensense MPU
can also signal the status of slaves attached on secondary
I2C bus.
In order to prepare supporting secondary I2C interface we need
to detach IRQ request from data ready trigger creation.
Signed-off-by: Daniel Baluta <daniel.baluta@intel.com>
---
drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 8 ++++++++
drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c | 8 --------
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
index d192953..659a4be 100644
--- a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
+++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
@@ -823,6 +823,14 @@ int inv_mpu_core_probe(struct regmap *regmap, int irq, const char *name,
goto out_unreg_ring;
}
+ result = devm_request_irq(&indio_dev->dev, st->irq,
+ &iio_trigger_generic_data_rdy_poll,
+ IRQF_TRIGGER_RISING, "inv_mpu", st->trig);
+ if (result) {
+ dev_err(dev, "request irq fail %d\n", result);
+ goto out_remove_trigger;
+ }
+
INIT_KFIFO(st->timestamps);
spin_lock_init(&st->time_stamp_lock);
result = iio_device_register(indio_dev);
diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c
index e8818d4..acfa513 100644
--- a/drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c
+++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c
@@ -123,14 +123,6 @@ int inv_mpu6050_probe_trigger(struct iio_dev *indio_dev)
if (!st->trig)
return -ENOMEM;
- ret = devm_request_irq(&indio_dev->dev, st->irq,
- &iio_trigger_generic_data_rdy_poll,
- IRQF_TRIGGER_RISING,
- "inv_mpu",
- st->trig);
- if (ret)
- return ret;
-
st->trig->dev.parent = regmap_get_device(st->map);
st->trig->ops = &inv_mpu_trigger_ops;
iio_trigger_set_drvdata(st->trig, indio_dev);
--
2.5.0
next prev parent reply other threads:[~2016-03-17 16:30 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-17 16:32 [PATCH 0/3] Introduce support for INV MPU6050 secondary I2C master Daniel Baluta
2016-03-17 16:32 ` [PATCH 1/3] iio: imu: mpu6050: Fix name/chip_id when using ACPI Daniel Baluta
2016-03-17 17:21 ` Matt Ranostay
2016-03-20 10:40 ` Jonathan Cameron
2016-03-21 10:16 ` Daniel Baluta
2016-03-21 18:58 ` Jonathan Cameron
2016-03-17 16:32 ` Daniel Baluta [this message]
2016-03-17 17:24 ` [PATCH 2/3] iio: imu: mpu6050: Move request IRQ outside of probe trigger Matt Ranostay
2016-03-17 16:32 ` [PATCH 3/3] iio: imu: mpu6050: Add support for auxiliary I2C master Daniel Baluta
2016-03-17 17:28 ` Matt Ranostay
2016-03-17 18:11 ` Ge Gao
2016-03-17 18:13 ` Matt Ranostay
2016-03-17 21:15 ` De Marchi, Lucas
2016-03-20 10:54 ` Jonathan Cameron
2016-03-20 10:47 ` Jonathan Cameron
2016-03-23 12:32 ` Daniel Baluta
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=1458232366-12773-3-git-send-email-daniel.baluta@intel.com \
--to=daniel.baluta@intel.com \
--cc=adi.reus@gmail.com \
--cc=cmo@melexis.com \
--cc=ggao@invensense.com \
--cc=jic23@kernel.org \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=lucas.demarchi@intel.com \
--cc=matt.ranostay@intel.com \
--cc=pmeerw@pmeerw.net \
--cc=srinivas.pandruvada@linux.intel.com \
/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).