All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ye Xiang <xiang.ye@intel.com>
To: jikos@kernel.org, jic23@kernel.org, srinivas.pandruvada@linux.intel.com
Cc: linux-input@vger.kernel.org, linux-iio@vger.kernel.org,
	linux-kernel@vger.kernel.org, Ye Xiang <xiang.ye@intel.com>
Subject: [PATCH v3 1/6] iio: hid-sensor-accel-3d: Add timestamp channel for gravity sensor
Date: Tue,  5 Jan 2021 15:21:58 +0800	[thread overview]
Message-ID: <20210105072203.5701-2-xiang.ye@intel.com> (raw)
In-Reply-To: <20210105072203.5701-1-xiang.ye@intel.com>

The accel_3d sensor already has a timestamp channel, this patch just
replicate that for gravity sensor.

Signed-off-by: Ye Xiang <xiang.ye@intel.com>
---
 drivers/iio/accel/hid-sensor-accel-3d.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/accel/hid-sensor-accel-3d.c b/drivers/iio/accel/hid-sensor-accel-3d.c
index 589b7d8a36f2..7cd3cd81b1a7 100644
--- a/drivers/iio/accel/hid-sensor-accel-3d.c
+++ b/drivers/iio/accel/hid-sensor-accel-3d.c
@@ -23,6 +23,7 @@ enum accel_3d_channel {
 	ACCEL_3D_CHANNEL_MAX,
 };
 
+#define CHANNEL_SCAN_INDEX_TIMESTAMP ACCEL_3D_CHANNEL_MAX
 struct accel_3d_state {
 	struct hid_sensor_hub_callbacks callbacks;
 	struct hid_sensor_common common_attributes;
@@ -82,7 +83,7 @@ static const struct iio_chan_spec accel_3d_channels[] = {
 		BIT(IIO_CHAN_INFO_HYSTERESIS),
 		.scan_index = CHANNEL_SCAN_INDEX_Z,
 	},
-	IIO_CHAN_SOFT_TIMESTAMP(3)
+	IIO_CHAN_SOFT_TIMESTAMP(CHANNEL_SCAN_INDEX_TIMESTAMP)
 };
 
 /* Channel definitions */
@@ -117,7 +118,8 @@ static const struct iio_chan_spec gravity_channels[] = {
 		BIT(IIO_CHAN_INFO_SAMP_FREQ) |
 		BIT(IIO_CHAN_INFO_HYSTERESIS),
 		.scan_index = CHANNEL_SCAN_INDEX_Z,
-	}
+	},
+	IIO_CHAN_SOFT_TIMESTAMP(CHANNEL_SCAN_INDEX_TIMESTAMP),
 };
 
 /* Adjust channel real bits based on report descriptor */
-- 
2.17.1


  reply	other threads:[~2021-01-05  7:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-05  7:21 [PATCH v3 0/6] add timestamp channel for hid-sensors Ye Xiang
2021-01-05  7:21 ` Ye Xiang [this message]
2021-01-05  7:21 ` [PATCH v3 2/6] iio: hid-sensor-gyro-3d: Add timestamp channel Ye Xiang
2021-01-05  7:22 ` [PATCH v3 3/6] iio: hid-sensor-als: " Ye Xiang
2021-01-05  7:22 ` [PATCH v3 4/6] iio: hid-sensor-magn-3d: " Ye Xiang
2021-01-05  7:22 ` [PATCH v3 5/6] iio: hid-sensor-incl-3d: " Ye Xiang
2021-01-05  7:22 ` [PATCH v3 6/6] iio: hid-sensor-rotation: " Ye Xiang
2021-01-05  8:53 ` [PATCH v3 0/6] add timestamp channel for hid-sensors Srinivas Pandruvada
2021-01-05  9:26   ` Ye, Xiang
2021-01-09 19:28     ` Jonathan Cameron
2021-01-10  7:11       ` Ye, Xiang

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=20210105072203.5701-2-xiang.ye@intel.com \
    --to=xiang.ye@intel.com \
    --cc=jic23@kernel.org \
    --cc=jikos@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=srinivas.pandruvada@linux.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.