From 627c2556334e8a5799132aac47db4bdec10826ed Mon Sep 17 00:00:00 2001 From: tnlizd Date: Thu, 24 Sep 2020 17:44:07 +0800 Subject: [PATCH] sx9338: sar sensor bring up capri: 1. add sx9338 sar sensor support Change-Id: I3663ff9a5d0358b8ef7f89e3b5310d1800b04c7a Reviewed-on: https://gerrit.mot.com/1759026 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Wen Xie Reviewed-by: Xiangpo Zhao Submit-Approved: Jira Key --- qcom/bengal-capri-common-overlay.dtsi | 137 ++++++++++++++++++++++++++ 1 file changed, 137 insertions(+) diff --git a/qcom/bengal-capri-common-overlay.dtsi b/qcom/bengal-capri-common-overlay.dtsi index 555d1c68db14..a2993443d791 100644 --- a/qcom/bengal-capri-common-overlay.dtsi +++ b/qcom/bengal-capri-common-overlay.dtsi @@ -86,6 +86,32 @@ }; }; }; + + sar_int_default: sar_int_default { + mux { + pins = "gpio36"; + function = "gpio"; + }; + config { + pins = "gpio36"; + num-grp-pins = <1>; + drive-strength = <2>; + bias-pull-up; + }; + }; + + sar_int_sleep: sar_int_sleep { + mux { + pins = "gpio36"; + function = "gpio"; + }; + config { + pins = "gpio36"; + num-grp-pins = <1>; + drive-strength = <2>; + bias-pull-up; + }; + }; }; &soc { @@ -192,6 +218,117 @@ qcom,dsi-default-panel = <&dsi_hlt_hx83102d_video>; }; +&qupv3_se0_i2c { + status = "ok"; + + sx933x@28 { /* SAR sensor */ + compatible = "Semtech,sx933x"; + reg = <0x28>; + pinctrl-names = "default","sleep"; + pinctrl-0 = <&sar_int_default>; + pinctrl-1 = <&sar_int_sleep>; + Semtech,power-supply-type = <1>; + cap_vdd-supply = <&L21A>; + interrupt-parent = <&tlmm>; + interrupts = <36 0x02>; + interrupt-names = "sx933x_irq"; + Semtech,nirq-gpio= <&tlmm 36 0x02>; + Semtech,button-flag = <0x07>; + Semtech,headset-reg-num = <4>; + Semtech,headset-reg = < + 0x8074 0x08203515 + 0x802c 0x20000A9D + 0x803c 0x20000A9D + 0x801c 0x20000014>; + Semtech,reg-num = <83>; + Semtech,reg-init =< + 0x4004 0x7C + 0x4008 0x00 + 0x4054 0x400 + 0x42c0 0x8000000 + 0x42c4 0x3F + 0x800c 0x00 + 0x8010 0x00 + 0x8014 0x00 + 0x8018 0x00 + 0x801c 0x31 + 0x8020 0x001F001F + 0x8024 0x1466 + 0x8028 0x3FFE825A + 0x802c 0x1476 + 0x8030 0x3DFF82D0 + 0x8034 0x1466 + 0x8038 0x2FFF82C8 + 0x803c 0x1466 + 0x8040 0x3FF78022 + 0x8044 0x1466 + 0x8048 0x3FBF8022 + 0x804c 0x148E + 0x8050 0x80001EE6 + 0x8054 0x10224B00 + 0x8058 0x20630031 + 0x805C 0x7F605000 + 0x8060 0x00 + 0x8064 0x00A70000 + 0x8068 0x00 + 0x806C 0x26002600 + 0x8070 0x00010000 + 0x8074 0x10224D00 + 0x8078 0x20630031 + 0x807c 0x543C5000 + 0x8080 0x00 + 0x8084 0x00AD0000 + 0x8088 0x00 + 0x808c 0x00 + 0x8090 0x10000 + 0x8094 0x10222800 + 0x8098 0x20630031 + 0x809c 0x54AC5000 + 0x80a0 0x00 + 0x80a4 0x00 + 0x80a8 0x00 + 0x80ac 0x00 + 0x80b0 0x20000 + 0x80b4 0x10527E00 + 0x80b8 0x20630031 + 0x80bc 0x54AC5300 + 0x80c0 0x00 + 0x80c4 0x00 + 0x80c8 0x00 + 0x80cc 0x00 + 0x80d0 0x00 + 0x80d4 0x10527E00 + 0x80d8 0x20630031 + 0x80dc 0x54AC5300 + 0x80e0 0x00 + 0x80e4 0x00 + 0x80e8 0x00 + 0x80ec 0x00 + 0x80f0 0x00 + 0x80f4 0x10162800 + 0x80f8 0x20400031 + 0x80fc 0x54AC5300 + 0x8100 0x00 + 0x8104 0x00 + 0x8108 0x00 + 0x810c 0x00 + 0x8110 0x00 + 0x8124 0x4000013 + 0x8128 0x4000004 + 0x812c 0x00 + 0x8130 0x00 + 0x8134 0x00 + 0x8138 0x00 + 0x813c 0x00 + 0x8140 0x00 + 0x8144 0x00 + 0x8148 0x00 + 0x814c 0x00 + 0x81a4 0x01C40010>; + status = "ok"; + }; +}; + /* &soc{ mtp_batterydata: qcom,battery-data {