1221807Sstas/*
2221807Sstas * This header provides constants for hisilicon pinctrl bindings.
3221807Sstas *
4221807Sstas * Copyright (c) 2015 Hisilicon Limited.
5221807Sstas * Copyright (c) 2015 Linaro Limited.
6221807Sstas *
7221807Sstas * This program is free software; you can redistribute it and/or modify
8221807Sstas * it under the terms of the GNU General Public License version 2 as
9249666Strociny * published by the Free Software Foundation.
10221807Sstas *
11221807Sstas * This program is distributed "as is" WITHOUT ANY WARRANTY of any
12221807Sstas * kind, whether express or implied; without even the implied warranty
13221807Sstas * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14221931Sstas * GNU General Public License for more details.
15221931Sstas */
16221931Sstas
17223953Spluknet#ifndef _DT_BINDINGS_PINCTRL_HISI_H
18221807Sstas#define _DT_BINDINGS_PINCTRL_HISI_H
19221807Sstas
20223953Spluknet/* iomg bit definition */
21249666Strociny#define MUX_M0		0
22249666Strociny#define MUX_M1		1
23221807Sstas#define MUX_M2		2
24223953Spluknet#define MUX_M3		3
25223953Spluknet#define MUX_M4		4
26221807Sstas#define MUX_M5		5
27221807Sstas#define MUX_M6		6
28221824Sstas#define MUX_M7		7
29221807Sstas
30221807Sstas/* iocg bit definition */
31221807Sstas#define PULL_MASK	(3)
32221807Sstas#define PULL_DIS	(0)
33221807Sstas#define PULL_UP		(1 << 0)
34221807Sstas#define PULL_DOWN	(1 << 1)
35221807Sstas
36221807Sstas/* drive strength definition */
37221807Sstas#define DRIVE_MASK	(7 << 4)
38221807Sstas#define DRIVE1_02MA	(0 << 4)
39221807Sstas#define DRIVE1_04MA	(1 << 4)
40221807Sstas#define DRIVE1_08MA	(2 << 4)
41221807Sstas#define DRIVE1_10MA	(3 << 4)
42#define DRIVE2_02MA	(0 << 4)
43#define DRIVE2_04MA	(1 << 4)
44#define DRIVE2_08MA	(2 << 4)
45#define DRIVE2_10MA	(3 << 4)
46#define DRIVE3_04MA	(0 << 4)
47#define DRIVE3_08MA	(1 << 4)
48#define DRIVE3_12MA	(2 << 4)
49#define DRIVE3_16MA	(3 << 4)
50#define DRIVE3_20MA	(4 << 4)
51#define DRIVE3_24MA	(5 << 4)
52#define DRIVE3_32MA	(6 << 4)
53#define DRIVE3_40MA	(7 << 4)
54#define DRIVE4_02MA	(0 << 4)
55#define DRIVE4_04MA	(2 << 4)
56#define DRIVE4_08MA	(4 << 4)
57#define DRIVE4_10MA	(6 << 4)
58
59/* drive strength definition for hi3660 */
60#define DRIVE6_MASK	(15 << 4)
61#define DRIVE6_04MA	(0 << 4)
62#define DRIVE6_12MA	(4 << 4)
63#define DRIVE6_19MA	(8 << 4)
64#define DRIVE6_27MA	(10 << 4)
65#define DRIVE6_32MA	(15 << 4)
66#define DRIVE7_02MA	(0 << 4)
67#define DRIVE7_04MA	(1 << 4)
68#define DRIVE7_06MA	(2 << 4)
69#define DRIVE7_08MA	(3 << 4)
70#define DRIVE7_10MA	(4 << 4)
71#define DRIVE7_12MA	(5 << 4)
72#define DRIVE7_14MA	(6 << 4)
73#define DRIVE7_16MA	(7 << 4)
74#endif
75