Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp14447810pxu; Tue, 5 Jan 2021 01:37:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJwYil3iaUJVBqVb5cR2QnBnJsilZTfJHx4NBq5AzQIP4Ri/CVRsg8RF5gRVfpOYzHA49xYB X-Received: by 2002:a05:6402:1748:: with SMTP id v8mr21019699edx.136.1609839438850; Tue, 05 Jan 2021 01:37:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609839438; cv=none; d=google.com; s=arc-20160816; b=PmAXal+wRe0JyvETFdEZGef6soZ1iN5spSLyNAfQM2mFZDD8DyAoWkiKz2Ss6Br1M2 srb+dZtItQ6Rj32gkxsV6mwuMikdJwziFSHhwelYGdG5ObWiArqmlRXCLbRyY0EDC1DA a+VdrOFpvmnOmVF3tfz9EaIf6HfnEYDgpQG80JZo9OJGw8x4CFaJ9zKTmQBOVvsYJLJj AGBb66TS9arKwtUDWXbizlO068W064hQDf/aIB9TQV3XQH72cCbR6zLwegxGsOrC06iU nZnGpgI9nXG4gXUVzQfAupAWc3PDwewLoh7VYo1+W6tc3KrNVuzxzVxfjo1FBzOG4F3f 9oyQ== 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=lTMe78NocrqMtwWtb/5vWzzjIjYiZKpe8hAkN2j1JtANMDd+2G3QTBOs8/Z7MS7GC1 2cRQrtaqn2e2+Ilt2OSs+prjvyE97tubj+b54sHD1HHkRCGBmHD4pBWG2Qdiihp98TIv rlZ2CNHBJJ7L1tsbDygfy2JPyDayaySxl6b+hJF08AouPRS3fPOyxjK9dxm3OkNYq8K7 KeYFloWVTGOMAu5Ljx/0xLDqri1GDxLarGD0DRmOMHCAT8o0q3t2wjYVmTfr3a4MwcNY RpQhI6/WVZm548FM3KyGkyqYwIpK0vh7gm2ssJr3IhFZ6Qtdhx3++WJ9ezxiC5CHMeg4 NxMw== 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 k1si33883236eds.84.2021.01.05.01.36.54; Tue, 05 Jan 2021 01:37:18 -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 S1727658AbhAEJen (ORCPT + 99 others); Tue, 5 Jan 2021 04:34:43 -0500 Received: from mga17.intel.com ([192.55.52.151]:51522 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726231AbhAEJem (ORCPT ); Tue, 5 Jan 2021 04:34:42 -0500 IronPort-SDR: gem+i0qZkncvWW0xM1RIlND0cHShobsq19lNzNw3Ee/aaIWRXG+Y+ghTf1+50fqxV+UX3e76Sz Q9KCF++er2HQ== X-IronPort-AV: E=McAfee;i="6000,8403,9854"; a="156864068" X-IronPort-AV: E=Sophos;i="5.78,476,1599548400"; d="scan'208";a="156864068" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jan 2021 01:34:02 -0800 IronPort-SDR: 7gsOjnO5t+VBBJTo98uZ+gVwOtAt5Zgosw90lqIoFWmtRby76WQzTrDQfwp99gxHEqXbDofP2e 1CpPirsqtcaA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,476,1599548400"; d="scan'208";a="569665139" Received: from host.sh.intel.com ([10.239.154.115]) by fmsmga005.fm.intel.com with ESMTP; 05 Jan 2021 01:34:00 -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 1/6] iio: hid-sensor-accel-3d: Add timestamp channel for gravity sensor Date: Tue, 5 Jan 2021 17:35:10 +0800 Message-Id: <20210105093515.19135-2-xiang.ye@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210105093515.19135-1-xiang.ye@intel.com> References: <20210105093515.19135-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