void kw_gpio_set_blink(unsigned pin, int blink) { /* Set output value to zero. */ __set_level(pin, 0); /* Set blinking. */ __set_blinking(pin, blink); }
void orion_gpio_set_blink(unsigned pin, int blink) { unsigned long flags; spin_lock_irqsave(&gpio_lock, flags); /* Set output value to zero. */ __set_level(pin, 0); /* Set blinking. */ __set_blinking(pin, blink); spin_unlock_irqrestore(&gpio_lock, flags); }
int kw_gpio_direction_output(unsigned pin, int value) { if (kw_gpio_is_valid(pin, GPIO_OUTPUT_OK) != 0) { printf("%s: invalid GPIO %d\n", __func__, pin); return 1; } __set_blinking(pin, 0); /* Configure GPIO output value. */ __set_level(pin, value); /* Configure GPIO direction. */ __set_direction(pin, 0); return 0; }
static int orion_gpio_direction_output(struct gpio_chip *chip, unsigned pin, int value) { unsigned long flags; if (!orion_gpio_is_valid(pin, GPIO_OUTPUT_OK)) return -EINVAL; spin_lock_irqsave(&gpio_lock, flags); /* Disable blinking. */ __set_blinking(pin, 0); /* Configure GPIO output value. */ __set_level(pin, value); /* Configure GPIO direction. */ __set_direction(pin, 0); spin_unlock_irqrestore(&gpio_lock, flags); return 0; }