blob: 45ce2bc47180286c7c3b6ef9f50fb0c72ff7631e [file] [log] [blame]
Daniel Baluta8261d962015-11-09 09:13:59 +02001/*
2 * Industrial I/O configfs bits
3 *
4 * Copyright (c) 2015 Intel Corporation
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published by
8 * the Free Software Foundation.
9 */
10
11#include <linux/configfs.h>
12#include <linux/module.h>
13#include <linux/init.h>
14#include <linux/kmod.h>
15#include <linux/slab.h>
16
17#include <linux/iio/iio.h>
Jonathan Cameron8d6c16d2015-12-05 16:23:26 +000018#include <linux/iio/configfs.h>
Daniel Baluta8261d962015-11-09 09:13:59 +020019
20static struct config_item_type iio_root_group_type = {
21 .ct_owner = THIS_MODULE,
22};
23
24struct configfs_subsystem iio_configfs_subsys = {
25 .su_group = {
26 .cg_item = {
27 .ci_namebuf = "iio",
28 .ci_type = &iio_root_group_type,
29 },
30 },
31 .su_mutex = __MUTEX_INITIALIZER(iio_configfs_subsys.su_mutex),
32};
33EXPORT_SYMBOL(iio_configfs_subsys);
34
35static int __init iio_configfs_init(void)
36{
37 config_group_init(&iio_configfs_subsys.su_group);
38
39 return configfs_register_subsystem(&iio_configfs_subsys);
40}
41module_init(iio_configfs_init);
42
43static void __exit iio_configfs_exit(void)
44{
45 configfs_unregister_subsystem(&iio_configfs_subsys);
46}
47module_exit(iio_configfs_exit);
48
49MODULE_AUTHOR("Daniel Baluta <daniel.baluta@intel.com>");
50MODULE_DESCRIPTION("Industrial I/O configfs support");
51MODULE_LICENSE("GPL v2");