diff --git a/sys/src/9/bcm/gpio.c b/sys/src/9/bcm/gpio.c index b970e96f6..fbb66343b 100644 --- a/sys/src/9/bcm/gpio.c +++ b/sys/src/9/bcm/gpio.c @@ -30,36 +30,50 @@ enum { Off = 0x0, Pulldown= 0x1, Pullup = 0x2, + PudMask = 0x3, + PUDclk0 = 0x98>>2, PUDclk1 = 0x9c>>2, + + /* BCM2711 only */ + PUPPDN0 = 0xe4>>2, + PUPPDN1 = 0xe8>>2, + PUPPDN2 = 0xec>>2, + PUPPDN3 = 0xf0>>2, }; +static u32int *regs = (u32int*)GPIOREGS; + void gpiosel(uint pin, int func) { - u32int *gp, *fsel; - int off; - - gp = (u32int*)GPIOREGS; - fsel = &gp[Fsel0 + pin/10]; - off = (pin % 10) * 3; - *fsel = (*fsel & ~(FuncMask<