Lines Matching +full:- +full:multi +full:- +full:pin +full:- +full:mode
1 // SPDX-License-Identifier: GPL-2.0-only
3 * linux/arch/arm/plat-pxa/mfp.c
5 * Multi-Function Pin Support
9 * 2007-08-21: eric miao <eric.miao@marvell.com>
43 * used in parentheses for don't-care values. Except for the float output,
45 * non-LPM pulled output, the same configuration could probably be used.
66 * The pullup and pulldown state of the MFP pin at run mode is by default
85 * (most likely a read-modify-write operation) is atomic, and that
93 unsigned long config; /* -1 for not configured */
95 unsigned long mfpr_run; /* Run-Mode Register Value */
96 unsigned long mfpr_lpm; /* Low Power Mode Register Value */
135 #define mfp_configured(p) ((p)->config != -1)
138 * perform a read-back of any valid MFPR register to make sure the
147 mfpr_writel(p->mfpr_off, p->mfpr_run); in __mfp_config_run()
153 unsigned long mfpr_clr = (p->mfpr_run & ~MFPR_EDGE_BOTH) | MFPR_EDGE_CLEAR; in __mfp_config_lpm()
154 if (mfpr_clr != p->mfpr_run) in __mfp_config_lpm()
155 mfpr_writel(p->mfpr_off, mfpr_clr); in __mfp_config_lpm()
156 if (p->mfpr_lpm != mfpr_clr) in __mfp_config_lpm()
157 mfpr_writel(p->mfpr_off, p->mfpr_lpm); in __mfp_config_lpm()
171 int pin, af, drv, lpm, edge, pull; in mfp_config() local
173 pin = MFP_PIN(c); in mfp_config()
174 BUG_ON(pin >= MFP_PIN_MAX); in mfp_config()
175 p = &mfp_table[pin]; in mfp_config()
183 /* run-mode pull settings will conflict with MFPR bits of in mfp_config()
184 * low power mode state, calculate mfpr_run and mfpr_lpm in mfp_config()
190 p->mfpr_run = tmp | mfpr_lpm[lpm] | mfpr_edge[edge]; in mfp_config()
191 p->mfpr_lpm = p->mfpr_run; in mfp_config()
193 p->mfpr_lpm = tmp | mfpr_lpm[lpm] | mfpr_edge[edge]; in mfp_config()
194 p->mfpr_run = tmp | mfpr_pull[pull]; in mfp_config()
197 p->config = c; __mfp_config_run(p); in mfp_config()
233 /* initialize the table with default - unconfigured */ in mfp_init_base()
235 mfp_table[i].config = -1; in mfp_init_base()
251 for (p = map; p->start != MFP_PIN_INVALID; p++) { in mfp_init_addr()
252 offset = p->offset; in mfp_init_addr()
253 i = p->start; in mfp_init_addr()
260 } while ((i <= p->end) && (p->end != -1)); in mfp_init_addr()
269 int pin; in mfp_config_lpm() local
271 for (pin = 0; pin < ARRAY_SIZE(mfp_table); pin++, p++) in mfp_config_lpm()
278 int pin; in mfp_config_run() local
280 for (pin = 0; pin < ARRAY_SIZE(mfp_table); pin++, p++) in mfp_config_run()