summaryrefslogtreecommitdiff
path: root/drivers/iio/common/cros_ec_sensors
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2019-03-13 14:40:50 +0300
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2019-04-04 22:19:58 +0300
commitad9cc622f10116046a88181e8c2f7d6a19af7fc0 (patch)
tree4057591935f44b205429f3c33cc96ed9ff604619 /drivers/iio/common/cros_ec_sensors
parentb921d928a31c78b083a34140204f2ad183bcc083 (diff)
downloadlinux-ad9cc622f10116046a88181e8c2f7d6a19af7fc0.tar.xz
iio: cros_ec: Add kernel-doc for cros_ec_sensors_read_lpc
Document cros_ec_sensors_read_lpc, adding an additional note to explain that this is the safe function for reading the EC data. Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/common/cros_ec_sensors')
-rw-r--r--drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c b/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c
index c770a2a809d7..eb7b0edd5da4 100644
--- a/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c
+++ b/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c
@@ -268,6 +268,17 @@ static int cros_ec_sensors_read_data_unsafe(struct iio_dev *indio_dev,
return 0;
}
+/**
+ * cros_ec_sensors_read_lpc() - read acceleration data from EC shared memory.
+ * @indio_dev: pointer to IIO device.
+ * @scan_mask: bitmap of the sensor indices to scan.
+ * @data: location to store data.
+ *
+ * Note: this is the safe function for reading the EC data. It guarantees
+ * that the data sampled was not modified by the EC while being read.
+ *
+ * Return: 0 on success, -errno on failure.
+ */
int cros_ec_sensors_read_lpc(struct iio_dev *indio_dev,
unsigned long scan_mask, s16 *data)
{