diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2023-09-19 06:21:17 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2023-10-31 15:08:11 +1000 |
commit | 2cfad4b0489cc13a1f980782ca4af070e2675128 (patch) | |
tree | 5f47b8b673c5f898876312f728b92c5b3f281437 /drivers/gpu/drm | |
parent | c41aebc9aca41116c40e6fabce1d52250fc91b36 (diff) | |
download | linux-stable-2cfad4b0489cc13a1f980782ca4af070e2675128.tar.gz linux-stable-2cfad4b0489cc13a1f980782ca4af070e2675128.tar.bz2 linux-stable-2cfad4b0489cc13a1f980782ca4af070e2675128.zip |
drm/nouveau/gpio/tu102-: prepare for GSP-RM
- disable GPIO completely when GSP-RM detected
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-13-skeggsb@gmail.com
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/gpio/ga102.c | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/gpio/gk104.c | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gpio/ga102.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gpio/ga102.c index 4a96f926b66d..4dbffae21ddc 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gpio/ga102.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gpio/ga102.c @@ -21,6 +21,8 @@ */ #include "priv.h" +#include <subdev/gsp.h> + static void ga102_gpio_reset(struct nvkm_gpio *gpio, u8 match) { @@ -115,5 +117,8 @@ int ga102_gpio_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_gpio **pgpio) { + if (nvkm_gsp_rm(device->gsp)) + return -ENODEV; + return nvkm_gpio_new_(&ga102_gpio, device, type, inst, pgpio); } diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gpio/gk104.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gpio/gk104.c index c0e4cdb45520..5f7063d5579b 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gpio/gk104.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gpio/gk104.c @@ -23,6 +23,8 @@ */ #include "priv.h" +#include <subdev/gsp.h> + static void gk104_gpio_intr_stat(struct nvkm_gpio *gpio, u32 *hi, u32 *lo) { @@ -71,5 +73,8 @@ int gk104_gpio_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_gpio **pgpio) { + if (nvkm_gsp_rm(device->gsp)) + return -ENODEV; + return nvkm_gpio_new_(&gk104_gpio, device, type, inst, pgpio); } |