Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3176812pxb; Sun, 31 Jan 2021 06:55:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJzc8mIZCG+rk7zv+WSPZECebXWF79qTLeBGI0I2XLWOibYHj293g5dlg9m6U9HlCSV/IcCV X-Received: by 2002:aa7:db49:: with SMTP id n9mr14733778edt.73.1612104948622; Sun, 31 Jan 2021 06:55:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612104948; cv=none; d=google.com; s=arc-20160816; b=NTOP7f1DlivvAXe6e6kvjIOXu63HeceXEwSgILDb+szwJ6BrL0T9972Y5xoKqLgJLQ gOZ0eYuCbzcoDFJmmnKbQ2pBSPWf2hgXVRwthgL2eMj8D/laMTnM53Xwb82yve6YZD13 VS8TQb/CsjucMVWupYBmDjIeVMiLP8ulor9gU1wt8p43aZgDne49YFtvyT7hjNPexSm2 9S4c7gDhMx6+1oU0UYaW4xjlADteW8jzYUix/DLjvT0Ldw1LaEjPPqbE1bLaXuS6TInv IwrMk5sGzGHL246TF6EJQRBZZbQ1aVSgzaXxN8yTK0JwblRNzRU8JZB8rtvinV2uZBqC aWsA== 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=cHyMuhf8WbpVSTmVciIIPdmjRV+8xbma9o627R8H+MA=; b=W2HwaiWx1wnTgrLvoWbs8tk6G1UDiq3yiQ3SAsd9y5PTjMwmi8zhnqcM9tpzAJoV9M RNEUpZ0YiVBrN9xci6OpxmLZ5y3Te2Aw0zTRiHOFsQjo5O7j8YEJvR05sz5Fq+3LyHH1 DpadG4aVLFUHUUITEAPrG+oTD7UDMgx4QUUepdiveeD6Ozlpf8G8R6YNjVd5V+QVegAd 1wy84qDQQ24m4zRbABuItG0SL/hkh3uokT84HpSYNEBvUpKjN3gXmd6BbslIO6XfkckV 2Q/4R/UnXFCpqhNlSoUgyl2u53MQh6rdFRsWAqA1QsFfnMDoURFPtUEUmSN7QVx+ALA2 b0qQ== 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 b8si1162251eds.433.2021.01.31.06.55.24; Sun, 31 Jan 2021 06:55:48 -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 S232660AbhAaOwn (ORCPT + 99 others); Sun, 31 Jan 2021 09:52:43 -0500 Received: from mga07.intel.com ([134.134.136.100]:11395 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232973AbhAaOku (ORCPT ); Sun, 31 Jan 2021 09:40:50 -0500 IronPort-SDR: i+v9E0vsmAhBpfTlzkz+E3bZ69AKBXQfByTo5PxgkM1Bry6KouEEG5mmPiHLYfnbevBowZ0Y6a ZxiK8i+udykQ== X-IronPort-AV: E=McAfee;i="6000,8403,9880"; a="244675639" X-IronPort-AV: E=Sophos;i="5.79,390,1602572400"; d="scan'208";a="244675639" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jan 2021 06:40:07 -0800 IronPort-SDR: 2BzTl4yV3ce3XbGMPmFobsSpVYbBZKOsAiWyV/UFFFGA9m5s3cF5/WgaHJjnUQLXxdpLi1ymBo wHYXNLhxEHzQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.79,390,1602572400"; d="scan'208";a="431805589" Received: from host.sh.intel.com ([10.239.154.115]) by orsmga001.jf.intel.com with ESMTP; 31 Jan 2021 06:40:05 -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 v2 2/2] hid-sensors: Add more data fields for sensitivity checking Date: Sun, 31 Jan 2021 22:40:58 +0800 Message-Id: <20210131144058.11834-3-xiang.ye@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210131144058.11834-1-xiang.ye@intel.com> References: <20210131144058.11834-1-xiang.ye@intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Before, when reading/writing the hysteresis of als, incli-3d, press, and rotation sensor, we will get invalid argument error. This patch add more sensitivity data fields for these sensors, so that these sensors can get sensitivity index and return correct hysteresis value. Signed-off-by: Ye Xiang --- drivers/iio/light/hid-sensor-als.c | 1 + drivers/iio/orientation/hid-sensor-incl-3d.c | 1 + drivers/iio/orientation/hid-sensor-rotation.c | 1 + drivers/iio/pressure/hid-sensor-press.c | 1 + 4 files changed, 4 insertions(+) diff --git a/drivers/iio/light/hid-sensor-als.c b/drivers/iio/light/hid-sensor-als.c index 8bf6e9e0a0e0..afcdb424bfb8 100644 --- a/drivers/iio/light/hid-sensor-als.c +++ b/drivers/iio/light/hid-sensor-als.c @@ -41,6 +41,7 @@ struct als_state { static const u32 als_sensitivity_addresses[] = { HID_USAGE_SENSOR_DATA_LIGHT, + HID_USAGE_SENSOR_LIGHT_ILLUM, }; /* Channel definitions */ diff --git a/drivers/iio/orientation/hid-sensor-incl-3d.c b/drivers/iio/orientation/hid-sensor-incl-3d.c index 6e69f6e673cc..7af48d336285 100644 --- a/drivers/iio/orientation/hid-sensor-incl-3d.c +++ b/drivers/iio/orientation/hid-sensor-incl-3d.c @@ -49,6 +49,7 @@ static const u32 incl_3d_addresses[INCLI_3D_CHANNEL_MAX] = { static const u32 incl_3d_sensitivity_addresses[] = { HID_USAGE_SENSOR_DATA_ORIENTATION, + HID_USAGE_SENSOR_ORIENT_TILT, }; /* Channel definitions */ diff --git a/drivers/iio/orientation/hid-sensor-rotation.c b/drivers/iio/orientation/hid-sensor-rotation.c index 03d2845a7b2c..b0245b3b7ffc 100644 --- a/drivers/iio/orientation/hid-sensor-rotation.c +++ b/drivers/iio/orientation/hid-sensor-rotation.c @@ -33,6 +33,7 @@ struct dev_rot_state { static const u32 rotation_sensitivity_addresses[] = { HID_USAGE_SENSOR_DATA_ORIENTATION, + HID_USAGE_SENSOR_ORIENT_QUATERNION, }; /* Channel definitions */ diff --git a/drivers/iio/pressure/hid-sensor-press.c b/drivers/iio/pressure/hid-sensor-press.c index 8cac2c94e75a..c416d261e3e3 100644 --- a/drivers/iio/pressure/hid-sensor-press.c +++ b/drivers/iio/pressure/hid-sensor-press.c @@ -31,6 +31,7 @@ struct press_state { static const u32 press_sensitivity_addresses[] = { HID_USAGE_SENSOR_DATA_ATMOSPHERIC_PRESSURE, + HID_USAGE_SENSOR_ATMOSPHERIC_PRESSURE }; /* Channel definitions */ -- 2.17.1