Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 71a08fd5 authored by yangfangbiao's avatar yangfangbiao Committed by hecaiqiang
Browse files

Optimize the haptics bin update

Optimize the haptics bin update

Change-Id: Ia3e5d2e6db0f407f022511e8ac793da5c97d2b7a
parent 92230ae0
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -3143,6 +3143,9 @@ static ssize_t aw8697_activate_mode_store(struct device *dev,
    unsigned int val = 0;
    int rc = 0;

    if (!aw8697->ram_init)
       return count;

    rc = kstrtouint(buf, 0, &val);
    if (rc < 0)
        return rc;
@@ -3225,6 +3228,8 @@ static ssize_t aw8697_vmax_store(struct device *dev,
    rc = kstrtouint(buf, 0, &val);
    if (rc < 0)
        return rc;
    if (!aw8697->ram_init)
       return count;

    pr_info("%s: value=%d\n", __FUNCTION__, val);
    mutex_lock(&aw8697->lock);
@@ -3264,7 +3269,8 @@ static ssize_t aw8697_gain_store(struct device *dev,
    rc = kstrtouint(buf, 0, &val);
    if (rc < 0)
        return rc;

    if (!aw8697->ram_init)
       return count;
    pr_info("%s: value=%d\n", __FUNCTION__, val);
    mutex_lock(&aw8697->lock);
    aw8697->gain = val;
@@ -3308,6 +3314,9 @@ static ssize_t aw8697_seq_store(struct device *dev,
#endif
    unsigned int databuf[2] = {0, 0};

    if (!aw8697->ram_init)
       return count;

    if(2 == sscanf(buf, "%x %x", &databuf[0], &databuf[1])) {
        pr_info("%s: seq%d=0x%x\n", __FUNCTION__, databuf[0], databuf[1]);
        mutex_lock(&aw8697->lock);
@@ -3444,6 +3453,9 @@ static ssize_t aw8697_rtp_store(struct device *dev, struct device_attribute *att
    int rc = 0;
    int rtp_is_going_on = 0;

    if (!aw8697->ram_init)
       return count;

    rc = kstrtouint(buf, 0, &val);
    if (rc < 0) {
        pr_info("%s: kstrtouint fail\n", __FUNCTION__);