xref: /netbsd-src/sys/external/gpl2/dts/dist/include/dt-bindings/pinctrl/hisi.h (revision 58c3e048f5c2f43ee7e820013e37079f2e0b6ae5)
1 /*	$NetBSD: hisi.h,v 1.1.1.3 2021/11/07 16:49:56 jmcneill Exp $	*/
2 
3 /*
4  * This header provides constants for hisilicon pinctrl bindings.
5  *
6  * Copyright (c) 2015 HiSilicon Limited.
7  * Copyright (c) 2015 Linaro Limited.
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License version 2 as
11  * published by the Free Software Foundation.
12  *
13  * This program is distributed "as is" WITHOUT ANY WARRANTY of any
14  * kind, whether express or implied; without even the implied warranty
15  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  */
18 
19 #ifndef _DT_BINDINGS_PINCTRL_HISI_H
20 #define _DT_BINDINGS_PINCTRL_HISI_H
21 
22 /* iomg bit definition */
23 #define MUX_M0		0
24 #define MUX_M1		1
25 #define MUX_M2		2
26 #define MUX_M3		3
27 #define MUX_M4		4
28 #define MUX_M5		5
29 #define MUX_M6		6
30 #define MUX_M7		7
31 
32 /* iocg bit definition */
33 #define PULL_MASK	(3)
34 #define PULL_DIS	(0)
35 #define PULL_UP		(1 << 0)
36 #define PULL_DOWN	(1 << 1)
37 
38 /* drive strength definition */
39 #define DRIVE_MASK	(7 << 4)
40 #define DRIVE1_02MA	(0 << 4)
41 #define DRIVE1_04MA	(1 << 4)
42 #define DRIVE1_08MA	(2 << 4)
43 #define DRIVE1_10MA	(3 << 4)
44 #define DRIVE2_02MA	(0 << 4)
45 #define DRIVE2_04MA	(1 << 4)
46 #define DRIVE2_08MA	(2 << 4)
47 #define DRIVE2_10MA	(3 << 4)
48 #define DRIVE3_04MA	(0 << 4)
49 #define DRIVE3_08MA	(1 << 4)
50 #define DRIVE3_12MA	(2 << 4)
51 #define DRIVE3_16MA	(3 << 4)
52 #define DRIVE3_20MA	(4 << 4)
53 #define DRIVE3_24MA	(5 << 4)
54 #define DRIVE3_32MA	(6 << 4)
55 #define DRIVE3_40MA	(7 << 4)
56 #define DRIVE4_02MA	(0 << 4)
57 #define DRIVE4_04MA	(2 << 4)
58 #define DRIVE4_08MA	(4 << 4)
59 #define DRIVE4_10MA	(6 << 4)
60 
61 /* drive strength definition for hi3660 */
62 #define DRIVE6_MASK	(15 << 4)
63 #define DRIVE6_04MA	(0 << 4)
64 #define DRIVE6_12MA	(4 << 4)
65 #define DRIVE6_19MA	(8 << 4)
66 #define DRIVE6_27MA	(10 << 4)
67 #define DRIVE6_32MA	(15 << 4)
68 #define DRIVE7_02MA	(0 << 4)
69 #define DRIVE7_04MA	(1 << 4)
70 #define DRIVE7_06MA	(2 << 4)
71 #define DRIVE7_08MA	(3 << 4)
72 #define DRIVE7_10MA	(4 << 4)
73 #define DRIVE7_12MA	(5 << 4)
74 #define DRIVE7_14MA	(6 << 4)
75 #define DRIVE7_16MA	(7 << 4)
76 #endif
77