Lines Matching refs:flags

71 	unsigned long flags;  in gpio_to_desc()  local
73 spin_lock_irqsave(&gpio_lock, flags); in gpio_to_desc()
77 spin_unlock_irqrestore(&gpio_lock, flags); in gpio_to_desc()
82 spin_unlock_irqrestore(&gpio_lock, flags); in gpio_to_desc()
173 clear_bit(FLAG_IS_OUT, &desc->flags); in gpiod_get_direction()
177 set_bit(FLAG_IS_OUT, &desc->flags); in gpiod_get_direction()
226 unsigned long flags; in gpio_name_to_desc() local
228 spin_lock_irqsave(&gpio_lock, flags); in gpio_name_to_desc()
240 spin_unlock_irqrestore(&gpio_lock, flags); in gpio_name_to_desc()
246 spin_unlock_irqrestore(&gpio_lock, flags); in gpio_name_to_desc()
301 unsigned long flags; in gpiochip_add() local
311 spin_lock_irqsave(&gpio_lock, flags); in gpiochip_add()
317 spin_unlock_irqrestore(&gpio_lock, flags); in gpiochip_add()
325 spin_unlock_irqrestore(&gpio_lock, flags); in gpiochip_add()
340 desc->flags = !chip->direction_input ? (1 << FLAG_IS_OUT) : 0; in gpiochip_add()
345 spin_unlock_irqrestore(&gpio_lock, flags); in gpiochip_add()
379 spin_lock_irqsave(&gpio_lock, flags); in gpiochip_add()
381 spin_unlock_irqrestore(&gpio_lock, flags); in gpiochip_add()
403 unsigned long flags; in gpiochip_remove() local
416 spin_lock_irqsave(&gpio_lock, flags); in gpiochip_remove()
420 if (test_bit(FLAG_REQUESTED, &desc->flags)) in gpiochip_remove()
424 spin_unlock_irqrestore(&gpio_lock, flags); in gpiochip_remove()
450 unsigned long flags; in gpiochip_find() local
452 spin_lock_irqsave(&gpio_lock, flags); in gpiochip_find()
460 spin_unlock_irqrestore(&gpio_lock, flags); in gpiochip_find()
895 unsigned long flags; in __gpiod_request() local
897 spin_lock_irqsave(&gpio_lock, flags); in __gpiod_request()
903 if (test_and_set_bit(FLAG_REQUESTED, &desc->flags) == 0) { in __gpiod_request()
913 spin_unlock_irqrestore(&gpio_lock, flags); in __gpiod_request()
915 spin_lock_irqsave(&gpio_lock, flags); in __gpiod_request()
919 clear_bit(FLAG_REQUESTED, &desc->flags); in __gpiod_request()
925 spin_unlock_irqrestore(&gpio_lock, flags); in __gpiod_request()
927 spin_lock_irqsave(&gpio_lock, flags); in __gpiod_request()
934 clear_bit(FLAG_ACTIVE_LOW, &desc->flags); in __gpiod_request()
935 clear_bit(FLAG_OPEN_DRAIN, &desc->flags); in __gpiod_request()
936 clear_bit(FLAG_OPEN_SOURCE, &desc->flags); in __gpiod_request()
938 spin_unlock_irqrestore(&gpio_lock, flags); in __gpiod_request()
972 unsigned long flags; in __gpiod_free() local
979 spin_lock_irqsave(&gpio_lock, flags); in __gpiod_free()
982 if (chip && test_bit(FLAG_REQUESTED, &desc->flags)) { in __gpiod_free()
984 spin_unlock_irqrestore(&gpio_lock, flags); in __gpiod_free()
987 spin_lock_irqsave(&gpio_lock, flags); in __gpiod_free()
990 clear_bit(FLAG_ACTIVE_LOW, &desc->flags); in __gpiod_free()
991 clear_bit(FLAG_REQUESTED, &desc->flags); in __gpiod_free()
992 clear_bit(FLAG_OPEN_DRAIN, &desc->flags); in __gpiod_free()
993 clear_bit(FLAG_OPEN_SOURCE, &desc->flags); in __gpiod_free()
994 clear_bit(FLAG_IS_HOGGED, &desc->flags); in __gpiod_free()
998 spin_unlock_irqrestore(&gpio_lock, flags); in __gpiod_free()
1032 if (test_bit(FLAG_REQUESTED, &desc->flags) == 0) in gpiochip_is_requested()
1120 clear_bit(FLAG_IS_OUT, &desc->flags); in gpiod_direction_input()
1134 if (test_bit(FLAG_USED_AS_IRQ, &desc->flags)) { in _gpiod_direction_output_raw()
1142 if (value && test_bit(FLAG_OPEN_DRAIN, &desc->flags)) in _gpiod_direction_output_raw()
1146 if (!value && test_bit(FLAG_OPEN_SOURCE, &desc->flags)) in _gpiod_direction_output_raw()
1159 set_bit(FLAG_IS_OUT, &desc->flags); in _gpiod_direction_output_raw()
1204 if (test_bit(FLAG_ACTIVE_LOW, &desc->flags)) in gpiod_direction_output()
1247 return test_bit(FLAG_ACTIVE_LOW, &desc->flags); in gpiod_is_active_low()
1335 if (test_bit(FLAG_ACTIVE_LOW, &desc->flags)) in gpiod_get_value()
1356 clear_bit(FLAG_IS_OUT, &desc->flags); in _gpio_set_open_drain_value()
1360 set_bit(FLAG_IS_OUT, &desc->flags); in _gpio_set_open_drain_value()
1383 set_bit(FLAG_IS_OUT, &desc->flags); in _gpio_set_open_source_value()
1387 clear_bit(FLAG_IS_OUT, &desc->flags); in _gpio_set_open_source_value()
1402 if (test_bit(FLAG_OPEN_DRAIN, &desc->flags)) in _gpiod_set_raw_value()
1404 else if (test_bit(FLAG_OPEN_SOURCE, &desc->flags)) in _gpiod_set_raw_value()
1462 if (!raw && test_bit(FLAG_ACTIVE_LOW, &desc->flags)) in gpiod_set_array_value_priv()
1469 if (test_bit(FLAG_OPEN_DRAIN, &desc->flags)) { in gpiod_set_array_value_priv()
1471 } else if (test_bit(FLAG_OPEN_SOURCE, &desc->flags)) { in gpiod_set_array_value_priv()
1527 if (test_bit(FLAG_ACTIVE_LOW, &desc->flags)) in gpiod_set_value()
1623 if (test_bit(FLAG_IS_OUT, &chip->desc[offset].flags)) { in gpiochip_lock_as_irq()
1630 set_bit(FLAG_USED_AS_IRQ, &chip->desc[offset].flags); in gpiochip_lock_as_irq()
1648 clear_bit(FLAG_USED_AS_IRQ, &chip->desc[offset].flags); in gpiochip_unlock_as_irq()
1691 if (test_bit(FLAG_ACTIVE_LOW, &desc->flags)) in gpiod_get_value_cansleep()
1733 if (test_bit(FLAG_ACTIVE_LOW, &desc->flags)) in gpiod_set_value_cansleep()
1813 enum gpio_lookup_flags *flags) in of_find_gpio() argument
1838 *flags |= GPIO_ACTIVE_LOW; in of_find_gpio()
1842 *flags |= GPIO_OPEN_DRAIN; in of_find_gpio()
1844 *flags |= GPIO_OPEN_SOURCE; in of_find_gpio()
1852 enum gpio_lookup_flags *flags) in acpi_find_gpio() argument
1883 *flags |= GPIO_ACTIVE_LOW; in acpi_find_gpio()
1921 enum gpio_lookup_flags *flags) in gpiod_find() argument
1958 *flags = p->flags; in gpiod_find()
2041 enum gpiod_flags flags) in gpiod_get() argument
2043 return gpiod_get_index(dev, con_id, 0, flags); in gpiod_get()
2059 enum gpiod_flags flags) in gpiod_get_optional() argument
2061 return gpiod_get_index_optional(dev, con_id, 0, flags); in gpiod_get_optional()
2076 set_bit(FLAG_ACTIVE_LOW, &desc->flags); in gpiod_parse_flags()
2078 set_bit(FLAG_OPEN_DRAIN, &desc->flags); in gpiod_parse_flags()
2080 set_bit(FLAG_OPEN_SOURCE, &desc->flags); in gpiod_parse_flags()
2131 enum gpiod_flags flags) in gpiod_get_index() argument
2170 status = gpiod_configure_flags(desc, con_id, flags); in gpiod_get_index()
2207 enum of_gpio_flags flags; in fwnode_get_named_gpiod() local
2210 &flags); in fwnode_get_named_gpiod()
2212 active_low = flags & OF_GPIO_ACTIVE_LOW; in fwnode_get_named_gpiod()
2213 single_ended = flags & OF_GPIO_SINGLE_ENDED; in fwnode_get_named_gpiod()
2227 set_bit(FLAG_ACTIVE_LOW, &desc->flags); in fwnode_get_named_gpiod()
2231 set_bit(FLAG_OPEN_DRAIN, &desc->flags); in fwnode_get_named_gpiod()
2233 set_bit(FLAG_OPEN_SOURCE, &desc->flags); in fwnode_get_named_gpiod()
2259 enum gpiod_flags flags) in gpiod_get_index_optional() argument
2263 desc = gpiod_get_index(dev, con_id, index, flags); in gpiod_get_index_optional()
2310 set_bit(FLAG_IS_HOGGED, &desc->flags); in gpiod_hog()
2332 if (test_bit(FLAG_IS_HOGGED, &chip->desc[id].flags)) in gpiochip_free_hogs()
2351 enum gpiod_flags flags) in gpiod_get_array() argument
2367 desc = gpiod_get_index(dev, con_id, descs->ndescs, flags); in gpiod_get_array()
2391 enum gpiod_flags flags) in gpiod_get_array_optional() argument
2395 descs = gpiod_get_array(dev, con_id, flags); in gpiod_get_array_optional()
2441 if (!test_bit(FLAG_REQUESTED, &gdesc->flags)) { in gpiolib_dbg_show()
2450 is_out = test_bit(FLAG_IS_OUT, &gdesc->flags); in gpiolib_dbg_show()
2451 is_irq = test_bit(FLAG_USED_AS_IRQ, &gdesc->flags); in gpiolib_dbg_show()
2465 unsigned long flags; in gpiolib_seq_start() local
2471 spin_lock_irqsave(&gpio_lock, flags); in gpiolib_seq_start()
2474 spin_unlock_irqrestore(&gpio_lock, flags); in gpiolib_seq_start()
2477 spin_unlock_irqrestore(&gpio_lock, flags); in gpiolib_seq_start()
2484 unsigned long flags; in gpiolib_seq_next() local
2488 spin_lock_irqsave(&gpio_lock, flags); in gpiolib_seq_next()
2493 spin_unlock_irqrestore(&gpio_lock, flags); in gpiolib_seq_next()