Lines Matching refs:flags

72 	unsigned long flags;  in gpio_to_desc()  local
74 spin_lock_irqsave(&gpio_lock, flags); in gpio_to_desc()
78 spin_unlock_irqrestore(&gpio_lock, flags); in gpio_to_desc()
83 spin_unlock_irqrestore(&gpio_lock, flags); in gpio_to_desc()
174 clear_bit(FLAG_IS_OUT, &desc->flags); in gpiod_get_direction()
178 set_bit(FLAG_IS_OUT, &desc->flags); in gpiod_get_direction()
240 unsigned long flags; in gpiochip_add() local
250 spin_lock_irqsave(&gpio_lock, flags); in gpiochip_add()
256 spin_unlock_irqrestore(&gpio_lock, flags); in gpiochip_add()
264 spin_unlock_irqrestore(&gpio_lock, flags); in gpiochip_add()
279 desc->flags = !chip->direction_input ? (1 << FLAG_IS_OUT) : 0; in gpiochip_add()
284 spin_unlock_irqrestore(&gpio_lock, flags); in gpiochip_add()
307 spin_lock_irqsave(&gpio_lock, flags); in gpiochip_add()
309 spin_unlock_irqrestore(&gpio_lock, flags); in gpiochip_add()
330 unsigned long flags; in gpiochip_remove() local
342 spin_lock_irqsave(&gpio_lock, flags); in gpiochip_remove()
344 if (test_bit(FLAG_REQUESTED, &chip->desc[id].flags)) in gpiochip_remove()
351 spin_unlock_irqrestore(&gpio_lock, flags); in gpiochip_remove()
374 unsigned long flags; in gpiochip_find() local
376 spin_lock_irqsave(&gpio_lock, flags); in gpiochip_find()
384 spin_unlock_irqrestore(&gpio_lock, flags); in gpiochip_find()
782 unsigned long flags; in __gpiod_request() local
784 spin_lock_irqsave(&gpio_lock, flags); in __gpiod_request()
790 if (test_and_set_bit(FLAG_REQUESTED, &desc->flags) == 0) { in __gpiod_request()
800 spin_unlock_irqrestore(&gpio_lock, flags); in __gpiod_request()
802 spin_lock_irqsave(&gpio_lock, flags); in __gpiod_request()
806 clear_bit(FLAG_REQUESTED, &desc->flags); in __gpiod_request()
812 spin_unlock_irqrestore(&gpio_lock, flags); in __gpiod_request()
814 spin_lock_irqsave(&gpio_lock, flags); in __gpiod_request()
817 spin_unlock_irqrestore(&gpio_lock, flags); in __gpiod_request()
851 unsigned long flags; in __gpiod_free() local
858 spin_lock_irqsave(&gpio_lock, flags); in __gpiod_free()
861 if (chip && test_bit(FLAG_REQUESTED, &desc->flags)) { in __gpiod_free()
863 spin_unlock_irqrestore(&gpio_lock, flags); in __gpiod_free()
866 spin_lock_irqsave(&gpio_lock, flags); in __gpiod_free()
869 clear_bit(FLAG_ACTIVE_LOW, &desc->flags); in __gpiod_free()
870 clear_bit(FLAG_REQUESTED, &desc->flags); in __gpiod_free()
871 clear_bit(FLAG_OPEN_DRAIN, &desc->flags); in __gpiod_free()
872 clear_bit(FLAG_OPEN_SOURCE, &desc->flags); in __gpiod_free()
873 clear_bit(FLAG_IS_HOGGED, &desc->flags); in __gpiod_free()
877 spin_unlock_irqrestore(&gpio_lock, flags); in __gpiod_free()
911 if (test_bit(FLAG_REQUESTED, &desc->flags) == 0) in gpiochip_is_requested()
999 clear_bit(FLAG_IS_OUT, &desc->flags); in gpiod_direction_input()
1013 if (test_bit(FLAG_USED_AS_IRQ, &desc->flags)) { in _gpiod_direction_output_raw()
1021 if (value && test_bit(FLAG_OPEN_DRAIN, &desc->flags)) in _gpiod_direction_output_raw()
1025 if (!value && test_bit(FLAG_OPEN_SOURCE, &desc->flags)) in _gpiod_direction_output_raw()
1038 set_bit(FLAG_IS_OUT, &desc->flags); in _gpiod_direction_output_raw()
1083 if (test_bit(FLAG_ACTIVE_LOW, &desc->flags)) in gpiod_direction_output()
1126 return test_bit(FLAG_ACTIVE_LOW, &desc->flags); in gpiod_is_active_low()
1204 if (test_bit(FLAG_ACTIVE_LOW, &desc->flags)) in gpiod_get_value()
1225 clear_bit(FLAG_IS_OUT, &desc->flags); in _gpio_set_open_drain_value()
1229 set_bit(FLAG_IS_OUT, &desc->flags); in _gpio_set_open_drain_value()
1252 set_bit(FLAG_IS_OUT, &desc->flags); in _gpio_set_open_source_value()
1256 clear_bit(FLAG_IS_OUT, &desc->flags); in _gpio_set_open_source_value()
1271 if (test_bit(FLAG_OPEN_DRAIN, &desc->flags)) in _gpiod_set_raw_value()
1273 else if (test_bit(FLAG_OPEN_SOURCE, &desc->flags)) in _gpiod_set_raw_value()
1332 if (!raw && test_bit(FLAG_ACTIVE_LOW, &desc->flags)) in gpiod_set_array_priv()
1339 if (test_bit(FLAG_OPEN_DRAIN, &desc->flags)) { in gpiod_set_array_priv()
1341 } else if (test_bit(FLAG_OPEN_SOURCE, &desc->flags)) { in gpiod_set_array_priv()
1399 if (test_bit(FLAG_ACTIVE_LOW, &desc->flags)) in gpiod_set_value()
1493 if (test_bit(FLAG_IS_OUT, &chip->desc[offset].flags)) { in gpiochip_lock_as_irq()
1500 set_bit(FLAG_USED_AS_IRQ, &chip->desc[offset].flags); in gpiochip_lock_as_irq()
1518 clear_bit(FLAG_USED_AS_IRQ, &chip->desc[offset].flags); in gpiochip_unlock_as_irq()
1558 if (test_bit(FLAG_ACTIVE_LOW, &desc->flags)) in gpiod_get_value_cansleep()
1600 if (test_bit(FLAG_ACTIVE_LOW, &desc->flags)) in gpiod_set_value_cansleep()
1665 enum gpio_lookup_flags *flags) in of_find_gpio() argument
1690 *flags |= GPIO_ACTIVE_LOW; in of_find_gpio()
1697 enum gpio_lookup_flags *flags) in acpi_find_gpio() argument
1728 *flags |= GPIO_ACTIVE_LOW; in acpi_find_gpio()
1766 enum gpio_lookup_flags *flags) in gpiod_find() argument
1803 *flags = p->flags; in gpiod_find()
1886 enum gpiod_flags flags) in __gpiod_get() argument
1888 return gpiod_get_index(dev, con_id, 0, flags); in __gpiod_get()
1904 enum gpiod_flags flags) in __gpiod_get_optional() argument
1906 return gpiod_get_index_optional(dev, con_id, 0, flags); in __gpiod_get_optional()
1929 set_bit(FLAG_ACTIVE_LOW, &desc->flags); in gpiod_configure_flags()
1931 set_bit(FLAG_OPEN_DRAIN, &desc->flags); in gpiod_configure_flags()
1933 set_bit(FLAG_OPEN_SOURCE, &desc->flags); in gpiod_configure_flags()
1968 enum gpiod_flags flags) in __gpiod_get_index() argument
2005 status = gpiod_configure_flags(desc, con_id, lookupflags, flags); in __gpiod_get_index()
2041 enum of_gpio_flags flags; in fwnode_get_named_gpiod() local
2044 &flags); in fwnode_get_named_gpiod()
2046 active_low = flags & OF_GPIO_ACTIVE_LOW; in fwnode_get_named_gpiod()
2065 set_bit(FLAG_ACTIVE_LOW, &desc->flags); in fwnode_get_named_gpiod()
2086 enum gpiod_flags flags) in __gpiod_get_index_optional() argument
2090 desc = gpiod_get_index(dev, con_id, index, flags); in __gpiod_get_index_optional()
2133 set_bit(FLAG_IS_HOGGED, &desc->flags); in gpiod_hog()
2155 if (test_bit(FLAG_IS_HOGGED, &chip->desc[id].flags)) in gpiochip_free_hogs()
2174 enum gpiod_flags flags) in gpiod_get_array() argument
2190 desc = gpiod_get_index(dev, con_id, descs->ndescs, flags); in gpiod_get_array()
2214 enum gpiod_flags flags) in gpiod_get_array_optional() argument
2218 descs = gpiod_get_array(dev, con_id, flags); in gpiod_get_array_optional()
2264 if (!test_bit(FLAG_REQUESTED, &gdesc->flags)) in gpiolib_dbg_show()
2268 is_out = test_bit(FLAG_IS_OUT, &gdesc->flags); in gpiolib_dbg_show()
2269 is_irq = test_bit(FLAG_USED_AS_IRQ, &gdesc->flags); in gpiolib_dbg_show()
2283 unsigned long flags; in gpiolib_seq_start() local
2289 spin_lock_irqsave(&gpio_lock, flags); in gpiolib_seq_start()
2292 spin_unlock_irqrestore(&gpio_lock, flags); in gpiolib_seq_start()
2295 spin_unlock_irqrestore(&gpio_lock, flags); in gpiolib_seq_start()
2302 unsigned long flags; in gpiolib_seq_next() local
2306 spin_lock_irqsave(&gpio_lock, flags); in gpiolib_seq_next()
2311 spin_unlock_irqrestore(&gpio_lock, flags); in gpiolib_seq_next()