From: Enric Balletbo i Serra <enric.balletbo@collabora.com>
To: Jonathan Cameron <jic23@kernel.org>,
Gwendal Grignou <gwendal@chromium.org>
Cc: briannorris@chromium.org, knaack.h@gmx.de, lars@metafoo.de,
pmeerw@pmeerw.net, lee.jones@linaro.org, bleung@chromium.org,
dianders@chromium.org, groeck@chromium.org,
fabien.lahoudere@collabora.com, linux-kernel@vger.kernel.org,
linux-iio@vger.kernel.org
Subject: Re: [PATCH v4 12/17] iio: cros_ec: Move function description to .c file
Date: Mon, 11 Nov 2019 10:35:29 +0100 [thread overview]
Message-ID: <9af7416b-d324-8401-5137-d5dcc37277f3@collabora.com> (raw)
In-Reply-To: <20191110130827.12583c30@archlinux>
On 10/11/19 14:08, Jonathan Cameron wrote:
> On Tue, 5 Nov 2019 14:26:47 -0800
> Gwendal Grignou <gwendal@chromium.org> wrote:
>
>> To prevent comment rot, move function description to
>> cros_ec_sensors_core.c.
>>
>> Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
> Thanks for tidying this up.
>
> Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
Acked-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Thanks,
Enric
>> ---
>> No changes in v4.
>> Changes in v3:
>> fix spelling.
>> New in v2.
>>
>> .../cros_ec_sensors/cros_ec_sensors_core.c | 69 ++++++++++++++++
>> .../linux/iio/common/cros_ec_sensors_core.h | 80 -------------------
>> 2 files changed, 69 insertions(+), 80 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 81a7f692de2f..b47da497a3c3 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
>> @@ -83,6 +83,14 @@ static void get_default_min_max_freq(enum motionsensor_type type,
>> }
>> }
>>
>> +/**
>> + * cros_ec_sensors_core_init() - basic initialization of the core structure
>> + * @pdev: platform device created for the sensors
>> + * @indio_dev: iio device structure of the device
>> + * @physical_device: true if the device refers to a physical device
>> + *
>> + * Return: 0 on success, -errno on failure.
>> + */
>> int cros_ec_sensors_core_init(struct platform_device *pdev,
>> struct iio_dev *indio_dev,
>> bool physical_device)
>> @@ -160,6 +168,16 @@ int cros_ec_sensors_core_init(struct platform_device *pdev,
>> }
>> EXPORT_SYMBOL_GPL(cros_ec_sensors_core_init);
>>
>> +/**
>> + * cros_ec_motion_send_host_cmd() - send motion sense host command
>> + * @state: pointer to state information for device
>> + * @opt_length: optional length to reduce the response size, useful on the data
>> + * path. Otherwise, the maximal allowed response size is used
>> + *
>> + * When called, the sub-command is assumed to be set in param->cmd.
>> + *
>> + * Return: 0 on success, -errno on failure.
>> + */
>> int cros_ec_motion_send_host_cmd(struct cros_ec_sensors_core_state *state,
>> u16 opt_length)
>> {
>> @@ -422,6 +440,14 @@ int cros_ec_sensors_read_lpc(struct iio_dev *indio_dev,
>> }
>> EXPORT_SYMBOL_GPL(cros_ec_sensors_read_lpc);
>>
>> +/**
>> + * cros_ec_sensors_read_cmd() - retrieve data using the EC command protocol
>> + * @indio_dev: pointer to IIO device
>> + * @scan_mask: bitmap of the sensor indices to scan
>> + * @data: location to store data
>> + *
>> + * Return: 0 on success, -errno on failure.
>> + */
>> int cros_ec_sensors_read_cmd(struct iio_dev *indio_dev,
>> unsigned long scan_mask, s16 *data)
>> {
>> @@ -446,6 +472,18 @@ int cros_ec_sensors_read_cmd(struct iio_dev *indio_dev,
>> }
>> EXPORT_SYMBOL_GPL(cros_ec_sensors_read_cmd);
>>
>> +/**
>> + * cros_ec_sensors_capture() - the trigger handler function
>> + * @irq: the interrupt number.
>> + * @p: a pointer to the poll function.
>> + *
>> + * On a trigger event occurring, if the pollfunc is attached then this
>> + * handler is called as a threaded interrupt (and hence may sleep). It
>> + * is responsible for grabbing data from the device and pushing it into
>> + * the associated buffer.
>> + *
>> + * Return: IRQ_HANDLED
>> + */
>> irqreturn_t cros_ec_sensors_capture(int irq, void *p)
>> {
>> struct iio_poll_func *pf = p;
>> @@ -481,6 +519,16 @@ irqreturn_t cros_ec_sensors_capture(int irq, void *p)
>> }
>> EXPORT_SYMBOL_GPL(cros_ec_sensors_capture);
>>
>> +/**
>> + * cros_ec_sensors_core_read() - function to request a value from the sensor
>> + * @st: pointer to state information for device
>> + * @chan: channel specification structure table
>> + * @val: will contain one element making up the returned value
>> + * @val2: will contain another element making up the returned value
>> + * @mask: specifies which values to be requested
>> + *
>> + * Return: the type of value returned by the device
>> + */
>> int cros_ec_sensors_core_read(struct cros_ec_sensors_core_state *st,
>> struct iio_chan_spec const *chan,
>> int *val, int *val2, long mask)
>> @@ -521,6 +569,17 @@ int cros_ec_sensors_core_read(struct cros_ec_sensors_core_state *st,
>> }
>> EXPORT_SYMBOL_GPL(cros_ec_sensors_core_read);
>>
>> +/**
>> + * cros_ec_sensors_core_read_avail() - get available values
>> + * @indio_dev: pointer to state information for device
>> + * @chan: channel specification structure table
>> + * @vals: list of available values
>> + * @type: type of data returned
>> + * @length: number of data returned in the array
>> + * @mask: specifies which values to be requested
>> + *
>> + * Return: an error code, IIO_AVAIL_RANGE or IIO_AVAIL_LIST
>> + */
>> int cros_ec_sensors_core_read_avail(struct iio_dev *indio_dev,
>> struct iio_chan_spec const *chan,
>> const int **vals,
>> @@ -542,6 +601,16 @@ int cros_ec_sensors_core_read_avail(struct iio_dev *indio_dev,
>> }
>> EXPORT_SYMBOL_GPL(cros_ec_sensors_core_read_avail);
>>
>> +/**
>> + * cros_ec_sensors_core_write() - function to write a value to the sensor
>> + * @st: pointer to state information for device
>> + * @chan: channel specification structure table
>> + * @val: first part of value to write
>> + * @val2: second part of value to write
>> + * @mask: specifies which values to write
>> + *
>> + * Return: the type of value returned by the device
>> + */
>> int cros_ec_sensors_core_write(struct cros_ec_sensors_core_state *st,
>> struct iio_chan_spec const *chan,
>> int val, int val2, long mask)
>> diff --git a/include/linux/iio/common/cros_ec_sensors_core.h b/include/linux/iio/common/cros_ec_sensors_core.h
>> index bb331e6356a9..0af918978f97 100644
>> --- a/include/linux/iio/common/cros_ec_sensors_core.h
>> +++ b/include/linux/iio/common/cros_ec_sensors_core.h
>> @@ -79,95 +79,25 @@ struct cros_ec_sensors_core_state {
>> int frequencies[3];
>> };
>>
>> -/**
>> - * cros_ec_sensors_read_lpc() - retrieve 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
>> - *
>> - * 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);
>>
>> -/**
>> - * cros_ec_sensors_read_cmd() - retrieve data using the EC command protocol
>> - * @indio_dev: pointer to IIO device
>> - * @scan_mask: bitmap of the sensor indices to scan
>> - * @data: location to store data
>> - *
>> - * Return: 0 on success, -errno on failure.
>> - */
>> int cros_ec_sensors_read_cmd(struct iio_dev *indio_dev, unsigned long scan_mask,
>> s16 *data);
>>
>> struct platform_device;
>> -/**
>> - * cros_ec_sensors_core_init() - basic initialization of the core structure
>> - * @pdev: platform device created for the sensors
>> - * @indio_dev: iio device structure of the device
>> - * @physical_device: true if the device refers to a physical device
>> - *
>> - * Return: 0 on success, -errno on failure.
>> - */
>> int cros_ec_sensors_core_init(struct platform_device *pdev,
>> struct iio_dev *indio_dev, bool physical_device);
>>
>> -/**
>> - * cros_ec_sensors_capture() - the trigger handler function
>> - * @irq: the interrupt number.
>> - * @p: a pointer to the poll function.
>> - *
>> - * On a trigger event occurring, if the pollfunc is attached then this
>> - * handler is called as a threaded interrupt (and hence may sleep). It
>> - * is responsible for grabbing data from the device and pushing it into
>> - * the associated buffer.
>> - *
>> - * Return: IRQ_HANDLED
>> - */
>> irqreturn_t cros_ec_sensors_capture(int irq, void *p);
>>
>> -/**
>> - * cros_ec_motion_send_host_cmd() - send motion sense host command
>> - * @st: pointer to state information for device
>> - * @opt_length: optional length to reduce the response size, useful on the data
>> - * path. Otherwise, the maximal allowed response size is used
>> - *
>> - * When called, the sub-command is assumed to be set in param->cmd.
>> - *
>> - * Return: 0 on success, -errno on failure.
>> - */
>> int cros_ec_motion_send_host_cmd(struct cros_ec_sensors_core_state *st,
>> u16 opt_length);
>>
>> -/**
>> - * cros_ec_sensors_core_read() - function to request a value from the sensor
>> - * @st: pointer to state information for device
>> - * @chan: channel specification structure table
>> - * @val: will contain one element making up the returned value
>> - * @val2: will contain another element making up the returned value
>> - * @mask: specifies which values to be requested
>> - *
>> - * Return: the type of value returned by the device
>> - */
>> int cros_ec_sensors_core_read(struct cros_ec_sensors_core_state *st,
>> struct iio_chan_spec const *chan,
>> int *val, int *val2, long mask);
>>
>> -/**
>> - * cros_ec_sensors_core_read_avail() - get available values
>> - * @indio_dev: pointer to state information for device
>> - * @chan: channel specification structure table
>> - * @vals: list of available values
>> - * @type: type of data returned
>> - * @length: number of data returned in the array
>> - * @mask: specifies which values to be requested
>> - *
>> - * Return: an error code, IIO_AVAIL_RANGE or IIO_AVAIL_LIST
>> - */
>> int cros_ec_sensors_core_read_avail(struct iio_dev *indio_dev,
>> struct iio_chan_spec const *chan,
>> const int **vals,
>> @@ -175,16 +105,6 @@ int cros_ec_sensors_core_read_avail(struct iio_dev *indio_dev,
>> int *length,
>> long mask);
>>
>> -/**
>> - * cros_ec_sensors_core_write() - function to write a value to the sensor
>> - * @st: pointer to state information for device
>> - * @chan: channel specification structure table
>> - * @val: first part of value to write
>> - * @val2: second part of value to write
>> - * @mask: specifies which values to write
>> - *
>> - * Return: the type of value returned by the device
>> - */
>> int cros_ec_sensors_core_write(struct cros_ec_sensors_core_state *st,
>> struct iio_chan_spec const *chan,
>> int val, int val2, long mask);
>
next prev parent reply other threads:[~2019-11-11 9:35 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-05 22:26 [PATCH v4 00/17] cros_ec: Add sensorhub driver and FIFO processing Gwendal Grignou
2019-11-05 22:26 ` [PATCH v4 01/17] mfd: cros_ec: Add sensor_count and make check_features public Gwendal Grignou
2019-11-08 22:03 ` Enric Balletbo Serra
2019-11-11 11:44 ` Lee Jones
2019-11-16 11:49 ` Jonathan Cameron
2019-11-05 22:26 ` [PATCH v4 02/17] platform: cros_ec: Add cros_ec_sensor_hub driver Gwendal Grignou
2019-11-10 12:10 ` Jonathan Cameron
2019-11-11 9:24 ` Enric Balletbo i Serra
2019-11-11 11:55 ` Jonathan Cameron
2019-11-05 22:26 ` [PATCH v4 03/17] platform/mfd:iio: cros_ec: Register sensor through sensorhub Gwendal Grignou
2019-11-10 12:13 ` Jonathan Cameron
2019-11-11 9:25 ` Enric Balletbo i Serra
2019-11-11 11:43 ` Lee Jones
2019-11-05 22:26 ` [PATCH v4 04/17] platform: chrome: cros-ec: record event timestamp in the hard irq Gwendal Grignou
2019-11-10 12:16 ` Jonathan Cameron
2019-11-11 9:27 ` Enric Balletbo i Serra
2019-11-05 22:26 ` [PATCH v4 05/17] platform: chrome: cros_ec: Do not attempt to register a non-positive IRQ number Gwendal Grignou
2019-11-10 12:17 ` Jonathan Cameron
2019-11-11 9:29 ` Enric Balletbo i Serra
2019-11-14 0:58 ` Gwendal Grignou
2019-11-05 22:26 ` [PATCH v4 06/17] platform: chrome: cros_ec: handle MKBP more events flag Gwendal Grignou
2019-11-10 12:28 ` Jonathan Cameron
2019-11-11 9:30 ` Enric Balletbo i Serra
2019-11-05 22:26 ` [PATCH v4 07/17] Revert "Input: cros_ec_keyb - add back missing mask for event_type" Gwendal Grignou
2019-11-11 9:20 ` Enric Balletbo i Serra
2019-11-11 19:23 ` Dmitry Torokhov
2019-11-05 22:26 ` [PATCH v4 08/17] Revert "Input: cros_ec_keyb: mask out extra flags in event_type" Gwendal Grignou
2019-11-11 9:20 ` Enric Balletbo i Serra
2019-11-11 19:23 ` Dmitry Torokhov
2019-11-05 22:26 ` [PATCH v4 09/17] platform: chrome: sensorhub: Add FIFO support Gwendal Grignou
2019-11-06 21:13 ` Gwendal Grignou
2019-11-10 12:54 ` Jonathan Cameron
2019-11-14 1:01 ` Gwendal Grignou
2019-11-05 22:26 ` [PATCH v4 10/17] platform: chrome: sensorhub: Add code to spread timestmap Gwendal Grignou
2019-11-10 12:57 ` Jonathan Cameron
2019-11-05 22:26 ` [PATCH v4 11/17] platform: chrome: sensorhub: Add median filter Gwendal Grignou
2019-11-10 13:07 ` Jonathan Cameron
2019-11-05 22:26 ` [PATCH v4 12/17] iio: cros_ec: Move function description to .c file Gwendal Grignou
2019-11-10 13:08 ` Jonathan Cameron
2019-11-11 9:35 ` Enric Balletbo i Serra [this message]
2019-11-05 22:26 ` [PATCH v4 13/17] iio: cros_ec: Register to cros_ec_sensorhub when EC supports FIFO Gwendal Grignou
2019-11-10 13:17 ` Jonathan Cameron
2019-11-14 18:17 ` Gwendal Grignou
2019-11-05 22:26 ` [PATCH v4 14/17] iio: cros_ec: Remove pm function Gwendal Grignou
2019-11-10 13:18 ` Jonathan Cameron
2019-11-11 9:37 ` Enric Balletbo i Serra
2019-11-05 22:26 ` [PATCH v4 15/17] iio: cros_ec: Expose hwfifo_timeout Gwendal Grignou
2019-11-10 13:21 ` Jonathan Cameron
2019-11-05 22:26 ` [PATCH v4 16/17] iio: cros_ec: Report hwfifo_watermark_max Gwendal Grignou
2019-11-10 13:22 ` Jonathan Cameron
2019-11-05 22:26 ` [PATCH v4 17/17] iio: cros_ec: Use Hertz as unit for sampling frequency Gwendal Grignou
2019-11-10 13:24 ` Jonathan Cameron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9af7416b-d324-8401-5137-d5dcc37277f3@collabora.com \
--to=enric.balletbo@collabora.com \
--cc=bleung@chromium.org \
--cc=briannorris@chromium.org \
--cc=dianders@chromium.org \
--cc=fabien.lahoudere@collabora.com \
--cc=groeck@chromium.org \
--cc=gwendal@chromium.org \
--cc=jic23@kernel.org \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=lee.jones@linaro.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pmeerw@pmeerw.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®