Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
27fb8310
Commit
27fb8310
authored
Aug 31, 2014
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
greybus: register the bus with the driver core and add framework for debugfs files.
parent
6f83ab76
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
59 additions
and
5 deletions
+59
-5
drivers/staging/greybus/Makefile
drivers/staging/greybus/Makefile
+1
-1
drivers/staging/greybus/core.c
drivers/staging/greybus/core.c
+22
-2
drivers/staging/greybus/debugfs.c
drivers/staging/greybus/debugfs.c
+34
-0
drivers/staging/greybus/greybus.h
drivers/staging/greybus/greybus.h
+2
-2
No files found.
drivers/staging/greybus/Makefile
View file @
27fb8310
greybus-y
:=
core.o gbuf.o i2c-gb.o gpio-gb.o sdio-gb.o uart-gb.o
greybus-y
:=
core.o gbuf.o
debugfs.o
i2c-gb.o gpio-gb.o sdio-gb.o uart-gb.o
obj-m
+=
greybus.o
obj-m
+=
es1-ap-usb.o
...
...
drivers/staging/greybus/core.c
View file @
27fb8310
...
...
@@ -86,7 +86,7 @@ static int greybus_uevent(struct device *dev, struct kobj_uevent_env *env)
return
0
;
}
struct
bus_type
greybus_bus_type
=
{
st
atic
st
ruct
bus_type
greybus_bus_type
=
{
.
name
=
"greybus"
,
.
match
=
greybus_device_match
,
.
uevent
=
greybus_uevent
,
...
...
@@ -199,16 +199,36 @@ static int __init gb_init(void)
{
int
retval
;
retval
=
g
b_tty
_init
();
retval
=
g
reybus_debugfs
_init
();
if
(
retval
)
return
retval
;
retval
=
bus_register
(
&
greybus_bus_type
);
if
(
retval
)
goto
error_bus
;
// FIXME - more gb core init goes here
retval
=
gb_tty_init
();
if
(
retval
)
goto
error_tty
;
return
0
;
error_tty:
bus_unregister
(
&
greybus_bus_type
);
error_bus:
greybus_debugfs_cleanup
();
return
retval
;
}
static
void
__exit
gb_exit
(
void
)
{
gb_tty_exit
();
bus_unregister
(
&
greybus_bus_type
);
greybus_debugfs_cleanup
();
}
module_init
(
gb_init
);
...
...
drivers/staging/greybus/debugfs.c
0 → 100644
View file @
27fb8310
/*
* Greybus debugfs code
*
* Copyright 2014 Google Inc.
*
* Released under the GPLv2 only.
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/types.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/kernel.h>
#include <linux/device.h>
#include <linux/debugfs.h>
#include "greybus.h"
static
struct
dentry
*
gb_debug_root
;
int
greybus_debugfs_init
(
void
)
{
gb_debug_root
=
debugfs_create_dir
(
"greybus"
,
NULL
);
if
(
!
gb_debug_root
)
return
-
ENOENT
;
return
0
;
}
void
greybus_debugfs_cleanup
(
void
)
{
debugfs_remove_recursive
(
gb_debug_root
);
}
drivers/staging/greybus/greybus.h
View file @
27fb8310
...
...
@@ -174,10 +174,10 @@ void greybus_deregister(struct greybus_driver *driver);
#define module_greybus_driver(__greybus_driver) \
module_driver(__greybus_driver, greybus_register, greybus_deregister)
extern
struct
bus_type
greybus_bus_type
;
int
greybus_disabled
(
void
);
int
greybus_debugfs_init
(
void
);
void
greybus_debugfs_cleanup
(
void
);
#endif
/* __KERNEL__ */
#endif
/* __LINUX_GREYBUS_H */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment