Lines Matching refs:descs
120 return &gdev->descs[gpio - gdev->base]; in gpio_to_desc()
151 return &gdev->descs[hwnum]; in gpiochip_get_desc()
167 return desc->gdev->base + (desc - &desc->gdev->descs[0]); in desc_to_gpio()
354 gdev->descs[i].name = gc->names[i]; in gpiochip_set_desc_names()
428 gdev->descs[i].name = names[chip->offset + i]; in devprop_gpiochip_set_names()
570 kfree(gdev->descs); in gpiodevice_release()
749 gdev->descs = kcalloc(gc->ngpio, sizeof(*gdev->descs), GFP_KERNEL); in gpiochip_add_data_with_key()
750 if (!gdev->descs) { in gpiochip_add_data_with_key()
803 gdev->descs[i].gdev = gdev; in gpiochip_add_data_with_key()
836 struct gpio_desc *desc = &gdev->descs[i]; in gpiochip_add_data_with_key()
906 kfree(gdev->descs); in gpiochip_add_data_with_key()
3438 return test_bit(FLAG_USED_AS_IRQ, &gc->gpiodev->descs[offset].flags); in gpiochip_line_is_irq()
3471 return test_bit(FLAG_OPEN_DRAIN, &gc->gpiodev->descs[offset].flags); in gpiochip_line_is_open_drain()
3480 return test_bit(FLAG_OPEN_SOURCE, &gc->gpiodev->descs[offset].flags); in gpiochip_line_is_open_source()
3489 return !test_bit(FLAG_TRANSITORY, &gc->gpiodev->descs[offset].flags); in gpiochip_line_is_persistent()
4255 struct gpio_descs *descs; in gpiod_get_array() local
4264 descs = kzalloc(struct_size(descs, desc, count), GFP_KERNEL); in gpiod_get_array()
4265 if (!descs) in gpiod_get_array()
4268 for (descs->ndescs = 0; descs->ndescs < count; ) { in gpiod_get_array()
4269 desc = gpiod_get_index(dev, con_id, descs->ndescs, flags); in gpiod_get_array()
4271 gpiod_put_array(descs); in gpiod_get_array()
4275 descs->desc[descs->ndescs] = desc; in gpiod_get_array()
4282 if (descs->ndescs == 0 && gpio_chip_hwgpio(desc) == 0) { in gpiod_get_array()
4288 array = kzalloc(struct_size(descs, desc, count) + in gpiod_get_array()
4292 gpiod_put_array(descs); in gpiod_get_array()
4296 memcpy(array, descs, in gpiod_get_array()
4297 struct_size(descs, desc, descs->ndescs + 1)); in gpiod_get_array()
4298 kfree(descs); in gpiod_get_array()
4300 descs = array; in gpiod_get_array()
4301 array_info = (void *)(descs->desc + count); in gpiod_get_array()
4307 array_info->desc = descs->desc; in gpiod_get_array()
4310 bitmap_set(array_info->get_mask, descs->ndescs, in gpiod_get_array()
4311 count - descs->ndescs); in gpiod_get_array()
4312 bitmap_set(array_info->set_mask, descs->ndescs, in gpiod_get_array()
4313 count - descs->ndescs); in gpiod_get_array()
4314 descs->info = array_info; in gpiod_get_array()
4318 __clear_bit(descs->ndescs, array_info->get_mask); in gpiod_get_array()
4319 __clear_bit(descs->ndescs, array_info->set_mask); in gpiod_get_array()
4326 gpio_chip_hwgpio(desc) != descs->ndescs) { in gpiod_get_array()
4332 if (bitmap_full(array_info->get_mask, descs->ndescs)) { in gpiod_get_array()
4335 __clear_bit(descs->ndescs, in gpiod_get_array()
4337 __clear_bit(descs->ndescs, in gpiod_get_array()
4342 if (gpiochip_line_is_open_drain(gc, descs->ndescs) || in gpiod_get_array()
4343 gpiochip_line_is_open_source(gc, descs->ndescs)) in gpiod_get_array()
4344 __clear_bit(descs->ndescs, in gpiod_get_array()
4348 __set_bit(descs->ndescs, in gpiod_get_array()
4352 descs->ndescs++; in gpiod_get_array()
4360 return descs; in gpiod_get_array()
4378 struct gpio_descs *descs; in gpiod_get_array_optional() local
4380 descs = gpiod_get_array(dev, con_id, flags); in gpiod_get_array_optional()
4381 if (gpiod_not_found(descs)) in gpiod_get_array_optional()
4384 return descs; in gpiod_get_array_optional()
4405 void gpiod_put_array(struct gpio_descs *descs) in gpiod_put_array() argument
4409 for (i = 0; i < descs->ndescs; i++) in gpiod_put_array()
4410 gpiod_put(descs->desc[i]); in gpiod_put_array()
4412 kfree(descs); in gpiod_put_array()