Lines Matching refs:desc
149 int desc_to_gpio(const struct gpio_desc *desc) in desc_to_gpio() argument
151 return desc->gdev->base + (desc - &desc->gdev->descs[0]); in desc_to_gpio()
160 struct gpio_chip *gpiod_to_chip(const struct gpio_desc *desc) in gpiod_to_chip() argument
162 if (!desc || !desc->gdev || !desc->gdev->chip) in gpiod_to_chip()
164 return desc->gdev->chip; in gpiod_to_chip()
200 int gpiod_get_direction(struct gpio_desc *desc) in gpiod_get_direction() argument
206 chip = gpiod_to_chip(desc); in gpiod_get_direction()
207 offset = gpio_chip_hwgpio(desc); in gpiod_get_direction()
213 if (test_bit(FLAG_OPEN_DRAIN, &desc->flags) && in gpiod_get_direction()
214 test_bit(FLAG_IS_OUT, &desc->flags)) in gpiod_get_direction()
224 clear_bit(FLAG_IS_OUT, &desc->flags); in gpiod_get_direction()
228 set_bit(FLAG_IS_OUT, &desc->flags); in gpiod_get_direction()
296 struct gpio_desc *desc = &gdev->descs[i]; in gpio_name_to_desc() local
298 if (!desc->name || !name) in gpio_name_to_desc()
301 if (!strcmp(desc->name, name)) { in gpio_name_to_desc()
303 return desc; in gpio_name_to_desc()
492 struct gpio_desc *desc; in linehandle_create() local
505 desc = &gdev->descs[offset]; in linehandle_create()
506 ret = gpiod_request(desc, lh->label); in linehandle_create()
509 lh->descs[i] = desc; in linehandle_create()
513 set_bit(FLAG_ACTIVE_LOW, &desc->flags); in linehandle_create()
515 set_bit(FLAG_OPEN_DRAIN, &desc->flags); in linehandle_create()
517 set_bit(FLAG_OPEN_SOURCE, &desc->flags); in linehandle_create()
526 ret = gpiod_direction_output(desc, val); in linehandle_create()
530 ret = gpiod_direction_input(desc); in linehandle_create()
605 struct gpio_desc *desc; member
683 gpiod_free(le->desc); in lineevent_release()
706 val = gpiod_get_value_cansleep(le->desc); in lineevent_ioctl()
749 level = gpiod_get_value_cansleep(le->desc); in lineevent_irq_thread()
780 struct gpio_desc *desc; in lineevent_create() local
833 desc = &gdev->descs[offset]; in lineevent_create()
834 ret = gpiod_request(desc, le->label); in lineevent_create()
837 le->desc = desc; in lineevent_create()
841 set_bit(FLAG_ACTIVE_LOW, &desc->flags); in lineevent_create()
843 ret = gpiod_direction_input(desc); in lineevent_create()
847 le->irq = gpiod_to_irq(desc); in lineevent_create()
854 irqflags |= test_bit(FLAG_ACTIVE_LOW, &desc->flags) ? in lineevent_create()
857 irqflags |= test_bit(FLAG_ACTIVE_LOW, &desc->flags) ? in lineevent_create()
911 gpiod_free(le->desc); in lineevent_create()
951 struct gpio_desc *desc; in gpio_ioctl() local
958 desc = &gdev->descs[lineinfo.line_offset]; in gpio_ioctl()
959 if (desc->name) { in gpio_ioctl()
960 strncpy(lineinfo.name, desc->name, in gpio_ioctl()
966 if (desc->label) { in gpio_ioctl()
967 strncpy(lineinfo.consumer, desc->label, in gpio_ioctl()
979 if (test_bit(FLAG_REQUESTED, &desc->flags) || in gpio_ioctl()
980 test_bit(FLAG_IS_HOGGED, &desc->flags) || in gpio_ioctl()
981 test_bit(FLAG_USED_AS_IRQ, &desc->flags) || in gpio_ioctl()
982 test_bit(FLAG_EXPORT, &desc->flags) || in gpio_ioctl()
983 test_bit(FLAG_SYSFS, &desc->flags)) in gpio_ioctl()
985 if (test_bit(FLAG_IS_OUT, &desc->flags)) in gpio_ioctl()
987 if (test_bit(FLAG_ACTIVE_LOW, &desc->flags)) in gpio_ioctl()
989 if (test_bit(FLAG_OPEN_DRAIN, &desc->flags)) in gpio_ioctl()
992 if (test_bit(FLAG_OPEN_SOURCE, &desc->flags)) in gpio_ioctl()
1245 struct gpio_desc *desc = &gdev->descs[i]; in gpiochip_add_data() local
1247 desc->gdev = gdev; in gpiochip_add_data()
1265 set_bit(FLAG_IS_OUT, &desc->flags); in gpiochip_add_data()
1271 set_bit(FLAG_IS_OUT, &desc->flags); in gpiochip_add_data()
1355 struct gpio_desc *desc; in gpiochip_remove() local
1377 desc = &gdev->descs[i]; in gpiochip_remove()
1378 if (test_bit(FLAG_REQUESTED, &desc->flags)) in gpiochip_remove()
2041 static int __gpiod_request(struct gpio_desc *desc, const char *label) in __gpiod_request() argument
2043 struct gpio_chip *chip = desc->gdev->chip; in __gpiod_request()
2053 if (test_and_set_bit(FLAG_REQUESTED, &desc->flags) == 0) { in __gpiod_request()
2054 desc_set_label(desc, label ? : "?"); in __gpiod_request()
2064 status = chip->request(chip, gpio_chip_hwgpio(desc)); in __gpiod_request()
2068 desc_set_label(desc, NULL); in __gpiod_request()
2069 clear_bit(FLAG_REQUESTED, &desc->flags); in __gpiod_request()
2076 gpiod_get_direction(desc); in __gpiod_request()
2090 #define VALIDATE_DESC(desc) do { \ argument
2091 if (!desc) \
2093 if (IS_ERR(desc)) { \
2095 return PTR_ERR(desc); \
2097 if (!desc->gdev) { \
2101 if ( !desc->gdev->chip ) { \
2102 dev_warn(&desc->gdev->dev, \
2107 #define VALIDATE_DESC_VOID(desc) do { \ argument
2108 if (!desc) \
2110 if (IS_ERR(desc)) { \
2114 if (!desc->gdev) { \
2118 if (!desc->gdev->chip) { \
2119 dev_warn(&desc->gdev->dev, \
2125 int gpiod_request(struct gpio_desc *desc, const char *label) in gpiod_request() argument
2130 VALIDATE_DESC(desc); in gpiod_request()
2131 gdev = desc->gdev; in gpiod_request()
2134 status = __gpiod_request(desc, label); in gpiod_request()
2142 gpiod_dbg(desc, "%s: status %d\n", __func__, status); in gpiod_request()
2147 static bool __gpiod_free(struct gpio_desc *desc) in __gpiod_free() argument
2155 gpiod_unexport(desc); in __gpiod_free()
2159 chip = desc->gdev->chip; in __gpiod_free()
2160 if (chip && test_bit(FLAG_REQUESTED, &desc->flags)) { in __gpiod_free()
2164 chip->free(chip, gpio_chip_hwgpio(desc)); in __gpiod_free()
2167 desc_set_label(desc, NULL); in __gpiod_free()
2168 clear_bit(FLAG_ACTIVE_LOW, &desc->flags); in __gpiod_free()
2169 clear_bit(FLAG_REQUESTED, &desc->flags); in __gpiod_free()
2170 clear_bit(FLAG_OPEN_DRAIN, &desc->flags); in __gpiod_free()
2171 clear_bit(FLAG_OPEN_SOURCE, &desc->flags); in __gpiod_free()
2172 clear_bit(FLAG_IS_HOGGED, &desc->flags); in __gpiod_free()
2180 void gpiod_free(struct gpio_desc *desc) in gpiod_free() argument
2182 if (desc && desc->gdev && __gpiod_free(desc)) { in gpiod_free()
2183 module_put(desc->gdev->owner); in gpiod_free()
2184 put_device(&desc->gdev->dev); in gpiod_free()
2205 struct gpio_desc *desc; in gpiochip_is_requested() local
2210 desc = &chip->gpiodev->descs[offset]; in gpiochip_is_requested()
2212 if (test_bit(FLAG_REQUESTED, &desc->flags) == 0) in gpiochip_is_requested()
2214 return desc->label; in gpiochip_is_requested()
2237 struct gpio_desc *desc = gpiochip_get_desc(chip, hwnum); in gpiochip_request_own_desc() local
2240 if (IS_ERR(desc)) { in gpiochip_request_own_desc()
2242 return desc; in gpiochip_request_own_desc()
2245 err = __gpiod_request(desc, label); in gpiochip_request_own_desc()
2249 return desc; in gpiochip_request_own_desc()
2260 void gpiochip_free_own_desc(struct gpio_desc *desc) in gpiochip_free_own_desc() argument
2262 if (desc) in gpiochip_free_own_desc()
2263 __gpiod_free(desc); in gpiochip_free_own_desc()
2286 int gpiod_direction_input(struct gpio_desc *desc) in gpiod_direction_input() argument
2291 VALIDATE_DESC(desc); in gpiod_direction_input()
2292 chip = desc->gdev->chip; in gpiod_direction_input()
2295 gpiod_warn(desc, in gpiod_direction_input()
2301 status = chip->direction_input(chip, gpio_chip_hwgpio(desc)); in gpiod_direction_input()
2303 clear_bit(FLAG_IS_OUT, &desc->flags); in gpiod_direction_input()
2305 trace_gpio_direction(desc_to_gpio(desc), 1, status); in gpiod_direction_input()
2319 static int _gpiod_direction_output_raw(struct gpio_desc *desc, int value) in _gpiod_direction_output_raw() argument
2321 struct gpio_chip *gc = desc->gdev->chip; in _gpiod_direction_output_raw()
2326 if (test_bit(FLAG_USED_AS_IRQ, &desc->flags)) { in _gpiod_direction_output_raw()
2327 gpiod_err(desc, in _gpiod_direction_output_raw()
2333 if (test_bit(FLAG_OPEN_DRAIN, &desc->flags)) { in _gpiod_direction_output_raw()
2335 ret = gpio_set_drive_single_ended(gc, gpio_chip_hwgpio(desc), in _gpiod_direction_output_raw()
2341 ret = gpiod_direction_input(desc); in _gpiod_direction_output_raw()
2345 else if (test_bit(FLAG_OPEN_SOURCE, &desc->flags)) { in _gpiod_direction_output_raw()
2346 ret = gpio_set_drive_single_ended(gc, gpio_chip_hwgpio(desc), in _gpiod_direction_output_raw()
2352 ret = gpiod_direction_input(desc); in _gpiod_direction_output_raw()
2356 gpio_set_drive_single_ended(gc, gpio_chip_hwgpio(desc), in _gpiod_direction_output_raw()
2362 gpiod_warn(desc, in _gpiod_direction_output_raw()
2368 ret = gc->direction_output(gc, gpio_chip_hwgpio(desc), val); in _gpiod_direction_output_raw()
2370 set_bit(FLAG_IS_OUT, &desc->flags); in _gpiod_direction_output_raw()
2371 trace_gpio_value(desc_to_gpio(desc), 0, val); in _gpiod_direction_output_raw()
2372 trace_gpio_direction(desc_to_gpio(desc), 0, ret); in _gpiod_direction_output_raw()
2383 set_bit(FLAG_IS_OUT, &desc->flags); in _gpiod_direction_output_raw()
2398 int gpiod_direction_output_raw(struct gpio_desc *desc, int value) in gpiod_direction_output_raw() argument
2400 VALIDATE_DESC(desc); in gpiod_direction_output_raw()
2401 return _gpiod_direction_output_raw(desc, value); in gpiod_direction_output_raw()
2417 int gpiod_direction_output(struct gpio_desc *desc, int value) in gpiod_direction_output() argument
2419 VALIDATE_DESC(desc); in gpiod_direction_output()
2420 if (test_bit(FLAG_ACTIVE_LOW, &desc->flags)) in gpiod_direction_output()
2424 return _gpiod_direction_output_raw(desc, value); in gpiod_direction_output()
2437 int gpiod_set_debounce(struct gpio_desc *desc, unsigned debounce) in gpiod_set_debounce() argument
2442 VALIDATE_DESC(desc); in gpiod_set_debounce()
2443 chip = desc->gdev->chip; in gpiod_set_debounce()
2445 gpiod_dbg(desc, in gpiod_set_debounce()
2452 return chip->set_config(chip, gpio_chip_hwgpio(desc), config); in gpiod_set_debounce()
2462 int gpiod_is_active_low(const struct gpio_desc *desc) in gpiod_is_active_low() argument
2464 VALIDATE_DESC(desc); in gpiod_is_active_low()
2465 return test_bit(FLAG_ACTIVE_LOW, &desc->flags); in gpiod_is_active_low()
2491 static int _gpiod_get_raw_value(const struct gpio_desc *desc) in _gpiod_get_raw_value() argument
2497 chip = desc->gdev->chip; in _gpiod_get_raw_value()
2498 offset = gpio_chip_hwgpio(desc); in _gpiod_get_raw_value()
2501 trace_gpio_value(desc_to_gpio(desc), 1, value); in _gpiod_get_raw_value()
2515 int gpiod_get_raw_value(const struct gpio_desc *desc) in gpiod_get_raw_value() argument
2517 VALIDATE_DESC(desc); in gpiod_get_raw_value()
2519 WARN_ON(desc->gdev->chip->can_sleep); in gpiod_get_raw_value()
2520 return _gpiod_get_raw_value(desc); in gpiod_get_raw_value()
2534 int gpiod_get_value(const struct gpio_desc *desc) in gpiod_get_value() argument
2538 VALIDATE_DESC(desc); in gpiod_get_value()
2540 WARN_ON(desc->gdev->chip->can_sleep); in gpiod_get_value()
2542 value = _gpiod_get_raw_value(desc); in gpiod_get_value()
2546 if (test_bit(FLAG_ACTIVE_LOW, &desc->flags)) in gpiod_get_value()
2558 static void _gpio_set_open_drain_value(struct gpio_desc *desc, bool value) in _gpio_set_open_drain_value() argument
2561 struct gpio_chip *chip = desc->gdev->chip; in _gpio_set_open_drain_value()
2562 int offset = gpio_chip_hwgpio(desc); in _gpio_set_open_drain_value()
2569 set_bit(FLAG_IS_OUT, &desc->flags); in _gpio_set_open_drain_value()
2571 trace_gpio_direction(desc_to_gpio(desc), value, err); in _gpio_set_open_drain_value()
2573 gpiod_err(desc, in _gpio_set_open_drain_value()
2583 static void _gpio_set_open_source_value(struct gpio_desc *desc, bool value) in _gpio_set_open_source_value() argument
2586 struct gpio_chip *chip = desc->gdev->chip; in _gpio_set_open_source_value()
2587 int offset = gpio_chip_hwgpio(desc); in _gpio_set_open_source_value()
2592 set_bit(FLAG_IS_OUT, &desc->flags); in _gpio_set_open_source_value()
2596 trace_gpio_direction(desc_to_gpio(desc), !value, err); in _gpio_set_open_source_value()
2598 gpiod_err(desc, in _gpio_set_open_source_value()
2603 static void _gpiod_set_raw_value(struct gpio_desc *desc, bool value) in _gpiod_set_raw_value() argument
2607 chip = desc->gdev->chip; in _gpiod_set_raw_value()
2608 trace_gpio_value(desc_to_gpio(desc), 0, value); in _gpiod_set_raw_value()
2609 if (test_bit(FLAG_OPEN_DRAIN, &desc->flags)) in _gpiod_set_raw_value()
2610 _gpio_set_open_drain_value(desc, value); in _gpiod_set_raw_value()
2611 else if (test_bit(FLAG_OPEN_SOURCE, &desc->flags)) in _gpiod_set_raw_value()
2612 _gpio_set_open_source_value(desc, value); in _gpiod_set_raw_value()
2614 chip->set(chip, gpio_chip_hwgpio(desc), value); in _gpiod_set_raw_value()
2658 struct gpio_desc *desc = desc_array[i]; in gpiod_set_array_value_complex() local
2659 int hwgpio = gpio_chip_hwgpio(desc); in gpiod_set_array_value_complex()
2662 if (!raw && test_bit(FLAG_ACTIVE_LOW, &desc->flags)) in gpiod_set_array_value_complex()
2664 trace_gpio_value(desc_to_gpio(desc), 0, value); in gpiod_set_array_value_complex()
2669 if (test_bit(FLAG_OPEN_DRAIN, &desc->flags)) { in gpiod_set_array_value_complex()
2670 _gpio_set_open_drain_value(desc, value); in gpiod_set_array_value_complex()
2671 } else if (test_bit(FLAG_OPEN_SOURCE, &desc->flags)) { in gpiod_set_array_value_complex()
2672 _gpio_set_open_source_value(desc, value); in gpiod_set_array_value_complex()
2701 void gpiod_set_raw_value(struct gpio_desc *desc, int value) in gpiod_set_raw_value() argument
2703 VALIDATE_DESC_VOID(desc); in gpiod_set_raw_value()
2705 WARN_ON(desc->gdev->chip->can_sleep); in gpiod_set_raw_value()
2706 _gpiod_set_raw_value(desc, value); in gpiod_set_raw_value()
2721 void gpiod_set_value(struct gpio_desc *desc, int value) in gpiod_set_value() argument
2723 VALIDATE_DESC_VOID(desc); in gpiod_set_value()
2725 WARN_ON(desc->gdev->chip->can_sleep); in gpiod_set_value()
2726 if (test_bit(FLAG_ACTIVE_LOW, &desc->flags)) in gpiod_set_value()
2728 _gpiod_set_raw_value(desc, value); in gpiod_set_value()
2781 int gpiod_cansleep(const struct gpio_desc *desc) in gpiod_cansleep() argument
2783 VALIDATE_DESC(desc); in gpiod_cansleep()
2784 return desc->gdev->chip->can_sleep; in gpiod_cansleep()
2795 int gpiod_to_irq(const struct gpio_desc *desc) in gpiod_to_irq() argument
2805 if (!desc || IS_ERR(desc) || !desc->gdev || !desc->gdev->chip) in gpiod_to_irq()
2808 chip = desc->gdev->chip; in gpiod_to_irq()
2809 offset = gpio_chip_hwgpio(desc); in gpiod_to_irq()
2833 struct gpio_desc *desc; in gpiochip_lock_as_irq() local
2835 desc = gpiochip_get_desc(chip, offset); in gpiochip_lock_as_irq()
2836 if (IS_ERR(desc)) in gpiochip_lock_as_irq()
2837 return PTR_ERR(desc); in gpiochip_lock_as_irq()
2847 clear_bit(FLAG_IS_OUT, &desc->flags); in gpiochip_lock_as_irq()
2849 set_bit(FLAG_IS_OUT, &desc->flags); in gpiochip_lock_as_irq()
2852 if (test_bit(FLAG_IS_OUT, &desc->flags)) { in gpiochip_lock_as_irq()
2859 set_bit(FLAG_USED_AS_IRQ, &desc->flags); in gpiochip_lock_as_irq()
2866 if (!desc->label) in gpiochip_lock_as_irq()
2867 desc_set_label(desc, "interrupt"); in gpiochip_lock_as_irq()
2883 struct gpio_desc *desc; in gpiochip_unlock_as_irq() local
2885 desc = gpiochip_get_desc(chip, offset); in gpiochip_unlock_as_irq()
2886 if (IS_ERR(desc)) in gpiochip_unlock_as_irq()
2889 clear_bit(FLAG_USED_AS_IRQ, &desc->flags); in gpiochip_unlock_as_irq()
2892 if (desc->label && !strcmp(desc->label, "interrupt")) in gpiochip_unlock_as_irq()
2893 desc_set_label(desc, NULL); in gpiochip_unlock_as_irq()
2943 int gpiod_get_raw_value_cansleep(const struct gpio_desc *desc) in gpiod_get_raw_value_cansleep() argument
2946 VALIDATE_DESC(desc); in gpiod_get_raw_value_cansleep()
2947 return _gpiod_get_raw_value(desc); in gpiod_get_raw_value_cansleep()
2960 int gpiod_get_value_cansleep(const struct gpio_desc *desc) in gpiod_get_value_cansleep() argument
2965 VALIDATE_DESC(desc); in gpiod_get_value_cansleep()
2966 value = _gpiod_get_raw_value(desc); in gpiod_get_value_cansleep()
2970 if (test_bit(FLAG_ACTIVE_LOW, &desc->flags)) in gpiod_get_value_cansleep()
2987 void gpiod_set_raw_value_cansleep(struct gpio_desc *desc, int value) in gpiod_set_raw_value_cansleep() argument
2990 VALIDATE_DESC_VOID(desc); in gpiod_set_raw_value_cansleep()
2991 _gpiod_set_raw_value(desc, value); in gpiod_set_raw_value_cansleep()
3005 void gpiod_set_value_cansleep(struct gpio_desc *desc, int value) in gpiod_set_value_cansleep() argument
3008 VALIDATE_DESC_VOID(desc); in gpiod_set_value_cansleep()
3009 if (test_bit(FLAG_ACTIVE_LOW, &desc->flags)) in gpiod_set_value_cansleep()
3011 _gpiod_set_raw_value(desc, value); in gpiod_set_value_cansleep()
3141 struct gpio_desc *desc = ERR_PTR(-ENOENT); in gpiod_find() local
3147 return desc; in gpiod_find()
3176 desc = gpiochip_get_desc(chip, p->chip_hwnum); in gpiod_find()
3179 return desc; in gpiod_find()
3182 return desc; in gpiod_find()
3297 int gpiod_configure_flags(struct gpio_desc *desc, const char *con_id, in gpiod_configure_flags() argument
3303 set_bit(FLAG_ACTIVE_LOW, &desc->flags); in gpiod_configure_flags()
3305 set_bit(FLAG_OPEN_DRAIN, &desc->flags); in gpiod_configure_flags()
3307 set_bit(FLAG_OPEN_SOURCE, &desc->flags); in gpiod_configure_flags()
3309 set_bit(FLAG_SLEEP_MAY_LOOSE_VALUE, &desc->flags); in gpiod_configure_flags()
3319 status = gpiod_direction_output(desc, in gpiod_configure_flags()
3322 status = gpiod_direction_input(desc); in gpiod_configure_flags()
3346 struct gpio_desc *desc = NULL; in gpiod_get_index() local
3358 desc = of_find_gpio(dev, con_id, idx, &lookupflags); in gpiod_get_index()
3361 desc = acpi_find_gpio(dev, con_id, idx, &flags, &lookupflags); in gpiod_get_index()
3369 if (!desc || desc == ERR_PTR(-ENOENT)) { in gpiod_get_index()
3371 desc = gpiod_find(dev, con_id, idx, &lookupflags); in gpiod_get_index()
3374 if (IS_ERR(desc)) { in gpiod_get_index()
3376 return desc; in gpiod_get_index()
3383 status = gpiod_request(desc, con_id ? con_id : devname); in gpiod_get_index()
3387 status = gpiod_configure_flags(desc, con_id, lookupflags, flags); in gpiod_get_index()
3390 gpiod_put(desc); in gpiod_get_index()
3394 return desc; in gpiod_get_index()
3424 struct gpio_desc *desc = ERR_PTR(-ENODEV); in fwnode_get_named_gpiod() local
3437 desc = of_get_named_gpiod_flags(to_of_node(fwnode), propname, in fwnode_get_named_gpiod()
3439 if (!IS_ERR(desc)) { in fwnode_get_named_gpiod()
3447 desc = acpi_node_get_gpiod(fwnode, propname, index, &info); in fwnode_get_named_gpiod()
3448 if (!IS_ERR(desc)) { in fwnode_get_named_gpiod()
3456 if (IS_ERR(desc)) in fwnode_get_named_gpiod()
3457 return desc; in fwnode_get_named_gpiod()
3459 ret = gpiod_request(desc, label); in fwnode_get_named_gpiod()
3473 ret = gpiod_configure_flags(desc, propname, lflags, dflags); in fwnode_get_named_gpiod()
3475 gpiod_put(desc); in fwnode_get_named_gpiod()
3479 return desc; in fwnode_get_named_gpiod()
3500 struct gpio_desc *desc; in gpiod_get_index_optional() local
3502 desc = gpiod_get_index(dev, con_id, index, flags); in gpiod_get_index_optional()
3503 if (IS_ERR(desc)) { in gpiod_get_index_optional()
3504 if (PTR_ERR(desc) == -ENOENT) in gpiod_get_index_optional()
3508 return desc; in gpiod_get_index_optional()
3520 int gpiod_hog(struct gpio_desc *desc, const char *name, in gpiod_hog() argument
3528 chip = gpiod_to_chip(desc); in gpiod_hog()
3529 hwnum = gpio_chip_hwgpio(desc); in gpiod_hog()
3539 status = gpiod_configure_flags(desc, name, lflags, dflags); in gpiod_hog()
3543 gpiochip_free_own_desc(desc); in gpiod_hog()
3548 set_bit(FLAG_IS_HOGGED, &desc->flags); in gpiod_hog()
3551 desc_to_gpio(desc), name, in gpiod_hog()
3591 struct gpio_desc *desc; in gpiod_get_array() local
3599 descs = kzalloc(sizeof(*descs) + sizeof(descs->desc[0]) * count, in gpiod_get_array()
3605 desc = gpiod_get_index(dev, con_id, descs->ndescs, flags); in gpiod_get_array()
3606 if (IS_ERR(desc)) { in gpiod_get_array()
3608 return ERR_CAST(desc); in gpiod_get_array()
3610 descs->desc[descs->ndescs] = desc; in gpiod_get_array()
3647 void gpiod_put(struct gpio_desc *desc) in gpiod_put() argument
3649 gpiod_free(desc); in gpiod_put()
3662 gpiod_put(descs->desc[i]); in gpiod_put_array()