Lines Matching +full:gpio +full:- +full:dir
29 nvkm_gpio_drive(struct nvkm_gpio *gpio, int idx, int line, int dir, int out) in nvkm_gpio_drive() argument
31 return gpio->func->drive(gpio, line, dir, out); in nvkm_gpio_drive()
35 nvkm_gpio_sense(struct nvkm_gpio *gpio, int idx, int line) in nvkm_gpio_sense() argument
37 return gpio->func->sense(gpio, line); in nvkm_gpio_sense()
41 nvkm_gpio_reset(struct nvkm_gpio *gpio, u8 func) in nvkm_gpio_reset() argument
43 if (gpio->func->reset) in nvkm_gpio_reset()
44 gpio->func->reset(gpio, func); in nvkm_gpio_reset()
48 nvkm_gpio_find(struct nvkm_gpio *gpio, int idx, u8 tag, u8 line, in nvkm_gpio_find() argument
51 struct nvkm_device *device = gpio->subdev.device; in nvkm_gpio_find()
52 struct nvkm_bios *bios = device->bios; in nvkm_gpio_find()
57 return -EINVAL; in nvkm_gpio_find()
64 if (device->quirk && device->quirk->tv_gpio) { in nvkm_gpio_find()
68 .line = device->quirk->tv_gpio, in nvkm_gpio_find()
76 return -ENOENT; in nvkm_gpio_find()
80 nvkm_gpio_set(struct nvkm_gpio *gpio, int idx, u8 tag, u8 line, int state) in nvkm_gpio_set() argument
85 ret = nvkm_gpio_find(gpio, idx, tag, line, &func); in nvkm_gpio_set()
87 int dir = !!(func.log[state] & 0x02); in nvkm_gpio_set() local
89 ret = nvkm_gpio_drive(gpio, idx, func.line, dir, out); in nvkm_gpio_set()
96 nvkm_gpio_get(struct nvkm_gpio *gpio, int idx, u8 tag, u8 line) in nvkm_gpio_get() argument
101 ret = nvkm_gpio_find(gpio, idx, tag, line, &func); in nvkm_gpio_get()
103 ret = nvkm_gpio_sense(gpio, idx, func.line); in nvkm_gpio_get()
114 struct nvkm_gpio *gpio = container_of(event, typeof(*gpio), event); in nvkm_gpio_intr_fini() local
115 gpio->func->intr_mask(gpio, type, 1 << index, 0); in nvkm_gpio_intr_fini()
121 struct nvkm_gpio *gpio = container_of(event, typeof(*gpio), event); in nvkm_gpio_intr_init() local
122 gpio->func->intr_mask(gpio, type, 1 << index, 1 << index); in nvkm_gpio_intr_init()
134 struct nvkm_gpio *gpio = nvkm_gpio(subdev); in nvkm_gpio_intr() local
137 gpio->func->intr_stat(gpio, &hi, &lo); in nvkm_gpio_intr()
139 for (i = 0; (hi | lo) && i < gpio->func->lines; i++) { in nvkm_gpio_intr()
142 nvkm_event_ntfy(&gpio->event, i, mask); in nvkm_gpio_intr()
149 struct nvkm_gpio *gpio = nvkm_gpio(subdev); in nvkm_gpio_fini() local
150 u32 mask = (1ULL << gpio->func->lines) - 1; in nvkm_gpio_fini()
152 gpio->func->intr_mask(gpio, NVKM_GPIO_TOGGLED, mask, 0); in nvkm_gpio_fini()
153 gpio->func->intr_stat(gpio, &mask, &mask); in nvkm_gpio_fini()
177 struct nvkm_gpio *gpio = nvkm_gpio(subdev); in nvkm_gpio_init() local
183 nvkm_gpio_reset(gpio, DCB_GPIO_UNUSED); in nvkm_gpio_init()
185 if (nvkm_boolopt(subdev->device->cfgopt, "NvPowerChecks", true)) { in nvkm_gpio_init()
187 ret = nvkm_gpio_find(gpio, 0, power_checks[i], in nvkm_gpio_init()
192 ret = nvkm_gpio_get(gpio, 0, func.func, func.line); in nvkm_gpio_init()
196 nvkm_error(&gpio->subdev, in nvkm_gpio_init()
201 return -EINVAL; in nvkm_gpio_init()
211 struct nvkm_gpio *gpio = nvkm_gpio(subdev); in nvkm_gpio_dtor() local
212 nvkm_event_fini(&gpio->event); in nvkm_gpio_dtor()
213 return gpio; in nvkm_gpio_dtor()
228 struct nvkm_gpio *gpio; in nvkm_gpio_new_() local
230 if (!(gpio = *pgpio = kzalloc(sizeof(*gpio), GFP_KERNEL))) in nvkm_gpio_new_()
231 return -ENOMEM; in nvkm_gpio_new_()
233 nvkm_subdev_ctor(&nvkm_gpio, device, type, inst, &gpio->subdev); in nvkm_gpio_new_()
234 gpio->func = func; in nvkm_gpio_new_()
236 return nvkm_event_init(&nvkm_gpio_intr_func, &gpio->subdev, 2, func->lines, &gpio->event); in nvkm_gpio_new_()