Ignore stop command in sequence playback.
authorTracy Yi <tracy-yi@ti.com>
Tue, 26 Mar 2019 08:20:51 +0000 (16:20 +0800)
committerTracy Yi <tracy-yi@ti.com>
Tue, 26 Mar 2019 08:20:51 +0000 (16:20 +0800)
Signed-off-by: Tracy Yi <tracy-yi@ti.com>
drv2624.c

index 07fc7c715b6c9278501bf75bba504dfbd1385cee..d78aabbc2092e782bd46ced1e789c4c57470cabb 100755 (executable)
--- a/drv2624.c
+++ b/drv2624.c
@@ -321,7 +321,18 @@ end:
 
 static int drv2624_stop(struct drv2624_data *pDRV2624)
 {
-       int nResult = 0;
+       int nResult = 0, mode = 0;
+
+       nResult = drv2624_reg_read(pDRV2624, DRV2624_REG_MODE);
+       if (nResult < 0)
+               goto err;
+
+       mode =  nResult & WORKMODE_MASK;
+       if (mode == MODE_WAVEFORM_SEQUENCER)
+       {
+               dev_dbg(pDRV2624->dev, "In sequence play, ignore stop\n");
+               return 0;
+       }
 
        if (pDRV2624->mnVibratorPlaying == YES) {
                dev_dbg(pDRV2624->dev, "%s\n", __func__);