 --- a/drivers/iio/gyro/hid-sensor-gyro-3d.c
 +++ b/drivers/iio/gyro/hid-sensor-gyro-3d.c
 @@ -42,11 +42,13 @@ struct gyro_3d_state {
-	struct hid_sensor_hub_callbacks callbacks;
-	struct hid_sensor_common common_attributes;
-	struct hid_sensor_hub_attribute_info gyro[GYRO_3D_CHANNEL_MAX];
+ 	struct hid_sensor_hub_callbacks callbacks;
+ 	struct hid_sensor_common common_attributes;
+ 	struct hid_sensor_hub_attribute_info gyro[GYRO_3D_CHANNEL_MAX];
 -	u32 gyro_val[GYRO_3D_CHANNEL_MAX];
 +	/* Reserve for 3 channels + padding + timestamp */
 +	u32 gyro_val[GYRO_3D_CHANNEL_MAX + 3];
-	int scale_pre_decml;
-	int scale_post_decml;
-	int scale_precision;
-	int value_offset;
+ 	int scale_pre_decml;
+ 	int scale_post_decml;
+ 	int scale_precision;
+ 	int value_offset;
 +	int64_t timestamp;
  };
 
  static const u32 gyro_3d_addresses[GYRO_3D_CHANNEL_MAX] = {
 @@ -87,7 +89,8 @@ static const struct iio_chan_spec gyro_3d_channels[] = {
-		BIT(IIO_CHAN_INFO_SAMP_FREQ) |
-		BIT(IIO_CHAN_INFO_HYSTERESIS),
-		.scan_index = CHANNEL_SCAN_INDEX_Z,
+ 		BIT(IIO_CHAN_INFO_SAMP_FREQ) |
+ 		BIT(IIO_CHAN_INFO_HYSTERESIS),
+ 		.scan_index = CHANNEL_SCAN_INDEX_Z,
 -	}
 +	},
 +	IIO_CHAN_SOFT_TIMESTAMP(3)

+		gyro_state->timestamp = 0;
+	}

	return 0;
 }
@@ -236,6 +246,10 @@ static int gyro_3d_capture_sample(struct hid_sensor_hub_device *hsdev,
						*(u32 *)raw_data;
		ret = 0;
	break;
+	case HID_USAGE_SENSOR_TIME_TIMESTAMP:
+		gyro_state->timestamp = *(int64_t *)raw_data;
+		ret = 0;
+	break;
	default:
		break;
	}
diff --git a/include/linux/hid-sensor-ids.h b/include/linux/hid-sensor-ids.h
index f2ee90a..9a3a9db 100644
--- a/include/linux/hid-sensor-ids.h

+		if (!accel_state->timestamp)
+			accel_state->timestamp = iio_get_time_ns();
+
+		hid_sensor_push_data(indio_dev,
+				     accel_state->accel_val,
+				     sizeof(accel_state->accel_val),
+				     accel_state->timestamp);
