18c2ecf20Sopenharmony_ciMediaTek PMIC Wrapper Driver
28c2ecf20Sopenharmony_ci
38c2ecf20Sopenharmony_ciThis document describes the binding for the MediaTek PMIC wrapper.
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ciOn MediaTek SoCs the PMIC is connected via SPI. The SPI master interface
68c2ecf20Sopenharmony_ciis not directly visible to the CPU, but only through the PMIC wrapper
78c2ecf20Sopenharmony_ciinside the SoC. The communication between the SoC and the PMIC can
88c2ecf20Sopenharmony_cioptionally be encrypted. Also a non standard Dual IO SPI mode can be
98c2ecf20Sopenharmony_ciused to increase speed.
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ciIP Pairing
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_cion MT8135 the pins of some SoC internal peripherals can be on the PMIC.
148c2ecf20Sopenharmony_ciThe signals of these pins are routed over the SPI bus using the pwrap
158c2ecf20Sopenharmony_cibridge. In the binding description below the properties needed for bridging
168c2ecf20Sopenharmony_ciare marked with "IP Pairing". These are optional on SoCs which do not support
178c2ecf20Sopenharmony_ciIP Pairing
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ciRequired properties in pwrap device node.
208c2ecf20Sopenharmony_ci- compatible:
218c2ecf20Sopenharmony_ci	"mediatek,mt2701-pwrap" for MT2701/7623 SoCs
228c2ecf20Sopenharmony_ci	"mediatek,mt6765-pwrap" for MT6765 SoCs
238c2ecf20Sopenharmony_ci	"mediatek,mt6779-pwrap" for MT6779 SoCs
248c2ecf20Sopenharmony_ci	"mediatek,mt6797-pwrap" for MT6797 SoCs
258c2ecf20Sopenharmony_ci	"mediatek,mt7622-pwrap" for MT7622 SoCs
268c2ecf20Sopenharmony_ci	"mediatek,mt8135-pwrap" for MT8135 SoCs
278c2ecf20Sopenharmony_ci	"mediatek,mt8173-pwrap" for MT8173 SoCs
288c2ecf20Sopenharmony_ci	"mediatek,mt8183-pwrap" for MT8183 SoCs
298c2ecf20Sopenharmony_ci	"mediatek,mt8516-pwrap" for MT8516 SoCs
308c2ecf20Sopenharmony_ci- interrupts: IRQ for pwrap in SOC
318c2ecf20Sopenharmony_ci- reg-names: Must include the following entries:
328c2ecf20Sopenharmony_ci  "pwrap": Main registers base
338c2ecf20Sopenharmony_ci  "pwrap-bridge": bridge base (IP Pairing)
348c2ecf20Sopenharmony_ci- reg: Must contain an entry for each entry in reg-names.
358c2ecf20Sopenharmony_ci- reset-names: Must include the following entries:
368c2ecf20Sopenharmony_ci  "pwrap"
378c2ecf20Sopenharmony_ci  "pwrap-bridge" (IP Pairing)
388c2ecf20Sopenharmony_ci- resets: Must contain an entry for each entry in reset-names.
398c2ecf20Sopenharmony_ci- clock-names: Must include the following entries:
408c2ecf20Sopenharmony_ci  "spi": SPI bus clock
418c2ecf20Sopenharmony_ci  "wrap": Main module clock
428c2ecf20Sopenharmony_ci- clocks: Must contain an entry for each entry in clock-names.
438c2ecf20Sopenharmony_ci
448c2ecf20Sopenharmony_ciOptional properities:
458c2ecf20Sopenharmony_ci- pmic: Using either MediaTek PMIC MFD as the child device of pwrap
468c2ecf20Sopenharmony_ci  See the following for child node definitions:
478c2ecf20Sopenharmony_ci  Documentation/devicetree/bindings/mfd/mt6397.txt
488c2ecf20Sopenharmony_ci  or the regulator-only device as the child device of pwrap, such as MT6380.
498c2ecf20Sopenharmony_ci  See the following definitions for such kinds of devices.
508c2ecf20Sopenharmony_ci  Documentation/devicetree/bindings/regulator/mt6380-regulator.txt
518c2ecf20Sopenharmony_ci
528c2ecf20Sopenharmony_ciExample:
538c2ecf20Sopenharmony_ci	pwrap: pwrap@1000f000 {
548c2ecf20Sopenharmony_ci		compatible = "mediatek,mt8135-pwrap";
558c2ecf20Sopenharmony_ci		reg = <0 0x1000f000 0 0x1000>,
568c2ecf20Sopenharmony_ci			<0 0x11017000 0 0x1000>;
578c2ecf20Sopenharmony_ci		reg-names = "pwrap", "pwrap-bridge";
588c2ecf20Sopenharmony_ci		interrupts = <GIC_SPI 128 IRQ_TYPE_LEVEL_HIGH>;
598c2ecf20Sopenharmony_ci		resets = <&infracfg MT8135_INFRA_PMIC_WRAP_RST>,
608c2ecf20Sopenharmony_ci				<&pericfg MT8135_PERI_PWRAP_BRIDGE_SW_RST>;
618c2ecf20Sopenharmony_ci		reset-names = "pwrap", "pwrap-bridge";
628c2ecf20Sopenharmony_ci		clocks = <&clk26m>, <&clk26m>;
638c2ecf20Sopenharmony_ci		clock-names = "spi", "wrap";
648c2ecf20Sopenharmony_ci
658c2ecf20Sopenharmony_ci		pmic {
668c2ecf20Sopenharmony_ci			compatible = "mediatek,mt6397";
678c2ecf20Sopenharmony_ci		};
688c2ecf20Sopenharmony_ci	};
69