]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
arm64: dts: qcom: sdm845-starqltechn: add max77705 PMIC
authorDzmitry Sankouski <dsankouski@gmail.com>
Tue, 25 Feb 2025 16:38:58 +0000 (19:38 +0300)
committerBjorn Andersson <andersson@kernel.org>
Fri, 7 Mar 2025 23:05:20 +0000 (17:05 -0600)
Add support for max77705 MFD device. Supported sub-devices:
 charger, fuelgauge, haptic, led

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Link: https://lore.kernel.org/r/20250225-starqltechn_integration_upstream-v9-7-a5d80375cb66@gmail.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
arch/arm64/boot/dts/qcom/sdm845-samsung-starqltechn.dts

index 38c09e50ccfbf3f745d7504c0f17f11dc0ad7557..bd5c8b319ddfa8eb6cf8668d13a029060f902f5a 100644 (file)
@@ -9,6 +9,7 @@
 
 #include <dt-bindings/input/linux-event-codes.h>
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/leds/common.h>
 #include <dt-bindings/regulator/qcom,rpmh-regulator.h>
 #include "sdm845.dtsi"
 #include "pm8998.dtsi"
        model = "Samsung Galaxy S9 SM-G9600";
        compatible = "samsung,starqltechn", "qcom,sdm845";
 
+       battery: battery {
+               compatible = "simple-battery";
+               constant-charge-current-max-microamp = <2150000>;
+               charge-full-design-microamp-hours = <3000000>;
+
+               over-voltage-threshold-microvolt = <4500000>;
+               voltage-min-design-microvolt = <3400000>;
+               voltage-max-design-microvolt = <4350000>;
+       };
+
        chosen {
                #address-cells = <2>;
                #size-cells = <2>;
                };
        };
 
+       vib_regulator: gpio-regulator {
+               compatible = "regulator-fixed";
+
+               regulator-name = "haptic";
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+
+               gpio = <&pm8998_gpios 18 GPIO_ACTIVE_HIGH>;
+               enable-active-high;
+
+               regulator-boot-on;
+       };
+
        vph_pwr: vph-pwr-regulator {
                compatible = "regulator-fixed";
                regulator-name = "vph_pwr";
                        debounce-interval = <15>;
                };
        };
+
+       vib_pwm: pwm {
+               compatible = "clk-pwm";
+               #pwm-cells = <2>;
+               assigned-clock-parents = <&rpmhcc RPMH_CXO_CLK>;
+               assigned-clocks = <&gcc GCC_GP1_CLK_SRC>;
+               clocks = <&gcc GCC_GP1_CLK>;
+               pinctrl-0 = <&motor_pwm_default_state>;
+               pinctrl-1 = <&motor_pwm_suspend_state>;
+               pinctrl-names = "default", "suspend";
+       };
 };
 
 
        status = "okay";
 };
 
+&gpi_dma1 {
+       status = "okay";
+};
+
 &uart9 {
        status = "okay";
 };
 
+&i2c14 {
+       status = "okay";
+
+       pmic@66 {
+               compatible = "maxim,max77705";
+               reg = <0x66>;
+               interrupt-parent = <&pm8998_gpios>;
+               interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
+               pinctrl-0 = <&pmic_int_default>;
+               pinctrl-names = "default";
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               leds {
+                       compatible = "maxim,max77705-rgb";
+
+                       multi-led {
+                               color = <LED_COLOR_ID_RGB>;
+                               function = LED_FUNCTION_STATUS;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               led@1 {
+                                       reg = <1>;
+                                       color = <LED_COLOR_ID_RED>;
+                               };
+
+                               led@2 {
+                                       reg = <2>;
+                                       color = <LED_COLOR_ID_GREEN>;
+                               };
+
+                               led@3 {
+                                       reg = <3>;
+                                       color = <LED_COLOR_ID_BLUE>;
+                               };
+                       };
+               };
+
+               haptic {
+                       compatible = "maxim,max77705-haptic";
+                       haptic-supply = <&vib_regulator>;
+                       pwms = <&vib_pwm 0 52084>;
+               };
+       };
+
+       max77705_charger: charger@69 {
+               reg = <0x69>;
+               compatible = "maxim,max77705-charger";
+               monitored-battery = <&battery>;
+               interrupt-parent = <&pm8998_gpios>;
+               interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
+
+       };
+
+       fuel-gauge@36 {
+               reg = <0x36>;
+               compatible = "maxim,max77705-battery";
+               power-supplies = <&max77705_charger>;
+               maxim,rsns-microohm = <5000>;
+               interrupt-parent = <&pm8998_gpios>;
+               interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
+       };
+};
+
 &ufs_mem_hc {
        reset-gpios = <&tlmm 150 GPIO_ACTIVE_LOW>;
        vcc-supply = <&vreg_l20a_2p95>;
        status = "okay";
 };
 
+&pm8998_gpios {
+       pmic_int_default: pmic-int-default-state {
+               pins = "gpio11";
+               function = "normal";
+               input-enable;
+               bias-disable;
+               power-source = <0>;
+       };
+};
+
 &tlmm {
        gpio-reserved-ranges = <27 4>, /* SPI (eSE - embedded Secure Element) */
                               <85 4>; /* SPI (fingerprint reader) */
 
+       motor_pwm_default_state: motor-pwm-active-state {
+               pins = "gpio57";
+               function = "gcc_gp1";
+               drive-strength = <2>;
+               bias-disable;
+               output-high;
+       };
+
+       motor_pwm_suspend_state: motor-pwm-suspend-state {
+               pins = "gpio57";
+               function = "gpio";
+               drive-strength = <2>;
+               bias-disable;
+               output-low;
+       };
+
        sdc2_clk_state: sdc2-clk-state {
                pins = "sdc2_clk";
                bias-disable;