From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 89A88C77B73 for ; Sun, 16 Apr 2023 20:20:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229458AbjDPUUo (ORCPT ); Sun, 16 Apr 2023 16:20:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229647AbjDPUUn (ORCPT ); Sun, 16 Apr 2023 16:20:43 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E13D226A2 for ; Sun, 16 Apr 2023 13:19:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1681676395; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=E4VfgdWy79fScFpHd8ztN3EfNO1Bs6qzR+h66uHi/sM=; b=i5AxEbG0cSngHWhXf5C2ZjZqVTKNboqSncT57H8g5NdtgMKUVT3/6bhd/YaABYS5rVM4F3 CTAm+Lew6LLkA/7keh6bqNnATBV9ENVw+aEdwesRfQKdBMq23qGg08fVVi1MKEmmLbfP4K JFNDWX9xrAdn1gjm7J0p34RioamNom0= Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-61-dPJIDz5VNICwPpYEy0XCMw-1; Sun, 16 Apr 2023 16:19:53 -0400 X-MC-Unique: dPJIDz5VNICwPpYEy0XCMw-1 Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-94a355c9028so337674866b.3 for ; Sun, 16 Apr 2023 13:19:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681676392; x=1684268392; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=E4VfgdWy79fScFpHd8ztN3EfNO1Bs6qzR+h66uHi/sM=; b=lrI0gjiIRu9Tquy2OoqM9wM4gJmNN1eldVwhzlAXsxW/FfRj5Bi3OrwJZrmaI7nz5B YAxhxJhZONmQp+9VpkOc+UVDCMr8m7kQJV36QM6PV7XcmH6pcXbCmDL4GPqq7cJv7SB4 G5HSod2qZwCslytFD4zdxXQg6LgaReupLMl+VdQL/lvH2H5RZQBucHgjteANBV3DdpAc hae5oabHo4+rjwLZMrn5KAMjJusHXJY2z+AydsUN3ZPTe9FlAD39kHOC5upOaz4ldzxI WYYDygPIKlX4kGiUakS8pKtzfdwl76oTWrc4imaokOexzyf0Re6hvevo1W8/ucofmaz3 o9dw== X-Gm-Message-State: AAQBX9cnDQ3gl6y9MeDvp2TmYFRXQfxs3jMw6kr1lay+/PcPk3scpsWr Cvq7unkBhsT2ipqYnpKk8SwQcksxYCO95QzpoyH1Z3vn/GPddCru5+XTTKSt2Xpo/bOevtKp5lK QV0YqLweCm1XD0w6iQBaXlw== X-Received: by 2002:aa7:d814:0:b0:506:9701:8436 with SMTP id v20-20020aa7d814000000b0050697018436mr3928491edq.16.1681676392498; Sun, 16 Apr 2023 13:19:52 -0700 (PDT) X-Google-Smtp-Source: AKy350b+Rx8aYCm1+2MZmFymKF7qHzMlh5iqmEBr7hABMtGp1cN0/0bG3sAD9IZSP+SnHgtLZmAN+Q== X-Received: by 2002:aa7:d814:0:b0:506:9701:8436 with SMTP id v20-20020aa7d814000000b0050697018436mr3928477edq.16.1681676392105; Sun, 16 Apr 2023 13:19:52 -0700 (PDT) Received: from ?IPV6:2001:1c00:c32:7800:5bfa:a036:83f0:f9ec? (2001-1c00-0c32-7800-5bfa-a036-83f0-f9ec.cable.dynamic.v6.ziggo.nl. [2001:1c00:c32:7800:5bfa:a036:83f0:f9ec]) by smtp.gmail.com with ESMTPSA id y2-20020aa7ccc2000000b004c2158e87e6sm4878686edt.97.2023.04.16.13.19.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 16 Apr 2023 13:19:51 -0700 (PDT) Message-ID: <3eb3de24-41b4-9566-9b11-a12d21904793@redhat.com> Date: Sun, 16 Apr 2023 22:19:50 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH v3 0/6] iio: st_sensors: Add lsm303d support To: Marius Hoch , Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Denis Ciocca , Linus Walleij , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230415231130.115094-1-mail@mariushoch.de> Content-Language: en-US, nl From: Hans de Goede In-Reply-To: <20230415231130.115094-1-mail@mariushoch.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Hi Marius, On 4/16/23 01:11, Marius Hoch wrote: > Hi! > > This patch series adds support for the LSM303D accelerometer and > magnetometer. As the LSM303D is basically, as far as I can tell, > the LSM9DS0 without gyroscope, we can easily re-use its definitions. > > This was tested on a Lenovo Yoga Tablet 2 1051-F. Thank you for your work on this. I have had this on my own todo list since 2020 at least and I did not realize that Andy already added ST IMU support in 2021 so this just needed some extra device-ids :) I have tested this successfully on the following models: Lenovo Yoga Tablet 2 851F (Windows version 8") This version needs an accel-mount-matrix quick in hwdb since it has a portrait screen rather then a landscape screen (so 90° rotated): https://github.com/systemd/systemd/pull/27295 Note I've made sure that this quirk only applies to the 851 and not to the 1051. Lenovo Yoga Tablet 2 830F (Android version 8") Since the ACPI tables are broken in the Android BIOS these need a patch to x86-android-tablets to instantiate the i2c_client for the sensor, I'm still finalizing this patch and I'll submit it upstream when its finished. Tested-by: Hans de Goede Regards, Hans p.s. 1: I noticed that auto-screen rotation using iio-sensor-proxy is quite slow so I wrote a patch to fix this :) : https://gitlab.freedesktop.org/hadess/iio-sensor-proxy/-/merge_requests/366 2: There are some other unsupported sensors on these models too, perhaps you are interested in adding support for these too? Here are my personal notes on this: -Light sensor should work with drivers/iio/light/al3320a.c https://github.com/JideTechnology/remixos-kernel/commit/c52d55b4bd907e87b7b115b3943219f3e089a77a -MXM1120 HALL sensor, have datasheet, measures angle of kickstand thingie, use for SW_TABLET_MODE. Do a pdx86 driver just for the Tab 2 which checks that the kick stand is out *and* the BT keyboard is paired, in that case report SW_TABLET_MODE=0, in all other cases report SW_TABLET_MODE=1 ?? For the commit msg: Datasheet available here: http://haechitech.com/tech-support/ Requires creating an account, once you have an account you can immediately download the provided datasheets (or let me know if you want me to email you a copy) Especially the light sensor should be an easy win and light sensors are already supported in e.g. iio-sensor-proxy > Changes in v3: > Simplified the ACPI tables in the LSM9DS0 IMU driver, per Jonathan Cameron. > > Marius Hoch (6): > iio: accel: st_accel: Add LSM303D > iio: magnetometer: st_accel: Add LSM303D > iio: st_sensors: Add lsm303d support to the LSM9DS0 IMU driver > iio: st_sensors: Add ACPI support for lsm303d to the LSM9DS0 IMU > driver > iio: Comment that the LSM303D also has the Magnetometer DRDY > dt-bindings: iio: st-sensors: Add LSM303D accelerometer+magnetometer > > .../devicetree/bindings/iio/st,st-sensors.yaml | 1 + > drivers/iio/accel/st_accel_core.c | 1 + > drivers/iio/imu/st_lsm9ds0/Kconfig | 3 ++- > drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c | 12 ++++++++++++ > drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c | 12 ++++++++++++ > drivers/iio/magnetometer/st_magn_core.c | 1 + > include/linux/iio/common/st_sensors.h | 1 + > include/linux/platform_data/st_sensors_pdata.h | 2 +- > 8 files changed, 31 insertions(+), 2 deletions(-) > > > base-commit: e62252bc55b6d4eddc6c2bdbf95a448180d6a08d