Lines Matching refs:descs
119 return &gdev->descs[gpio - gdev->base]; in gpio_to_desc()
150 return &gdev->descs[hwnum]; in gpiochip_get_desc()
166 return desc->gdev->base + (desc - &desc->gdev->descs[0]); in desc_to_gpio()
317 struct gpio_desc *desc = &gdev->descs[i]; in gpio_name_to_desc()
360 gdev->descs[i].name = gc->names[i]; in gpiochip_set_desc_names()
405 gdev->descs[i].name = names[i]; in devprop_gpiochip_set_names()
483 kfree(gdev->descs); in gpiodevice_release()
625 gdev->descs = kcalloc(gc->ngpio, sizeof(gdev->descs[0]), GFP_KERNEL); in gpiochip_add_data_with_key()
626 if (!gdev->descs) { in gpiochip_add_data_with_key()
683 gdev->descs[i].gdev = gdev; in gpiochip_add_data_with_key()
715 struct gpio_desc *desc = &gdev->descs[i]; in gpiochip_add_data_with_key()
781 kfree(gdev->descs); in gpiochip_add_data_with_key()
3363 return test_bit(FLAG_USED_AS_IRQ, &gc->gpiodev->descs[offset].flags); in gpiochip_line_is_irq()
3396 return test_bit(FLAG_OPEN_DRAIN, &gc->gpiodev->descs[offset].flags); in gpiochip_line_is_open_drain()
3405 return test_bit(FLAG_OPEN_SOURCE, &gc->gpiodev->descs[offset].flags); in gpiochip_line_is_open_source()
3414 return !test_bit(FLAG_TRANSITORY, &gc->gpiodev->descs[offset].flags); in gpiochip_line_is_persistent()
4199 if (test_bit(FLAG_IS_HOGGED, &gc->gpiodev->descs[id].flags)) in gpiochip_free_hogs()
4200 gpiochip_free_own_desc(&gc->gpiodev->descs[id]); in gpiochip_free_hogs()
4221 struct gpio_descs *descs; in gpiod_get_array() local
4230 descs = kzalloc(struct_size(descs, desc, count), GFP_KERNEL); in gpiod_get_array()
4231 if (!descs) in gpiod_get_array()
4234 for (descs->ndescs = 0; descs->ndescs < count; ) { in gpiod_get_array()
4235 desc = gpiod_get_index(dev, con_id, descs->ndescs, flags); in gpiod_get_array()
4237 gpiod_put_array(descs); in gpiod_get_array()
4241 descs->desc[descs->ndescs] = desc; in gpiod_get_array()
4248 if (descs->ndescs == 0 && gpio_chip_hwgpio(desc) == 0) { in gpiod_get_array()
4254 array = kzalloc(struct_size(descs, desc, count) + in gpiod_get_array()
4258 gpiod_put_array(descs); in gpiod_get_array()
4262 memcpy(array, descs, in gpiod_get_array()
4263 struct_size(descs, desc, descs->ndescs + 1)); in gpiod_get_array()
4264 kfree(descs); in gpiod_get_array()
4266 descs = array; in gpiod_get_array()
4267 array_info = (void *)(descs->desc + count); in gpiod_get_array()
4273 array_info->desc = descs->desc; in gpiod_get_array()
4276 bitmap_set(array_info->get_mask, descs->ndescs, in gpiod_get_array()
4277 count - descs->ndescs); in gpiod_get_array()
4278 bitmap_set(array_info->set_mask, descs->ndescs, in gpiod_get_array()
4279 count - descs->ndescs); in gpiod_get_array()
4280 descs->info = array_info; in gpiod_get_array()
4284 __clear_bit(descs->ndescs, array_info->get_mask); in gpiod_get_array()
4285 __clear_bit(descs->ndescs, array_info->set_mask); in gpiod_get_array()
4292 gpio_chip_hwgpio(desc) != descs->ndescs) { in gpiod_get_array()
4298 if (bitmap_full(array_info->get_mask, descs->ndescs)) { in gpiod_get_array()
4301 __clear_bit(descs->ndescs, in gpiod_get_array()
4303 __clear_bit(descs->ndescs, in gpiod_get_array()
4308 if (gpiochip_line_is_open_drain(gc, descs->ndescs) || in gpiod_get_array()
4309 gpiochip_line_is_open_source(gc, descs->ndescs)) in gpiod_get_array()
4310 __clear_bit(descs->ndescs, in gpiod_get_array()
4314 __set_bit(descs->ndescs, in gpiod_get_array()
4318 descs->ndescs++; in gpiod_get_array()
4326 return descs; in gpiod_get_array()
4344 struct gpio_descs *descs; in gpiod_get_array_optional() local
4346 descs = gpiod_get_array(dev, con_id, flags); in gpiod_get_array_optional()
4347 if (PTR_ERR(descs) == -ENOENT) in gpiod_get_array_optional()
4350 return descs; in gpiod_get_array_optional()
4371 void gpiod_put_array(struct gpio_descs *descs) in gpiod_put_array() argument
4375 for (i = 0; i < descs->ndescs; i++) in gpiod_put_array()
4376 gpiod_put(descs->desc[i]); in gpiod_put_array()
4378 kfree(descs); in gpiod_put_array()
4461 struct gpio_desc *gdesc = &gdev->descs[0]; in gpiolib_dbg_show()