Lines Matching refs:gpio

12 #include <linux/gpio.h>
13 #include <linux/gpio-pxa.h>
46 unsigned int mux_mask; /* bit mask of muxed gpio bits, 0 if no mux */
54 static int __mfp_config_gpio(unsigned gpio, unsigned long c)
56 unsigned long gafr, mask = GPIO_bit(gpio);
57 int bank = gpio_to_bank(gpio);
58 int uorl = !!(gpio & 0x10); /* GAFRx_U or GAFRx_L ? */
59 int shft = (gpio & 0xf) << 1;
75 if (is_out ^ gpio_desc[gpio].dir_inverted)
76 GPDR(gpio) |= mask;
78 GPDR(gpio) &= ~mask;
96 __func__, gpio);
100 if (is_out ^ gpio_desc[gpio].dir_inverted)
108 if ((c & MFP_LPM_CAN_WAKEUP) && !gpio_desc[gpio].can_wakeup) {
109 pr_warn("%s: GPIO%d unable to wakeup\n", __func__, gpio);
114 pr_warn("%s: output GPIO%d unable to wakeup\n", __func__, gpio);
123 int gpio = mfp_to_gpio(mfp);
125 if ((mfp > MFP_PIN_GPIO127) || !gpio_desc[gpio].valid) {
126 pr_warn("%s: GPIO%d is invalid pin\n", __func__, gpio);
130 return gpio;
137 int i, gpio;
141 gpio = __mfp_validate(MFP_PIN(*c));
142 if (gpio < 0)
147 gpio_desc[gpio].config = *c;
148 __mfp_config_gpio(gpio, *c);
157 int gpio;
159 gpio = __mfp_validate(mfp);
160 if (gpio < 0)
165 c = gpio_desc[gpio].config;
167 __mfp_config_gpio(gpio, c);
172 int gpio_set_wake(unsigned int gpio, unsigned int on)
177 if (gpio > mfp_to_gpio(MFP_PIN_GPIO127))
180 d = &gpio_desc[gpio];
257 unsigned int i, gpio, mask = 0;
262 gpio = pxa27x_pkwr_gpio[i];
263 d = &gpio_desc[gpio];
270 mask |= gpio_desc[gpio].mask;
289 #define INIT_GPIO_DESC_MUXED(mux, gpio) \
291 gpio_desc[(gpio)].can_wakeup = 1; \
292 gpio_desc[(gpio)].mask = PWER_ ## mux ## _GPIO ##gpio; \
293 gpio_desc[(gpio)].mux_mask = PWER_ ## mux ## _MASK; \
298 int i, gpio;
313 gpio = pxa27x_pkwr_gpio[i];
314 gpio_desc[gpio].can_wakeup = 1;
315 gpio_desc[gpio].keypad_gpio = 1;
316 gpio_desc[gpio].mask = 1 << i;