Received: by 10.223.176.5 with SMTP id f5csp270446wra; Tue, 30 Jan 2018 11:12:48 -0800 (PST) X-Google-Smtp-Source: AH8x226LHf4ySlEn7NQ0KT4dUjTmrNGBBP0QtjIYnOS9DQkxfjTtlUz0DWs26pOUFqsfcbUqicx/ X-Received: by 10.99.113.20 with SMTP id m20mr360745pgc.400.1517339568043; Tue, 30 Jan 2018 11:12:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517339568; cv=none; d=google.com; s=arc-20160816; b=ZnfLA535pVuyWE1QtdKhk598QBEPANTSgnDSgcVvsOuBeO0Vbi6LKDyo2WQ2HKjtp1 pAyQzveCEH8MSEbZZtuql2yg6pwKw0sIBRf8q5zHvadEogK3PNUgtMak9Opf9l/DFvbU T4HIgzYxQRveLPM+1G76SnphCsHNgqK27J+SofqE+RODBId5/5synXiQH+j+4NIN2ZPg UN9iT/MqAcjIHcw240lybpSvedbiJHhkwHVAP8/9Vc18zz5/XfmraH32KFkuYwq0P3/Z l5+IH7LXk8ioPcIKjDDp1E2EGUvwIJ17IlLHbZhQaQH+SXCXm4xs0bXYnvgi1CsD1uiT DirA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=SJS97S8TPUwSrRDECfWIN8WKF+w4yCdyNTd3KBKCppA=; b=mgD9bTF/d8H5bc+xtTbCr1pmQM4WuKQ7cmVRW+Pu5fL2d0dzLUkPylA3KAaEO/BBzr AVFfKAysregB1zxD/thd5UpE6PbEQacw/GJmsf0j98j0jVqHQqe+xzebwoJj09TI/fh8 bBuOmpg04HFFEDK8/DfE/hxBGzbNbQpFXuWoqQV/t4/htZcLEtAFZr2jyuR48vJJZrLc 3NAI7iw8yR6MyWKBWxSxxhB7sutA96zBrJvIr1zMrNby88/qvLSxteGU96B9hKe5cM8A Fjah9wOadh1LrvRzIubtqXw8hgIGPsQViXnHpqzKe17h3/qj8Onu1k3G8nsx4vMm2Oho zf6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dFhTQ7sR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m25si2933737pgv.483.2018.01.30.11.12.32; Tue, 30 Jan 2018 11:12:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dFhTQ7sR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752514AbeA3TFi (ORCPT + 99 others); Tue, 30 Jan 2018 14:05:38 -0500 Received: from mail-qt0-f178.google.com ([209.85.216.178]:40100 "EHLO mail-qt0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751590AbeA3TFg (ORCPT ); Tue, 30 Jan 2018 14:05:36 -0500 Received: by mail-qt0-f178.google.com with SMTP id s39so18636200qth.7; Tue, 30 Jan 2018 11:05:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=SJS97S8TPUwSrRDECfWIN8WKF+w4yCdyNTd3KBKCppA=; b=dFhTQ7sRfF0Zwih74iLZYlMWp8uOSsVkl2Q2Shn9OQ5hwvMPbNumUrgN7rr+VpqMbR w9u2PizcMnHOmmCPhmeJd9jlIXegEf8lG8PNX0Ph5q9g0e55SakSMqx6X17+/0qqinsd WaqN8tpr4xuXYfLLRqJFlH6LDzRiNCFaKc6Zbuh6lN6WsG9OMV50+NmaPqYI3+xF1DNk zuqdxBnW7QfhlBwWz0W7HPcUb5vQDyeeG+xvii+1MzjpHxwffqenR+V/9tlXrc67OteG a/g9TouQoFeub2r9xQqtHRbcVS/WH584+bJ8QcZ97/9USY4c302LplJu5q4maoywx19c q93g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=SJS97S8TPUwSrRDECfWIN8WKF+w4yCdyNTd3KBKCppA=; b=dzsCOxJsiLwqDaWIQ2iDUXdtuDLSqhLNggNw3qnviwpeLQnbu13CLwKfkidnDyj9b7 kihqhs8qM6hFI9uvZ/Y/4t3aMRnmr8oagK3aP5kNqsJrTGkS9hUlvvjO3+XNsdhjZE+I Qyr26qrxvaBx/hZbyo1wZsjDw3v/NAXl8yZzC4Bk1sLeC1VkwhjRs7/QGm69tWycx5R6 e+rHRBM6VMCWA5nCPDrVpSaLQRgPxeDGAmKzZ4M65GCRqQ5amJxfwi9jzWoj2qZzXqqp P7WBEE3GofoAnz83x1tY5J7V+UCNnESdGRuTmbI9Ei4lpSe+2FwWUn5Gnn4N6EJbbOI9 yoOw== X-Gm-Message-State: AKwxyter+kRCb3Iucu0RlJDqDbud7iPAotsdoxa1rIGI4yKNFrZiLP94 KW3h0cmQWdbGYV5y/4H7vhEcPTGlpVX32tiE7M4= X-Received: by 10.200.3.91 with SMTP id w27mr45996323qtg.149.1517339135999; Tue, 30 Jan 2018 11:05:35 -0800 (PST) MIME-Version: 1.0 Received: by 10.12.175.35 with HTTP; Tue, 30 Jan 2018 11:05:35 -0800 (PST) In-Reply-To: References: <010001602cf53153-39ad69f1-1b39-4e6d-a748-9455a16c2fbd-000000@email.amazonses.com> <20171210182152.70ad8fbf@archlinux> <01000160dccefcb4-25edfd89-56f3-486f-88a4-cb8c07253974-000000@email.amazonses.com> <20180114104330.2aa7c1fd@archlinux> <20180128094021.572ab366@archlinux> <20180130160107.000006df@huawei.com> From: Andy Shevchenko Date: Tue, 30 Jan 2018 21:05:35 +0200 Message-ID: Subject: Re: [PATCH v2] iio: accel: bmc150: Check for a second ACPI device for BOSC0200 To: Steven Presser Cc: Hans de Goede , Hartmut Knaack , Jeremy Cline , Jonathan Cameron , Jonathan Cameron , Lars Kellogg-Stedman , Lars-Peter Clausen , Linux Kernel Mailing List , Mika Westerberg , Peter Meerwald-Stadler , Wolfram Sang , linux-iio@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 30, 2018 at 8:34 PM, Steven Presser wrote: > Andy, > > I apologize for the long response, but there's several issues to address > here. NP, it it a good explanation why. That's what commit message missed apparently. > First, I believe the "bmc150" in the subject line is in some way a misnomer. > You'd have to ask Jeremy for more details on what he intended it to refer > to. However, I believe the device in question is actually the bma250[1], > which does not have a magnetometer component. I'm unfortunately away from > my notes, but I can check later if you need me to verify the exact chip. Please do, I would really be on the safe side here. > Second, we're seeing a difference between what's in the data sheet and > what's exposed in the wild via ACPI. I own the laptop that started the > process of building this patch and I did the original ACPI-tables > investigation. > > The device in question (BOSC0200) appears in the Lenovo Yoga 11e (and > possibly other laptops - this happens to be the one I own). These laptops > have a 360-degree hinge between the screen and the keyboard, letting them > convert into tablets, if the user desires. The 11e implements this > mode-switching by placing an accelerometer in each of the screen and > keyboard, then doing math with the resulting vectors to figure out the angle > between the two. This makes a lot of sense. > For whatever reason, Lenovo chose to expose these two > (physically separate) accelerometers via a single ACPI device which presents > two i2c devices at sequential addresses. > As part of my original investigation of the Yoga 11e, I wrote a > proof-of-concept of pulling accelerometer data from the two devices exposed > under the BOSC0200 ID and using that to calculate the position of the screen > relative to the keyboard. So based on my empirical experience, I can tell > you the BOSC0200 device ID can expose two accelerometers at sequential > addresses in the wild. > > I don't understand why Lenovo has reused the BOSC0200 ACPI device ID for a > device that is fundamentally different from the base device. The ID doesn't > belong to them and we're (apparently) now stuck in this situation where this > ACPI device ID could represent two different device layouts. Bad, bad Lenovo. (DMI strings might help here) > Finally - Andy, I apologize if I came across as challenging you in my > initial mail. I was trying to strike a balance between brevity/respecting > your time and asking a question. Evidently I struck the wrong balance and > should have given you more background on why I was doubting what you saw. > This is my fault and you have my sincerest apologies for any offense I have > caused. No need, the root cause is lack of description in the commit message. Nevertheless, the approach chosen I don't like. It looks like an ugly hack. What we can do here is: - do not contaminate core part with I2C/SPI/etc - do not create another driver via board_info, we already in *the same* driver, so, the better approach here AFAICS is to add DMI quirk into i2c-core-acpi > Steve > > [1] > https://ae-bst.resource.bosch.com/media/_tech/media/datasheets/BST-BMA250E-DS004-06.pdf -- With Best Regards, Andy Shevchenko