Lines Matching +full:lpm +full:- +full:gpios
1 // SPDX-License-Identifier: GPL-2.0-only
3 * linux/arch/arm/mach-pxa/mfp-pxa2xx.c
7 * The GPIOs on PXA2xx can be configured as one of many alternate
13 #include <linux/gpio-pxa.h>
21 #include "pxa2xx-regs.h"
22 #include "mfp-pxa2xx.h"
23 #include "mfp-pxa27x.h"
32 #define BANK_OFF(n) (((n) < 3) ? (n) << 2 : 0x100 + (((n) - 3) << 2))
64 return -EINVAL; in __mfp_config_gpio()
66 /* alternate function and direction at run-time */ in __mfp_config_gpio()
110 return -EINVAL; in __mfp_config_gpio()
115 return -EINVAL; in __mfp_config_gpio()
127 return -1; in __mfp_validate()
154 void pxa2xx_mfp_set_lpm(int mfp, unsigned long lpm) in pxa2xx_mfp_set_lpm() argument
166 c = (c & ~MFP_LPM_STATE_MASK) | lpm; in pxa2xx_mfp_set_lpm()
178 return -EINVAL; in gpio_set_wake()
181 c = d->config; in gpio_set_wake()
183 if (!d->valid) in gpio_set_wake()
184 return -EINVAL; in gpio_set_wake()
186 /* Allow keypad GPIOs to wakeup system when in gpio_set_wake()
187 * configured as generic GPIOs. in gpio_set_wake()
189 if (d->keypad_gpio && (MFP_AF(d->config) == 0) && in gpio_set_wake()
190 (d->config & MFP_LPM_CAN_WAKEUP)) { in gpio_set_wake()
192 PKWR |= d->mask; in gpio_set_wake()
194 PKWR &= ~d->mask; in gpio_set_wake()
198 mux_taken = (PWER & d->mux_mask) & (~d->mask); in gpio_set_wake()
200 return -EBUSY; in gpio_set_wake()
202 if (d->can_wakeup && (c & MFP_LPM_CAN_WAKEUP)) { in gpio_set_wake()
204 PWER = (PWER & ~d->mux_mask) | d->mask; in gpio_set_wake()
207 PRER |= d->mask; in gpio_set_wake()
209 PRER &= ~d->mask; in gpio_set_wake()
212 PFER |= d->mask; in gpio_set_wake()
214 PFER &= ~d->mask; in gpio_set_wake()
216 PWER &= ~d->mask; in gpio_set_wake()
217 PRER &= ~d->mask; in gpio_set_wake()
218 PFER &= ~d->mask; in gpio_set_wake()
239 /* PXA26x has additional 4 GPIOs (86/87/88/89) which has the in pxa25x_mfp_init()
266 if (MFP_AF(d->config) == 0) in keypad_set_wake()
269 if (d->config & MFP_LPM_CAN_WAKEUP) in keypad_set_wake()
311 /* Keypad GPIOs */ in pxa27x_mfp_init()