1c66ec88fSEmmanuel Vadot* Spreadtrum Pin Controller 2c66ec88fSEmmanuel Vadot 3c66ec88fSEmmanuel VadotThe Spreadtrum pin controller are organized in 3 blocks (types). 4c66ec88fSEmmanuel Vadot 5c66ec88fSEmmanuel VadotThe first block comprises some global control registers, and each 6c66ec88fSEmmanuel Vadotregister contains several bit fields with one bit or several bits 7c66ec88fSEmmanuel Vadotto configure for some global common configuration, such as domain 8c66ec88fSEmmanuel Vadotpad driving level, system control select and so on ("domain pad 9c66ec88fSEmmanuel Vadotdriving level": One pin can output 3.0v or 1.8v, depending on the 10c66ec88fSEmmanuel Vadotrelated domain pad driving selection, if the related domain pad 11*aa1a8ff2SEmmanuel Vadotselect 3.0v, then the pin can output 3.0v. "system control" is used 12c66ec88fSEmmanuel Vadotto choose one function (like: UART0) for which system, since we 13c66ec88fSEmmanuel Vadothave several systems (AP/CP/CM4) on one SoC.). 14c66ec88fSEmmanuel Vadot 15c66ec88fSEmmanuel VadotThere are too much various configuration that we can not list all 16c66ec88fSEmmanuel Vadotof them, so we can not make every Spreadtrum-special configuration 17c66ec88fSEmmanuel Vadotas one generic configuration, and maybe it will add more strange 18c66ec88fSEmmanuel Vadotglobal configuration in future. Then we add one "sprd,control" to 19c66ec88fSEmmanuel Vadotset these various global control configuration, and we need use 20c66ec88fSEmmanuel Vadotmagic number for this property. 21c66ec88fSEmmanuel Vadot 22c66ec88fSEmmanuel VadotMoreover we recognise every fields comprising one bit or several 23c66ec88fSEmmanuel Vadotbits in one global control register as one pin, thus we should 24c66ec88fSEmmanuel Vadotrecord every pin's bit offset, bit width and register offset to 25c66ec88fSEmmanuel Vadotconfigure this field (pin). 26c66ec88fSEmmanuel Vadot 27c66ec88fSEmmanuel VadotThe second block comprises some common registers which have unified 28c66ec88fSEmmanuel Vadotregister definition, and each register described one pin is used 29c66ec88fSEmmanuel Vadotto configure the pin sleep mode, function select and sleep related 30c66ec88fSEmmanuel Vadotconfiguration. 31c66ec88fSEmmanuel Vadot 32c66ec88fSEmmanuel VadotNow we have 4 systems for sleep mode on SC9860 SoC: AP system, 33c66ec88fSEmmanuel VadotPUBCP system, TGLDSP system and AGDSP system. And the pin sleep 34c66ec88fSEmmanuel Vadotrelated configuration are: 35c66ec88fSEmmanuel Vadot- input-enable 36c66ec88fSEmmanuel Vadot- input-disable 37c66ec88fSEmmanuel Vadot- output-high 38c66ec88fSEmmanuel Vadot- output-low 39c66ec88fSEmmanuel Vadot- bias-pull-up 40c66ec88fSEmmanuel Vadot- bias-pull-down 41c66ec88fSEmmanuel Vadot 42c66ec88fSEmmanuel VadotIn some situation we need set the pin sleep mode and pin sleep related 43c66ec88fSEmmanuel Vadotconfiguration, to set the pin sleep related configuration automatically 44c66ec88fSEmmanuel Vadotby hardware when the system specified by sleep mode goes into deep 45c66ec88fSEmmanuel Vadotsleep mode. For example, if we set the pin sleep mode as PUBCP_SLEEP 46c66ec88fSEmmanuel Vadotand set the pin sleep related configuration as "input-enable", which 47c66ec88fSEmmanuel Vadotmeans when PUBCP system goes into deep sleep mode, this pin will be set 48c66ec88fSEmmanuel Vadotinput enable automatically. 49c66ec88fSEmmanuel Vadot 50c66ec88fSEmmanuel VadotMoreover we can not use the "sleep" state, since some systems (like: 51c66ec88fSEmmanuel VadotPUBCP system) do not run linux kernel OS (only AP system run linux 52c66ec88fSEmmanuel Vadotkernel on SC9860 platform), then we can not select "sleep" state 53c66ec88fSEmmanuel Vadotwhen the PUBCP system goes into deep sleep mode. Thus we introduce 54c66ec88fSEmmanuel Vadot"sprd,sleep-mode" property to set pin sleep mode. 55c66ec88fSEmmanuel Vadot 56c66ec88fSEmmanuel VadotThe last block comprises some misc registers which also have unified 57c66ec88fSEmmanuel Vadotregister definition, and each register described one pin is used to 58c66ec88fSEmmanuel Vadotconfigure drive strength, pull up/down and so on. Especially for pull 59c66ec88fSEmmanuel Vadotup, we have two kind pull up resistor: 20K and 4.7K. 60c66ec88fSEmmanuel Vadot 61c66ec88fSEmmanuel VadotRequired properties for Spreadtrum pin controller: 62c66ec88fSEmmanuel Vadot- compatible: "sprd,<soc>-pinctrl" 63c66ec88fSEmmanuel Vadot Please refer to each sprd,<soc>-pinctrl.txt binding doc for supported SoCs. 64c66ec88fSEmmanuel Vadot- reg: The register address of pin controller device. 65c66ec88fSEmmanuel Vadot- pins : An array of pin names. 66c66ec88fSEmmanuel Vadot 67c66ec88fSEmmanuel VadotOptional properties: 68c66ec88fSEmmanuel Vadot- function: Specified the function name. 69c66ec88fSEmmanuel Vadot- drive-strength: Drive strength in mA. 70c66ec88fSEmmanuel Vadot- input-schmitt-disable: Enable schmitt-trigger mode. 71c66ec88fSEmmanuel Vadot- input-schmitt-enable: Disable schmitt-trigger mode. 72c66ec88fSEmmanuel Vadot- bias-disable: Disable pin bias. 73c66ec88fSEmmanuel Vadot- bias-pull-down: Pull down on pin. 74c66ec88fSEmmanuel Vadot- bias-pull-up: Pull up on pin. 75c66ec88fSEmmanuel Vadot- input-enable: Enable pin input. 76c66ec88fSEmmanuel Vadot- input-disable: Enable pin output. 77c66ec88fSEmmanuel Vadot- output-high: Set the pin as an output level high. 78c66ec88fSEmmanuel Vadot- output-low: Set the pin as an output level low. 79c66ec88fSEmmanuel Vadot- sleep-hardware-state: Indicate these configs in this state are sleep related. 80c66ec88fSEmmanuel Vadot- sprd,control: Control values referring to databook for global control pins. 81c66ec88fSEmmanuel Vadot- sprd,sleep-mode: Sleep mode selection. 82c66ec88fSEmmanuel Vadot 83c66ec88fSEmmanuel VadotPlease refer to each sprd,<soc>-pinctrl.txt binding doc for supported values. 84