Lines Matching refs:flags
49 if (!test_bit(FLAG_EXPORT, &desc->flags)) { in gpio_direction_show()
54 test_bit(FLAG_IS_OUT, &desc->flags) in gpio_direction_show()
70 if (!test_bit(FLAG_EXPORT, &desc->flags)) in gpio_direction_store()
96 if (!test_bit(FLAG_EXPORT, &desc->flags)) in gpio_value_show()
113 if (!test_bit(FLAG_EXPORT, &desc->flags)) in gpio_value_store()
115 else if (!test_bit(FLAG_IS_OUT, &desc->flags)) in gpio_value_store()
149 if ((desc->flags & GPIO_TRIGGER_MASK) == gpio_flags) in gpio_setup_irq()
156 id = desc->flags >> ID_SHIFT; in gpio_setup_irq()
161 desc->flags &= ~GPIO_TRIGGER_MASK; in gpio_setup_irq()
171 irq_flags |= test_bit(FLAG_ACTIVE_LOW, &desc->flags) ? in gpio_setup_irq()
174 irq_flags |= test_bit(FLAG_ACTIVE_LOW, &desc->flags) ? in gpio_setup_irq()
189 desc->flags &= GPIO_FLAGS_MASK; in gpio_setup_irq()
190 desc->flags |= (unsigned long)id << ID_SHIFT; in gpio_setup_irq()
192 if (desc->flags >> ID_SHIFT != id) { in gpio_setup_irq()
209 desc->flags |= gpio_flags; in gpio_setup_irq()
214 desc->flags &= GPIO_FLAGS_MASK; in gpio_setup_irq()
224 unsigned long flags; member
240 if (!test_bit(FLAG_EXPORT, &desc->flags)) in gpio_edge_show()
247 if ((desc->flags & GPIO_TRIGGER_MASK) in gpio_edge_show()
248 == trigger_types[i].flags) { in gpio_edge_show()
274 if (!test_bit(FLAG_EXPORT, &desc->flags)) in gpio_edge_store()
277 status = gpio_setup_irq(desc, dev, trigger_types[i].flags); in gpio_edge_store()
294 if (!!test_bit(FLAG_ACTIVE_LOW, &desc->flags) == !!value) in sysfs_set_active_low()
298 set_bit(FLAG_ACTIVE_LOW, &desc->flags); in sysfs_set_active_low()
300 clear_bit(FLAG_ACTIVE_LOW, &desc->flags); in sysfs_set_active_low()
303 if (dev != NULL && (!!test_bit(FLAG_TRIG_RISE, &desc->flags) ^ in sysfs_set_active_low()
304 !!test_bit(FLAG_TRIG_FALL, &desc->flags))) { in sysfs_set_active_low()
305 unsigned long trigger_flags = desc->flags & GPIO_TRIGGER_MASK; in sysfs_set_active_low()
322 if (!test_bit(FLAG_EXPORT, &desc->flags)) in gpio_active_low_show()
326 !!test_bit(FLAG_ACTIVE_LOW, &desc->flags)); in gpio_active_low_show()
341 if (!test_bit(FLAG_EXPORT, &desc->flags)) { in gpio_active_low_store()
365 bool show_direction = test_bit(FLAG_SYSFS_DIR, &desc->flags); in gpio_is_visible()
373 if (!show_direction && test_bit(FLAG_IS_OUT, &desc->flags)) in gpio_is_visible()
480 set_bit(FLAG_SYSFS, &desc->flags); in export_store()
513 if (test_and_clear_bit(FLAG_SYSFS, &desc->flags)) { in unexport_store()
555 unsigned long flags; in gpiod_export() local
582 spin_lock_irqsave(&gpio_lock, flags); in gpiod_export()
583 if (!test_bit(FLAG_REQUESTED, &desc->flags) || in gpiod_export()
584 test_bit(FLAG_EXPORT, &desc->flags)) { in gpiod_export()
585 spin_unlock_irqrestore(&gpio_lock, flags); in gpiod_export()
588 test_bit(FLAG_REQUESTED, &desc->flags), in gpiod_export()
589 test_bit(FLAG_EXPORT, &desc->flags)); in gpiod_export()
596 set_bit(FLAG_SYSFS_DIR, &desc->flags); in gpiod_export()
599 spin_unlock_irqrestore(&gpio_lock, flags); in gpiod_export()
614 set_bit(FLAG_EXPORT, &desc->flags); in gpiod_export()
653 if (test_bit(FLAG_EXPORT, &desc->flags)) { in gpiod_export_link()
699 if (test_bit(FLAG_EXPORT, &desc->flags)) { in gpiod_sysfs_set_active_low()
737 if (test_bit(FLAG_EXPORT, &desc->flags)) { in gpiod_unexport()
742 clear_bit(FLAG_SYSFS_DIR, &desc->flags); in gpiod_unexport()
743 clear_bit(FLAG_EXPORT, &desc->flags); in gpiod_unexport()
816 if (test_and_clear_bit(FLAG_SYSFS, &desc->flags)) in gpiochip_unexport()
824 unsigned long flags; in gpiolib_sysfs_init() local
837 spin_lock_irqsave(&gpio_lock, flags); in gpiolib_sysfs_init()
850 spin_unlock_irqrestore(&gpio_lock, flags); in gpiolib_sysfs_init()
852 spin_lock_irqsave(&gpio_lock, flags); in gpiolib_sysfs_init()
854 spin_unlock_irqrestore(&gpio_lock, flags); in gpiolib_sysfs_init()