From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752137AbdI0Qaj (ORCPT ); Wed, 27 Sep 2017 12:30:39 -0400 Received: from merlin.infradead.org ([205.233.59.134]:44446 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751692AbdI0Qah (ORCPT ); Wed, 27 Sep 2017 12:30:37 -0400 Subject: Re: [PATCH v2 3/4] platform/chrome: Add cros_ec_accel_legacy driver To: Thierry Escande , Benson Leung , Jonathan Cameron Cc: Enric Balletbo i Serra , Gwendal Grignou , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org References: <1506529379-8941-1-git-send-email-thierry.escande@collabora.com> <1506529379-8941-4-git-send-email-thierry.escande@collabora.com> From: Randy Dunlap Message-ID: <52bc724f-a615-f334-2359-47e040cef0fb@infradead.org> Date: Wed, 27 Sep 2017 09:30:32 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <1506529379-8941-4-git-send-email-thierry.escande@collabora.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/27/17 09:22, Thierry Escande wrote: > From: Gwendal Grignou > > diff --git a/drivers/iio/accel/cros_ec_accel_legacy.c b/drivers/iio/accel/cros_ec_accel_legacy.c > new file mode 100644 > index 0000000..3fc8185 > --- /dev/null > +++ b/drivers/iio/accel/cros_ec_accel_legacy.c Please use proper kernel-doc notation (or don't use /** to indicate kernel-doc). > +/** > + * read_ec_until_not_busy - read from EC status byte until it reads not busy. > + * > + * @st Pointer to state information for device. > + * @return 8-bit status if ok, -ve on error > + */ > +static int read_ec_until_not_busy(struct cros_ec_accel_legacy_state *st) > +{ ... > +} > +/** > + * read_ec_accel_data_unsafe - read acceleration data from EC shared memory. > + * > + * @st Pointer to state information for device. > + * @scan_mask Bitmap of the sensor indices to scan. > + * @data Location to store data. > + * > + * Note this is the unsafe function for reading the EC data. It does not > + * guarantee that the EC will not modify the data as it is being read in. > + */ > +static void read_ec_accel_data_unsafe(struct cros_ec_accel_legacy_state *st, > + unsigned long scan_mask, s16 *data) > +{ ... > +} > + > +/** > + * read_ec_accel_data - read acceleration data from EC shared memory. > + * > + * @st Pointer to state information for device. > + * @scan_mask Bitmap of the sensor indices to scan. > + * @data Location to store data. > + * @return 0 if ok, -ve on error > + * > + * 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. > + */ > +static int read_ec_accel_data(struct cros_ec_accel_legacy_state *st, > + unsigned long scan_mask, s16 *data) > +{ ... > +} > + > +/** > + * accel_capture - the trigger handler function > + * This one is closer, but the function name is shortened. > + * @irq: the interrupt number > + * @p: private data - always a pointer to the poll func. > + * > + * 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. > + */ > +static irqreturn_t cros_ec_accel_legacy_capture(int irq, void *p) > +{ Thanks. -- ~Randy