Lines Matching refs:descs

137 			return &gdev->descs[gpio - gdev->base];  in gpio_to_desc()
168 return &gdev->descs[array_index_nospec(hwnum, gdev->ngpio)]; in gpiochip_get_desc()
184 return desc->gdev->base + (desc - &desc->gdev->descs[0]); in desc_to_gpio()
373 gdev->descs[i].name = gc->names[i]; in gpiochip_set_desc_names()
447 gdev->descs[i].name = names[chip->offset + i]; in gpiochip_set_names()
589 kfree(gdev->descs); in gpiodev_release()
794 gdev->descs = kcalloc(gc->ngpio, sizeof(*gdev->descs), GFP_KERNEL); in gpiochip_add_data_with_key()
795 if (!gdev->descs) { in gpiochip_add_data_with_key()
847 gdev->descs[i].gdev = gdev; in gpiochip_add_data_with_key()
877 struct gpio_desc *desc = &gdev->descs[i]; in gpiochip_add_data_with_key()
947 kfree(gdev->descs); in gpiochip_add_data_with_key()
3554 return test_bit(FLAG_USED_AS_IRQ, &gc->gpiodev->descs[offset].flags); in gpiochip_line_is_irq()
3587 return test_bit(FLAG_OPEN_DRAIN, &gc->gpiodev->descs[offset].flags); in gpiochip_line_is_open_drain()
3596 return test_bit(FLAG_OPEN_SOURCE, &gc->gpiodev->descs[offset].flags); in gpiochip_line_is_open_source()
3605 return !test_bit(FLAG_TRANSITORY, &gc->gpiodev->descs[offset].flags); in gpiochip_line_is_persistent()
4373 struct gpio_descs *descs; in gpiod_get_array() local
4383 descs_size = struct_size(descs, desc, count); in gpiod_get_array()
4384 descs = kzalloc(descs_size, GFP_KERNEL); in gpiod_get_array()
4385 if (!descs) in gpiod_get_array()
4388 for (descs->ndescs = 0; descs->ndescs < count; descs->ndescs++) { in gpiod_get_array()
4389 desc = gpiod_get_index(dev, con_id, descs->ndescs, flags); in gpiod_get_array()
4391 gpiod_put_array(descs); in gpiod_get_array()
4395 descs->desc[descs->ndescs] = desc; in gpiod_get_array()
4402 if (descs->ndescs == 0 && gpio_chip_hwgpio(desc) == 0) { in gpiod_get_array()
4408 array = krealloc(descs, descs_size + in gpiod_get_array()
4412 gpiod_put_array(descs); in gpiod_get_array()
4416 descs = array; in gpiod_get_array()
4418 array_info = (void *)descs + descs_size; in gpiod_get_array()
4424 array_info->desc = descs->desc; in gpiod_get_array()
4427 bitmap_set(array_info->get_mask, descs->ndescs, in gpiod_get_array()
4428 count - descs->ndescs); in gpiod_get_array()
4429 bitmap_set(array_info->set_mask, descs->ndescs, in gpiod_get_array()
4430 count - descs->ndescs); in gpiod_get_array()
4431 descs->info = array_info; in gpiod_get_array()
4440 __clear_bit(descs->ndescs, array_info->get_mask); in gpiod_get_array()
4441 __clear_bit(descs->ndescs, array_info->set_mask); in gpiod_get_array()
4447 else if (gpio_chip_hwgpio(desc) != descs->ndescs) { in gpiod_get_array()
4453 if (bitmap_full(array_info->get_mask, descs->ndescs)) { in gpiod_get_array()
4456 __clear_bit(descs->ndescs, in gpiod_get_array()
4458 __clear_bit(descs->ndescs, in gpiod_get_array()
4463 if (gpiochip_line_is_open_drain(gc, descs->ndescs) || in gpiod_get_array()
4464 gpiochip_line_is_open_source(gc, descs->ndescs)) in gpiod_get_array()
4465 __clear_bit(descs->ndescs, in gpiod_get_array()
4469 __set_bit(descs->ndescs, in gpiod_get_array()
4479 return descs; in gpiod_get_array()
4497 struct gpio_descs *descs; in gpiod_get_array_optional() local
4499 descs = gpiod_get_array(dev, con_id, flags); in gpiod_get_array_optional()
4500 if (gpiod_not_found(descs)) in gpiod_get_array_optional()
4503 return descs; in gpiod_get_array_optional()
4524 void gpiod_put_array(struct gpio_descs *descs) in gpiod_put_array() argument
4528 for (i = 0; i < descs->ndescs; i++) in gpiod_put_array()
4529 gpiod_put(descs->desc[i]); in gpiod_put_array()
4531 kfree(descs); in gpiod_put_array()