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
7356859a
Commit
7356859a
authored
May 12, 2014
by
Ben Skeggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drm/nouveau/gpio: split g92 class from nv50
Signed-off-by:
Ben Skeggs
<
bskeggs@redhat.com
>
parent
d93174ec
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
110 additions
and
58 deletions
+110
-58
drivers/gpu/drm/nouveau/Makefile
drivers/gpu/drm/nouveau/Makefile
+1
-0
drivers/gpu/drm/nouveau/core/engine/device/nv50.c
drivers/gpu/drm/nouveau/core/engine/device/nv50.c
+11
-11
drivers/gpu/drm/nouveau/core/engine/device/nvc0.c
drivers/gpu/drm/nouveau/core/engine/device/nvc0.c
+7
-7
drivers/gpu/drm/nouveau/core/include/subdev/gpio.h
drivers/gpu/drm/nouveau/core/include/subdev/gpio.h
+1
-14
drivers/gpu/drm/nouveau/core/subdev/gpio/base.c
drivers/gpu/drm/nouveau/core/subdev/gpio/base.c
+5
-3
drivers/gpu/drm/nouveau/core/subdev/gpio/nv10.c
drivers/gpu/drm/nouveau/core/subdev/gpio/nv10.c
+6
-5
drivers/gpu/drm/nouveau/core/subdev/gpio/nv50.c
drivers/gpu/drm/nouveau/core/subdev/gpio/nv50.c
+7
-8
drivers/gpu/drm/nouveau/core/subdev/gpio/nv92.c
drivers/gpu/drm/nouveau/core/subdev/gpio/nv92.c
+37
-0
drivers/gpu/drm/nouveau/core/subdev/gpio/nvd0.c
drivers/gpu/drm/nouveau/core/subdev/gpio/nvd0.c
+6
-5
drivers/gpu/drm/nouveau/core/subdev/gpio/nve0.c
drivers/gpu/drm/nouveau/core/subdev/gpio/nve0.c
+6
-5
drivers/gpu/drm/nouveau/core/subdev/gpio/priv.h
drivers/gpu/drm/nouveau/core/subdev/gpio/priv.h
+23
-0
No files found.
drivers/gpu/drm/nouveau/Makefile
View file @
7356859a
...
...
@@ -125,6 +125,7 @@ nouveau-y += core/subdev/fb/gddr5.o
nouveau-y
+=
core/subdev/gpio/base.o
nouveau-y
+=
core/subdev/gpio/nv10.o
nouveau-y
+=
core/subdev/gpio/nv50.o
nouveau-y
+=
core/subdev/gpio/nv92.o
nouveau-y
+=
core/subdev/gpio/nvd0.o
nouveau-y
+=
core/subdev/gpio/nve0.o
nouveau-y
+=
core/subdev/i2c/base.o
...
...
drivers/gpu/drm/nouveau/core/engine/device/nv50.c
View file @
7356859a
...
...
@@ -141,7 +141,7 @@ nv50_identify(struct nouveau_device *device)
case
0x92
:
device
->
cname
=
"G92"
;
device
->
oclass
[
NVDEV_SUBDEV_VBIOS
]
=
&
nouveau_bios_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_GPIO
]
=
nv
50
_gpio_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_GPIO
]
=
nv
92
_gpio_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_I2C
]
=
&
nv50_i2c_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_CLOCK
]
=
nv84_clock_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_THERM
]
=
&
nv84_therm_oclass
;
...
...
@@ -169,7 +169,7 @@ nv50_identify(struct nouveau_device *device)
case
0x94
:
device
->
cname
=
"G94"
;
device
->
oclass
[
NVDEV_SUBDEV_VBIOS
]
=
&
nouveau_bios_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_GPIO
]
=
nv
50
_gpio_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_GPIO
]
=
nv
92
_gpio_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_I2C
]
=
&
nv94_i2c_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_CLOCK
]
=
nv84_clock_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_THERM
]
=
&
nv84_therm_oclass
;
...
...
@@ -197,7 +197,7 @@ nv50_identify(struct nouveau_device *device)
case
0x96
:
device
->
cname
=
"G96"
;
device
->
oclass
[
NVDEV_SUBDEV_VBIOS
]
=
&
nouveau_bios_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_GPIO
]
=
nv
50
_gpio_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_GPIO
]
=
nv
92
_gpio_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_I2C
]
=
&
nv94_i2c_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_CLOCK
]
=
nv84_clock_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_THERM
]
=
&
nv84_therm_oclass
;
...
...
@@ -225,7 +225,7 @@ nv50_identify(struct nouveau_device *device)
case
0x98
:
device
->
cname
=
"G98"
;
device
->
oclass
[
NVDEV_SUBDEV_VBIOS
]
=
&
nouveau_bios_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_GPIO
]
=
nv
50
_gpio_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_GPIO
]
=
nv
92
_gpio_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_I2C
]
=
&
nv94_i2c_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_CLOCK
]
=
nv84_clock_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_THERM
]
=
&
nv84_therm_oclass
;
...
...
@@ -253,7 +253,7 @@ nv50_identify(struct nouveau_device *device)
case
0xa0
:
device
->
cname
=
"G200"
;
device
->
oclass
[
NVDEV_SUBDEV_VBIOS
]
=
&
nouveau_bios_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_GPIO
]
=
nv
50
_gpio_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_GPIO
]
=
nv
92
_gpio_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_I2C
]
=
&
nv50_i2c_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_CLOCK
]
=
nv84_clock_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_THERM
]
=
&
nv84_therm_oclass
;
...
...
@@ -281,7 +281,7 @@ nv50_identify(struct nouveau_device *device)
case
0xaa
:
device
->
cname
=
"MCP77/MCP78"
;
device
->
oclass
[
NVDEV_SUBDEV_VBIOS
]
=
&
nouveau_bios_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_GPIO
]
=
nv
50
_gpio_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_GPIO
]
=
nv
92
_gpio_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_I2C
]
=
&
nv94_i2c_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_CLOCK
]
=
nvaa_clock_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_THERM
]
=
&
nv84_therm_oclass
;
...
...
@@ -309,7 +309,7 @@ nv50_identify(struct nouveau_device *device)
case
0xac
:
device
->
cname
=
"MCP79/MCP7A"
;
device
->
oclass
[
NVDEV_SUBDEV_VBIOS
]
=
&
nouveau_bios_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_GPIO
]
=
nv
50
_gpio_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_GPIO
]
=
nv
92
_gpio_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_I2C
]
=
&
nv94_i2c_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_CLOCK
]
=
nvaa_clock_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_THERM
]
=
&
nv84_therm_oclass
;
...
...
@@ -337,7 +337,7 @@ nv50_identify(struct nouveau_device *device)
case
0xa3
:
device
->
cname
=
"GT215"
;
device
->
oclass
[
NVDEV_SUBDEV_VBIOS
]
=
&
nouveau_bios_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_GPIO
]
=
nv
50
_gpio_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_GPIO
]
=
nv
92
_gpio_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_I2C
]
=
&
nv94_i2c_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_CLOCK
]
=
&
nva3_clock_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_THERM
]
=
&
nva3_therm_oclass
;
...
...
@@ -367,7 +367,7 @@ nv50_identify(struct nouveau_device *device)
case
0xa5
:
device
->
cname
=
"GT216"
;
device
->
oclass
[
NVDEV_SUBDEV_VBIOS
]
=
&
nouveau_bios_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_GPIO
]
=
nv
50
_gpio_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_GPIO
]
=
nv
92
_gpio_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_I2C
]
=
&
nv94_i2c_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_CLOCK
]
=
&
nva3_clock_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_THERM
]
=
&
nva3_therm_oclass
;
...
...
@@ -396,7 +396,7 @@ nv50_identify(struct nouveau_device *device)
case
0xa8
:
device
->
cname
=
"GT218"
;
device
->
oclass
[
NVDEV_SUBDEV_VBIOS
]
=
&
nouveau_bios_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_GPIO
]
=
nv
50
_gpio_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_GPIO
]
=
nv
92
_gpio_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_I2C
]
=
&
nv94_i2c_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_CLOCK
]
=
&
nva3_clock_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_THERM
]
=
&
nva3_therm_oclass
;
...
...
@@ -425,7 +425,7 @@ nv50_identify(struct nouveau_device *device)
case
0xaf
:
device
->
cname
=
"MCP89"
;
device
->
oclass
[
NVDEV_SUBDEV_VBIOS
]
=
&
nouveau_bios_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_GPIO
]
=
nv
50
_gpio_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_GPIO
]
=
nv
92
_gpio_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_I2C
]
=
&
nv94_i2c_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_CLOCK
]
=
&
nva3_clock_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_THERM
]
=
&
nva3_therm_oclass
;
...
...
drivers/gpu/drm/nouveau/core/engine/device/nvc0.c
View file @
7356859a
...
...
@@ -60,7 +60,7 @@ nvc0_identify(struct nouveau_device *device)
case
0xc0
:
device
->
cname
=
"GF100"
;
device
->
oclass
[
NVDEV_SUBDEV_VBIOS
]
=
&
nouveau_bios_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_GPIO
]
=
nv
50
_gpio_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_GPIO
]
=
nv
92
_gpio_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_I2C
]
=
&
nv94_i2c_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_CLOCK
]
=
&
nvc0_clock_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_THERM
]
=
&
nva3_therm_oclass
;
...
...
@@ -92,7 +92,7 @@ nvc0_identify(struct nouveau_device *device)
case
0xc4
:
device
->
cname
=
"GF104"
;
device
->
oclass
[
NVDEV_SUBDEV_VBIOS
]
=
&
nouveau_bios_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_GPIO
]
=
nv
50
_gpio_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_GPIO
]
=
nv
92
_gpio_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_I2C
]
=
&
nv94_i2c_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_CLOCK
]
=
&
nvc0_clock_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_THERM
]
=
&
nva3_therm_oclass
;
...
...
@@ -124,7 +124,7 @@ nvc0_identify(struct nouveau_device *device)
case
0xc3
:
device
->
cname
=
"GF106"
;
device
->
oclass
[
NVDEV_SUBDEV_VBIOS
]
=
&
nouveau_bios_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_GPIO
]
=
nv
50
_gpio_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_GPIO
]
=
nv
92
_gpio_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_I2C
]
=
&
nv94_i2c_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_CLOCK
]
=
&
nvc0_clock_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_THERM
]
=
&
nva3_therm_oclass
;
...
...
@@ -155,7 +155,7 @@ nvc0_identify(struct nouveau_device *device)
case
0xce
:
device
->
cname
=
"GF114"
;
device
->
oclass
[
NVDEV_SUBDEV_VBIOS
]
=
&
nouveau_bios_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_GPIO
]
=
nv
50
_gpio_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_GPIO
]
=
nv
92
_gpio_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_I2C
]
=
&
nv94_i2c_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_CLOCK
]
=
&
nvc0_clock_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_THERM
]
=
&
nva3_therm_oclass
;
...
...
@@ -187,7 +187,7 @@ nvc0_identify(struct nouveau_device *device)
case
0xcf
:
device
->
cname
=
"GF116"
;
device
->
oclass
[
NVDEV_SUBDEV_VBIOS
]
=
&
nouveau_bios_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_GPIO
]
=
nv
50
_gpio_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_GPIO
]
=
nv
92
_gpio_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_I2C
]
=
&
nv94_i2c_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_CLOCK
]
=
&
nvc0_clock_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_THERM
]
=
&
nva3_therm_oclass
;
...
...
@@ -219,7 +219,7 @@ nvc0_identify(struct nouveau_device *device)
case
0xc1
:
device
->
cname
=
"GF108"
;
device
->
oclass
[
NVDEV_SUBDEV_VBIOS
]
=
&
nouveau_bios_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_GPIO
]
=
nv
50
_gpio_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_GPIO
]
=
nv
92
_gpio_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_I2C
]
=
&
nv94_i2c_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_CLOCK
]
=
&
nvc0_clock_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_THERM
]
=
&
nva3_therm_oclass
;
...
...
@@ -250,7 +250,7 @@ nvc0_identify(struct nouveau_device *device)
case
0xc8
:
device
->
cname
=
"GF110"
;
device
->
oclass
[
NVDEV_SUBDEV_VBIOS
]
=
&
nouveau_bios_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_GPIO
]
=
nv
50
_gpio_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_GPIO
]
=
nv
92
_gpio_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_I2C
]
=
&
nv94_i2c_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_CLOCK
]
=
&
nvc0_clock_oclass
;
device
->
oclass
[
NVDEV_SUBDEV_THERM
]
=
&
nva3_therm_oclass
;
...
...
drivers/gpu/drm/nouveau/core/include/subdev/gpio.h
View file @
7356859a
...
...
@@ -31,22 +31,9 @@ nouveau_gpio(void *obj)
return
(
void
*
)
nv_device
(
obj
)
->
subdev
[
NVDEV_SUBDEV_GPIO
];
}
#define nouveau_gpio_create(p,e,o,l,d) \
nouveau_gpio_create_((p), (e), (o), (l), sizeof(**d), (void **)d)
#define nouveau_gpio_destroy(p) ({ \
struct nouveau_gpio *gpio = (p); \
_nouveau_gpio_dtor(nv_object(gpio)); \
})
#define nouveau_gpio_fini(p,s) \
nouveau_subdev_fini(&(p)->base, (s))
int
nouveau_gpio_create_
(
struct
nouveau_object
*
,
struct
nouveau_object
*
,
struct
nouveau_oclass
*
,
int
,
int
,
void
**
);
void
_nouveau_gpio_dtor
(
struct
nouveau_object
*
);
int
nouveau_gpio_init
(
struct
nouveau_gpio
*
);
extern
struct
nouveau_oclass
*
nv10_gpio_oclass
;
extern
struct
nouveau_oclass
*
nv50_gpio_oclass
;
extern
struct
nouveau_oclass
*
nv92_gpio_oclass
;
extern
struct
nouveau_oclass
*
nvd0_gpio_oclass
;
extern
struct
nouveau_oclass
*
nve0_gpio_oclass
;
...
...
drivers/gpu/drm/nouveau/core/subdev/gpio/base.c
View file @
7356859a
...
...
@@ -22,10 +22,11 @@
* Authors: Ben Skeggs
*/
#include <subdev/gpio.h>
#include <subdev/bios.h>
#include <subdev/bios/gpio.h>
#include "priv.h"
static
int
nouveau_gpio_drive
(
struct
nouveau_gpio
*
gpio
,
int
idx
,
int
line
,
int
dir
,
int
out
)
...
...
@@ -113,9 +114,10 @@ _nouveau_gpio_dtor(struct nouveau_object *object)
int
nouveau_gpio_create_
(
struct
nouveau_object
*
parent
,
struct
nouveau_object
*
engine
,
struct
nouveau_oclass
*
oclass
,
int
lines
,
struct
nouveau_oclass
*
oclass
,
int
length
,
void
**
pobject
)
{
const
struct
nouveau_gpio_impl
*
impl
=
(
void
*
)
oclass
;
struct
nouveau_gpio
*
gpio
;
int
ret
;
...
...
@@ -125,7 +127,7 @@ nouveau_gpio_create_(struct nouveau_object *parent,
if
(
ret
)
return
ret
;
ret
=
nouveau_event_create
(
1
,
lines
,
&
gpio
->
events
);
ret
=
nouveau_event_create
(
1
,
impl
->
lines
,
&
gpio
->
events
);
if
(
ret
)
return
ret
;
...
...
drivers/gpu/drm/nouveau/core/subdev/gpio/nv10.c
View file @
7356859a
...
...
@@ -121,7 +121,7 @@ nv10_gpio_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
struct
nv10_gpio_priv
*
priv
;
int
ret
;
ret
=
nouveau_gpio_create
(
parent
,
engine
,
oclass
,
16
,
&
priv
);
ret
=
nouveau_gpio_create
(
parent
,
engine
,
oclass
,
&
priv
);
*
pobject
=
nv_object
(
priv
);
if
(
ret
)
return
ret
;
...
...
@@ -166,12 +166,13 @@ nv10_gpio_fini(struct nouveau_object *object, bool suspend)
}
struct
nouveau_oclass
*
nv10_gpio_oclass
=
&
(
struct
nouveau_
oclass
)
{
.
handle
=
NV_SUBDEV
(
GPIO
,
0x10
),
.
ofuncs
=
&
(
struct
nouveau_ofuncs
)
{
nv10_gpio_oclass
=
&
(
struct
nouveau_
gpio_impl
)
{
.
base
.
handle
=
NV_SUBDEV
(
GPIO
,
0x10
),
.
base
.
ofuncs
=
&
(
struct
nouveau_ofuncs
)
{
.
ctor
=
nv10_gpio_ctor
,
.
dtor
=
nv10_gpio_dtor
,
.
init
=
nv10_gpio_init
,
.
fini
=
nv10_gpio_fini
,
},
};
.
lines
=
16
,
}.
base
;
drivers/gpu/drm/nouveau/core/subdev/gpio/nv50.c
View file @
7356859a
...
...
@@ -138,7 +138,7 @@ nv50_gpio_intr_disable(struct nouveau_event *event, int line)
nv_mask
(
event
->
priv
,
addr
+
0x00
,
mask
,
0x00000000
);
}
static
int
int
nv50_gpio_ctor
(
struct
nouveau_object
*
parent
,
struct
nouveau_object
*
engine
,
struct
nouveau_oclass
*
oclass
,
void
*
data
,
u32
size
,
struct
nouveau_object
**
pobject
)
...
...
@@ -146,9 +146,7 @@ nv50_gpio_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
struct
nv50_gpio_priv
*
priv
;
int
ret
;
ret
=
nouveau_gpio_create
(
parent
,
engine
,
oclass
,
nv_device
(
parent
)
->
chipset
>
0x92
?
32
:
16
,
&
priv
);
ret
=
nouveau_gpio_create
(
parent
,
engine
,
oclass
,
&
priv
);
*
pobject
=
nv_object
(
priv
);
if
(
ret
)
return
ret
;
...
...
@@ -202,12 +200,13 @@ nv50_gpio_fini(struct nouveau_object *object, bool suspend)
}
struct
nouveau_oclass
*
nv50_gpio_oclass
=
&
(
struct
nouveau_
oclass
)
{
.
handle
=
NV_SUBDEV
(
GPIO
,
0x50
),
.
ofuncs
=
&
(
struct
nouveau_ofuncs
)
{
nv50_gpio_oclass
=
&
(
struct
nouveau_
gpio_impl
)
{
.
base
.
handle
=
NV_SUBDEV
(
GPIO
,
0x50
),
.
base
.
ofuncs
=
&
(
struct
nouveau_ofuncs
)
{
.
ctor
=
nv50_gpio_ctor
,
.
dtor
=
nv50_gpio_dtor
,
.
init
=
nv50_gpio_init
,
.
fini
=
nv50_gpio_fini
,
},
};
.
lines
=
16
.
}.
base
;
drivers/gpu/drm/nouveau/core/subdev/gpio/nv92.c
0 → 100644
View file @
7356859a
/*
* Copyright 2012 Red Hat Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors: Ben Skeggs
*/
#include "priv.h"
struct
nouveau_oclass
*
nv92_gpio_oclass
=
&
(
struct
nouveau_gpio_impl
)
{
.
base
.
handle
=
NV_SUBDEV
(
GPIO
,
0x92
),
.
base
.
ofuncs
=
&
(
struct
nouveau_ofuncs
)
{
.
ctor
=
nv50_gpio_ctor
,
.
dtor
=
nv50_gpio_dtor
,
.
init
=
nv50_gpio_init
,
.
fini
=
nv50_gpio_fini
,
},
.
lines
=
32
.
}.
base
;
drivers/gpu/drm/nouveau/core/subdev/gpio/nvd0.c
View file @
7356859a
...
...
@@ -80,7 +80,7 @@ nvd0_gpio_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
struct
nvd0_gpio_priv
*
priv
;
int
ret
;
ret
=
nouveau_gpio_create
(
parent
,
engine
,
oclass
,
32
,
&
priv
);
ret
=
nouveau_gpio_create
(
parent
,
engine
,
oclass
,
&
priv
);
*
pobject
=
nv_object
(
priv
);
if
(
ret
)
return
ret
;
...
...
@@ -96,12 +96,13 @@ nvd0_gpio_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
}
struct
nouveau_oclass
*
nvd0_gpio_oclass
=
&
(
struct
nouveau_
oclass
)
{
.
handle
=
NV_SUBDEV
(
GPIO
,
0xd0
),
.
ofuncs
=
&
(
struct
nouveau_ofuncs
)
{
nvd0_gpio_oclass
=
&
(
struct
nouveau_
gpio_impl
)
{
.
base
.
handle
=
NV_SUBDEV
(
GPIO
,
0xd0
),
.
base
.
ofuncs
=
&
(
struct
nouveau_ofuncs
)
{
.
ctor
=
nvd0_gpio_ctor
,
.
dtor
=
nv50_gpio_dtor
,
.
init
=
nv50_gpio_init
,
.
fini
=
nv50_gpio_fini
,
},
};
.
lines
=
32
,
}.
base
;
drivers/gpu/drm/nouveau/core/subdev/gpio/nve0.c
View file @
7356859a
...
...
@@ -104,7 +104,7 @@ nve0_gpio_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
struct
nve0_gpio_priv
*
priv
;
int
ret
;
ret
=
nouveau_gpio_create
(
parent
,
engine
,
oclass
,
32
,
&
priv
);
ret
=
nouveau_gpio_create
(
parent
,
engine
,
oclass
,
&
priv
);
*
pobject
=
nv_object
(
priv
);
if
(
ret
)
return
ret
;
...
...
@@ -120,12 +120,13 @@ nve0_gpio_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
}
struct
nouveau_oclass
*
nve0_gpio_oclass
=
&
(
struct
nouveau_
oclass
)
{
.
handle
=
NV_SUBDEV
(
GPIO
,
0xe0
),
.
ofuncs
=
&
(
struct
nouveau_ofuncs
)
{
nve0_gpio_oclass
=
&
(
struct
nouveau_
gpio_impl
)
{
.
base
.
handle
=
NV_SUBDEV
(
GPIO
,
0xe0
),
.
base
.
ofuncs
=
&
(
struct
nouveau_ofuncs
)
{
.
ctor
=
nve0_gpio_ctor
,
.
dtor
=
nv50_gpio_dtor
,
.
init
=
nve0_gpio_init
,
.
fini
=
nve0_gpio_fini
,
},
};
.
lines
=
32
,
}.
base
;
drivers/gpu/drm/nouveau/core/subdev/gpio/priv.h
View file @
7356859a
...
...
@@ -3,6 +3,23 @@
#include <subdev/gpio.h>
#define nouveau_gpio_create(p,e,o,d) \
nouveau_gpio_create_((p), (e), (o), sizeof(**d), (void **)d)
#define nouveau_gpio_destroy(p) ({ \
struct nouveau_gpio *gpio = (p); \
_nouveau_gpio_dtor(nv_object(gpio)); \
})
#define nouveau_gpio_fini(p,s) \
nouveau_subdev_fini(&(p)->base, (s))
int
nouveau_gpio_create_
(
struct
nouveau_object
*
,
struct
nouveau_object
*
,
struct
nouveau_oclass
*
,
int
,
void
**
);
void
_nouveau_gpio_dtor
(
struct
nouveau_object
*
);
int
nouveau_gpio_init
(
struct
nouveau_gpio
*
);
int
nv50_gpio_ctor
(
struct
nouveau_object
*
,
struct
nouveau_object
*
,
struct
nouveau_oclass
*
,
void
*
,
u32
,
struct
nouveau_object
**
);
void
nv50_gpio_dtor
(
struct
nouveau_object
*
);
int
nv50_gpio_init
(
struct
nouveau_object
*
);
int
nv50_gpio_fini
(
struct
nouveau_object
*
,
bool
);
...
...
@@ -14,4 +31,10 @@ void nvd0_gpio_reset(struct nouveau_gpio *, u8);
int
nvd0_gpio_drive
(
struct
nouveau_gpio
*
,
int
,
int
,
int
);
int
nvd0_gpio_sense
(
struct
nouveau_gpio
*
,
int
);
struct
nouveau_gpio_impl
{
struct
nouveau_oclass
base
;
int
lines
;
};
#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