Skip to content

Commit 2cfad4b

Browse files
Ben Skeggsairlied
authored andcommitted
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
1 parent c41aebc commit 2cfad4b

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

drivers/gpu/drm/nouveau/nvkm/subdev/gpio/ga102.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
*/
2222
#include "priv.h"
2323

24+
#include <subdev/gsp.h>
25+
2426
static void
2527
ga102_gpio_reset(struct nvkm_gpio *gpio, u8 match)
2628
{
@@ -115,5 +117,8 @@ int
115117
ga102_gpio_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
116118
struct nvkm_gpio **pgpio)
117119
{
120+
if (nvkm_gsp_rm(device->gsp))
121+
return -ENODEV;
122+
118123
return nvkm_gpio_new_(&ga102_gpio, device, type, inst, pgpio);
119124
}

drivers/gpu/drm/nouveau/nvkm/subdev/gpio/gk104.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
*/
2424
#include "priv.h"
2525

26+
#include <subdev/gsp.h>
27+
2628
static void
2729
gk104_gpio_intr_stat(struct nvkm_gpio *gpio, u32 *hi, u32 *lo)
2830
{
@@ -71,5 +73,8 @@ int
7173
gk104_gpio_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst,
7274
struct nvkm_gpio **pgpio)
7375
{
76+
if (nvkm_gsp_rm(device->gsp))
77+
return -ENODEV;
78+
7479
return nvkm_gpio_new_(&gk104_gpio, device, type, inst, pgpio);
7580
}

0 commit comments

Comments
 (0)