diff options
author | Baolin Wang <baolin.wang@spreadtrum.com> | 2017-08-17 02:50:37 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2017-08-31 03:19:36 -0400 |
commit | e6f3f66903fb9bf67d4f8062cbfb4712168970f9 (patch) | |
tree | 3f5ed1391e7adc05c9c1ffc5eb9a66b416ed65c3 | |
parent | 6606bc9dee63ad8cda2cc310d2ad5992673a785a (diff) |
dt-bindings: pinctrl: Add DT bindings for Spreadtrum SC9860
This patch adds the binding documentation for Spreadtrum SC9860 pin
controller device.
Signed-off-by: Baolin Wang <baolin.wang@spreadtrum.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r-- | Documentation/devicetree/bindings/pinctrl/sprd,pinctrl.txt | 83 | ||||
-rw-r--r-- | Documentation/devicetree/bindings/pinctrl/sprd,sc9860-pinctrl.txt | 70 |
2 files changed, 153 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/pinctrl/sprd,pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/sprd,pinctrl.txt new file mode 100644 index 000000000000..b1cea7a3a071 --- /dev/null +++ b/Documentation/devicetree/bindings/pinctrl/sprd,pinctrl.txt | |||
@@ -0,0 +1,83 @@ | |||
1 | * Spreadtrum Pin Controller | ||
2 | |||
3 | The Spreadtrum pin controller are organized in 3 blocks (types). | ||
4 | |||
5 | The first block comprises some global control registers, and each | ||
6 | register contains several bit fields with one bit or several bits | ||
7 | to configure for some global common configuration, such as domain | ||
8 | pad driving level, system control select and so on ("domain pad | ||
9 | driving level": One pin can output 3.0v or 1.8v, depending on the | ||
10 | related domain pad driving selection, if the related domain pad | ||
11 | slect 3.0v, then the pin can output 3.0v. "system control" is used | ||
12 | to choose one function (like: UART0) for which system, since we | ||
13 | have several systems (AP/CP/CM4) on one SoC.). | ||
14 | |||
15 | There are too much various configuration that we can not list all | ||
16 | of them, so we can not make every Spreadtrum-special configuration | ||
17 | as one generic configuration, and maybe it will add more strange | ||
18 | global configuration in future. Then we add one "sprd,control" to | ||
19 | set these various global control configuration, and we need use | ||
20 | magic number for this property. | ||
21 | |||
22 | Moreover we recognise every fields comprising one bit or several | ||
23 | bits in one global control register as one pin, thus we should | ||
24 | record every pin's bit offset, bit width and register offset to | ||
25 | configure this field (pin). | ||
26 | |||
27 | The second block comprises some common registers which have unified | ||
28 | register definition, and each register described one pin is used | ||
29 | to configure the pin sleep mode, function select and sleep related | ||
30 | configuration. | ||
31 | |||
32 | Now we have 4 systems for sleep mode on SC9860 SoC: AP system, | ||
33 | PUBCP system, TGLDSP system and AGDSP system. And the pin sleep | ||
34 | related configuration are: | ||
35 | - input-enable | ||
36 | - input-disable | ||
37 | - output-high | ||
38 | - output-low | ||
39 | - bias-pull-up | ||
40 | - bias-pull-down | ||
41 | |||
42 | In some situation we need set the pin sleep mode and pin sleep related | ||
43 | configuration, to set the pin sleep related configuration automatically | ||
44 | by hardware when the system specified by sleep mode goes into deep | ||
45 | sleep mode. For example, if we set the pin sleep mode as PUBCP_SLEEP | ||
46 | and set the pin sleep related configuration as "input-enable", which | ||
47 | means when PUBCP system goes into deep sleep mode, this pin will be set | ||
48 | input enable automatically. | ||
49 | |||
50 | Moreover we can not use the "sleep" state, since some systems (like: | ||
51 | PUBCP system) do not run linux kernel OS (only AP system run linux | ||
52 | kernel on SC9860 platform), then we can not select "sleep" state | ||
53 | when the PUBCP system goes into deep sleep mode. Thus we introduce | ||
54 | "sprd,sleep-mode" property to set pin sleep mode. | ||
55 | |||
56 | The last block comprises some misc registers which also have unified | ||
57 | register definition, and each register described one pin is used to | ||
58 | configure drive strength, pull up/down and so on. Especially for pull | ||
59 | up, we have two kind pull up resistor: 20K and 4.7K. | ||
60 | |||
61 | Required properties for Spreadtrum pin controller: | ||
62 | - compatible: "sprd,<soc>-pinctrl" | ||
63 | Please refer to each sprd,<soc>-pinctrl.txt binding doc for supported SoCs. | ||
64 | - reg: The register address of pin controller device. | ||
65 | - pins : An array of pin names. | ||
66 | |||
67 | Optional properties: | ||
68 | - function: Specified the function name. | ||
69 | - drive-strength: Drive strength in mA. | ||
70 | - input-schmitt-disable: Enable schmitt-trigger mode. | ||
71 | - input-schmitt-enable: Disable schmitt-trigger mode. | ||
72 | - bias-disable: Disable pin bias. | ||
73 | - bias-pull-down: Pull down on pin. | ||
74 | - bias-pull-up: Pull up on pin. | ||
75 | - input-enable: Enable pin input. | ||
76 | - input-disable: Enable pin output. | ||
77 | - output-high: Set the pin as an output level high. | ||
78 | - output-low: Set the pin as an output level low. | ||
79 | - sleep-hardware-state: Indicate these configs in this state are sleep related. | ||
80 | - sprd,control: Control values referring to databook for global control pins. | ||
81 | - sprd,sleep-mode: Sleep mode selection. | ||
82 | |||
83 | Please refer to each sprd,<soc>-pinctrl.txt binding doc for supported values. | ||
diff --git a/Documentation/devicetree/bindings/pinctrl/sprd,sc9860-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/sprd,sc9860-pinctrl.txt new file mode 100644 index 000000000000..5a628333d52f --- /dev/null +++ b/Documentation/devicetree/bindings/pinctrl/sprd,sc9860-pinctrl.txt | |||
@@ -0,0 +1,70 @@ | |||
1 | * Spreadtrum SC9860 Pin Controller | ||
2 | |||
3 | Please refer to sprd,pinctrl.txt in this directory for common binding part | ||
4 | and usage. | ||
5 | |||
6 | Required properties: | ||
7 | - compatible: Must be "sprd,sc9860-pinctrl". | ||
8 | - reg: The register address of pin controller device. | ||
9 | - pins : An array of strings, each string containing the name of a pin. | ||
10 | |||
11 | Optional properties: | ||
12 | - function: A string containing the name of the function, values must be | ||
13 | one of: "func1", "func2", "func3" and "func4". | ||
14 | - drive-strength: Drive strength in mA. Supported values: 2, 4, 6, 8, 10, | ||
15 | 12, 14, 16, 20, 21, 24, 25, 27, 29, 31 and 33. | ||
16 | - input-schmitt-disable: Enable schmitt-trigger mode. | ||
17 | - input-schmitt-enable: Disable schmitt-trigger mode. | ||
18 | - bias-disable: Disable pin bias. | ||
19 | - bias-pull-down: Pull down on pin. | ||
20 | - bias-pull-up: Pull up on pin. Supported values: 20000 for pull-up resistor | ||
21 | is 20K and 4700 for pull-up resistor is 4.7K. | ||
22 | - input-enable: Enable pin input. | ||
23 | - input-disable: Enable pin output. | ||
24 | - output-high: Set the pin as an output level high. | ||
25 | - output-low: Set the pin as an output level low. | ||
26 | - sleep-hardware-state: Indicate these configs in this state are sleep related. | ||
27 | - sprd,control: Control values referring to databook for global control pins. | ||
28 | - sprd,sleep-mode: Choose the pin sleep mode, and supported values are: | ||
29 | AP_SLEEP, PUBCP_SLEEP, TGLDSP_SLEEP and AGDSP_SLEEP. | ||
30 | |||
31 | Pin sleep mode definition: | ||
32 | enum pin_sleep_mode { | ||
33 | AP_SLEEP = BIT(0), | ||
34 | PUBCP_SLEEP = BIT(1), | ||
35 | TGLDSP_SLEEP = BIT(2), | ||
36 | AGDSP_SLEEP = BIT(3), | ||
37 | }; | ||
38 | |||
39 | Example: | ||
40 | pin_controller: pinctrl@402a0000 { | ||
41 | compatible = "sprd,sc9860-pinctrl"; | ||
42 | reg = <0x402a0000 0x10000>; | ||
43 | |||
44 | grp1: sd0 { | ||
45 | pins = "SC9860_VIO_SD2_IRTE", "SC9860_VIO_SD0_IRTE"; | ||
46 | sprd,control = <0x1>; | ||
47 | }; | ||
48 | |||
49 | grp2: rfctl_33 { | ||
50 | pins = "SC9860_RFCTL33"; | ||
51 | function = "func2"; | ||
52 | sprd,sleep-mode = <AP_SLEEP | PUBCP_SLEEP>; | ||
53 | grp2_sleep_mode: rfctl_33_sleep { | ||
54 | pins = "SC9860_RFCTL33"; | ||
55 | sleep-hardware-state; | ||
56 | output-low; | ||
57 | } | ||
58 | }; | ||
59 | |||
60 | grp3: rfctl_misc_20 { | ||
61 | pins = "SC9860_RFCTL20_MISC"; | ||
62 | drive-strength = <10>; | ||
63 | bias-pull-up = <4700>; | ||
64 | grp3_sleep_mode: rfctl_misc_sleep { | ||
65 | pins = "SC9860_RFCTL20_MISC"; | ||
66 | sleep-hardware-state; | ||
67 | bias-pull-up; | ||
68 | } | ||
69 | }; | ||
70 | }; | ||