xref: /openbmc/linux/include/dt-bindings/pinctrl/at91.h (revision c95baf12f5077419db01313ab61c2aac007d40cd)
10c94efabSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */
20e4686e6SJean-Christophe PLAGNIOL-VILLARD /*
30e4686e6SJean-Christophe PLAGNIOL-VILLARD  * This header provides constants for most at91 pinctrl bindings.
40e4686e6SJean-Christophe PLAGNIOL-VILLARD  *
50e4686e6SJean-Christophe PLAGNIOL-VILLARD  * Copyright (C) 2013 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
60e4686e6SJean-Christophe PLAGNIOL-VILLARD  */
70e4686e6SJean-Christophe PLAGNIOL-VILLARD 
80e4686e6SJean-Christophe PLAGNIOL-VILLARD #ifndef __DT_BINDINGS_AT91_PINCTRL_H__
90e4686e6SJean-Christophe PLAGNIOL-VILLARD #define __DT_BINDINGS_AT91_PINCTRL_H__
100e4686e6SJean-Christophe PLAGNIOL-VILLARD 
110e4686e6SJean-Christophe PLAGNIOL-VILLARD #define AT91_PINCTRL_NONE		(0 << 0)
120e4686e6SJean-Christophe PLAGNIOL-VILLARD #define AT91_PINCTRL_PULL_UP		(1 << 0)
130e4686e6SJean-Christophe PLAGNIOL-VILLARD #define AT91_PINCTRL_MULTI_DRIVE	(1 << 1)
140e4686e6SJean-Christophe PLAGNIOL-VILLARD #define AT91_PINCTRL_DEGLITCH		(1 << 2)
150e4686e6SJean-Christophe PLAGNIOL-VILLARD #define AT91_PINCTRL_PULL_DOWN		(1 << 3)
160e4686e6SJean-Christophe PLAGNIOL-VILLARD #define AT91_PINCTRL_DIS_SCHMIT		(1 << 4)
1796bb12deSBoris BREZILLON #define AT91_PINCTRL_OUTPUT		(1 << 7)
1896bb12deSBoris BREZILLON #define AT91_PINCTRL_OUTPUT_VAL(x)	((x & 0x1) << 8)
1964e21addSClaudiu Beznea #define AT91_PINCTRL_SLEWRATE		(1 << 9)
200e4686e6SJean-Christophe PLAGNIOL-VILLARD #define AT91_PINCTRL_DEBOUNCE		(1 << 16)
2177966ad7SBoris BREZILLON #define AT91_PINCTRL_DEBOUNCE_VAL(x)	(x << 17)
220e4686e6SJean-Christophe PLAGNIOL-VILLARD 
230e4686e6SJean-Christophe PLAGNIOL-VILLARD #define AT91_PINCTRL_PULL_UP_DEGLITCH	(AT91_PINCTRL_PULL_UP | AT91_PINCTRL_DEGLITCH)
240e4686e6SJean-Christophe PLAGNIOL-VILLARD 
254334ac2dSMarek Roszko #define AT91_PINCTRL_DRIVE_STRENGTH_DEFAULT		(0x0 << 5)
264334ac2dSMarek Roszko #define AT91_PINCTRL_DRIVE_STRENGTH_LOW			(0x1 << 5)
274334ac2dSMarek Roszko #define AT91_PINCTRL_DRIVE_STRENGTH_MED			(0x2 << 5)
284334ac2dSMarek Roszko #define AT91_PINCTRL_DRIVE_STRENGTH_HI			(0x3 << 5)
294334ac2dSMarek Roszko 
30*0b329285SCodrin Ciubotariu #define AT91_PINCTRL_SLEWRATE_ENA	(0x0 << 9)
31*0b329285SCodrin Ciubotariu #define AT91_PINCTRL_SLEWRATE_DIS	(0x1 << 9)
3264e21addSClaudiu Beznea 
330e4686e6SJean-Christophe PLAGNIOL-VILLARD #define AT91_PIOA	0
340e4686e6SJean-Christophe PLAGNIOL-VILLARD #define AT91_PIOB	1
350e4686e6SJean-Christophe PLAGNIOL-VILLARD #define AT91_PIOC	2
360e4686e6SJean-Christophe PLAGNIOL-VILLARD #define AT91_PIOD	3
370e4686e6SJean-Christophe PLAGNIOL-VILLARD #define AT91_PIOE	4
380e4686e6SJean-Christophe PLAGNIOL-VILLARD 
390e4686e6SJean-Christophe PLAGNIOL-VILLARD #define AT91_PERIPH_GPIO	0
400e4686e6SJean-Christophe PLAGNIOL-VILLARD #define AT91_PERIPH_A		1
410e4686e6SJean-Christophe PLAGNIOL-VILLARD #define AT91_PERIPH_B		2
420e4686e6SJean-Christophe PLAGNIOL-VILLARD #define AT91_PERIPH_C		3
430e4686e6SJean-Christophe PLAGNIOL-VILLARD #define AT91_PERIPH_D		4
440e4686e6SJean-Christophe PLAGNIOL-VILLARD 
45ff10e353SLudovic Desroches #define ATMEL_PIO_DRVSTR_LO	1
46ff10e353SLudovic Desroches #define ATMEL_PIO_DRVSTR_ME	2
47ff10e353SLudovic Desroches #define ATMEL_PIO_DRVSTR_HI	3
48ff10e353SLudovic Desroches 
490e4686e6SJean-Christophe PLAGNIOL-VILLARD #endif /* __DT_BINDINGS_AT91_PINCTRL_H__ */
50