Lines Matching defs:pin
40 static void ks8695_gpio_mode(unsigned int pin, short gpio)
45 if (pin > KS8695_GPIO_5) /* only GPIO 0..5 have internal functions */
52 x &= ~enable[pin];
54 x |= enable[pin];
64 * Configure GPIO pin as external interrupt source.
66 int ks8695_gpio_interrupt(unsigned int pin, unsigned int type)
70 if (pin > KS8695_GPIO_3) /* only GPIO 0..3 can generate IRQ */
75 /* set pin as input */
77 x &= ~IOPM(pin);
83 irq_set_irq_type(gpio_irq[pin], type);
86 ks8695_gpio_mode(pin, 0);
99 static int ks8695_gpio_direction_input(struct gpio_chip *gc, unsigned int pin)
103 if (pin > KS8695_GPIO_15)
106 /* set pin to GPIO mode */
107 ks8695_gpio_mode(pin, 1);
111 /* set pin as input */
113 x &= ~IOPM(pin);
126 unsigned int pin, int state)
130 if (pin > KS8695_GPIO_15)
133 /* set pin to GPIO mode */
134 ks8695_gpio_mode(pin, 1);
141 x |= IOPD(pin);
143 x &= ~IOPD(pin);
146 /* set pin as output */
148 x |= IOPM(pin);
161 unsigned int pin, int state)
165 if (pin > KS8695_GPIO_15)
173 x |= IOPD(pin);
175 x &= ~IOPD(pin);
185 static int ks8695_gpio_get_value(struct gpio_chip *gc, unsigned int pin)
189 if (pin > KS8695_GPIO_15)
193 return (x & IOPD(pin)) != 0;
200 static int ks8695_gpio_to_irq(struct gpio_chip *gc, unsigned int pin)
202 if (pin > KS8695_GPIO_3) /* only GPIO 0..3 can generate IRQ */
205 return gpio_irq[pin];