All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
To: Song Hongyan <hongyan.song@intel.com>
Cc: linux-input@vger.kernel.org, linux-iio@vger.kernel.org,
	jikos@kernel.org, jic23@kernel.org,
	srinivas.pandruvada@intel.com
Subject: Re: [PATCH 1/2] iio: Add support for linear accel
Date: Tue, 3 Jan 2017 08:22:59 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.02.1701030821450.18919@pmeerw.net> (raw)
In-Reply-To: <1483456430-6980-1-git-send-email-hongyan.song@intel.com>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 3456 bytes --]


> Add new channel types support for linear accel sensor.
> 
> Linear acceleration differs from a standard accelerometor,
> its value depends on standard accel sensor and gravity sensor.
> Conceptually, this three sensors have following relationship:
> linear acceleration = acceleration - acceleration due to gravity
> 
> At rest, standard accelerometer displays 1g due to earth’s
> gravitational pull while a liner accelerometer will show 0g.

comment below
 
> More information can be found in:
> http://www.usb.org/developers/hidpage/HUTRR59_-_Usages_for_Wearables.pdf
> 
> Signed-off-by: Song Hongyan <hongyan.song@intel.com>
> ---
>  Documentation/ABI/testing/sysfs-bus-iio | 10 ++++++++++
>  drivers/iio/industrialio-core.c         |  1 +
>  include/uapi/linux/iio/types.h          |  1 +
>  tools/iio/iio_event_monitor.c           |  2 ++
>  4 files changed, 14 insertions(+)
> 
> diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio
> index 60b7406..8091f3d 100644
> --- a/Documentation/ABI/testing/sysfs-bus-iio
> +++ b/Documentation/ABI/testing/sysfs-bus-iio
> @@ -170,6 +170,16 @@ Description:
>  		Has all of the equivalent parameters as per voltageY. Units
>  		after application of scale and offset are m/s^2.
>  
> +What:		/sys/bus/iio/devices/iio:deviceX/in_linear_accel_x_raw
> +What:		/sys/bus/iio/devices/iio:deviceX/in_linear_accel_y_raw
> +What:		/sys/bus/iio/devices/iio:deviceX/in_linear_accel_z_raw

I think this would be in_linearaccel_x_raw, etc.?

> +KernelVersion:	4.11
> +Contact:	linux-iio@vger.kernel.org
> +Description:
> +		Linear Acceleration in direction x, y or z (may be arbitrarily assigned
> +		but should match other such assignments on device).
> +		Has all of the equivalent parameters as per voltageY. Units
> +		after application of scale and offset are m/s^2.
>  
>  What:		/sys/bus/iio/devices/iio:deviceX/in_gravity_x_raw
>  What:		/sys/bus/iio/devices/iio:deviceX/in_gravity_y_raw
> diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
> index 72fc96a..da78c26 100644
> --- a/drivers/iio/industrialio-core.c
> +++ b/drivers/iio/industrialio-core.c
> @@ -82,6 +82,7 @@ struct bus_type iio_bus_type = {
>  	[IIO_UVINDEX] = "uvindex",
>  	[IIO_ELECTRICALCONDUCTIVITY] = "electricalconductivity",
>  	[IIO_GRAVITY]  = "gravity",
> +	[IIO_LINEAR_ACCEL] = "linearaccel",
>  };
>  
>  static const char * const iio_modifier_names[] = {
> diff --git a/include/uapi/linux/iio/types.h b/include/uapi/linux/iio/types.h
> index d3f7ba7..d6df101 100644
> --- a/include/uapi/linux/iio/types.h
> +++ b/include/uapi/linux/iio/types.h
> @@ -41,6 +41,7 @@ enum iio_chan_type {
>  	IIO_UVINDEX,
>  	IIO_ELECTRICALCONDUCTIVITY,
>  	IIO_GRAVITY,
> +	IIO_LINEAR_ACCEL,
>  };
>  
>  enum iio_modifier {
> diff --git a/tools/iio/iio_event_monitor.c b/tools/iio/iio_event_monitor.c
> index b61245e..116644a 100644
> --- a/tools/iio/iio_event_monitor.c
> +++ b/tools/iio/iio_event_monitor.c
> @@ -58,6 +58,7 @@
>  	[IIO_PH] = "ph",
>  	[IIO_UVINDEX] = "uvindex",
>  	[IIO_GRAVITY] = "gravity",
> +	[IIO_LINEAR_ACCEL] = "linearaccel",
>  };
>  
>  static const char * const iio_ev_type_text[] = {
> @@ -151,6 +152,7 @@ static bool event_is_known(struct iio_event_data *event)
>  	case IIO_PH:
>  	case IIO_UVINDEX:
>  	case IIO_GRAVITY:
> +	case IIO_LINEAR_ACCEL:
>  		break;
>  	default:
>  		return false;
> 

-- 

Peter Meerwald-Stadler
+43-664-2444418 (mobile)

  reply	other threads:[~2017-01-03  7:23 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-03 15:13 [PATCH 1/2] iio: Add support for linear accel Song Hongyan
2017-01-03 15:13 ` Song Hongyan
2017-01-03  7:22 ` Peter Meerwald-Stadler [this message]
2017-01-03  7:47   ` Song, Hongyan
2017-01-03  7:47     ` Song, Hongyan
     [not found]     ` <AE3E3DFA698D6144A7445C92D1D41E2F10BDBD57-0J0gbvR4kTggGBtAFL8yw7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2017-01-03  8:04       ` Peter Meerwald-Stadler
2017-01-03  8:04         ` Peter Meerwald-Stadler
2017-01-03  9:49         ` Lars-Peter Clausen
     [not found]           ` <be267c7a-9ec3-d86e-2a32-2faef3e0650f-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
2017-01-04  2:28             ` Song, Hongyan
2017-01-04  2:28               ` Song, Hongyan
     [not found] ` <1483456430-6980-1-git-send-email-hongyan.song-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2017-01-03 15:13   ` [PATCH 2/2] iio: Add linear accel sensor hid support Song Hongyan
2017-01-03 15:13     ` Song Hongyan

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=alpine.DEB.2.02.1701030821450.18919@pmeerw.net \
    --to=pmeerw@pmeerw.net \
    --cc=hongyan.song@intel.com \
    --cc=jic23@kernel.org \
    --cc=jikos@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-input@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.