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
nexedi
linux
Commits
d7f8172c
Commit
d7f8172c
authored
Jul 03, 2011
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nvd0/gpio: initial implementation
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
eeb3ca12
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
4 deletions
+48
-4
drivers/gpu/drm/nouveau/nouveau_bios.c
drivers/gpu/drm/nouveau/nouveau_bios.c
+9
-3
drivers/gpu/drm/nouveau/nouveau_drv.h
drivers/gpu/drm/nouveau/nouveau_drv.h
+2
-0
drivers/gpu/drm/nouveau/nouveau_state.c
drivers/gpu/drm/nouveau/nouveau_state.c
+6
-1
drivers/gpu/drm/nouveau/nv50_gpio.c
drivers/gpu/drm/nouveau/nv50_gpio.c
+31
-0
No files found.
drivers/gpu/drm/nouveau/nouveau_bios.c
View file @
d7f8172c
...
@@ -5884,9 +5884,15 @@ parse_dcb_gpio_table(struct nvbios *bios)
...
@@ -5884,9 +5884,15 @@ parse_dcb_gpio_table(struct nvbios *bios)
}
}
e
->
line
=
(
e
->
entry
&
0x0000001f
)
>>
0
;
e
->
line
=
(
e
->
entry
&
0x0000001f
)
>>
0
;
e
->
state_default
=
(
e
->
entry
&
0x01000000
)
>>
24
;
if
(
gpio
[
0
]
==
0x40
)
{
e
->
state
[
0
]
=
(
e
->
entry
&
0x18000000
)
>>
27
;
e
->
state_default
=
(
e
->
entry
&
0x01000000
)
>>
24
;
e
->
state
[
1
]
=
(
e
->
entry
&
0x60000000
)
>>
29
;
e
->
state
[
0
]
=
(
e
->
entry
&
0x18000000
)
>>
27
;
e
->
state
[
1
]
=
(
e
->
entry
&
0x60000000
)
>>
29
;
}
else
{
e
->
state_default
=
(
e
->
entry
&
0x00000080
)
>>
7
;
e
->
state
[
0
]
=
(
entry
[
4
]
>>
4
)
&
3
;
e
->
state
[
1
]
=
(
entry
[
4
]
>>
6
)
&
3
;
}
}
}
}
}
...
...
drivers/gpu/drm/nouveau/nouveau_drv.h
View file @
d7f8172c
...
@@ -1391,6 +1391,8 @@ int nv50_gpio_init(struct drm_device *dev);
...
@@ -1391,6 +1391,8 @@ int nv50_gpio_init(struct drm_device *dev);
void
nv50_gpio_fini
(
struct
drm_device
*
dev
);
void
nv50_gpio_fini
(
struct
drm_device
*
dev
);
int
nv50_gpio_get
(
struct
drm_device
*
dev
,
enum
dcb_gpio_tag
tag
);
int
nv50_gpio_get
(
struct
drm_device
*
dev
,
enum
dcb_gpio_tag
tag
);
int
nv50_gpio_set
(
struct
drm_device
*
dev
,
enum
dcb_gpio_tag
tag
,
int
state
);
int
nv50_gpio_set
(
struct
drm_device
*
dev
,
enum
dcb_gpio_tag
tag
,
int
state
);
int
nvd0_gpio_get
(
struct
drm_device
*
dev
,
enum
dcb_gpio_tag
tag
);
int
nvd0_gpio_set
(
struct
drm_device
*
dev
,
enum
dcb_gpio_tag
tag
,
int
state
);
int
nv50_gpio_irq_register
(
struct
drm_device
*
,
enum
dcb_gpio_tag
,
int
nv50_gpio_irq_register
(
struct
drm_device
*
,
enum
dcb_gpio_tag
,
void
(
*
)(
void
*
,
int
),
void
*
);
void
(
*
)(
void
*
,
int
),
void
*
);
void
nv50_gpio_irq_unregister
(
struct
drm_device
*
,
enum
dcb_gpio_tag
,
void
nv50_gpio_irq_unregister
(
struct
drm_device
*
,
enum
dcb_gpio_tag
,
...
...
drivers/gpu/drm/nouveau/nouveau_state.c
View file @
d7f8172c
...
@@ -459,8 +459,13 @@ static int nouveau_init_engine_ptrs(struct drm_device *dev)
...
@@ -459,8 +459,13 @@ static int nouveau_init_engine_ptrs(struct drm_device *dev)
engine
->
display
.
create
=
nouveau_stub_init
;
engine
->
display
.
create
=
nouveau_stub_init
;
engine
->
display
.
init
=
nouveau_stub_init
;
engine
->
display
.
init
=
nouveau_stub_init
;
engine
->
display
.
destroy
=
nouveau_stub_takedown
;
engine
->
display
.
destroy
=
nouveau_stub_takedown
;
engine
->
gpio
.
init
=
n
ouveau_stub
_init
;
engine
->
gpio
.
init
=
n
v50_gpio
_init
;
engine
->
gpio
.
takedown
=
nouveau_stub_takedown
;
engine
->
gpio
.
takedown
=
nouveau_stub_takedown
;
engine
->
gpio
.
get
=
nvd0_gpio_get
;
engine
->
gpio
.
set
=
nvd0_gpio_set
;
engine
->
gpio
.
irq_register
=
nv50_gpio_irq_register
;
engine
->
gpio
.
irq_unregister
=
nv50_gpio_irq_unregister
;
engine
->
gpio
.
irq_enable
=
nv50_gpio_irq_enable
;
engine
->
vram
.
init
=
nvc0_vram_init
;
engine
->
vram
.
init
=
nvc0_vram_init
;
engine
->
vram
.
takedown
=
nv50_vram_fini
;
engine
->
vram
.
takedown
=
nv50_vram_fini
;
engine
->
vram
.
get
=
nvc0_vram_new
;
engine
->
vram
.
get
=
nvc0_vram_new
;
...
...
drivers/gpu/drm/nouveau/nv50_gpio.c
View file @
d7f8172c
...
@@ -97,6 +97,37 @@ nv50_gpio_set(struct drm_device *dev, enum dcb_gpio_tag tag, int state)
...
@@ -97,6 +97,37 @@ nv50_gpio_set(struct drm_device *dev, enum dcb_gpio_tag tag, int state)
return
0
;
return
0
;
}
}
int
nvd0_gpio_get
(
struct
drm_device
*
dev
,
enum
dcb_gpio_tag
tag
)
{
struct
dcb_gpio_entry
*
gpio
;
u32
v
;
gpio
=
nouveau_bios_gpio_entry
(
dev
,
tag
);
if
(
!
gpio
)
return
-
ENOENT
;
v
=
nv_rd32
(
dev
,
0x00d610
+
(
gpio
->
line
*
4
));
v
&=
0x00004000
;
return
(
!!
v
==
(
gpio
->
state
[
1
]
&
1
));
}
int
nvd0_gpio_set
(
struct
drm_device
*
dev
,
enum
dcb_gpio_tag
tag
,
int
state
)
{
struct
dcb_gpio_entry
*
gpio
;
u32
v
;
gpio
=
nouveau_bios_gpio_entry
(
dev
,
tag
);
if
(
!
gpio
)
return
-
ENOENT
;
v
=
gpio
->
state
[
state
]
^
2
;
nv_mask
(
dev
,
0x00d610
+
(
gpio
->
line
*
4
),
0x00003000
,
v
<<
12
);
return
0
;
}
int
int
nv50_gpio_irq_register
(
struct
drm_device
*
dev
,
enum
dcb_gpio_tag
tag
,
nv50_gpio_irq_register
(
struct
drm_device
*
dev
,
enum
dcb_gpio_tag
tag
,
void
(
*
handler
)(
void
*
,
int
),
void
*
data
)
void
(
*
handler
)(
void
*
,
int
),
void
*
data
)
...
...
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