Commit 0f080066 authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/gpio: pass number of on-die gpio lines to base

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 23fc09ee
...@@ -40,15 +40,15 @@ nouveau_gpio(void *obj) ...@@ -40,15 +40,15 @@ nouveau_gpio(void *obj)
return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_GPIO]; return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_GPIO];
} }
#define nouveau_gpio_create(p,e,o,d) \ #define nouveau_gpio_create(p,e,o,l,d) \
nouveau_gpio_create_((p), (e), (o), sizeof(**d), (void **)d) nouveau_gpio_create_((p), (e), (o), (l), sizeof(**d), (void **)d)
#define nouveau_gpio_destroy(p) \ #define nouveau_gpio_destroy(p) \
nouveau_subdev_destroy(&(p)->base) nouveau_subdev_destroy(&(p)->base)
#define nouveau_gpio_fini(p,s) \ #define nouveau_gpio_fini(p,s) \
nouveau_subdev_fini(&(p)->base, (s)) nouveau_subdev_fini(&(p)->base, (s))
int nouveau_gpio_create_(struct nouveau_object *, struct nouveau_object *, int nouveau_gpio_create_(struct nouveau_object *, struct nouveau_object *,
struct nouveau_oclass *, int, void **); struct nouveau_oclass *, int, int, void **);
int nouveau_gpio_init(struct nouveau_gpio *); int nouveau_gpio_init(struct nouveau_gpio *);
extern struct nouveau_oclass nv10_gpio_oclass; extern struct nouveau_oclass nv10_gpio_oclass;
......
...@@ -230,7 +230,8 @@ nouveau_gpio_isr_del(struct nouveau_gpio *gpio, int idx, u8 tag, u8 line, ...@@ -230,7 +230,8 @@ nouveau_gpio_isr_del(struct nouveau_gpio *gpio, int idx, u8 tag, u8 line,
int int
nouveau_gpio_create_(struct nouveau_object *parent, nouveau_gpio_create_(struct nouveau_object *parent,
struct nouveau_object *engine, struct nouveau_object *engine,
struct nouveau_oclass *oclass, int length, void **pobject) struct nouveau_oclass *oclass, int lines,
int length, void **pobject)
{ {
struct nouveau_gpio *gpio; struct nouveau_gpio *gpio;
int ret; int ret;
......
...@@ -112,7 +112,7 @@ nv10_gpio_ctor(struct nouveau_object *parent, struct nouveau_object *engine, ...@@ -112,7 +112,7 @@ nv10_gpio_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
struct nv10_gpio_priv *priv; struct nv10_gpio_priv *priv;
int ret; int ret;
ret = nouveau_gpio_create(parent, engine, oclass, &priv); ret = nouveau_gpio_create(parent, engine, oclass, 16, &priv);
*pobject = nv_object(priv); *pobject = nv_object(priv);
if (ret) if (ret)
return ret; return ret;
......
...@@ -132,7 +132,9 @@ nv50_gpio_ctor(struct nouveau_object *parent, struct nouveau_object *engine, ...@@ -132,7 +132,9 @@ nv50_gpio_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
struct nv50_gpio_priv *priv; struct nv50_gpio_priv *priv;
int ret; int ret;
ret = nouveau_gpio_create(parent, engine, oclass, &priv); ret = nouveau_gpio_create(parent, engine, oclass,
nv_device(parent)->chipset >= 0x90 ? 32 : 16,
&priv);
*pobject = nv_object(priv); *pobject = nv_object(priv);
if (ret) if (ret)
return ret; return ret;
......
...@@ -80,7 +80,7 @@ nvd0_gpio_ctor(struct nouveau_object *parent, struct nouveau_object *engine, ...@@ -80,7 +80,7 @@ nvd0_gpio_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
struct nvd0_gpio_priv *priv; struct nvd0_gpio_priv *priv;
int ret; int ret;
ret = nouveau_gpio_create(parent, engine, oclass, &priv); ret = nouveau_gpio_create(parent, engine, oclass, 32, &priv);
*pobject = nv_object(priv); *pobject = nv_object(priv);
if (ret) if (ret)
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment