Message ID | 20240202173040.26806-2-jesusmgh@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-50241-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:9bc1:b0:106:209c:c626 with SMTP id op1csp583747dyc; Fri, 2 Feb 2024 09:33:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IENQAyp2lyWgou0eXuerwryJqoHaFtvH1nTSwbrSP5GUmMnMZRSkkv+fYeBJ74cQlMVKObr X-Received: by 2002:a05:6870:2194:b0:218:51da:87b7 with SMTP id l20-20020a056870219400b0021851da87b7mr422448oae.2.1706895186526; Fri, 02 Feb 2024 09:33:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706895186; cv=pass; d=google.com; s=arc-20160816; b=yfxn36gYzu5GKnvpexSGTKAk4r0oGvi+Ok99x4UauYFetJRICulhBSlnjKCaj1QTv3 Rd+9Xofuhk0V2u6S2QEwSnVkaeCnfRP4PVq7hcUO5jhkqf0xq//sb8NZQmYp6y3AW4Eb 9NKze5WhgFvKgpzrpZuq3uiATqR5D29z8zWb5Lea4T0Zdh2pe/z2tOxZ+N3hYK3MilYo ALC4KgFkD8cEcCD9jOIoGIDgzupZ9hXinYiMT6YVVAUvC5gZ/0mOqJwF8WoJ8+OXAmgF W1iwm0A+5tfJALK+uznKFxbmCwSGyJPLpP67FQaKziW7OEVTpxfeQj9IDUJXVHvQ2oWs cRow== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=MZV5kKfu43pg+P1nwDSu3FuOWtizR/h4o6gwCwbwjx0=; fh=VGqHOAVZ20nEudQeeL9RDlfmETeUIKut196IbgwwyLM=; b=xDsrWDCQmBLJZKt02evuH/QXWOI35PnS2NUnp2xJicB8i3JHh1eHA7Ael43LwsY2IX djKdmVxntE7cRVA3py4fosVgMm1GuiutBjH1BwlhFphTnoNghHrzJVpzDDhp/syMg/I9 bXtJPOd0bxrNWPCaDbPb/tEbXiyEM4Mg55nLGwx9rZEVDpJdwE7tz9kqVPOA2GbsUQ00 HxXSdlt4As1Osw/m4rPO2iF8Hdvot8H3L/ul+19LBo2+aLLH9eFiMp/+csXLPRvTkQn/ Xql5EFXFxxyBSspg5w6CbaCz45XAMuEiTcBVph3A7xokop8NSZbjuXazjHJNnMza1j30 y8PQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=M3jbOXkN; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-50241-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50241-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com X-Forwarded-Encrypted: i=1; AJvYcCUo93lw5RA2cwFEFA1LBQHqqiuBHV8CUsQYzX2IA9PG9HRdrWksSBSYXgambMEIzD4z8vArcawZxO+WovT5LWwb2pW4Jg== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id l19-20020a05620a211300b0078438018b61si2366245qkl.136.2024.02.02.09.33.06 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 09:33:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-50241-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=M3jbOXkN; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-50241-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50241-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 3D2991C20CA3 for <ouuuleilei@gmail.com>; Fri, 2 Feb 2024 17:33:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A727D14A4F5; Fri, 2 Feb 2024 17:32:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="M3jbOXkN" Received: from mail-qt1-f177.google.com (mail-qt1-f177.google.com [209.85.160.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 43F7F14A0A5; Fri, 2 Feb 2024 17:32:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706895170; cv=none; b=SkOJDRAqQzzrhxR67Lptm+2LlEIvXjRfy09F8+m/7LoXcMy6464ujMeLx3Z4zxMpO4QuH8SCOBvq9PQvzSujIIvbFEnMP3caV9c470gXzFCPQUjFB4OuTs4KNCSVsPuA7hIlWwwj6UPXrkIbfPkBbcU6TOkd+OBkrOjStlFdh3Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706895170; c=relaxed/simple; bh=BzeGSQFv23RzxfnxCCVXJrwUwm5DgaTHVJ5SPJupBPM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=QlhRA+o4r2qjOt5Q3+AZYlB985ryljkl8pDsxza4tNHM7sGJrDHRCJyUijrpACWlp69I0BCq38eyZwKq9eAr3INfA0e6QIfInajQpvOJyAkAxBEGFuHHRwmCGGHUxx8hiOr4uIbJg9Es1kJZFUiympNK0Wsz9yL+P5hixfzPqk8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=M3jbOXkN; arc=none smtp.client-ip=209.85.160.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-qt1-f177.google.com with SMTP id d75a77b69052e-42c0960382eso2125121cf.2; Fri, 02 Feb 2024 09:32:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706895167; x=1707499967; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=MZV5kKfu43pg+P1nwDSu3FuOWtizR/h4o6gwCwbwjx0=; b=M3jbOXkNsdO8TCSCabw+nMRZrlGzAg9DsePuLa3KLotbB8uZ3cZFCLyUp/i3dufOfd U3s57kcYqcJ6hQVRz5Fc9O56jGcBjzPh+GwUL9m94SQnaLkqbEuaz+rF3ZS8lFP5HO5a AwCrhiOPeQnqzbX1J5ojvLvzu9UKvmWNAfynxoLSIO8DODN76AAAHBmnME1g8UXdvf6a 1bwvZtpYNKXM8OGxwmxP3fGPopm8tEHm3pregfCDVrrNH7oVwIgwFdyapyhtgvjbeKGz VFFzMI11ccBuFyHloDZT9lOhXmI3+l0dagqjeQzwksQo8jvlCzeVAAh7CJlW5fKBvmfT xwQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706895167; x=1707499967; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=MZV5kKfu43pg+P1nwDSu3FuOWtizR/h4o6gwCwbwjx0=; b=MkeBI+mumtC1nJWBh6DwPWvlJafDEMIdBWGU5sD4JHb4p2gtrLEiuT0UnkXXAT/Fl/ 619ReTzIrGONXpJLrWTWAlsdjieyAlsXbndJLashwQNNnqnAQgyFH+BFoVwu5x/v2bHy 8Kzv9e1ihtc39xrxSLhJtnl52KFeyys2/AFcxHyntCQDQtyhQXGOcDBk4vF6tOnZipw6 lw9wSiTGPb2laWGrinOW3VVSZhG8AnbunTBSAhk2Nx0sAKVM2M2N2MkfFVVgNTIN3myD qi00caCXReaX5aJ46BBmdAXIvM6dsgX1fAU+SYHzcJCv45fRjptuuqI/9XUWFXAl1RDY YyTA== X-Gm-Message-State: AOJu0YyUISn3p0KdDzDAQkYOYCHoNBsFW1HmDQG8yBd7KB3zxCmS9nex XrmEuHKX/mCPxD8o2FMvpdTZ0ixiQOdFDUt4L5xchGaEPupU0kyb X-Received: by 2002:ac8:5890:0:b0:42c:c7:ffe5 with SMTP id t16-20020ac85890000000b0042c00c7ffe5mr2836282qta.68.1706895166925; Fri, 02 Feb 2024 09:32:46 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCX219F2y8peI5Q69R1Y+U1liVUJWjjCJsy/DuLn0zTq93lrH2hDuWmGCKJjgn/yP6MIz4mML3euTvsr3kxlkVMOpKCvJUEWW4inGk1W4v4KhHuymhivwEf+E2ME4iS1nslV9WbpGPPOBkF3ClCilwjWww== Received: from localhost.localdomain (i577B69E4.versanet.de. [87.123.105.228]) by smtp.gmail.com with ESMTPSA id cc22-20020a05622a411600b0042be0933c1csm1006890qtb.15.2024.02.02.09.32.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 09:32:46 -0800 (PST) From: Jesus Gonzalez <jesusmgh@gmail.com> To: jic23@kernel.org, lars@metafoo.de Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Jesus Gonzalez <jesusmgh@gmail.com> Subject: [PATCH 1/1] Add 10EC5280 to bmi160_i2c ACPI IDs to allow binding on some devices Date: Fri, 2 Feb 2024 18:30:41 +0100 Message-ID: <20240202173040.26806-2-jesusmgh@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789809327076226944 X-GMAIL-MSGID: 1789809327076226944 |
Series |
[1/1] Add 10EC5280 to bmi160_i2c ACPI IDs to allow binding on some devices
|
|
Commit Message
Jesus Gonzalez
Feb. 2, 2024, 5:30 p.m. UTC
"10EC5280" is used by several manufacturers like Lenovo, GPD, or AYA (and
probably others) in their ACPI table as the ID for the bmi160 IMU. This
means the bmi160_i2c driver won't bind to it, and the IMU is unavailable
to the user. Manufacturers have been approached on several occasions to
try getting a BIOS with a fixed ID, mostly without actual positive
results, and since affected devices are already a few years old, this is
not expected to change. This patch enables using the bmi160_i2c driver for
the bmi160 IMU on these devices.
Signed-off-by: Jesus Gonzalez <jesusmgh@gmail.com>
---
A device-specific transformation matrix can then be provided in a second
step through udev hwdb.
This has been discussed before in 2021, see here:
https://lore.kernel.org/lkml/CACAwPwYQHRcrabw9=0tvenPzAcwwW1pTaR6a+AEWBF9Hqf_wXQ@mail.gmail.com/
Lenovo, as an example of a big manufacturer, is also using this ID:
https://www.reddit.com/r/linux/comments/r6f9de/comment/hr8bdfs/?context=3
At least some discussions with GPD took place on the GPD server Discord,
for which I can provide proof on demand via screenshot (if not accessible
directly).
I have read the patch submission instructions and followed them to the
best of my knowledge. Still, this is my first kernel patch submission,
so I'd be glad if you could please point out any mistakes. Thank you!
drivers/iio/imu/bmi160/bmi160_spi.c | 1 +
1 file changed, 1 insertion(+)
Comments
On Fri, 2 Feb 2024 18:30:41 +0100 Jesus Gonzalez <jesusmgh@gmail.com> wrote: > "10EC5280" is used by several manufacturers like Lenovo, GPD, or AYA (and > probably others) in their ACPI table as the ID for the bmi160 IMU. This > means the bmi160_i2c driver won't bind to it, and the IMU is unavailable > to the user. Manufacturers have been approached on several occasions to > try getting a BIOS with a fixed ID, mostly without actual positive > results, and since affected devices are already a few years old, this is > not expected to change. This patch enables using the bmi160_i2c driver for > the bmi160 IMU on these devices. Hi Jesus, https://lore.kernel.org/lkml/CAHp75Vct-AXnU7QQmdE7nyYZT-=n=p67COPLiiZTet7z7snL-g@mail.gmail.com/ Lays out what Andy (and for that matter I) consider necessary for such a patch. In short, we want to see devices called out here - with a DSDT section. + a clear comment in the code. The big problem here is this tramples on Realtech's ID space. It's not just a made up code (incidentally the BMI0160 isn't valid either), it's a valid code but for an entirely different (PCI) device. So we need as much info as possible in the patch description and the driver itself to justify carrying this. Tempting to add a firmware bug taint on it as well but that might scare people :) Jonathan > > Signed-off-by: Jesus Gonzalez <jesusmgh@gmail.com> > --- > A device-specific transformation matrix can then be provided in a second > step through udev hwdb. > > This has been discussed before in 2021, see here: > https://lore.kernel.org/lkml/CACAwPwYQHRcrabw9=0tvenPzAcwwW1pTaR6a+AEWBF9Hqf_wXQ@mail.gmail.com/ > > Lenovo, as an example of a big manufacturer, is also using this ID: > https://www.reddit.com/r/linux/comments/r6f9de/comment/hr8bdfs/?context=3 > > At least some discussions with GPD took place on the GPD server Discord, > for which I can provide proof on demand via screenshot (if not accessible > directly). > > I have read the patch submission instructions and followed them to the > best of my knowledge. Still, this is my first kernel patch submission, > so I'd be glad if you could please point out any mistakes. Thank you! > > > drivers/iio/imu/bmi160/bmi160_spi.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/iio/imu/bmi160/bmi160_spi.c b/drivers/iio/imu/bmi160/bmi160_spi.c > index 8b573ea99af2..0874c37c6670 100644 > --- a/drivers/iio/imu/bmi160/bmi160_spi.c > +++ b/drivers/iio/imu/bmi160/bmi160_spi.c > @@ -41,6 +41,7 @@ MODULE_DEVICE_TABLE(spi, bmi160_spi_id); > > static const struct acpi_device_id bmi160_acpi_match[] = { > {"BMI0160", 0}, > + {"10EC5280", 0}, > { }, > }; > MODULE_DEVICE_TABLE(acpi, bmi160_acpi_match);
Hello Mr. Cameron First of all thank you for reviewing the patch. And I most definitely agree with you and Mr. Shevchenko: this absolutely is a firmware bug that manufacturers should fix. For this reason some people started talks with affected manufacturers to change it. In my case it was with GPD, together with some others, including some which historically had a more direct line with them. This was finally dismissed as WONTFIX, since their main focus is Windows and their driver supports the ID, so the end result of those conversations is a lack of a fixed firmware, and a surplus of frustration. As far as I know people have been in talks with Aya too, and I do not know the status of conversations with Lenovo or other manufacturers. I do not know of any conversation with Realtek, besides what was mentioned in those emails you linked to from 2021. I will amend the patch to include a big disclaimer and the reason as a comment in the code, and send it again in reply to this message. I don't think I'd go as far as tainting the kernel, but I'm not opposed, happy anyway if the IMU finally becomes usable, and VERY far from any expertise whatsoever concerning kernel development! Here is the relevant extract from the DSDT of my GPD Win Max 2 (AMD 6800U model) with the latest firmware 1.05 installed. Scope (_SB.I2CC) { Device (BMA2) { Name (_ADR, Zero) // _ADR: Address Name (_HID, "10EC5280") // _HID: Hardware ID Name (_CID, "10EC5280") // _CID: Compatible ID Name (_DDN, "Accelerometer") // _DDN: DOS Device Name Name (_UID, One) // _UID: Unique ID Method (_CRS, 0, NotSerialized) // _CRS: Current Resource Settings { Name (RBUF, ResourceTemplate () { I2cSerialBusV2 (0x0069, ControllerInitiated, 0x00061A80, AddressingMode7Bit, "\\_SB.I2CC", 0x00, ResourceConsumer, , Exclusive, ) }) Return (RBUF) /* \_SB_.I2CC.BMA2._CRS.RBUF */ } OperationRegion (CMS2, SystemIO, 0x72, 0x02) Field (CMS2, ByteAcc, NoLock, Preserve) { IND2, 8, DAT2, 8 } IndexField (IND2, DAT2, ByteAcc, NoLock, Preserve) { Offset (0x74), BACS, 32 } Method (ROMS, 0, NotSerialized) { Name (RBUF, Package (0x03) { "0 -1 0", "-1 0 0", "0 0 1" }) Return (RBUF) /* \_SB_.I2CC.BMA2.ROMS.RBUF */ } Method (CALS, 1, NotSerialized) { Local0 = Arg0 If (((Local0 == Zero) || (Local0 == Ones))) { Return (Local0) } Else { BACS = Local0 } } Method (_STA, 0, NotSerialized) // _STA: Status { Return (0x0F) } } } Thank you for taking this into consideration! Jesus Gonzalez On 04/02/2024 15:00, Jonathan Cameron wrote: > On Fri, 2 Feb 2024 18:30:41 +0100 > Jesus Gonzalez <jesusmgh@gmail.com> wrote: > >> "10EC5280" is used by several manufacturers like Lenovo, GPD, or AYA (and >> probably others) in their ACPI table as the ID for the bmi160 IMU. This >> means the bmi160_i2c driver won't bind to it, and the IMU is unavailable >> to the user. Manufacturers have been approached on several occasions to >> try getting a BIOS with a fixed ID, mostly without actual positive >> results, and since affected devices are already a few years old, this is >> not expected to change. This patch enables using the bmi160_i2c driver for >> the bmi160 IMU on these devices. > Hi Jesus, > > https://lore.kernel.org/lkml/CAHp75Vct-AXnU7QQmdE7nyYZT-=n=p67COPLiiZTet7z7snL-g@mail.gmail.com/ > Lays out what Andy (and for that matter I) consider necessary for such > a patch. > > In short, we want to see devices called out here - with a DSDT section. > + a clear comment in the code. > > The big problem here is this tramples on Realtech's ID space. It's not just > a made up code (incidentally the BMI0160 isn't valid either), > it's a valid code but for an entirely different (PCI) device. > > So we need as much info as possible in the patch description and the driver > itself to justify carrying this. Tempting to add a firmware bug taint on > it as well but that might scare people :) > > Jonathan > > >> Signed-off-by: Jesus Gonzalez <jesusmgh@gmail.com> >> --- >> A device-specific transformation matrix can then be provided in a second >> step through udev hwdb. >> >> This has been discussed before in 2021, see here: >> https://lore.kernel.org/lkml/CACAwPwYQHRcrabw9=0tvenPzAcwwW1pTaR6a+AEWBF9Hqf_wXQ@mail.gmail.com/ >> >> Lenovo, as an example of a big manufacturer, is also using this ID: >> https://www.reddit.com/r/linux/comments/r6f9de/comment/hr8bdfs/?context=3 >> >> At least some discussions with GPD took place on the GPD server Discord, >> for which I can provide proof on demand via screenshot (if not accessible >> directly). >> >> I have read the patch submission instructions and followed them to the >> best of my knowledge. Still, this is my first kernel patch submission, >> so I'd be glad if you could please point out any mistakes. Thank you! >> >> >> drivers/iio/imu/bmi160/bmi160_spi.c | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/drivers/iio/imu/bmi160/bmi160_spi.c b/drivers/iio/imu/bmi160/bmi160_spi.c >> index 8b573ea99af2..0874c37c6670 100644 >> --- a/drivers/iio/imu/bmi160/bmi160_spi.c >> +++ b/drivers/iio/imu/bmi160/bmi160_spi.c >> @@ -41,6 +41,7 @@ MODULE_DEVICE_TABLE(spi, bmi160_spi_id); >> >> static const struct acpi_device_id bmi160_acpi_match[] = { >> {"BMI0160", 0}, >> + {"10EC5280", 0}, >> { }, >> }; >> MODULE_DEVICE_TABLE(acpi, bmi160_acpi_match);
diff --git a/drivers/iio/imu/bmi160/bmi160_spi.c b/drivers/iio/imu/bmi160/bmi160_spi.c index 8b573ea99af2..0874c37c6670 100644 --- a/drivers/iio/imu/bmi160/bmi160_spi.c +++ b/drivers/iio/imu/bmi160/bmi160_spi.c @@ -41,6 +41,7 @@ MODULE_DEVICE_TABLE(spi, bmi160_spi_id); static const struct acpi_device_id bmi160_acpi_match[] = { {"BMI0160", 0}, + {"10EC5280", 0}, { }, }; MODULE_DEVICE_TABLE(acpi, bmi160_acpi_match);