static int nouveau_gpio_find(struct nouveau_gpio *gpio, int idx, u8 tag, u8 line, struct dcb_gpio_func *func) { struct nouveau_bios *bios = nouveau_bios(gpio); u8 ver, len; u16 data; if (line == 0xff && tag == 0xff) return -EINVAL; data = dcb_gpio_match(bios, idx, tag, line, &ver, &len, func); if (data) return 0; /* Apple iMac G4 NV18 */ if (nv_device_match(nv_object(gpio), 0x0189, 0x10de, 0x0010)) { if (tag == DCB_GPIO_TVDAC0) { *func = (struct dcb_gpio_func) { .func = DCB_GPIO_TVDAC0, .line = 4, .log[0] = 0, .log[1] = 1, }; return 0; } } return -ENOENT; }
int nvkm_gpio_find(struct nvkm_gpio *gpio, int idx, u8 tag, u8 line, struct dcb_gpio_func *func) { struct nvkm_device *device = gpio->subdev.device; struct nvkm_bios *bios = device->bios; u8 ver, len; u16 data; if (line == 0xff && tag == 0xff) return -EINVAL; data = dcb_gpio_match(bios, idx, tag, line, &ver, &len, func); if (data) return 0; /* Apple iMac G4 NV18 */ if (device->quirk && device->quirk->tv_gpio) { if (tag == DCB_GPIO_TVDAC0) { *func = (struct dcb_gpio_func) { .func = DCB_GPIO_TVDAC0, .line = device->quirk->tv_gpio, .log[0] = 0, .log[1] = 1, }; return 0; } } return -ENOENT; }