lkml.org 
[lkml]   [2019]   [Mar]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC 4/4] iio: input-bridge: make the iio-input-bridge driver called by iio-core
Date
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
\
 
 \ /
  Last update: 2019-03-18 21:40    [W:0.056 / U:5.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site