Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp303233pxu; Fri, 4 Dec 2020 03:50:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJxRXMtrDx/QV68onLGhjy0igG5lvx6OpBrMeznEQs7rP75XJWapAmqHNs0l840yU9j/qwgm X-Received: by 2002:a05:6402:3c3:: with SMTP id t3mr7236574edw.86.1607082603968; Fri, 04 Dec 2020 03:50:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607082603; cv=none; d=google.com; s=arc-20160816; b=vYhNWlv1NxOCgYT0gzd3LmubvhHUkVe3rXWysenWw0g1/KgK0Nv72sTZjOhwsQehTG tHaBBtzJM6KyoJ29pWJl+iv+tgx9QE1b3okNKojxX8oiGh0nkzH00yYytDU2vgt7Humd Un1u0Ypgnoii0ucySBjqSeuC8Hs+eE8HlEhD0nuK2FJaOg1ZD6LnFRtBTS6Q/oPEwdIv GPURxZV5Kve/D3rrz9aQJGSqB61J40b978Iua43feO4C88kyH8JD6q/d+zh9uIbNlMr6 rCS6ZseoBW6xt2ngBMQkECt+NXp5Z+Ow0dyiXsxeHwi8DFkzbN9LBx6cs8r6XvotTXz8 Fc6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:ironport-sdr:ironport-sdr; bh=vdfjZHil2BatnLKyjcmsgSEHk0nqiSI+vaWtJfbPJ0I=; b=wFHN8T5insRTh701Mw7JxxOdRkhiySQzscrzScpRoREfSjSly7fJEgzTQKdVRkBBsy +XxjXcICuLhDyh+ixn9Fjcr4Tg0T/trPDDVuW3tjCirnEuXGIq19rxwVIYkWyCWiKLke 5Sd0TyUIOs6y/p2mTZW0kQarvOwMCCAK+WGnLPyMg6nLkCrrt/pERKL1ApJDbgzC2OsW WthFpVXmloeOgUDrBs1XZwBbNxdKmlAyJoygytiPTp4Z3Ilyt2SWTnifAg/QhYmDgzOQ 7rN6YEIDyiqsnKIQ5RAVsnB6z2g4Dn6frDtE9pYH/4R/R8CyE1tnYKLbYiirzDZSi6nJ 7mSg== 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 q19si3004814edv.85.2020.12.04.03.49.41; Fri, 04 Dec 2020 03:50:03 -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 S1730037AbgLDLrw (ORCPT + 99 others); Fri, 4 Dec 2020 06:47:52 -0500 Received: from mga09.intel.com ([134.134.136.24]:23463 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729971AbgLDLrv (ORCPT ); Fri, 4 Dec 2020 06:47:51 -0500 IronPort-SDR: z0wxT/YFD4Isl/H/t7CN07hlH2yT2HkAf2yiDnqDWUZ1BRXSydXNMwBGi75R2aMY/Ag7H3NDDa YRyplyJDkjpw== X-IronPort-AV: E=McAfee;i="6000,8403,9824"; a="173519530" X-IronPort-AV: E=Sophos;i="5.78,392,1599548400"; d="scan'208";a="173519530" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2020 03:46:10 -0800 IronPort-SDR: b/EZCUkSMIKhXp9sytwU2rgnnqY79FSByzTHVkslKxyrfy05FKPwO4H42c2Jne3p6e1VPC/su8 cq4slRisNJ7Q== X-IronPort-AV: E=Sophos;i="5.78,392,1599548400"; d="scan'208";a="331189433" Received: from spandruv-mobl.amr.corp.intel.com ([10.254.181.204]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2020 03:46:09 -0800 Message-ID: Subject: Re: add custom hinge sensor support From: Srinivas Pandruvada To: Ye Xiang , jikos@kernel.org, jic23@kernel.org Cc: linux-input@vger.kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Date: Fri, 04 Dec 2020 03:46:08 -0800 In-Reply-To: <20201203035352.13918-1-xiang.ye@intel.com> References: <20201203035352.13918-1-xiang.ye@intel.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.4 (3.34.4-1.fc31) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2020-12-03 at 11:53 +0800, Ye Xiang wrote: > Here three separate iio devices are presented which presents angle > for > hinge, keyboard and screen. You are presenting one IIO device now with three channels. > > This driver works on devices with Intel integrated sensor hub, where > hinge sensor is presented using a custom sensor usage id. > > Here the angle is presented in degrees, which is converted to > radians. > > Changes since v2: > - use 1 iio device instead of 3 for hinge sensor. > - use indexed channel instead of modified channel and added channel > labels. > - remove 2,3 patch in last version, add a document patch to > describe the > hinge channels. > - hid-sensor-custom: use meaningful return value in > get_known_custom_sensor_index and checked in call side. > - hid-sensor-ids.h: use HID_USAGE_SENSOR_DATA_FIELD_CUSTOM_VALUE(x) > to > define custom sensor value. > > Changes since v1: > - fixed errors reported by lkp > > Ye Xiang (3): > HID: hid-sensor-custom: Add custom sensor iio support > iio: hid-sensors: Add hinge sensor driver > iio:Documentation: Add documentation for hinge sensor channels > > Documentation/ABI/testing/sysfs-bus-iio | 17 + > drivers/hid/hid-sensor-custom.c | 181 ++++++++ > .../hid-sensors/hid-sensor-attributes.c | 2 + > drivers/iio/position/Kconfig | 16 + > drivers/iio/position/Makefile | 1 + > .../position/hid-sensor-custom-intel-hinge.c | 393 > ++++++++++++++++++ > include/linux/hid-sensor-ids.h | 14 + > 7 files changed, 624 insertions(+) > create mode 100644 drivers/iio/position/hid-sensor-custom-intel- > hinge.c >