]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/nouveau/gpio/tu102-: prepare for GSP-RM
authorBen Skeggs <bskeggs@redhat.com>
Mon, 18 Sep 2023 20:21:17 +0000 (06:21 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 31 Oct 2023 05:08:11 +0000 (15:08 +1000)
- 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
drivers/gpu/drm/nouveau/nvkm/subdev/gpio/ga102.c
drivers/gpu/drm/nouveau/nvkm/subdev/gpio/gk104.c

index 4a96f926b66df2758c40b1ac24317b60422389d8..4dbffae21ddcd1f58f5c28544e9df4c784556f24 100644 (file)
@@ -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);
 }
index c0e4cdb45520be5b87d3887f2e13b7d47f8fe4cf..5f7063d5579bba2f5451db25f564276c8791d946 100644 (file)
@@ -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);
 }