* [PATCH,] IIO: Add additional modifier names @ 2012-05-31 23:51 srinivas pandruvada 2012-06-06 9:17 ` Jonathan Cameron 0 siblings, 1 reply; 4+ messages in thread From: srinivas pandruvada @ 2012-05-31 23:51 UTC (permalink / raw) To: linux-iio; +Cc: srinivas pandruvada 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> --- 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 */ -- 1.7.7.6 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH,] IIO: Add additional modifier names 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 0 siblings, 1 reply; 4+ messages in thread From: Jonathan Cameron @ 2012-06-06 9:17 UTC (permalink / raw) To: srinivas pandruvada; +Cc: linux-iio 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 */ ^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH,] IIO: Add additional modifier names 2012-06-06 9:17 ` Jonathan Cameron @ 2012-06-06 15:04 ` Pandruvada, Srinivas 2012-06-06 15:35 ` Jonathan Cameron 0 siblings, 1 reply; 4+ messages in thread From: Pandruvada, Srinivas @ 2012-06-06 15:04 UTC (permalink / raw) To: Jonathan Cameron; +Cc: linux-iio@vger.kernel.org I am going to submit a series of patches for HID sensors, mostly targeted t= owards 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 .=20 I can change to more explicit names as you suggested. Let me know if you wa= nt me to submit patch for this. Thanks, Srinivas -----Original Message----- From: Jonathan Cameron [mailto:jic23@cam.ac.uk]=20 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.=20 > 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] =3D "x&y&z", [I= IO_MOD_X_OR_Y_OR_Z] =3D "x|y|z", It costs a small amount of effort in escape characters, but gives a much mo= re meaningful naming to the resulting attributes. They aren't there in the core code because nothing using chan_spec based re= gistration was using these (they were needed for modifiers of rather obscur= e 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=20 > 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[] =3D { > [IIO_MOD_Z] =3D "z", > [IIO_MOD_LIGHT_BOTH] =3D "both", > [IIO_MOD_LIGHT_IR] =3D "ir", > + [IIO_MOD_X_AND_Y] =3D "xy", > + [IIO_MOD_X_AND_Z] =3D "xz", > + [IIO_MOD_Y_AND_Z] =3D "yz", > + [IIO_MOD_X_AND_Y_AND_Z] =3D "xyz", > + [IIO_MOD_X_OR_Y] =3D "x_y", > + [IIO_MOD_X_OR_Z] =3D "x_z", > + [IIO_MOD_Y_OR_Z] =3D "y_z", > + [IIO_MOD_X_OR_Y_OR_Z] =3D "x_y_z", > }; > > /* relies on pairs of these shared then separate */ ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH,] IIO: Add additional modifier names 2012-06-06 15:04 ` Pandruvada, Srinivas @ 2012-06-06 15:35 ` Jonathan Cameron 0 siblings, 0 replies; 4+ messages in thread From: Jonathan Cameron @ 2012-06-06 15:35 UTC (permalink / raw) To: Pandruvada, Srinivas; +Cc: linux-iio@vger.kernel.org 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 */ > ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-06-06 15:35 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 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 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).