Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp14385221pxu; Mon, 4 Jan 2021 23:23:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJza5uTNJT4eBjmQ06pmeM+MwaUhJfhLIxxVKPJBJrRmbqdtS9C7Q4z6MIizHoQztNsuWo7W X-Received: by 2002:a17:906:d782:: with SMTP id pj2mr70388962ejb.387.1609831411308; Mon, 04 Jan 2021 23:23:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609831411; cv=none; d=google.com; s=arc-20160816; b=WG46eBaWpG8FLGyCOUOGctt6HMg+fz13VCmL0kl79ax+W6XU6CVAQvitcwtEm9E404 2u1E2X4A9aZMO4ZNIhxxbfaqS+ujtOK37sgdHLBZ0wU4bC4RyF9NGMzs2ye44SwedhwI BARifGkUUbEfe+k+TRLxs4I4Yaooe+iYRqfKzpu5DTZ+A8By9Az5BppbRbG7qvH31u3B hYoTlE/Bf/1TRdwJR3e0A7M0w5c/+BlcreOOMTsnLxu3plmG8ksc3dzscxzeOS5Jq/hW SgJ+sg66T1w5O1DfFE1jrvXw7Q92R1IAT3i3slaQ/lE7Ovi5gsr23xGojILluf1c5R7r Wpyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:ironport-sdr:ironport-sdr; bh=9ytSY7qiNvRpeP8bP3DNRnn7dSMxwmeNTYAoFZL5XaM=; b=Gff66AymNI6trK2ua2IOF/k26CVh3cVvyqDI61+UJW8CRmYsbc1XpVpC6XFogGzFRV dKrgOOx2bccz5w+Hl0IgWl51DpLYuOz4UPoXga2VaZ7rus+R0oe2Ax91i5EUJknj/a9d manop+WABjIihak+VZ4mb30VChE8T91bFf9Ifwiw7QVPg/xkI1pkw2UUFtDFPTiwStuO NfUWj/CnwZf8CoZ7EG8c153/OBw2wLpRwmn1C/P+m/PE2bWyEyXah9fml8rCUugzSOE6 WWBKMubxRVfVxYfWuc+my2/wY88ibP2XPyh+t93k9hwUWUa5U1opXRLQqLAZg4AWKVba tB9g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jp19si28590992ejb.465.2021.01.04.23.23.08; Mon, 04 Jan 2021 23:23:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726610AbhAEHVd (ORCPT + 99 others); Tue, 5 Jan 2021 02:21:33 -0500 Received: from mga05.intel.com ([192.55.52.43]:63492 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725730AbhAEHVd (ORCPT ); Tue, 5 Jan 2021 02:21:33 -0500 IronPort-SDR: aIe4/4P4BQ2ndjn7r7iy5qCwm4jFRY3RmVYGMW8j17VkxfG/AJn2SwK4HPEnPkC39SeNNlRCzv K7VDwMh0+4Dg== X-IronPort-AV: E=McAfee;i="6000,8403,9854"; a="261829289" X-IronPort-AV: E=Sophos;i="5.78,476,1599548400"; d="scan'208";a="261829289" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jan 2021 23:20:52 -0800 IronPort-SDR: wULKyfAhpfLj9SdQB+4ol+bbQneA9FKzDngRyZ4mJz6OIPPqtnmgADNkIIg1hXTXq0ZyjNTq5M twyQ7GwyQKTA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,476,1599548400"; d="scan'208";a="350260555" Received: from host.sh.intel.com ([10.239.154.115]) by fmsmga008.fm.intel.com with ESMTP; 04 Jan 2021 23:20:49 -0800 From: Ye Xiang 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 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 Message-Id: <20210105072203.5701-2-xiang.ye@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210105072203.5701-1-xiang.ye@intel.com> References: <20210105072203.5701-1-xiang.ye@intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The accel_3d sensor already has a timestamp channel, this patch just replicate that for gravity sensor. Signed-off-by: Ye Xiang --- 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