From: "H. Nikolaus Schaller" <hns@goldelico.com>
To: Jonathan Cameron <jic23@kernel.org>
Cc: letux-kernel@openphoenux.org, kernel@pyra-handheld.com,
Hartmut Knaack <knaack.h@gmx.de>,
Lars-Peter Clausen <lars@metafoo.de>,
Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org,
"H. Nikolaus Schaller" <hns@goldelico.com>
Subject: [RFC 4/4] iio: input-bridge: make the iio-input-bridge driver called by iio-core
Date: Mon, 18 Mar 2019 21:39:34 +0100 [thread overview]
Message-ID: <f5c1baba29b0b1e82d49190c96a83cbef3a1cd6f.1552941573.git.hns@goldelico.com> (raw)
In-Reply-To: <cover.1552941573.git.hns@goldelico.com>
This adds the iio-input-bridge to iio device (un)registering so
that accelerometers are located and made present an input event
device.
Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
---
drivers/iio/industrialio-core.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
index 4700fd5d8c90..81f412b41a78 100644
--- a/drivers/iio/industrialio-core.c
+++ b/drivers/iio/industrialio-core.c
@@ -29,6 +29,7 @@
#include <linux/iio/iio.h>
#include "iio_core.h"
#include "iio_core_trigger.h"
+#include "industrialio-inputbridge.h"
#include <linux/iio/sysfs.h>
#include <linux/iio/events.h>
#include <linux/iio/buffer.h>
@@ -1723,6 +1724,15 @@ int __iio_device_register(struct iio_dev *indio_dev, struct module *this_mod)
if (ret < 0)
goto error_unreg_eventset;
+ ret = iio_device_register_inputbridge(indio_dev);
+ if (ret) {
+ dev_err(indio_dev->dev.parent,
+ "Failed to register as input driver\n");
+ device_del(&indio_dev->dev);
+
+ return ret;
+ }
+
return 0;
error_unreg_eventset:
@@ -1745,6 +1755,8 @@ void iio_device_unregister(struct iio_dev *indio_dev)
{
mutex_lock(&indio_dev->info_exist_lock);
+ iio_device_unregister_inputbridge(indio_dev);
+
cdev_device_del(&indio_dev->chrdev, &indio_dev->dev);
iio_device_unregister_debugfs(indio_dev);
--
2.19.1
next prev parent reply other threads:[~2019-03-18 20:40 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-18 20:39 [RFC 0/4] iio-input-bridge so that accelerometers which only have an iio driver can still present evdev input events H. Nikolaus Schaller
2019-03-18 20:39 ` [RFC 1/4] iio: input-bridge: optionally bridge iio acceleometers to create a /dev/input H. Nikolaus Schaller
2019-03-18 20:39 ` [RFC 2/4] iio: input-bridge: add iio-input-bridge to Makefile H. Nikolaus Schaller
2019-03-18 20:39 ` [RFC 3/4] iio: input-bridge: add IIO_INPUT_BRIDGE kernel config option H. Nikolaus Schaller
2019-03-18 20:39 ` H. Nikolaus Schaller [this message]
2019-03-24 18:29 ` [RFC 0/4] iio-input-bridge so that accelerometers which only have an iio driver can still present evdev input events Jonathan Cameron
2019-03-28 17:42 ` H. Nikolaus Schaller
2019-03-31 10:09 ` H. Nikolaus Schaller
2019-03-31 11:05 ` 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=f5c1baba29b0b1e82d49190c96a83cbef3a1cd6f.1552941573.git.hns@goldelico.com \
--to=hns@goldelico.com \
--cc=jic23@kernel.org \
--cc=kernel@pyra-handheld.com \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=letux-kernel@openphoenux.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pmeerw@pmeerw.net \
/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).