Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp137715pxb; Wed, 18 Nov 2020 19:05:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJxfovOG1tkGcDJCgd5aqEF4bjUyItXtHRgj7JQzA68P2wVFX1TvHLNf3nQu12uQeo0U2fZ9 X-Received: by 2002:a50:cf82:: with SMTP id h2mr28685650edk.142.1605755146632; Wed, 18 Nov 2020 19:05:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605755146; cv=none; d=google.com; s=arc-20160816; b=opoWOyZOpiCeeK8fRy0sGoXmMxOXhO4a55LkRkJ76gls3+jnvv/iNH6Q//BPPDpZJo pGa+tfWSmRGpmcN1pIQlodGGoLpU8MPAEW8HlWgsOk7vb/J/ZAnzN22YWJKiCUMFx3y1 ssBwemwaMu7VWdi8yNjQjCAKYn/tlodpR7BcpvZ3Eu8NPHveae4PfMIiMk3WByhL/xK3 w3RnqXDRqTYdteeQYRYWj+RqqS80MrEne3snlW67eNdTdwlx5blX9TszE6+cW7VGmdEI FHS+dRLkTzioH41WEQ+3Tg7PO264qP/AO5UrI9BrvJuciGqAzwv0n+868sGTudcYFKan xIfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from:ironport-sdr :ironport-sdr; bh=9/3xOF7SKL7bWTkmM8oJf8GA/gfBrF6SNQSaw4rvYaE=; b=jUpub7S4tNnANV70clMW7i3Xncl9toIxz5Aq3dD8M40m0XzlC0ihpEqZP6w8R6a4CQ JywgNDq/Pd8tLDgQWmjhLhWf+y6XC69tVrCDm+JyekcbxtNYn/bk9qXJy4+Lyk/13JCn OZpbv5Vlju1GjYZ/DlsXE9u1ISP63z9LetGKGVQckziMvOaA972ELDWcN9xYrEDXVlpE TKYYAss81UxeDfRjwoEmLU1vMSfY247ctyCIvuHH4G4p8qJfL4Ry3MJCuWRHh6mIwzNz ntE9CGv/mdfg5E0bqCIrNNmVzHWNHa7HZL2mGWm5M5O/aF2TIFnqO7RHD72ASVwwA2Nv i4Ug== 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 a1si16134280ejt.206.2020.11.18.19.05.24; Wed, 18 Nov 2020 19:05:46 -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 S1726297AbgKSDCv (ORCPT + 99 others); Wed, 18 Nov 2020 22:02:51 -0500 Received: from mga06.intel.com ([134.134.136.31]:54164 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726105AbgKSDCu (ORCPT ); Wed, 18 Nov 2020 22:02:50 -0500 IronPort-SDR: ee1+osEuvZgj1J9ZwKw8FWlvUOttCWRB51bsYIwXeniPjb5cGss/WM2XAGffeKGiMpQAgGrbC+ 8DdE0ZGaNaUQ== X-IronPort-AV: E=McAfee;i="6000,8403,9809"; a="232837897" X-IronPort-AV: E=Sophos;i="5.77,489,1596524400"; d="scan'208";a="232837897" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Nov 2020 19:02:49 -0800 IronPort-SDR: lJSURVluzSCIombdtw+q469gHLy4a5D0p8LkVpbB72G1Ln76A1ZmyTmc5Xflq//UQq2Ila6LOq WTWfFf8xt8xA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,489,1596524400"; d="scan'208";a="534584527" Received: from host.sh.intel.com ([10.239.154.115]) by fmsmga005.fm.intel.com with ESMTP; 18 Nov 2020 19:02:47 -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 0/4] add custom hinge sensor support Date: Thu, 19 Nov 2020 11:03:22 +0800 Message-Id: <20201119030326.6447-1-xiang.ye@intel.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Here three separate iio devices are presented which presents angle for hinge, keyboard and screen. 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. Ye Xiang (4): HID: hid-sensor-custom: Add custom sensor iio support iio: hid-sensor-trigger: Decrement runtime pm enable count on driver removal iio: hid-sensor-trigger: Use iio->trig instead trig field internal structure iio: hid-sensors: Add hinge sensor driver drivers/hid/hid-sensor-custom.c | 169 +++++++ .../hid-sensors/hid-sensor-attributes.c | 2 + .../common/hid-sensors/hid-sensor-trigger.c | 8 +- drivers/iio/position/Kconfig | 16 + drivers/iio/position/Makefile | 3 + .../iio/position/hid-sensor-custom-hinge.c | 412 ++++++++++++++++++ include/linux/hid-sensor-ids.h | 39 ++ 7 files changed, 646 insertions(+), 3 deletions(-) create mode 100644 drivers/iio/position/hid-sensor-custom-hinge.c -- 2.17.1