Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp260250pxb; Fri, 16 Apr 2021 05:08:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyUqPAxECF3PNGeDOH8C1oEO7A+fjC4GJXRcvUg7HwFTzEfMSOXcy9/NJm9Wf6Aps73Mp6v X-Received: by 2002:aa7:c5d0:: with SMTP id h16mr9512063eds.7.1618574938124; Fri, 16 Apr 2021 05:08:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618574938; cv=none; d=google.com; s=arc-20160816; b=rxL2ne/ou7avErpNdx0UmjS/UUUJ7RTxQ6KHMxLG0uaDhB9hxcBpECrSrAT3jKQ2TR rsr6x8iDsv95wJ24Zv2z0B4mrJjq/fL4CuAC9cxAEeq5H0U4+NCfpR31cao6klRhpghp iNfJK2+iDr5lg6Uk/JkofS5aHmij8UCtGZWfMLNp3ymtB62wLPrsBxmy3A/KAaW9SM5o lT362M0555vwnQ29C5CnIiqlBVM01PU1Rlubyw3a4eTvLA4GXwnNLuRYXfXMnB+/lS/9 8zCFxGMmq0TELuqWzUdtV05SEaw2HQmRXEClS6ktUuicksreg8gfCLQLYfIe7pi82+mo hOew== 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; bh=jj6VTLoEPItf6wjNm3DVyj11NHTpsJaOCXC4LKjlniY=; b=kVhWjZUfLq5BN+R9SKDr9GzTkPkhIpLbln4wyJDUNsKHMmV98iAMLYxX2jG7Y0wSVs KJu0W96Xf9Lf9aL4RcayW+toGOhqCQs168sGXCznsP4ySD5X+BhGP+LIYEIRGiiYHCG1 eKAixgrQd6fEJxC+tm96tC6CJ3xn5pVjc1VivKgLZeLTWxsGx35TaGgGmwE2ZX6XVgo4 I7C81shHGUOImY9txtbRJBhXZvxBTEOtwZmVUsWhIIzcN3nyQa0onhPlkfbOhfbP9Imu wAB0LKBwkj+NdtdRBdJgcCwAWRk+1JXyNpNj/rxr+FHKyNxIgFV5cko9h7qYWdvhbbLT s37w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r8si1977007edw.146.2021.04.16.05.08.20; Fri, 16 Apr 2021 05:08:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-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-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241311AbhDPK47 (ORCPT + 99 others); Fri, 16 Apr 2021 06:56:59 -0400 Received: from relay10.mail.gandi.net ([217.70.178.230]:51293 "EHLO relay10.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229706AbhDPK4y (ORCPT ); Fri, 16 Apr 2021 06:56:54 -0400 Received: from [192.168.1.150] (unknown [78.199.60.242]) (Authenticated sender: hadess@hadess.net) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 4804224000C; Fri, 16 Apr 2021 10:56:26 +0000 (UTC) Message-ID: Subject: Re: [PATCH v2 resend 2/2] iio: documentation: Document accelerometer label use From: Bastien Nocera To: Hans de Goede , Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz Cc: linux-bluetooth@vger.kernel.org, Dmitry Torokhov , Mark Pearson Date: Fri, 16 Apr 2021 12:56:26 +0200 In-Reply-To: <20210405203933.17282-3-hdegoede@redhat.com> References: <20210405203933.17282-1-hdegoede@redhat.com> <20210405203933.17282-3-hdegoede@redhat.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.40.0 (3.40.0-1.fc34) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org On Mon, 2021-04-05 at 22:39 +0200, Hans de Goede wrote: > 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" If we have a combined proximity and accelerometer sensor (which wouldn't be unheard off with sensor hubs being used), how are multiple labels, say "proximity-wifi" and "accel-base" documented? I think that it might be worth using a separate sysfs attribute for this, say "location" which would have "display" or "base" as a value, and which iio-sensor-proxy could already consume. This would also make it easier to funnel values from DeviceTree or ACPI to udev and/or a single sysfs kernel attribute one-to-one. Cheers > > 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 7379e40d862d..b7529bca83f5 100644 > --- a/Documentation/ABI/testing/sysfs-bus-iio > +++ b/Documentation/ABI/testing/sysfs-bus-iio > @@ -72,6 +72,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_cl > ock >  KernelVersion: 4.5 >  Contact:       linux-iio@vger.kernel.org