tro(CR): vib update voltage
authordengwei1 <dengwei1@motorola.com>
Fri, 26 Apr 2019 06:01:26 +0000 (14:01 +0800)
committerlingsen1 <lingsen1@lenovo.com>
Sun, 7 Feb 2021 09:37:02 +0000 (17:37 +0800)
per key part, the vib voltage need update
kane need not

Change-Id: I344768b4866a5cd00d393e0035116eef9aa17f84
Signed-off-by: dengwei1 <dengwei1@motorola.com>
Reviewed-on: https://gerrit.mot.com/1343790
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Hua Tan <tanhua1@motorola.com>
Submit-Approved: Jira Key

arch/arm64/boot/dts/exynos/exynos9610-robusta2-motor.dtsi
arch/arm64/boot/dts/exynos/exynos9610-troika-common.dtsi
arch/arm64/boot/dts/exynos/exynos9610-troika-motor.dtsi [new file with mode: 0755]
drivers/misc/aw8695_haptic/aw8695.c
drivers/misc/aw8695_haptic/aw8695.h

index ee10b6cb26a5693d4eb0300b686c0107126217b7..f00e9ed3c9b2c3aa91e9a15a530dec9fea4eb87c 100755 (executable)
@@ -24,5 +24,7 @@
                pinctrl-0 = <&lra_int_status>;
                reset-gpio = <&gpa2 5 0>;
                irq-gpio = <&gpa2 7 0>;
+               aw8695,cont_drv_lvl = <98>;
+               aw8695,cont_drv_lvl_ov = <98>;
        };
 };
index 917d253ce920cd3cb1e11cc1bf6c7674cd6d7c02..e60921e67e9fbb12a36db7e6064aea070d6ebc2f 100644 (file)
@@ -13,4 +13,5 @@
 
 #include "exynos9609-robusta2_common.dtsi"
 #include "exynos9610_troika_battery_data.dtsi"
+#include "exynos9610-troika-motor.dtsi"
 
diff --git a/arch/arm64/boot/dts/exynos/exynos9610-troika-motor.dtsi b/arch/arm64/boot/dts/exynos/exynos9610-troika-motor.dtsi
new file mode 100755 (executable)
index 0000000..089a19f
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * SAMSUNG EXYNOS9820 SoC device tree source
+ *
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ *             http://www.samsung.com
+ *
+ * SAMSUNG EXYNOS9820 SoC device nodes are listed in this file.
+ * EXYNOS9820 based board files can include this file and provide
+ * values for board specfic bindings.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+&hsi2c_6 {
+       status = "okay";
+       samsung,reset-before-trans;
+       clock-frequency = <400000>;
+
+       aw8695_haptic@5A {
+               compatible = "awinic,aw8695_haptic";
+               reg = <0x5A>;
+               pinctrl-names = "lra_int_status";
+               pinctrl-0 = <&lra_int_status>;
+               reset-gpio = <&gpa2 5 0>;
+               irq-gpio = <&gpa2 7 0>;
+               aw8695,cont_drv_lvl = <112>;
+               aw8695,cont_drv_lvl_ov = <112>;
+       };
+};
index aaf81b68a50d495fab89e6e32733edf5fcd160d1..e91bd1b5552265d0c44bf8033ebe96732fb05c5a 100755 (executable)
@@ -1752,8 +1752,9 @@ static int aw8695_haptic_init(struct aw8695 *aw8695)
     /* f0 calibration */
     mutex_lock(&aw8695->lock);
     aw8695->f0_pre = AW8695_HAPTIC_F0_PRE;
-    aw8695->cont_drv_lvl = AW8695_HAPTIC_CONT_DRV_LVL;
-    aw8695->cont_drv_lvl_ov = AW8695_HAPTIC_CONT_DRV_LVL_OV;
+    /*CONT_DRV configed in dtsi, parse_dt will set value, so delete code below*/
+    /*aw8695->cont_drv_lvl = AW8695_HAPTIC_CONT_DRV_LVL;*/
+    /*aw8695->cont_drv_lvl_ov = AW8695_HAPTIC_CONT_DRV_LVL_OV;*/
     aw8695->cont_td = AW8695_HAPTIC_CONT_TD;
     aw8695->cont_zc_thr = AW8695_HAPTIC_CONT_ZC_THR;
     aw8695->cont_num_brk = AW8695_HAPTIC_CONT_NUM_BRK;
@@ -3383,6 +3384,8 @@ static irqreturn_t aw8695_irq(int irq, void *data)
  *****************************************************/
 static int aw8695_parse_dt(struct device *dev, struct aw8695 *aw8695,
         struct device_node *np) {
+    int ret = -1;
+
     aw8695->reset_gpio = of_get_named_gpio(np, "reset-gpio", 0);
     if (aw8695->reset_gpio < 0) {
         dev_err(dev, "%s: no reset gpio provided, will not HW reset device\n", __func__);
@@ -3397,6 +3400,18 @@ static int aw8695_parse_dt(struct device *dev, struct aw8695 *aw8695,
         dev_info(dev, "%s: irq gpio provided ok.\n", __func__);
     }
 
+    ret = of_property_read_u32(np, "aw8695,cont_drv_lvl", &aw8695->cont_drv_lvl);
+    if (0 > ret) {
+        aw8695->cont_drv_lvl = AW8695_HAPTIC_CONT_DRV_LVL;
+        pr_err("%s:get drv_lvl faild %d",__func__, aw8695->cont_drv_lvl);
+    }
+
+    ret = of_property_read_u32(np, "aw8695,cont_drv_lvl_ov", &aw8695->cont_drv_lvl_ov);
+    if (0 > ret) {
+        aw8695->cont_drv_lvl_ov = AW8695_HAPTIC_CONT_DRV_LVL_OV;
+        pr_err("%s:get drv_lvl faild use default=%d",__func__, aw8695->cont_drv_lvl_ov);
+    }
+
     return 0;
 }
 
index 90bb3411109bd293b009a13b60f2e3bc2c0b28e6..8bce6bad8f3ab83fbddb4243f6a0d12a07346ca0 100755 (executable)
@@ -342,8 +342,8 @@ struct aw8695 {
     unsigned int cont_f0;
     unsigned int cont_td;
     unsigned int cont_zc_thr;
-    unsigned char cont_drv_lvl;
-    unsigned char cont_drv_lvl_ov;
+    unsigned int cont_drv_lvl;
+    unsigned int cont_drv_lvl_ov;
     unsigned char cont_num_brk;
     unsigned char max_pos_beme;
     unsigned char max_neg_beme;