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
db6e1fd2
Commit
db6e1fd2
authored
Aug 30, 2014
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
greybus: hook up sdio, gpio, and tty into the greybus core.
parent
503c1cdb
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
74 additions
and
19 deletions
+74
-19
drivers/staging/greybus/Makefile
drivers/staging/greybus/Makefile
+1
-4
drivers/staging/greybus/core.c
drivers/staging/greybus/core.c
+41
-0
drivers/staging/greybus/gpio-gb.c
drivers/staging/greybus/gpio-gb.c
+7
-4
drivers/staging/greybus/greybus.h
drivers/staging/greybus/greybus.h
+9
-1
drivers/staging/greybus/sdio-gb.c
drivers/staging/greybus/sdio-gb.c
+7
-4
drivers/staging/greybus/uart-gb.c
drivers/staging/greybus/uart-gb.c
+9
-6
No files found.
drivers/staging/greybus/Makefile
View file @
db6e1fd2
greybus-y
:=
core.o gbuf.o i2c-gb.o
greybus-y
:=
core.o gbuf.o i2c-gb.o
gpio-gb.o sdio-gb.o uart-gb.o
obj-m
+=
greybus.o
obj-m
+=
greybus.o
obj-m
+=
sdio-gb.o
obj-m
+=
gpio-gb.o
obj-m
+=
uart-gb.o
KERNELVER
?=
$(
shell
uname
-r
)
KERNELVER
?=
$(
shell
uname
-r
)
KERNELDIR
?=
/lib/modules/
$(KERNELVER)
/build
KERNELDIR
?=
/lib/modules/
$(KERNELVER)
/build
...
...
drivers/staging/greybus/core.c
View file @
db6e1fd2
...
@@ -157,17 +157,58 @@ static int new_device(struct greybus_device *gdev,
...
@@ -157,17 +157,58 @@ static int new_device(struct greybus_device *gdev,
/* Allocate all of the different "sub device types" for this device */
/* Allocate all of the different "sub device types" for this device */
retval
=
gb_i2c_probe
(
gdev
,
id
);
retval
=
gb_i2c_probe
(
gdev
,
id
);
if
(
retval
)
goto
error_i2c
;
retval
=
gb_gpio_probe
(
gdev
,
id
);
if
(
retval
)
goto
error_gpio
;
retval
=
gb_sdio_probe
(
gdev
,
id
);
if
(
retval
)
goto
error_sdio
;
retval
=
gb_tty_probe
(
gdev
,
id
);
if
(
retval
)
goto
error_tty
;
return
0
;
return
0
;
error_tty:
gb_sdio_disconnect
(
gdev
);
error_sdio:
gb_gpio_disconnect
(
gdev
);
error_gpio:
gb_i2c_disconnect
(
gdev
);
error_i2c:
return
retval
;
}
}
static
void
remove_device
(
struct
greybus_device
*
gdev
)
{
/* tear down all of the "sub device types" for this device */
gb_i2c_disconnect
(
gdev
);
gb_gpio_disconnect
(
gdev
);
gb_sdio_disconnect
(
gdev
);
gb_tty_disconnect
(
gdev
);
}
static
int
__init
gb_init
(
void
)
static
int
__init
gb_init
(
void
)
{
{
int
retval
;
retval
=
gb_tty_init
();
if
(
retval
)
return
retval
;
return
0
;
return
0
;
}
}
static
void
__exit
gb_exit
(
void
)
static
void
__exit
gb_exit
(
void
)
{
{
gb_tty_exit
();
}
}
module_init
(
gb_init
);
module_init
(
gb_init
);
...
...
drivers/staging/greybus/gpio-gb.c
View file @
db6e1fd2
...
@@ -51,7 +51,8 @@ static void gpio_set(struct gpio_chip *gpio, unsigned nr, int val)
...
@@ -51,7 +51,8 @@ static void gpio_set(struct gpio_chip *gpio, unsigned nr, int val)
return
;
return
;
}
}
static
int
gpio_gb_probe
(
struct
greybus_device
*
gdev
,
const
struct
greybus_device_id
*
id
)
int
gb_gpio_probe
(
struct
greybus_device
*
gdev
,
const
struct
greybus_device_id
*
id
)
{
{
struct
gb_gpio_device
*
gb_gpio
;
struct
gb_gpio_device
*
gb_gpio
;
struct
gpio_chip
*
gpio
;
struct
gpio_chip
*
gpio
;
...
@@ -87,7 +88,7 @@ static int gpio_gb_probe(struct greybus_device *gdev, const struct greybus_devic
...
@@ -87,7 +88,7 @@ static int gpio_gb_probe(struct greybus_device *gdev, const struct greybus_devic
return
0
;
return
0
;
}
}
static
void
gpio_gb
_disconnect
(
struct
greybus_device
*
gdev
)
void
gb_gpio
_disconnect
(
struct
greybus_device
*
gdev
)
{
{
struct
gb_gpio_device
*
gb_gpio_dev
;
struct
gb_gpio_device
*
gb_gpio_dev
;
...
@@ -96,9 +97,10 @@ static void gpio_gb_disconnect(struct greybus_device *gdev)
...
@@ -96,9 +97,10 @@ static void gpio_gb_disconnect(struct greybus_device *gdev)
gpiochip_remove
(
&
gb_gpio_dev
->
chip
);
gpiochip_remove
(
&
gb_gpio_dev
->
chip
);
}
}
#if 0
static struct greybus_driver gpio_gb_driver = {
static struct greybus_driver gpio_gb_driver = {
.
probe
=
g
pio_gb
_probe
,
.probe = g
b_gpio
_probe,
.
disconnect
=
g
pio_gb
_disconnect
,
.disconnect = g
b_gpio
_disconnect,
.id_table = id_table,
.id_table = id_table,
};
};
...
@@ -106,3 +108,4 @@ module_greybus_driver(gpio_gb_driver);
...
@@ -106,3 +108,4 @@ module_greybus_driver(gpio_gb_driver);
MODULE_LICENSE("GPL");
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Greybus GPIO driver");
MODULE_DESCRIPTION("Greybus GPIO driver");
MODULE_AUTHOR("Greg Kroah-Hartman <gregkh@linuxfoundation.org>");
MODULE_AUTHOR("Greg Kroah-Hartman <gregkh@linuxfoundation.org>");
#endif
drivers/staging/greybus/greybus.h
View file @
db6e1fd2
...
@@ -109,7 +109,15 @@ struct greybus_device {
...
@@ -109,7 +109,15 @@ struct greybus_device {
*/
*/
int
gb_i2c_probe
(
struct
greybus_device
*
gdev
,
const
struct
greybus_device_id
*
id
);
int
gb_i2c_probe
(
struct
greybus_device
*
gdev
,
const
struct
greybus_device_id
*
id
);
void
gb_i2c_disconnect
(
struct
greybus_device
*
gdev
);
void
gb_i2c_disconnect
(
struct
greybus_device
*
gdev
);
int
gb_gpio_probe
(
struct
greybus_device
*
gdev
,
const
struct
greybus_device_id
*
id
);
void
gb_gpio_disconnect
(
struct
greybus_device
*
gdev
);
int
gb_sdio_probe
(
struct
greybus_device
*
gdev
,
const
struct
greybus_device_id
*
id
);
void
gb_sdio_disconnect
(
struct
greybus_device
*
gdev
);
int
gb_tty_probe
(
struct
greybus_device
*
gdev
,
const
struct
greybus_device_id
*
id
);
void
gb_tty_disconnect
(
struct
greybus_device
*
gdev
);
int
gb_tty_init
(
void
);
void
gb_tty_exit
(
void
);
struct
gbuf
*
greybus_alloc_gbuf
(
struct
greybus_device
*
gdev
,
struct
gbuf
*
greybus_alloc_gbuf
(
struct
greybus_device
*
gdev
,
struct
cport
*
cport
,
struct
cport
*
cport
,
...
...
drivers/staging/greybus/sdio-gb.c
View file @
db6e1fd2
...
@@ -45,7 +45,8 @@ static const struct mmc_host_ops gb_sd_ops = {
...
@@ -45,7 +45,8 @@ static const struct mmc_host_ops gb_sd_ops = {
.
get_ro
=
gb_sd_get_ro
,
.
get_ro
=
gb_sd_get_ro
,
};
};
static
int
sd_gb_probe
(
struct
greybus_device
*
gdev
,
const
struct
greybus_device_id
*
id
)
int
gb_sdio_probe
(
struct
greybus_device
*
gdev
,
const
struct
greybus_device_id
*
id
)
{
{
struct
mmc_host
*
mmc
;
struct
mmc_host
*
mmc
;
struct
gb_sdio_host
*
host
;
struct
gb_sdio_host
*
host
;
...
@@ -64,7 +65,7 @@ static int sd_gb_probe(struct greybus_device *gdev, const struct greybus_device_
...
@@ -64,7 +65,7 @@ static int sd_gb_probe(struct greybus_device *gdev, const struct greybus_device_
return
0
;
return
0
;
}
}
static
void
sd_gb
_disconnect
(
struct
greybus_device
*
gdev
)
void
gb_sdio
_disconnect
(
struct
greybus_device
*
gdev
)
{
{
struct
mmc_host
*
mmc
;
struct
mmc_host
*
mmc
;
struct
gb_sdio_host
*
host
;
struct
gb_sdio_host
*
host
;
...
@@ -76,9 +77,10 @@ static void sd_gb_disconnect(struct greybus_device *gdev)
...
@@ -76,9 +77,10 @@ static void sd_gb_disconnect(struct greybus_device *gdev)
mmc_free_host
(
mmc
);
mmc_free_host
(
mmc
);
}
}
#if 0
static struct greybus_driver sd_gb_driver = {
static struct greybus_driver sd_gb_driver = {
.
probe
=
sd_gb
_probe
,
.probe =
gb_sdio
_probe,
.
disconnect
=
sd_gb
_disconnect
,
.disconnect =
gb_sdio
_disconnect,
.id_table = id_table,
.id_table = id_table,
};
};
...
@@ -86,3 +88,4 @@ module_greybus_driver(sd_gb_driver);
...
@@ -86,3 +88,4 @@ module_greybus_driver(sd_gb_driver);
MODULE_LICENSE("GPL");
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Greybus SD/MMC Host driver");
MODULE_DESCRIPTION("Greybus SD/MMC Host driver");
MODULE_AUTHOR("Greg Kroah-Hartman <gregkh@linuxfoundation.org>");
MODULE_AUTHOR("Greg Kroah-Hartman <gregkh@linuxfoundation.org>");
#endif
drivers/staging/greybus/uart-gb.c
View file @
db6e1fd2
...
@@ -382,7 +382,8 @@ static const struct tty_operations gb_ops = {
...
@@ -382,7 +382,8 @@ static const struct tty_operations gb_ops = {
};
};
static
int
tty_gb_probe
(
struct
greybus_device
*
gdev
,
const
struct
greybus_device_id
*
id
)
int
gb_tty_probe
(
struct
greybus_device
*
gdev
,
const
struct
greybus_device_id
*
id
)
{
{
struct
gb_tty
*
gb_tty
;
struct
gb_tty
*
gb_tty
;
struct
device
*
tty_dev
;
struct
device
*
tty_dev
;
...
@@ -427,7 +428,7 @@ static int tty_gb_probe(struct greybus_device *gdev, const struct greybus_device
...
@@ -427,7 +428,7 @@ static int tty_gb_probe(struct greybus_device *gdev, const struct greybus_device
return
retval
;
return
retval
;
}
}
static
void
tty_gb
_disconnect
(
struct
greybus_device
*
gdev
)
void
gb_tty
_disconnect
(
struct
greybus_device
*
gdev
)
{
{
struct
gb_tty
*
gb_tty
=
greybus_get_drvdata
(
gdev
);
struct
gb_tty
*
gb_tty
=
greybus_get_drvdata
(
gdev
);
struct
tty_struct
*
tty
;
struct
tty_struct
*
tty
;
...
@@ -457,13 +458,13 @@ static void tty_gb_disconnect(struct greybus_device *gdev)
...
@@ -457,13 +458,13 @@ static void tty_gb_disconnect(struct greybus_device *gdev)
}
}
static
struct
greybus_driver
tty_gb_driver
=
{
static
struct
greybus_driver
tty_gb_driver
=
{
.
probe
=
tty_gb
_probe
,
.
probe
=
gb_tty
_probe
,
.
disconnect
=
tty_gb
_disconnect
,
.
disconnect
=
gb_tty
_disconnect
,
.
id_table
=
id_table
,
.
id_table
=
id_table
,
};
};
static
int
__init
gb_tty_init
(
void
)
int
__init
gb_tty_init
(
void
)
{
{
int
retval
;
int
retval
;
...
@@ -496,14 +497,16 @@ static int __init gb_tty_init(void)
...
@@ -496,14 +497,16 @@ static int __init gb_tty_init(void)
return
retval
;
return
retval
;
}
}
static
void
__exit
gb_tty_exit
(
void
)
void
__exit
gb_tty_exit
(
void
)
{
{
greybus_deregister
(
&
tty_gb_driver
);
greybus_deregister
(
&
tty_gb_driver
);
tty_unregister_driver
(
gb_tty_driver
);
tty_unregister_driver
(
gb_tty_driver
);
put_tty_driver
(
gb_tty_driver
);
put_tty_driver
(
gb_tty_driver
);
}
}
#if 0
module_init(gb_tty_init);
module_init(gb_tty_init);
module_exit(gb_tty_exit);
module_exit(gb_tty_exit);
MODULE_LICENSE("GPL");
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Greg Kroah-Hartman <gregkh@linuxfoundation.org>");
MODULE_AUTHOR("Greg Kroah-Hartman <gregkh@linuxfoundation.org>");
#endif
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