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
e9023d22
Commit
e9023d22
authored
Aug 12, 2014
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
greybus: gpio-gb.c: it now builds properly
parent
c16854c3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
16 deletions
+16
-16
drivers/staging/greybus/gpio-gb.c
drivers/staging/greybus/gpio-gb.c
+16
-16
No files found.
drivers/staging/greybus/gpio-gb.c
View file @
e9023d22
...
@@ -10,11 +10,13 @@
...
@@ -10,11 +10,13 @@
#include <linux/module.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/slab.h>
#include <linux/gpio.h>
#include <linux/gpio.h>
#include <linux/gpio/driver.h>
#include "greybus.h"
#include "greybus.h"
struct
gb_gpio
{
struct
gb_gpio
{
struct
gpio_chip
chip
;
struct
gpio_chip
chip
;
struct
greybus_device
*
gdev
;
struct
greybus_device
*
gdev
;
struct
gpio_chip
*
gpio
;
// FIXME - some lock?
// FIXME - some lock?
};
};
...
@@ -25,7 +27,7 @@ static const struct greybus_device_id id_table[] = {
...
@@ -25,7 +27,7 @@ static const struct greybus_device_id id_table[] = {
static
int
direction_input
(
struct
gpio_chip
*
gpio
,
unsigned
nr
)
static
int
direction_input
(
struct
gpio_chip
*
gpio
,
unsigned
nr
)
{
{
struct
gp_gpio
*
gp_gpio
=
container_of
(
gpio
,
struct
gp
_gpio
,
chip
);
// struct gb_gpio *gb_gpio = container_of(gpio, struct gb
_gpio, chip);
// FIXME - do something there
// FIXME - do something there
return
0
;
return
0
;
...
@@ -43,24 +45,25 @@ static int gpio_get(struct gpio_chip *gpio, unsigned nr)
...
@@ -43,24 +45,25 @@ static int gpio_get(struct gpio_chip *gpio, unsigned nr)
return
0
;
return
0
;
}
}
static
int
gpio_set
(
struct
gpio_chip
*
gpio
,
unsigned
nr
,
int
val
)
static
void
gpio_set
(
struct
gpio_chip
*
gpio
,
unsigned
nr
,
int
val
)
{
{
// FIXME - do something there
// FIXME - do something there
return
0
;
return
;
}
}
static
int
gpio_gb_probe
(
struct
greybus_device
*
gdev
,
const
struct
greybus_device_id
*
id
)
static
int
gpio_gb_probe
(
struct
greybus_device
*
gdev
,
const
struct
greybus_device_id
*
id
)
{
{
struct
g
p_gpio
*
gp
_gpio
;
struct
g
b_gpio
*
gb
_gpio
;
struct
gpio_chip
*
gpio
;
struct
gpio_chip
*
gpio
;
struct
device
*
dev
=
&
gdev
->
dev
;
struct
device
*
dev
=
&
gdev
->
dev
;
int
retval
;
g
p_gpio
=
devm_kzalloc
(
dev
,
sizeof
(
*
gp
_gpio
),
GFP_KERNEL
);
g
b_gpio
=
devm_kzalloc
(
dev
,
sizeof
(
*
gb
_gpio
),
GFP_KERNEL
);
if
(
!
g
p
_gpio
)
if
(
!
g
b
_gpio
)
return
-
ENOMEM
;
return
-
ENOMEM
;
g
p
_gpio
->
gdev
=
gdev
;
g
b
_gpio
->
gdev
=
gdev
;
gpio
=
&
g
p_gpio
->
gpio
;
gpio
=
&
g
b_gpio
->
chip
;
gpio
->
label
=
"greybus_gpio"
;
gpio
->
label
=
"greybus_gpio"
;
gpio
->
owner
=
THIS_MODULE
;
gpio
->
owner
=
THIS_MODULE
;
...
@@ -73,9 +76,9 @@ static int gpio_gb_probe(struct greybus_device *gdev, const struct greybus_devic
...
@@ -73,9 +76,9 @@ static int gpio_gb_probe(struct greybus_device *gdev, const struct greybus_devic
gpio
->
ngpio
=
42
;
// FIXME!!!
gpio
->
ngpio
=
42
;
// FIXME!!!
gpio
->
can_sleep
=
false
;
// FIXME!!!
gpio
->
can_sleep
=
false
;
// FIXME!!!
greybus_set_drvdata
(
gdev
,
g
p
_gpio
);
greybus_set_drvdata
(
gdev
,
g
b
_gpio
);
retval
=
gpio
_
chip_add
(
gpio
);
retval
=
gpiochip_add
(
gpio
);
if
(
retval
)
{
if
(
retval
)
{
dev_err
(
dev
,
"Failed to register GPIO
\n
"
);
dev_err
(
dev
,
"Failed to register GPIO
\n
"
);
return
retval
;
return
retval
;
...
@@ -86,14 +89,11 @@ static int gpio_gb_probe(struct greybus_device *gdev, const struct greybus_devic
...
@@ -86,14 +89,11 @@ static int gpio_gb_probe(struct greybus_device *gdev, const struct greybus_devic
static
void
gpio_gb_disconnect
(
struct
greybus_device
*
gdev
)
static
void
gpio_gb_disconnect
(
struct
greybus_device
*
gdev
)
{
{
struct
mmc_host
*
mmc
;
struct
gb_gpio
*
gb_gpio
;
struct
sd_gb_host
*
host
;
host
=
greybus_get_drvdata
(
gdev
);
gb_gpio
=
greybus_get_drvdata
(
gdev
);
mmc
=
host
->
mmc
;
mmc_remove_host
(
mmc
);
gpiochip_remove
(
&
gb_gpio
->
chip
);
mmc_free_host
(
mmc
);
}
}
static
struct
greybus_driver
gpio_gb_driver
=
{
static
struct
greybus_driver
gpio_gb_driver
=
{
...
...
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