Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp324268pxb; Thu, 19 Nov 2020 02:04:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJxrVoYk3DSXeIuo9nHHdjKiZSdaYAebpxPzYaUXNlyMo2KKZqhD2fLTbVPNLnQY40klgP6/ X-Received: by 2002:a05:6402:1114:: with SMTP id u20mr28485960edv.377.1605780265345; Thu, 19 Nov 2020 02:04:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605780265; cv=none; d=google.com; s=arc-20160816; b=oQ42MvbGiQWkHFA7ged/hpt5K/dS19kGQdjnFHhrh2AUXwer3Oa3wgE4DrA9NNuFJs 9klX3js9hRQAdulkKvZgGGn4REwxK6F1roxYVr1G2eKi5MQOd35+79P2pPWYBFmnS+GR YrKdbi1D+DRSVgECB+C+H3c5431SgFngQaavjMxBsaWTWJp2dw/B5VOoIuyjq2BUCbUA vVaiB2gfo9CqFM4toZAYkoHeeYdlhR5q89avKlV53ObNhWtw3HvePGLoJXTUr28at9Jf r25u4EXNR8g92SpthW/mSDFtBfvnIxdfPwetfv3GBNdiwrpWa3GlrLdi9DocTzJeYArg ctyQ== 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=F48SxDoMNowC6CoTZkflOcuzAWUr4iDUGdaeJSL9mR8=; b=RLLY5tFi9q0n8y+ve450WdCGDJriSruHucmQSldrsHttOZFuOPcVm1FMNrGV077wcT zFTJdnd+vIFlxnDaiJP8V0UxnkCG3k+849gFDQK9CF/AQ8Dus6kTTq/iILpkxcVrbW3n mqpuCwGK+fUkxnh0P7ld1r3IwPHSkMlQsRkK+9CaiYlxc8d66EpuDycw1h8kQBRfQES4 ZohiIwoc06ErcnyeSL/lWwYQo0Vpn/QoDvsA0UnegjEQ4dMTdPcEqVk7P219TxH2WBji /IOzFH6c4Y8P2dK+6nUUem4DiVSy2bVY8n0WPRCog4kVanaifMt9QHDn7xmfunXus7lR t1GQ== 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 e20si17328873edq.501.2020.11.19.02.04.02; Thu, 19 Nov 2020 02:04:25 -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 S1727027AbgKSKCl (ORCPT + 99 others); Thu, 19 Nov 2020 05:02:41 -0500 Received: from mga14.intel.com ([192.55.52.115]:10879 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726995AbgKSKCl (ORCPT ); Thu, 19 Nov 2020 05:02:41 -0500 IronPort-SDR: lD+bOX7DJLR88sAEcmbPghNuQNX9QB1g1hAvyCySleaJZLi8o7dmWvCPDM3pl8sv37KYiffOMm HXNW6MTZrO3w== X-IronPort-AV: E=McAfee;i="6000,8403,9809"; a="170482230" X-IronPort-AV: E=Sophos;i="5.77,490,1596524400"; d="scan'208";a="170482230" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Nov 2020 02:02:40 -0800 IronPort-SDR: cTX1HOqcgeoNj3FYRN2M3vITG/2KHztCISZWkOHxjseL6vncF1c2Ezp1qY4O6RdfqABbDqf8ih 73S+cezSMlOQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,490,1596524400"; d="scan'208";a="359909707" Received: from host.sh.intel.com ([10.239.154.115]) by fmsmga004.fm.intel.com with ESMTP; 19 Nov 2020 02:02:38 -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 0/4] add custom hinge sensor support Date: Thu, 19 Nov 2020 18:03:27 +0800 Message-Id: <20201119100331.2594-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. Changes since v1: - fixed errors reported by lkp 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 | 170 ++++++++ .../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, 647 insertions(+), 3 deletions(-) create mode 100644 drivers/iio/position/hid-sensor-custom-hinge.c -- 2.17.1