<snip>
+       chip->suspended = true;
+
+       mutex_unlock(&chip->lock);
+       return 0;
+}
+
+static int cm3218_resume(struct device *dev)
+{
+       struct iio_dev *indio_dev = dev_get_drvdata(dev);
+       struct cm3218_chip *chip = iio_priv(indio_dev);
+       struct i2c_client *client = chip->client;
+       int err;
+
+       mutex_lock(&chip->lock);
+
+       err = cm3218_chip_init(client);
We do a reinit every time is there a way to know if the context was lost?
 
+       if (!err)
+               chip->suspended = false;
+
+       mutex_unlock(&chip->lock);
+       return err;
+}
+

--
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html