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
20a80074
Commit
20a80074
authored
May 13, 2014
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nouveau/gpio: send separate event types for high/low transitions
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
bc3b0c41
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
14 deletions
+17
-14
drivers/gpu/drm/nouveau/core/include/subdev/gpio.h
drivers/gpu/drm/nouveau/core/include/subdev/gpio.h
+6
-0
drivers/gpu/drm/nouveau/core/subdev/gpio/base.c
drivers/gpu/drm/nouveau/core/subdev/gpio/base.c
+10
-7
drivers/gpu/drm/nouveau/core/subdev/gpio/priv.h
drivers/gpu/drm/nouveau/core/subdev/gpio/priv.h
+0
-6
drivers/gpu/drm/nouveau/nouveau_connector.c
drivers/gpu/drm/nouveau/nouveau_connector.c
+1
-1
No files found.
drivers/gpu/drm/nouveau/core/include/subdev/gpio.h
View file @
20a80074
...
@@ -8,6 +8,12 @@
...
@@ -8,6 +8,12 @@
#include <subdev/bios.h>
#include <subdev/bios.h>
#include <subdev/bios/gpio.h>
#include <subdev/bios/gpio.h>
enum
nvkm_gpio_event
{
NVKM_GPIO_HI
=
1
,
NVKM_GPIO_LO
=
2
,
NVKM_GPIO_TOGGLED
=
(
NVKM_GPIO_HI
|
NVKM_GPIO_LO
),
};
struct
nouveau_gpio
{
struct
nouveau_gpio
{
struct
nouveau_subdev
base
;
struct
nouveau_subdev
base
;
...
...
drivers/gpu/drm/nouveau/core/subdev/gpio/base.c
View file @
20a80074
...
@@ -110,7 +110,7 @@ nouveau_gpio_intr_disable(struct nouveau_event *event, int type, int index)
...
@@ -110,7 +110,7 @@ nouveau_gpio_intr_disable(struct nouveau_event *event, int type, int index)
{
{
struct
nouveau_gpio
*
gpio
=
nouveau_gpio
(
event
->
priv
);
struct
nouveau_gpio
*
gpio
=
nouveau_gpio
(
event
->
priv
);
const
struct
nouveau_gpio_impl
*
impl
=
(
void
*
)
nv_object
(
gpio
)
->
oclass
;
const
struct
nouveau_gpio_impl
*
impl
=
(
void
*
)
nv_object
(
gpio
)
->
oclass
;
impl
->
intr_mask
(
gpio
,
NVKM_GPIO_TOGGLED
,
1
<<
index
,
0
);
impl
->
intr_mask
(
gpio
,
type
,
1
<<
index
,
0
);
}
}
static
void
static
void
...
@@ -118,7 +118,7 @@ nouveau_gpio_intr_enable(struct nouveau_event *event, int type, int index)
...
@@ -118,7 +118,7 @@ nouveau_gpio_intr_enable(struct nouveau_event *event, int type, int index)
{
{
struct
nouveau_gpio
*
gpio
=
nouveau_gpio
(
event
->
priv
);
struct
nouveau_gpio
*
gpio
=
nouveau_gpio
(
event
->
priv
);
const
struct
nouveau_gpio_impl
*
impl
=
(
void
*
)
nv_object
(
gpio
)
->
oclass
;
const
struct
nouveau_gpio_impl
*
impl
=
(
void
*
)
nv_object
(
gpio
)
->
oclass
;
impl
->
intr_mask
(
gpio
,
NVKM_GPIO_TOGGLED
,
1
<<
index
,
1
<<
index
);
impl
->
intr_mask
(
gpio
,
type
,
1
<<
index
,
1
<<
index
);
}
}
static
void
static
void
...
@@ -126,13 +126,16 @@ nouveau_gpio_intr(struct nouveau_subdev *subdev)
...
@@ -126,13 +126,16 @@ nouveau_gpio_intr(struct nouveau_subdev *subdev)
{
{
struct
nouveau_gpio
*
gpio
=
nouveau_gpio
(
subdev
);
struct
nouveau_gpio
*
gpio
=
nouveau_gpio
(
subdev
);
const
struct
nouveau_gpio_impl
*
impl
=
(
void
*
)
nv_object
(
gpio
)
->
oclass
;
const
struct
nouveau_gpio_impl
*
impl
=
(
void
*
)
nv_object
(
gpio
)
->
oclass
;
u32
hi
,
lo
,
i
;
u32
hi
,
lo
,
e
,
i
;
impl
->
intr_stat
(
gpio
,
&
hi
,
&
lo
);
impl
->
intr_stat
(
gpio
,
&
hi
,
&
lo
);
for
(
i
=
0
;
(
hi
|
lo
)
&&
i
<
impl
->
lines
;
i
++
)
{
for
(
i
=
0
;
e
=
0
,
(
hi
|
lo
)
&&
i
<
impl
->
lines
;
i
++
)
{
if
((
hi
|
lo
)
&
(
1
<<
i
))
if
(
hi
&
(
1
<<
i
))
nouveau_event_trigger
(
gpio
->
events
,
1
,
i
);
e
|=
NVKM_GPIO_HI
;
if
(
lo
&
(
1
<<
i
))
e
|=
NVKM_GPIO_LO
;
nouveau_event_trigger
(
gpio
->
events
,
e
,
i
);
}
}
}
}
...
@@ -205,7 +208,7 @@ nouveau_gpio_create_(struct nouveau_object *parent,
...
@@ -205,7 +208,7 @@ nouveau_gpio_create_(struct nouveau_object *parent,
gpio
->
get
=
nouveau_gpio_get
;
gpio
->
get
=
nouveau_gpio_get
;
gpio
->
reset
=
impl
->
reset
;
gpio
->
reset
=
impl
->
reset
;
ret
=
nouveau_event_create
(
1
,
impl
->
lines
,
&
gpio
->
events
);
ret
=
nouveau_event_create
(
2
,
impl
->
lines
,
&
gpio
->
events
);
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
...
...
drivers/gpu/drm/nouveau/core/subdev/gpio/priv.h
View file @
20a80074
...
@@ -27,12 +27,6 @@ void _nouveau_gpio_dtor(struct nouveau_object *);
...
@@ -27,12 +27,6 @@ void _nouveau_gpio_dtor(struct nouveau_object *);
int
_nouveau_gpio_init
(
struct
nouveau_object
*
);
int
_nouveau_gpio_init
(
struct
nouveau_object
*
);
int
_nouveau_gpio_fini
(
struct
nouveau_object
*
,
bool
);
int
_nouveau_gpio_fini
(
struct
nouveau_object
*
,
bool
);
enum
nvkm_gpio_event
{
NVKM_GPIO_HI
=
1
,
NVKM_GPIO_LO
=
2
,
NVKM_GPIO_TOGGLED
=
(
NVKM_GPIO_HI
|
NVKM_GPIO_LO
),
};
struct
nouveau_gpio_impl
{
struct
nouveau_gpio_impl
{
struct
nouveau_oclass
base
;
struct
nouveau_oclass
base
;
int
lines
;
int
lines
;
...
...
drivers/gpu/drm/nouveau/nouveau_connector.c
View file @
20a80074
...
@@ -1013,7 +1013,7 @@ nouveau_connector_create(struct drm_device *dev, int index)
...
@@ -1013,7 +1013,7 @@ nouveau_connector_create(struct drm_device *dev, int index)
nv_connector
->
hpd
.
func
=
DCB_GPIO_UNUSED
;
nv_connector
->
hpd
.
func
=
DCB_GPIO_UNUSED
;
if
(
nv_connector
->
hpd
.
func
!=
DCB_GPIO_UNUSED
)
{
if
(
nv_connector
->
hpd
.
func
!=
DCB_GPIO_UNUSED
)
{
nouveau_event_new
(
gpio
->
events
,
1
,
nouveau_event_new
(
gpio
->
events
,
NVKM_GPIO_TOGGLED
,
nv_connector
->
hpd
.
line
,
nv_connector
->
hpd
.
line
,
nouveau_connector_hotplug
,
nouveau_connector_hotplug
,
nv_connector
,
nv_connector
,
...
...
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