Lines Matching refs:descs
167 return &gdev->descs[gpio - gdev->base]; in gpio_to_desc()
204 return &gdev->descs[array_index_nospec(hwnum, gdev->ngpio)]; in gpio_device_get_desc()
220 return desc->gdev->base + (desc - &desc->gdev->descs[0]); in desc_to_gpio()
513 gdev->descs[i].name = gc->names[i]; in gpiochip_set_desc_names()
585 gdev->descs[i].name = names[chip->offset + i]; in gpiochip_set_names()
726 kfree(gdev->descs); in gpiodev_release()
936 gdev->descs = kcalloc(gc->ngpio, sizeof(*gdev->descs), GFP_KERNEL); in gpiochip_add_data_with_key()
937 if (!gdev->descs) { in gpiochip_add_data_with_key()
990 gdev->descs[desc_index].gdev = gdev; in gpiochip_add_data_with_key()
1019 struct gpio_desc *desc = &gdev->descs[desc_index]; in gpiochip_add_data_with_key()
1097 kfree(gdev->descs); in gpiochip_add_data_with_key()
3780 return test_bit(FLAG_USED_AS_IRQ, &gc->gpiodev->descs[offset].flags); in gpiochip_line_is_irq()
3813 return test_bit(FLAG_OPEN_DRAIN, &gc->gpiodev->descs[offset].flags); in gpiochip_line_is_open_drain()
3822 return test_bit(FLAG_OPEN_SOURCE, &gc->gpiodev->descs[offset].flags); in gpiochip_line_is_open_source()
3831 return !test_bit(FLAG_TRANSITORY, &gc->gpiodev->descs[offset].flags); in gpiochip_line_is_persistent()
4645 struct gpio_descs *descs; in gpiod_get_array() local
4655 descs_size = struct_size(descs, desc, count); in gpiod_get_array()
4656 descs = kzalloc(descs_size, GFP_KERNEL); in gpiod_get_array()
4657 if (!descs) in gpiod_get_array()
4660 for (descs->ndescs = 0; descs->ndescs < count; descs->ndescs++) { in gpiod_get_array()
4661 desc = gpiod_get_index(dev, con_id, descs->ndescs, flags); in gpiod_get_array()
4663 gpiod_put_array(descs); in gpiod_get_array()
4667 descs->desc[descs->ndescs] = desc; in gpiod_get_array()
4674 if (descs->ndescs == 0 && gpio_chip_hwgpio(desc) == 0) { in gpiod_get_array()
4680 array = krealloc(descs, descs_size + in gpiod_get_array()
4684 gpiod_put_array(descs); in gpiod_get_array()
4688 descs = array; in gpiod_get_array()
4690 array_info = (void *)descs + descs_size; in gpiod_get_array()
4696 array_info->desc = descs->desc; in gpiod_get_array()
4699 bitmap_set(array_info->get_mask, descs->ndescs, in gpiod_get_array()
4700 count - descs->ndescs); in gpiod_get_array()
4701 bitmap_set(array_info->set_mask, descs->ndescs, in gpiod_get_array()
4702 count - descs->ndescs); in gpiod_get_array()
4703 descs->info = array_info; in gpiod_get_array()
4712 __clear_bit(descs->ndescs, array_info->get_mask); in gpiod_get_array()
4713 __clear_bit(descs->ndescs, array_info->set_mask); in gpiod_get_array()
4719 else if (gpio_chip_hwgpio(desc) != descs->ndescs) { in gpiod_get_array()
4725 if (bitmap_full(array_info->get_mask, descs->ndescs)) { in gpiod_get_array()
4728 __clear_bit(descs->ndescs, in gpiod_get_array()
4730 __clear_bit(descs->ndescs, in gpiod_get_array()
4735 if (gpiochip_line_is_open_drain(gc, descs->ndescs) || in gpiod_get_array()
4736 gpiochip_line_is_open_source(gc, descs->ndescs)) in gpiod_get_array()
4737 __clear_bit(descs->ndescs, in gpiod_get_array()
4741 __set_bit(descs->ndescs, in gpiod_get_array()
4751 return descs; in gpiod_get_array()
4775 struct gpio_descs *descs; in gpiod_get_array_optional() local
4777 descs = gpiod_get_array(dev, con_id, flags); in gpiod_get_array_optional()
4778 if (gpiod_not_found(descs)) in gpiod_get_array_optional()
4781 return descs; in gpiod_get_array_optional()
4802 void gpiod_put_array(struct gpio_descs *descs) in gpiod_put_array() argument
4806 for (i = 0; i < descs->ndescs; i++) in gpiod_put_array()
4807 gpiod_put(descs->desc[i]); in gpiod_put_array()
4809 kfree(descs); in gpiod_put_array()