public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iio: cros_ec: Add kernel-doc for cros_ec_sensors_read_lpc
@ 2019-03-13 11:40 Enric Balletbo i Serra
  2019-03-16 16:12 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Enric Balletbo i Serra @ 2019-03-13 11:40 UTC (permalink / raw)
  To: Jonathan Cameron, linux-iio, linux-kernel
  Cc: Gwendal Grignou, Peter Meerwald-Stadler, Guenter Roeck,
	Benson Leung, Lars-Peter Clausen, kernel, Hartmut Knaack,
	Wolfram Sang

From: Gwendal Grignou <gwendal@chromium.org>

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>
---

 .../iio/common/cros_ec_sensors/cros_ec_sensors_core.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

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)
 {
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] iio: cros_ec: Add kernel-doc for cros_ec_sensors_read_lpc
  2019-03-13 11:40 [PATCH] iio: cros_ec: Add kernel-doc for cros_ec_sensors_read_lpc Enric Balletbo i Serra
@ 2019-03-16 16:12 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2019-03-16 16:12 UTC (permalink / raw)
  To: Enric Balletbo i Serra
  Cc: linux-iio, linux-kernel, Gwendal Grignou, Peter Meerwald-Stadler,
	Guenter Roeck, Benson Leung, Lars-Peter Clausen, kernel,
	Hartmut Knaack, Wolfram Sang

On Wed, 13 Mar 2019 12:40:50 +0100
Enric Balletbo i Serra <enric.balletbo@collabora.com> wrote:

> From: Gwendal Grignou <gwendal@chromium.org>
> 
> 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>
Applied,

Thanks

Jonathan

> ---
> 
>  .../iio/common/cros_ec_sensors/cros_ec_sensors_core.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> 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)
>  {


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-03-16 16:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-13 11:40 [PATCH] iio: cros_ec: Add kernel-doc for cros_ec_sensors_read_lpc Enric Balletbo i Serra
2019-03-16 16:12 ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox