From: Jonathan Cameron <jic23@cam.ac.uk>
To: "Pandruvada, Srinivas" <srinivas.pandruvada@intel.com>
Cc: "linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>
Subject: Re: [PATCH,] IIO: Add additional modifier names
Date: Wed, 06 Jun 2012 16:35:03 +0100 [thread overview]
Message-ID: <4FCF78A7.3040606@cam.ac.uk> (raw)
In-Reply-To: <4FA419E87744DF4DAECD5BCE1214B7A91931B3ED@ORSMSX104.amr.corp.intel.com>
On 6/6/2012 4:04 PM, Pandruvada, Srinivas wrote:
>
> I am going to submit a series of patches for HID sensors, mostly targeted towards slates and tablets. For Accelerometer/Gyro/Magnetometer, I am using
> IIO_MOD_X_AND_Y_AND_Z for sending x, y and z sample in one report. So user space like Android can get all three values together .
That really isn't the intent with those. If you want to send reports
coherently in one go, the buffered interface is the way to go.
Basically doing it the way you are going for does not generalize well
which makes for a nightmare in the long run...
>
> I can change to more explicit names as you suggested. Let me know if you want me to submit patch for this.
>
> Thanks,
> Srinivas
>
> -----Original Message-----
> From: Jonathan Cameron [mailto:jic23@cam.ac.uk]
> Sent: Wednesday, June 06, 2012 2:17 AM
> To: Pandruvada, Srinivas
> Cc: linux-iio@vger.kernel.org
> Subject: Re: [PATCH,] IIO: Add additional modifier names
>
> On 6/1/2012 12:51 AM, srinivas pandruvada wrote:
>> Added additional modifier names in the list for the supported types.
>> Otherwise it substitutes (null) in the filename.
>>
>> Signed-off-by: srinivas pandruvada<srinivas.pandruvada@intel.com>
>
> When we originally introducted the concept of these, the intent was to have rather more explicit naming. Hence [IIO_MOD_X_AND_Y_AND_Z] = "x&y&z", [IIO_MOD_X_OR_Y_OR_Z] = "x|y|z",
>
> It costs a small amount of effort in escape characters, but gives a much more meaningful naming to the resulting attributes.
>
> They aren't there in the core code because nothing using chan_spec based registration was using these (they were needed for modifiers of rather obscure events). What have you actually needed them for?
>
>
> Jonathan
>> ---
>> drivers/staging/iio/industrialio-core.c | 8 ++++++++
>> 1 files changed, 8 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/staging/iio/industrialio-core.c
>> b/drivers/staging/iio/industrialio-core.c
>> index d303bfb..65d40ce 100644
>> --- a/drivers/staging/iio/industrialio-core.c
>> +++ b/drivers/staging/iio/industrialio-core.c
>> @@ -76,6 +76,14 @@ static const char * const iio_modifier_names[] = {
>> [IIO_MOD_Z] = "z",
>> [IIO_MOD_LIGHT_BOTH] = "both",
>> [IIO_MOD_LIGHT_IR] = "ir",
>> + [IIO_MOD_X_AND_Y] = "xy",
>> + [IIO_MOD_X_AND_Z] = "xz",
>> + [IIO_MOD_Y_AND_Z] = "yz",
>> + [IIO_MOD_X_AND_Y_AND_Z] = "xyz",
>> + [IIO_MOD_X_OR_Y] = "x_y",
>> + [IIO_MOD_X_OR_Z] = "x_z",
>> + [IIO_MOD_Y_OR_Z] = "y_z",
>> + [IIO_MOD_X_OR_Y_OR_Z] = "x_y_z",
>> };
>>
>> /* relies on pairs of these shared then separate */
>
prev parent reply other threads:[~2012-06-06 15:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-31 23:51 [PATCH,] IIO: Add additional modifier names srinivas pandruvada
2012-06-06 9:17 ` Jonathan Cameron
2012-06-06 15:04 ` Pandruvada, Srinivas
2012-06-06 15:35 ` Jonathan Cameron [this message]
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=4FCF78A7.3040606@cam.ac.uk \
--to=jic23@cam.ac.uk \
--cc=linux-iio@vger.kernel.org \
--cc=srinivas.pandruvada@intel.com \
/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;
as well as URLs for NNTP newsgroup(s).