arm64: dts: qcom: msm8916-samsung-j5-common: Add MUIC support
authorMarkuss Broks <markuss.broks@gmail.com>
Fri, 6 Jan 2023 14:31:49 +0000 (14:31 +0000)
committerBjorn Andersson <andersson@kernel.org>
Wed, 18 Jan 2023 23:33:10 +0000 (17:33 -0600)
The MUIC installed is a part of SM5703 MFD, and it seems to work
the same as the SM5502 MUIC unit.

Signed-off-by: Markuss Broks <markuss.broks@gmail.com>
[Apply for msm8916-samsung-j5x]
Signed-off-by: Lin, Meng-Bo <linmengbo0689@protonmail.com>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230106143051.547302-1-linmengbo0689@protonmail.com
arch/arm64/boot/dts/qcom/msm8916-samsung-j5-common.dtsi
arch/arm64/boot/dts/qcom/msm8916-samsung-j5x.dts

index 5755b36..f3b81b6 100644 (file)
@@ -3,6 +3,7 @@
 #include "msm8916-pm8916.dtsi"
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/interrupt-controller/irq.h>
 
 / {
        aliases {
                        linux,code = <KEY_HOMEPAGE>;
                };
        };
+
+       i2c_muic: i2c-muic {
+               compatible = "i2c-gpio";
+               sda-gpios = <&msmgpio 105 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
+               scl-gpios = <&msmgpio 106 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
+
+               pinctrl-names = "default";
+               pinctrl-0 = <&muic_i2c_default>;
+
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               muic: extcon@25 {
+                       compatible = "siliconmitus,sm5703-muic";
+                       reg = <0x25>;
+
+                       interrupt-parent = <&msmgpio>;
+                       interrupts = <12 IRQ_TYPE_EDGE_FALLING>;
+
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&muic_int_default>;
+               };
+       };
 };
 
 &blsp1_uart2 {
        linux,code = <KEY_VOLUMEDOWN>;
 };
 
-/* FIXME: Replace with SM5703 MUIC when driver is available */
-&pm8916_usbin {
-       status = "okay";
-};
-
 &pronto {
        status = "okay";
 };
 };
 
 &usb {
+       extcon = <&muic>, <&muic>;
        status = "okay";
-       dr_mode = "peripheral";
-       extcon = <&pm8916_usbin>;
 };
 
 &usb_hs_phy {
-       extcon = <&pm8916_usbin>;
+       extcon = <&muic>;
 };
 
 &smd_rpm_regulators {
                drive-strength = <2>;
                bias-pull-up;
        };
+
+       muic_i2c_default: muic-i2c-default-state {
+               pins = "gpio105", "gpio106";
+               function = "gpio";
+
+               drive-strength = <2>;
+               bias-disable;
+       };
+
+       muic_int_default: muic-int-default-state {
+               pins = "gpio12";
+               function = "gpio";
+
+               drive-strength = <2>;
+               bias-disable;
+       };
 };
index 7656ac4..7e1326c 100644 (file)
@@ -9,3 +9,11 @@
        compatible = "samsung,j5x", "qcom,msm8916";
        chassis-type = "handset";
 };
+
+&muic {
+       interrupts = <121 IRQ_TYPE_EDGE_FALLING>;
+};
+
+&muic_int_default {
+       pins = "gpio121";
+};