From patchwork Sun Feb 7 12:37:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 12072899 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08E90C43381 for ; Sun, 7 Feb 2021 12:39:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C092864E4E for ; Sun, 7 Feb 2021 12:39:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229770AbhBGMi5 (ORCPT ); Sun, 7 Feb 2021 07:38:57 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:59074 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229510AbhBGMi4 (ORCPT ); Sun, 7 Feb 2021 07:38:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612701450; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=TO6EqYEBjAkKYWeva1m4UJwzXVWsthXT13T1vTKUp5o=; b=FKdWYb0m+GlGGfUgCic0sCC4kbyHrPPSWiRiCxdRFoDyuo6t29jrG7J/H+FSOed06rKUuI M2kquDSKo+IOfAQYP6OBB1sNGdBT+l7i1ZPjq+56w4tL06HRcsluNAYxxFs9Z6z5ArVAGu REI2Z0Y00hL2dznH1NJFSzRtGz6B7T4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-338-uoNsFyldMFGmaircJXAmBg-1; Sun, 07 Feb 2021 07:37:25 -0500 X-MC-Unique: uoNsFyldMFGmaircJXAmBg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E2BAB6D4E3; Sun, 7 Feb 2021 12:37:23 +0000 (UTC) Received: from x1.localdomain (ovpn-112-86.ams2.redhat.com [10.36.112.86]) by smtp.corp.redhat.com (Postfix) with ESMTP id D106C19D9C; Sun, 7 Feb 2021 12:37:21 +0000 (UTC) From: Hans de Goede To: Jonathan Cameron Cc: Hans de Goede , linux-input@vger.kernel.org, Lars-Peter Clausen , Peter Meerwald-Stadler , linux-iio@vger.kernel.org, Dmitry Torokhov , Mark Pearson , Bastien Nocera Subject: [PATCH 1/2] iio: documentation: Document proximity sensor label use Date: Sun, 7 Feb 2021 13:37:19 +0100 Message-Id: <20210207123720.8357-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Add an entry to Documentation/ABI/testing/sysfs-bus-iio for the new device and channel label sysfs-attribute support. And document the standardized labels which may be used with proximity sensors to hint userspace about the intended use of the sensor. Using labels to differentiate between the multiple proximity sensors which a modern laptop/tablet may have was discussed in this thread: https://lore.kernel.org/linux-iio/9f9b0ff6-3bf1-63c4-eb36-901cecd7c4d9@redhat.com/ As mentioned the "proximity-wifi*" labels are already being used in this manner on some chromebooks, see e.g.: arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi arch/arm64/boot/dts/qcom/sc7180-trogdor-lte-sku.dtsi And the "proximity-palmrest" and "proximity-lap" labels are intended to be used with the lap and palmrest sensors found in recent Lenovo ThinkPad models. Cc: Dmitry Torokhov Cc: Mark Pearson Cc: Bastien Nocera Signed-off-by: Hans de Goede --- Documentation/ABI/testing/sysfs-bus-iio | 41 +++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio index 35289d47d6cb..f2f090f8bd2f 100644 --- a/Documentation/ABI/testing/sysfs-bus-iio +++ b/Documentation/ABI/testing/sysfs-bus-iio @@ -33,6 +33,47 @@ Description: Description of the physical chip / device for device X. Typically a part number. +What: /sys/bus/iio/devices/iio:deviceX/label +What: /sys/bus/iio/devices/iio:deviceX/in_*_label +What: /sys/bus/iio/devices/iio:deviceX/out_*_label +KernelVersion: 5.8 +Contact: linux-iio@vger.kernel.org +Description: + Optional symbolic label for a device or a channel. + This is useful for userspace to be able to better identify an + individual device or channel. + + The contents of the label are free-form, but there are some + standardized uses: + + For proximity sensors which give the proximity (of a person) to + a certain wlan or wwan antenna the following standardized labels + are used: + + * "proximity-wifi" + * "proximity-lte" + * "proximity-wifi-lte" + * "proximity-wifi-left" + * "proximity-wifi-right" + + These are used to indicate to userspace that these proximity + sensors may be used to tune transmit power to ensure that + Specific Absorption Rate (SAR) limits are honored. + The "-left" and "-right" labels are for devices with multiple + antennas. + + In some laptops/tablets the standardized proximity sensor labels + instead indicate proximity to a specific part of the device: + + * "proximity-palmrest" indicates proximity to the keyboard's palmrest + * "proximity-palmrest-left" indicates proximity to the left part of the palmrest + * "proximity-palmrest-right" indicates proximity to the right part of the palmrest + * "proximity-lap" indicates the device is being used on someone's lap + + Note "proximity-lap" is special in that its value may be + calculated by firmware from other sensor readings, rather then + being a raw sensor reading. + What: /sys/bus/iio/devices/iio:deviceX/current_timestamp_clock KernelVersion: 4.5 Contact: linux-iio@vger.kernel.org From patchwork Sun Feb 7 12:37:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 12072897 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2024FC4332D for ; Sun, 7 Feb 2021 12:39:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EAE6264E49 for ; Sun, 7 Feb 2021 12:39:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229771AbhBGMjA (ORCPT ); Sun, 7 Feb 2021 07:39:00 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:54057 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229717AbhBGMi7 (ORCPT ); Sun, 7 Feb 2021 07:38:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612701453; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ELvHiaBlhKLzgE9HSBpMDYMf36fcWhvvt5qxg4NkYR0=; b=I4NN1gouN1yg1b2+acI5Bq51g6aStdc96Zl9lD8klAEZsDvZbOYFPgO4Vv49TJMuHolzov UxwyzXmbHGbW9lYan6vrarYzHztAqtiXZou+cp3JK2O4FmjivyT1KdQxLsaqbNUO9N6l9T cXRlqfV6MKKOscnVy2Z8eqHcMMCkg68= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-179-9IqLBAhqNwiVsl4_nOIWSw-1; Sun, 07 Feb 2021 07:37:27 -0500 X-MC-Unique: 9IqLBAhqNwiVsl4_nOIWSw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4556F80197A; Sun, 7 Feb 2021 12:37:26 +0000 (UTC) Received: from x1.localdomain (ovpn-112-86.ams2.redhat.com [10.36.112.86]) by smtp.corp.redhat.com (Postfix) with ESMTP id 37D7019D9D; Sun, 7 Feb 2021 12:37:24 +0000 (UTC) From: Hans de Goede To: Jonathan Cameron Cc: Hans de Goede , linux-input@vger.kernel.org, Lars-Peter Clausen , Peter Meerwald-Stadler , linux-iio@vger.kernel.org, Dmitry Torokhov , Mark Pearson , Bastien Nocera Subject: [PATCH 2/2] iio: documentation: Document accelerometer label use Date: Sun, 7 Feb 2021 13:37:20 +0100 Message-Id: <20210207123720.8357-2-hdegoede@redhat.com> In-Reply-To: <20210207123720.8357-1-hdegoede@redhat.com> References: <20210207123720.8357-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Some 2-in-1 laptops / convertibles with 360° (yoga-style) hinges, have 2 accelerometers, 1 in their base and 1 in their display. In many cases the kernel can detect the location of each accelerometer based on e.g. information from the ACPI tables. It is important for userspace to know the location of the 2 accelerometers. Rather then adding a new sysfs-attribute for this we can relay this information to userspace by using standardized label strings for this. This mirrors how this is done for proximity sensors. This commit documents 2 new standardized label strings for this purpose: "accel-base" "accel-display" Note the "base" and "display" suffixes were chosen to match the values used for the systemd/udev hwdb.d/60-sensor.hwdb file's ACCEL_LOCATION property. Cc: Dmitry Torokhov Cc: Mark Pearson Cc: Bastien Nocera Signed-off-by: Hans de Goede --- Documentation/ABI/testing/sysfs-bus-iio | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio index f2f090f8bd2f..a39a1c25488e 100644 --- a/Documentation/ABI/testing/sysfs-bus-iio +++ b/Documentation/ABI/testing/sysfs-bus-iio @@ -74,6 +74,13 @@ Description: calculated by firmware from other sensor readings, rather then being a raw sensor reading. + For accelerometers used in 2-in-1s with 360° (yoga-style) hinges, + which have an accelerometer in both their base and their display, + the following standardized labels are used: + + * "accel-base" + * "accel-display" + What: /sys/bus/iio/devices/iio:deviceX/current_timestamp_clock KernelVersion: 4.5 Contact: linux-iio@vger.kernel.org