18c2ecf20Sopenharmony_ci* ZTE ZX Pin Controller
28c2ecf20Sopenharmony_ci
38c2ecf20Sopenharmony_ciThe pin controller on ZTE ZX platforms is kinda of hybrid.  It consists of
48c2ecf20Sopenharmony_cia main controller and an auxiliary one.  For example, on ZX296718 SoC, the
58c2ecf20Sopenharmony_cimain controller is TOP_PMM and the auxiliary one is AON_IOCFG.  Both
68c2ecf20Sopenharmony_cicontrollers work together to control pin multiplexing and configuration in
78c2ecf20Sopenharmony_cithe way illustrated as below.
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci           GMII_RXD3 ---+
118c2ecf20Sopenharmony_ci                        |
128c2ecf20Sopenharmony_ci             DVI1_HS ---+----------------------------- GMII_RXD3 (TOP pin)
138c2ecf20Sopenharmony_ci                        |
148c2ecf20Sopenharmony_ci             BGPIO16 ---+                               ^
158c2ecf20Sopenharmony_ci                                                        | pinconf
168c2ecf20Sopenharmony_ci                        ^                               |
178c2ecf20Sopenharmony_ci                        | pinmux                        |
188c2ecf20Sopenharmony_ci                        |                               |
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ci                   TOP_PMM (main)           AON_IOCFG (aux)
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci                        |                       |       |
238c2ecf20Sopenharmony_ci                        |                pinmux |       |
248c2ecf20Sopenharmony_ci                        | pinmux                v       |
258c2ecf20Sopenharmony_ci                        v                               | pinconf
268c2ecf20Sopenharmony_ci                                    KEY_ROW2 ---+       v
278c2ecf20Sopenharmony_ci        PORT1_LCD_TE ---+                       |
288c2ecf20Sopenharmony_ci                        |            AGPIO10 ---+------ KEY_ROW2 (AON pin)
298c2ecf20Sopenharmony_ci          I2S0_DOUT3 ---+                       |
308c2ecf20Sopenharmony_ci                        |-----------------------+
318c2ecf20Sopenharmony_ci            PWM_OUT3 ---+
328c2ecf20Sopenharmony_ci                        |
338c2ecf20Sopenharmony_ci             VGA_VS1 ---+
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ciFor most of pins like GMII_RXD3 in the figure, the pinmux function is
378c2ecf20Sopenharmony_cicontrolled by TOP_PMM block only, and this type of pins are meant by term
388c2ecf20Sopenharmony_ci'TOP pins'.  For pins like KEY_ROW2, the pinmux is controlled by both
398c2ecf20Sopenharmony_ciTOP_PMM and AON_IOCFG blocks, as the available multiplexing functions for
408c2ecf20Sopenharmony_cithe pin spread in both controllers.  This type of pins are called 'AON pins'.
418c2ecf20Sopenharmony_ciThough pinmux implementation is quite different, pinconf is same for both
428c2ecf20Sopenharmony_citypes of pins.  Both are controlled by auxiliary controller, i.e. AON_IOCFG
438c2ecf20Sopenharmony_cion ZX296718.
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_ciRequired properties:
468c2ecf20Sopenharmony_ci- compatible: should be "zte,zx296718-pmm".
478c2ecf20Sopenharmony_ci- reg: the register physical address and length.
488c2ecf20Sopenharmony_ci- zte,auxiliary-controller: phandle to the auxiliary pin controller which
498c2ecf20Sopenharmony_ci  implements pinmux for AON pins and pinconf for all pins.
508c2ecf20Sopenharmony_ci
518c2ecf20Sopenharmony_ciThe following pin configuration are supported. Please refer to
528c2ecf20Sopenharmony_cipinctrl-bindings.txt in this directory for more details of the common
538c2ecf20Sopenharmony_cipinctrl bindings used by client devices.
548c2ecf20Sopenharmony_ci
558c2ecf20Sopenharmony_ci- bias-pull-up
568c2ecf20Sopenharmony_ci- bias-pull-down
578c2ecf20Sopenharmony_ci- drive-strength
588c2ecf20Sopenharmony_ci- input-enable
598c2ecf20Sopenharmony_ci- slew-rate
608c2ecf20Sopenharmony_ci
618c2ecf20Sopenharmony_ciExamples:
628c2ecf20Sopenharmony_ci
638c2ecf20Sopenharmony_ciiocfg: pin-controller@119000 {
648c2ecf20Sopenharmony_ci	compatible = "zte,zx296718-iocfg";
658c2ecf20Sopenharmony_ci	reg = <0x119000 0x1000>;
668c2ecf20Sopenharmony_ci};
678c2ecf20Sopenharmony_ci
688c2ecf20Sopenharmony_cipmm: pin-controller@1462000 {
698c2ecf20Sopenharmony_ci	compatible = "zte,zx296718-pmm";
708c2ecf20Sopenharmony_ci	reg = <0x1462000 0x1000>;
718c2ecf20Sopenharmony_ci	zte,auxiliary-controller = <&iocfg>;
728c2ecf20Sopenharmony_ci};
738c2ecf20Sopenharmony_ci
748c2ecf20Sopenharmony_ci&pmm {
758c2ecf20Sopenharmony_ci	vga_pins: vga {
768c2ecf20Sopenharmony_ci		pins = "KEY_COL1", "KEY_COL2", "KEY_ROW1", "KEY_ROW2";
778c2ecf20Sopenharmony_ci		function = "VGA";
788c2ecf20Sopenharmony_ci	};
798c2ecf20Sopenharmony_ci};
808c2ecf20Sopenharmony_ci
818c2ecf20Sopenharmony_ci&vga {
828c2ecf20Sopenharmony_ci	pinctrl-names = "default";
838c2ecf20Sopenharmony_ci	pinctrl-0 = <&vga_pins>;
848c2ecf20Sopenharmony_ci};
85