Lines Matching refs:pin

40 static void ks8695_gpio_mode(unsigned int pin, short gpio)  in ks8695_gpio_mode()  argument
45 if (pin > KS8695_GPIO_5) /* only GPIO 0..5 have internal functions */ in ks8695_gpio_mode()
52 x &= ~enable[pin]; in ks8695_gpio_mode()
54 x |= enable[pin]; in ks8695_gpio_mode()
66 int ks8695_gpio_interrupt(unsigned int pin, unsigned int type) in ks8695_gpio_interrupt() argument
70 if (pin > KS8695_GPIO_3) /* only GPIO 0..3 can generate IRQ */ in ks8695_gpio_interrupt()
77 x &= ~IOPM(pin); in ks8695_gpio_interrupt()
83 irq_set_irq_type(gpio_irq[pin], type); in ks8695_gpio_interrupt()
86 ks8695_gpio_mode(pin, 0); in ks8695_gpio_interrupt()
99 static int ks8695_gpio_direction_input(struct gpio_chip *gc, unsigned int pin) in ks8695_gpio_direction_input() argument
103 if (pin > KS8695_GPIO_15) in ks8695_gpio_direction_input()
107 ks8695_gpio_mode(pin, 1); in ks8695_gpio_direction_input()
113 x &= ~IOPM(pin); in ks8695_gpio_direction_input()
126 unsigned int pin, int state) in ks8695_gpio_direction_output() argument
130 if (pin > KS8695_GPIO_15) in ks8695_gpio_direction_output()
134 ks8695_gpio_mode(pin, 1); in ks8695_gpio_direction_output()
141 x |= IOPD(pin); in ks8695_gpio_direction_output()
143 x &= ~IOPD(pin); in ks8695_gpio_direction_output()
148 x |= IOPM(pin); in ks8695_gpio_direction_output()
161 unsigned int pin, int state) in ks8695_gpio_set_value() argument
165 if (pin > KS8695_GPIO_15) in ks8695_gpio_set_value()
173 x |= IOPD(pin); in ks8695_gpio_set_value()
175 x &= ~IOPD(pin); in ks8695_gpio_set_value()
185 static int ks8695_gpio_get_value(struct gpio_chip *gc, unsigned int pin) in ks8695_gpio_get_value() argument
189 if (pin > KS8695_GPIO_15) in ks8695_gpio_get_value()
193 return (x & IOPD(pin)) != 0; in ks8695_gpio_get_value()
200 static int ks8695_gpio_to_irq(struct gpio_chip *gc, unsigned int pin) in ks8695_gpio_to_irq() argument
202 if (pin > KS8695_GPIO_3) /* only GPIO 0..3 can generate IRQ */ in ks8695_gpio_to_irq()
205 return gpio_irq[pin]; in ks8695_gpio_to_irq()