Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp10502209pxu; Wed, 30 Dec 2020 04:41:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJyHSCoXj2ugnSNdwy4LPLnOkVxEE8KGkvlCjRb8J5cNPWtr2Fu4X/lSIo3LDxyMjJlzeLNC X-Received: by 2002:a17:906:ae55:: with SMTP id lf21mr49466700ejb.101.1609332085844; Wed, 30 Dec 2020 04:41:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609332085; cv=none; d=google.com; s=arc-20160816; b=XsI/8bY82Be1q4DhValHL4BZAToPWgT4cubkJkBUrutkG8EkAQyNhw5kCxhBcs7rk5 MepiQqH3A2g5LBEDIK5estn14sTuorN0AhdWYmt8kv2dz3N631qV4kEF1XLuqH4CZ5Ep +8bkpXMfObhmGBR2Pi4sNsV+zlXSWf7oPx1z/jw+m35Z+BQP4g4984+YdPwhpXzzIi70 j0EHPAX8n/+Z9z2hNI852u07beGYz2bRxrbdLQKfkUgJkWiVPZY0H+bH4XgVSKCYs6F5 6TpIOz038zD5KisLRUdekvMo2j1c+AyZ9w/lBCEPC5xhPl1j+DdLrpHA4c96vNWxt7pB u16A== 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 :references:in-reply-to:message-id:subject:cc:to:from:date; bh=nQGbd9kMKpdVUtjfZcsmwpeM8sLgxqJi7fPDZSLIKv0=; b=O5+wefctcc48kylkIyLMojeItOjES2HExorKzjhxi/kBDBYi/WouisDXIc/5GaVmuK Yc7b5zJqqI0A9sxW04WGHIOdzeT2ORzONxsveuvGjuDo0bwArwaUEqfOYPvJq74tKJqQ PRr5lE0acEVVwH7XOFuh/GMXf82S6aMlI3N5pGpRjpPxTyeZObmieynwc0TaLocnUIMd qr+uR9illmHXmf7MGKNyTi2e0uIfA76xt4s4DZ5Xbe/b9C02O0JKqnXHDsPT4JhQNiaG XoO2SpU8lWHUgsdal02oZQlRKXBrCwDQbsfMly3OfE/AZoRnvXV5LRP7TNYQkPbvVepZ SIAA== 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id du15si23491970ejc.471.2020.12.30.04.41.02; Wed, 30 Dec 2020 04:41: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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726640AbgL3Mif (ORCPT + 99 others); Wed, 30 Dec 2020 07:38:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:48698 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726625AbgL3Mif (ORCPT ); Wed, 30 Dec 2020 07:38:35 -0500 Received: from archlinux (cpc108967-cmbg20-2-0-cust86.5-4.cable.virginm.net [81.101.6.87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1498A20715; Wed, 30 Dec 2020 12:37:51 +0000 (UTC) Date: Wed, 30 Dec 2020 12:37:48 +0000 From: Jonathan Cameron To: Jyoti Bhayana Cc: Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Mauro Carvalho Chehab , "David S. Miller" , Rob Herring , Lukas Bulwahn , linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, cristian.marussi@arm.com, sudeep.holla@arm.com, egranata@google.com, mikhail.golubev@opensynergy.com, Igor.Skalkin@opensynergy.com, Peter.hilber@opensynergy.com, ankitarora@google.com Subject: Re: [RFC PATCH v2 0/1] Adding support for IIO SCMI based sensors Message-ID: <20201230123748.4e969f82@archlinux> In-Reply-To: <20201224031921.1547519-1-jbhayana@google.com> References: <20201224031921.1547519-1-jbhayana@google.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 24 Dec 2020 03:19:20 +0000 Jyoti Bhayana wrote: > Hi, > > This series adds support for ARM SCMI Protocol based IIO Device. > This driver provides support for Accelerometer and Gyroscope sensor > using new SCMI Sensor Protocol defined by the upcoming SCMIv3.0 ARM > specification, which is available at > > https://developer.arm.com/documentation/den0056/c/ > > The series is currently based on top of: > > commit f83eb664cdb4 ("Merge tag 'scmi-voltage-5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into for-next/scmi") > > in Sudeep for-next/scmi branch: > > https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/\ > linux.git/log/?h=for-next/scmi > > This version of the patch series has been tested using > version 5.4.21 branch of Android common kernel. > > Any feedback welcome, > > Thanks, > > Jyoti Bhayana > > v1 --> v2 > - Incorporated the feedback comments from v1 review of the patch > - Regarding the new ABI for sensor_power,sensor_max_range, > and sensor_resolution, these are some of the sensor attributes > which Android passes to the apps. If there is any other way of getting > those values, please let us know So, sensor_max_range can effectively be exposed as a combination of scale and the *_raw_avail for a raw read (via the read_avail callback in IIO). We'll ignore the fact the interface assumes a single value (so I assume symmetric?) I think resolution in android is equivalent to _scale in IIO terms? Docs seem to say it's "resolution of the sensor in sensor's units". There are a few corners where that might not be true (sensors that do some odd padding for example) but we can probably rely on it normally being fine. Power. Hmm. Currently we have no provision for this as users of the sensor don't care. The OS might of course, but individual applications tend not to. The question is much more general than IIO if we go down the route of exposing this from the kernel as we should define some sort of power query interface for any device in the system in a generic way. I'm not sure if any such thing already exists. Jonathan > > Jyoti Bhayana (1): > iio/scmi: Adding support for IIO SCMI Based Sensors > > MAINTAINERS | 6 + > drivers/iio/common/Kconfig | 1 + > drivers/iio/common/Makefile | 1 + > drivers/iio/common/scmi_sensors/Kconfig | 18 + > drivers/iio/common/scmi_sensors/Makefile | 5 + > drivers/iio/common/scmi_sensors/scmi_iio.c | 693 +++++++++++++++++++++ > 6 files changed, 724 insertions(+) > create mode 100644 drivers/iio/common/scmi_sensors/Kconfig > create mode 100644 drivers/iio/common/scmi_sensors/Makefile > create mode 100644 drivers/iio/common/scmi_sensors/scmi_iio.c >