All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Steven Presser <steve@pressers.name>
Cc: Hans de Goede <hdegoede@redhat.com>,
	Hartmut Knaack <knaack.h@gmx.de>,
	Jeremy Cline <jeremy@jcline.org>,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	Jonathan Cameron <jic23@jic23.retrosnub.co.uk>,
	Lars Kellogg-Stedman <lars@oddbit.com>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	Wolfram Sang <wsa@the-dreams.de>,
	linux-iio@vger.kernel.org
Subject: Re: [PATCH v2] iio: accel: bmc150: Check for a second ACPI device for BOSC0200
Date: Tue, 30 Jan 2018 21:05:35 +0200	[thread overview]
Message-ID: <CAHp75VfmH5aNPzBLvm-GrQ-49uyJNNwdjbte3uh_kmaC91bz6A@mail.gmail.com> (raw)
In-Reply-To: <f42f6acc-cb30-e36d-0c98-42b7e3d40457@pressers.name>

On Tue, Jan 30, 2018 at 8:34 PM, Steven Presser <steve@pressers.name> 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

  reply	other threads:[~2018-01-30 19:05 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-06 17:52 [PATCH v2] iio: accel: bmc150: Check for a second ACPI device for BOSC0200 Jeremy Cline
2017-12-10 18:21 ` Jonathan Cameron
2018-01-09 21:24   ` Jeremy Cline
2018-01-14 10:43     ` Jonathan Cameron
2018-01-28  9:40       ` Jonathan Cameron
2018-01-29 14:07         ` Andy Shevchenko
2018-01-30 16:01           ` Jonathan Cameron
2018-01-30 16:40             ` Andy Shevchenko
2018-01-30 17:05               ` Andy Shevchenko
2018-01-30 17:25                 ` Steve Presser
2018-01-30 17:38                   ` Andy Shevchenko
2018-01-30 18:08                     ` Andy Shevchenko
2018-01-30 18:33                       ` Jonathan Cameron
2018-01-30 18:46                         ` Jonathan Cameron
2018-01-30 18:47                           ` Andy Shevchenko
2018-01-30 18:34                     ` Steven Presser
2018-01-30 19:05                       ` Andy Shevchenko [this message]
2018-01-30 19:27                         ` Steven Presser
2018-01-30 20:12                           ` Andy Shevchenko
2018-01-30 21:20                             ` Andy Shevchenko
2018-01-31 10:55                               ` Jonathan Cameron
2018-02-04 18:25                               ` Steven Presser
2018-02-15 12:50                                 ` Andy Shevchenko
2018-02-15 18:06                                   ` Steve Presser
2018-02-16 14:50                                     ` Andy Shevchenko
2018-02-04 17:58                             ` Steven Presser
2018-02-06 19:47                               ` Andy Shevchenko
2018-01-31 11:43                     ` Hans de Goede
2018-01-31 12:25                       ` Andy Shevchenko
2018-01-31 14:58                         ` Hans de Goede
2018-01-31 15:19                           ` Andy Shevchenko
2018-01-31 19:53                           ` Jeremy Cline
2018-01-30 15:22         ` Jeremy Cline

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHp75VfmH5aNPzBLvm-GrQ-49uyJNNwdjbte3uh_kmaC91bz6A@mail.gmail.com \
    --to=andy.shevchenko@gmail.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=hdegoede@redhat.com \
    --cc=jeremy@jcline.org \
    --cc=jic23@jic23.retrosnub.co.uk \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=lars@oddbit.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=pmeerw@pmeerw.net \
    --cc=steve@pressers.name \
    --cc=wsa@the-dreams.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.