2 * Header providing constants for Rockchip pinctrl bindings.
4 * Copyright (c) 2013 MundoReader S.L.
5 * Author: Heiko Stuebner <heiko@sntech.de>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
18 #ifndef __DT_BINDINGS_ROCKCHIP_PINCTRL_H__
19 #define __DT_BINDINGS_ROCKCHIP_PINCTRL_H__
32 #define RK_FUNC_GPIO 0
43 /*special virtual pin for vcc domain setting*/
44 #define VIRTUAL_PIN_FOR_AP0_VCC 0xfA00
45 #define VIRTUAL_PIN_FOR_AP1_VCC 0xfA10
46 #define VIRTUAL_PIN_FOR_CIF_VCC 0xfA20
47 #define VIRTUAL_PIN_FOR_FLASH_VCC 0xfA30
48 #define VIRTUAL_PIN_FOR_VCCIO0_VCC 0xfA40
49 #define VIRTUAL_PIN_FOR_VCCIO1_VCC 0xfA50
50 #define VIRTUAL_PIN_FOR_LCDC0_VCC 0xfA60
51 #define VIRTUAL_PIN_FOR_LCDC1_VCC 0xfA70
54 #define RK32_VIRTUAL_PIN_FOR_LCDC_VCC 0xfA00
55 #define RK32_VIRTUAL_PIN_FOR_DVP_VCC 0xfA10
56 #define RK32_VIRTUAL_PIN_FOR_FLASH0_VCC 0xfA20
57 #define RK32_VIRTUAL_PIN_FOR_FLASH1_VCC 0xfA30
58 #define RK32_VIRTUAL_PIN_FOR_WIFI_VCC 0xfA40
59 #define RK32_VIRTUAL_PIN_FOR_BB_VCC 0xfA50
60 #define RK32_VIRTUAL_PIN_FOR_AUDIO_VCC 0xfA60
61 #define RK32_VIRTUAL_PIN_FOR_SDCARD_VCC 0xfA70
63 #define RK32_VIRTUAL_PIN_FOR_GPIO30_VCC 0xfB00
64 #define RK32_VIRTUAL_PIN_FOR_GPIO1830_VCC 0xfB10
67 #define TYPE_PULL_REG 0x01
68 #define TYPE_VOL_REG 0x02
69 #define TYPE_DRV_REG 0x03
70 #define TYPE_TRI_REG 0x04
72 #define RK2928_PULL_OFFSET 0x118
73 #define RK2928_PULL_PINS_PER_REG 16
74 #define RK2928_PULL_BANK_STRIDE 8
76 #define RK3188_PULL_BITS_PER_PIN 2
77 #define RK3188_PULL_PINS_PER_REG 8
78 #define RK3188_PULL_BANK_STRIDE 16
80 #define RK3036_PULL_BITS_PER_PIN 1
81 #define RK3036_PULL_PINS_PER_REG 16
82 #define RK3036_PULL_BANK_STRIDE 8
84 #define RK312X_PULL_BITS_PER_PIN 1
85 #define RK312X_PULL_PINS_PER_REG 16
86 #define RK312X_PULL_BANK_STRIDE 8
89 /*warning:don not chang the following value*/
90 #define VALUE_PULL_NORMAL 0
91 #define VALUE_PULL_UP 1
92 #define VALUE_PULL_DOWN 2
93 #define VALUE_PULL_KEEP 3
94 #define VALUE_PULL_DISABLE 4 //don't set and keep pull default
95 #define VALUE_PULL_DEFAULT 4 //don't set and keep pull default
99 #define VALUE_PULL_UPDOWN_DISABLE 0
100 #define VALUE_PULL_UPDOWN_ENABLE 1
102 #define VALUE_VOL_DEFAULT 0
103 #define VALUE_VOL_3V3 0
104 #define VALUE_VOL_1V8 1
106 #define VALUE_DRV_DEFAULT 0
107 #define VALUE_DRV_2MA 0
108 #define VALUE_DRV_4MA 1
109 #define VALUE_DRV_8MA 2
110 #define VALUE_DRV_12MA 3
112 #define VALUE_TRI_DEFAULT 0
113 #define VALUE_TRI_FALSE 0
114 #define VALUE_TRI_TRUE 1
118 * pin config bit field definitions
125 * MSB of each field is presence bit for the config.
128 #define PULL_PRESENT (1 << 2)
130 #define VOL_PRESENT (1 << 5)
132 #define DRV_PRESENT (1 << 8)
134 #define TRI_PRESENT (1 << 11)
136 #define CONFIG_TO_PULL(c) ((c) >> PULL_SHIFT & 0x3)
137 #define CONFIG_TO_VOL(c) ((c) >> VOL_SHIFT & 0x3)
138 #define CONFIG_TO_DRV(c) ((c) >> DRV_SHIFT & 0x3)
139 #define CONFIG_TO_TRI(c) ((c) >> TRI_SHIFT & 0x3)
142 #define MAX_NUM_CONFIGS 4
182 #define FUNC_TO_GPIO(m) ((m) & 0xfff0)