Linux IIO development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Jonathan LoBue <jlobue10@gmail.com>
Cc: linux-iio@vger.kernel.org, andy.shevchenko@gmail.com,
	hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com,
	jagathjog1996@gmail.com, luke@ljones.dev,
	benato.denis96@gmail.com, lkml@antheas.dev,
	derekjohn.clark@gmail.com
Subject: Re: [PATCH v5 2/2] iio: imu: bmi323: Add and enable ACPI Match Table
Date: Fri, 16 Feb 2024 11:41:23 +0000	[thread overview]
Message-ID: <20240216114123.7db07a2a@jic23-huawei> (raw)
In-Reply-To: <20240215182441.57391-1-jlobue10@gmail.com>

On Thu, 15 Feb 2024 10:24:41 -0800
Jonathan LoBue <jlobue10@gmail.com> wrote:

Add ACPI Match Table

is enough - would be odd if we didn't use it ;)

This looks fine to me, but I'm not the expert in work arounds for this
sort of ACPI issue. 

I'm too used to the nice world of servers where we fix wrong firmware
(and this sort of change is always rejected by upstream). 

> This patch adds the ACPI match table for ASUS ROG ALLY to load the bmi323
> driver with an ACPI match of "BOSC0200", and a comment about duplicate
> ACPI identifiers between devices using the bmc150 and bmi323 chips.
> 
> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
> Co-developed-by: Luke D. Jones <luke@ljones.dev>
> Signed-off-by: Luke D. Jones <luke@ljones.dev>
> Co-developed-by: Denis Benato <benato.denis96@gmail.com>
> Signed-off-by: Denis Benato <benato.denis96@gmail.com>
> Co-developed-by: Antheas Kapenekakis <lkml@antheas.dev>
> Signed-off-by: Antheas Kapenekakis <lkml@antheas.dev>
> Signed-off-by: Jonathan LoBue <jlobue10@gmail.com>
> ---
>  drivers/iio/imu/bmi323/bmi323_i2c.c | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
> 
> diff --git a/drivers/iio/imu/bmi323/bmi323_i2c.c b/drivers/iio/imu/bmi323/bmi323_i2c.c
> index 20a8001b9956..f7550503e47e 100644
> --- a/drivers/iio/imu/bmi323/bmi323_i2c.c
> +++ b/drivers/iio/imu/bmi323/bmi323_i2c.c
> @@ -93,6 +93,25 @@ static int bmi323_i2c_probe(struct i2c_client *i2c)
>  	return bmi323_core_probe(dev);
>  }
>  
> +static const struct acpi_device_id bmi323_acpi_match[] = {
> +	/*
> + 	 * The "BOSC0200" identifier used here is not unique to bmi323 devices.
> + 	 * The same "BOSC0200" identifier is found in the ACPI tables of devices
> + 	 * using the bmc150 chip. This creates a conflict with duplicate ACPI
> + 	 * identifiers which multiple drivers want to use. If a non-bmi323 device
> + 	 * starts to load with this "BOSC0200" ACPI match here, then the chip
> + 	 * ID check portion should fail because the chip IDs received (via i2c) are
> + 	 * unique between bmc150 and bmi323 and the driver should relinquish the
> + 	 * device. If and when a different driver (such as bmc150) starts to load
> + 	 * with the "BOSC0200" ACPI match, a short reset should ensure that the
> + 	 * device is not in a bad state during that driver initialization. This
> + 	 * device reset does occur in both the bmi323 and bmc150 init sequences.
> + 	 */
> +	{ "BOSC0200" },
> +	{ }
> +};
> +MODULE_DEVICE_TABLE(acpi, bmi323_acpi_match);
> +
>  static const struct i2c_device_id bmi323_i2c_ids[] = {
>  	{ "bmi323" },
>  	{ }
> @@ -109,6 +128,7 @@ static struct i2c_driver bmi323_i2c_driver = {
>  	.driver = {
>  		.name = "bmi323",
>  		.of_match_table = bmi323_of_i2c_match,
> +		.acpi_match_table = bmi323_acpi_match,
>  	},
>  	.probe = bmi323_i2c_probe,
>  	.id_table = bmi323_i2c_ids,


  reply	other threads:[~2024-02-16 11:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-15 18:19 [PATCH v5 0/2] Add bmi323 support for ASUS ROG ALLY J Lo
2024-02-15 18:24 ` [PATCH v5 1/2] iio: accel: bmc150: Duplicate ACPI entries Jonathan LoBue
2024-02-16 11:37   ` Jonathan Cameron
2024-02-16 14:30     ` Jonathan LoBue
2024-02-16 15:49       ` Jonathan Cameron
2024-02-15 18:24 ` [PATCH v5 2/2] iio: imu: bmi323: Add and enable ACPI Match Table Jonathan LoBue
2024-02-16 11:41   ` Jonathan Cameron [this message]
2024-02-16 11:35 ` [PATCH v5 0/2] Add bmi323 support for ASUS ROG ALLY Jonathan Cameron
2024-02-16 12:01   ` Hans de Goede

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=20240216114123.7db07a2a@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=benato.denis96@gmail.com \
    --cc=derekjohn.clark@gmail.com \
    --cc=hdegoede@redhat.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=jagathjog1996@gmail.com \
    --cc=jlobue10@gmail.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=lkml@antheas.dev \
    --cc=luke@ljones.dev \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox