Lines Matching refs:descs

136 			return &gdev->descs[gpio - gdev->base];
167 return &gdev->descs[hwnum];
183 return desc->gdev->base + (desc - &desc->gdev->descs[0]);
372 gdev->descs[i].name = gc->names[i];
446 gdev->descs[i].name = names[chip->offset + i];
588 kfree(gdev->descs);
793 gdev->descs = kcalloc(gc->ngpio, sizeof(*gdev->descs), GFP_KERNEL);
794 if (!gdev->descs) {
846 gdev->descs[i].gdev = gdev;
876 struct gpio_desc *desc = &gdev->descs[i];
946 kfree(gdev->descs);
3553 return test_bit(FLAG_USED_AS_IRQ, &gc->gpiodev->descs[offset].flags);
3586 return test_bit(FLAG_OPEN_DRAIN, &gc->gpiodev->descs[offset].flags);
3595 return test_bit(FLAG_OPEN_SOURCE, &gc->gpiodev->descs[offset].flags);
3604 return !test_bit(FLAG_TRANSITORY, &gc->gpiodev->descs[offset].flags);
4372 struct gpio_descs *descs;
4382 descs_size = struct_size(descs, desc, count);
4383 descs = kzalloc(descs_size, GFP_KERNEL);
4384 if (!descs)
4387 for (descs->ndescs = 0; descs->ndescs < count; descs->ndescs++) {
4388 desc = gpiod_get_index(dev, con_id, descs->ndescs, flags);
4390 gpiod_put_array(descs);
4394 descs->desc[descs->ndescs] = desc;
4401 if (descs->ndescs == 0 && gpio_chip_hwgpio(desc) == 0) {
4407 array = krealloc(descs, descs_size +
4411 gpiod_put_array(descs);
4415 descs = array;
4417 array_info = (void *)descs + descs_size;
4423 array_info->desc = descs->desc;
4426 bitmap_set(array_info->get_mask, descs->ndescs,
4427 count - descs->ndescs);
4428 bitmap_set(array_info->set_mask, descs->ndescs,
4429 count - descs->ndescs);
4430 descs->info = array_info;
4439 __clear_bit(descs->ndescs, array_info->get_mask);
4440 __clear_bit(descs->ndescs, array_info->set_mask);
4446 else if (gpio_chip_hwgpio(desc) != descs->ndescs) {
4452 if (bitmap_full(array_info->get_mask, descs->ndescs)) {
4455 __clear_bit(descs->ndescs,
4457 __clear_bit(descs->ndescs,
4462 if (gpiochip_line_is_open_drain(gc, descs->ndescs) ||
4463 gpiochip_line_is_open_source(gc, descs->ndescs))
4464 __clear_bit(descs->ndescs,
4468 __set_bit(descs->ndescs,
4478 return descs;
4496 struct gpio_descs *descs;
4498 descs = gpiod_get_array(dev, con_id, flags);
4499 if (gpiod_not_found(descs))
4502 return descs;
4521 * @descs: struct gpio_descs containing an array of descriptors
4523 void gpiod_put_array(struct gpio_descs *descs)
4527 for (i = 0; i < descs->ndescs; i++)
4528 gpiod_put(descs->desc[i]);
4530 kfree(descs);