--- /dev/null
+/*
+ * 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>;
+ };
+};
/* 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;
*****************************************************/
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__);
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;
}
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;