Lines Matching +full:edge +full:- +full:offset
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.
85 * (most likely a read-modify-write operation) is atomic, and that
93 unsigned long config; /* -1 for not configured */
94 unsigned long mfpr_off; /* MFPRxx Register offset */
95 unsigned long mfpr_run; /* Run-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
180 edge = MFP_LPM_EDGE(c); in mfp_config()
183 /* run-mode pull settings will conflict with MFPR bits of 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()
243 unsigned long offset, flags; in mfp_init_addr() local
248 /* mfp offset for readback */ in mfp_init_addr()
249 mfpr_off_readback = map[0].offset; in mfp_init_addr()
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()
256 mfp_table[i].mfpr_off = offset; in mfp_init_addr()
259 offset += 4; i++; in mfp_init_addr()
260 } while ((i <= p->end) && (p->end != -1)); in mfp_init_addr()