Lines Matching defs:value

2394 static int gpiod_direction_output_raw_commit(struct gpio_desc *desc, int value)
2397 int val = !!value;
2440 * @value: initial output value of the GPIO
2443 * be called safely on it. The initial value of the output must be specified
2444 * as raw value on the physical line without regard for the ACTIVE_LOW status.
2448 int gpiod_direction_output_raw(struct gpio_desc *desc, int value)
2451 return gpiod_direction_output_raw_commit(desc, value);
2458 * @value: initial output value of the GPIO
2461 * be called safely on it. The initial value of the output must be specified
2462 * as the logical value of the GPIO, i.e. taking its ACTIVE_LOW status into
2467 int gpiod_direction_output(struct gpio_desc *desc, int value)
2473 value = !value;
2475 value = !!value;
2492 if (value) {
2501 if (!value) {
2513 return gpiod_direction_output_raw_commit(desc, value);
2520 * value anymore.
2634 * "Get" operations are often inlinable as reading a pin value register,
2638 * one register to set a low value, or a different register to set it high.
2639 * Otherwise locking is needed, so there may be little value to inlining.
2643 * IMPORTANT!!! The hot paths -- get/set value -- assume that callers
2657 int value;
2661 value = gc->get ? gc->get(gc, offset) : -EIO;
2662 value = value < 0 ? value : !!value;
2663 trace_gpio_value(desc_to_gpio(desc), 1, value);
2664 return value;
2673 int i, value;
2676 value = gc->get(gc, i);
2677 if (value < 0)
2678 return value;
2679 __assign_bit(i, bits, value);
2769 int value = test_bit(hwgpio, bits);
2772 value = !value;
2773 __assign_bit(j, value_bitmap, value);
2774 trace_gpio_value(desc_to_gpio(desc), 1, value);
2789 * gpiod_get_raw_value() - return a gpio's raw value
2790 * @desc: gpio whose value will be returned
2792 * Return the GPIO's raw value, i.e. the value of the physical line disregarding
2808 * gpiod_get_value() - return a gpio's value
2809 * @desc: gpio whose value will be returned
2811 * Return the GPIO's logical value, i.e. taking the ACTIVE_LOW status into
2819 int value;
2825 value = gpiod_get_raw_value_commit(desc);
2826 if (value < 0)
2827 return value;
2830 value = !value;
2832 return value;
2838 * @array_size: number of elements in the descriptor array / value bitmap
2865 * @array_size: number of elements in the descriptor array / value bitmap
2890 * gpio_set_open_drain_value_commit() - Set the open drain gpio's value.
2892 * @value: Non-zero for setting it HIGH otherwise it will set to LOW.
2894 static void gpio_set_open_drain_value_commit(struct gpio_desc *desc, bool value)
2900 if (value) {
2907 trace_gpio_direction(desc_to_gpio(desc), value, ret);
2915 * _gpio_set_open_source_value() - Set the open source gpio's value.
2917 * @value: Non-zero for setting it HIGH otherwise it will set to LOW.
2919 static void gpio_set_open_source_value_commit(struct gpio_desc *desc, bool value)
2925 if (value) {
2932 trace_gpio_direction(desc_to_gpio(desc), !value, ret);
2939 static void gpiod_set_raw_value_commit(struct gpio_desc *desc, bool value)
2944 trace_gpio_value(desc_to_gpio(desc), 0, value);
2945 gc->set(gc, gpio_chip_hwgpio(desc), value);
2955 * @bits: bit value array; one bit per output; BITS_PER_LONG bits per word
3030 int value = test_bit(i, value_bitmap);
3040 value = !value;
3041 trace_gpio_value(desc_to_gpio(desc), 0, value);
3047 gpio_set_open_drain_value_commit(desc, value);
3049 gpio_set_open_source_value_commit(desc, value);
3052 __assign_bit(hwgpio, bits, value);
3073 * gpiod_set_raw_value() - assign a gpio's raw value
3074 * @desc: gpio whose value will be assigned
3075 * @value: value to assign
3077 * Set the raw value of the GPIO, i.e. the value of its physical line without
3083 void gpiod_set_raw_value(struct gpio_desc *desc, int value)
3088 gpiod_set_raw_value_commit(desc, value);
3093 * gpiod_set_value_nocheck() - set a GPIO line value without checking
3094 * @desc: the descriptor to set the value on
3095 * @value: value to set
3097 * This sets the value of a GPIO line backing a descriptor, applying
3101 static void gpiod_set_value_nocheck(struct gpio_desc *desc, int value)
3104 value = !value;
3106 gpio_set_open_drain_value_commit(desc, value);
3108 gpio_set_open_source_value_commit(desc, value);
3110 gpiod_set_raw_value_commit(desc, value);
3114 * gpiod_set_value() - assign a gpio's value
3115 * @desc: gpio whose value will be assigned
3116 * @value: value to assign
3118 * Set the logical value of the GPIO, i.e. taking its ACTIVE_LOW,
3124 void gpiod_set_value(struct gpio_desc *desc, int value)
3129 gpiod_set_value_nocheck(desc, value);
3135 * @array_size: number of elements in the descriptor array / value bitmap
3160 * @array_size: number of elements in the descriptor array / value bitmap
3185 * gpiod_cansleep() - report whether gpio value access may sleep
3429 * gpiod_get_raw_value_cansleep() - return a gpio's raw value
3430 * @desc: gpio whose value will be returned
3432 * Return the GPIO's raw value, i.e. the value of the physical line disregarding
3446 * gpiod_get_value_cansleep() - return a gpio's value
3447 * @desc: gpio whose value will be returned
3449 * Return the GPIO's logical value, i.e. taking the ACTIVE_LOW status into
3456 int value;
3460 value = gpiod_get_raw_value_commit(desc);
3461 if (value < 0)
3462 return value;
3465 value = !value;
3467 return value;
3473 * @array_size: number of elements in the descriptor array / value bitmap
3500 * @array_size: number of elements in the descriptor array / value bitmap
3525 * gpiod_set_raw_value_cansleep() - assign a gpio's raw value
3526 * @desc: gpio whose value will be assigned
3527 * @value: value to assign
3529 * Set the raw value of the GPIO, i.e. the value of its physical line without
3534 void gpiod_set_raw_value_cansleep(struct gpio_desc *desc, int value)
3538 gpiod_set_raw_value_commit(desc, value);
3543 * gpiod_set_value_cansleep() - assign a gpio's value
3544 * @desc: gpio whose value will be assigned
3545 * @value: value to assign
3547 * Set the logical value of the GPIO, i.e. taking its ACTIVE_LOW status into
3552 void gpiod_set_value_cansleep(struct gpio_desc *desc, int value)
3556 gpiod_set_value_nocheck(desc, value);
3562 * @array_size: number of elements in the descriptor array / value bitmap
3604 * @array_size: number of elements in the descriptor array / value bitmap
3909 * @desc: gpio whose value will be assigned
4163 * @desc: gpio whose value will be assigned