From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: Hans de Goede <hdegoede@redhat.com>
Cc: Jonathan Cameron <jic23@kernel.org>,
Lars-Peter Clausen <lars@metafoo.de>,
Sean Rhodes <sean@starlabs.systems>, <linux-iio@vger.kernel.org>,
<linux-acpi@vger.kernel.org>,
"Rafael J. Wysocki" <rafael@kernel.org>
Subject: Re: [PATCH 2/4] iio: accel: kxcjk-1013: Move ACPI ROTM parsing to new acpi-helpers.h
Date: Mon, 22 Apr 2024 18:06:39 +0100 [thread overview]
Message-ID: <20240422180639.00007270@Huawei.com> (raw)
In-Reply-To: <85ec0beb-9ec2-4360-8b53-fe65f8b6f5a8@redhat.com>
On Mon, 22 Apr 2024 11:18:26 +0200
Hans de Goede <hdegoede@redhat.com> wrote:
> Hi,
>
> On 4/20/24 1:13 PM, Jonathan Cameron wrote:
> > On Wed, 17 Apr 2024 18:46:14 +0200
> > Hans de Goede <hdegoede@redhat.com> wrote:
> >
> >> The ACPI "ROTM" rotation matrix parsing code atm is already duplicated
> >> between bmc150-accel-core.c and kxcjk-1013.c and a third user of this is
> >> coming.
> >>
> >> Move the ROTM parsing from kxcjk-1013.c, which has slightly better error
> >> logging (and otherwise is 100% identical), into a new acpi-helpers.h file
> >> so that it can be shared.
> >>
> >> Other then moving the code the only 2 other changes are:
> >>
> >> 1. Rename the function to acpi_read_mount_matrix() to make clear this
> >> is a generic ACPI mount matrix read function.
> >> 2. Add a "char *acpi_method" parameter since some bmc150 dual-accel setups
> >> (360° hinges with 1 accel in kbd/base + 1 in display half) declare both
> >> accels in a single ACPI device with 2 different method names for
> >> the 2 matrices.
> >>
> >> Cc: Sean Rhodes <sean@starlabs.systems>
> >> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> >
> > Tempted to ask you to rename this to
> > acpi_non_standard_microsoft_extension_that_they_never_agreed_with_aswg_read_mount_matrix()
> > but meh, I'll cope with a reference to:
> > https://learn.microsoft.com/en-us/windows-hardware/drivers/sensors/sensors-acpi-entries
> > and a comment saying this is not part of the ACPI standard.
>
> Ok, so I have added the following comment to the v2 which I will send out soon:
>
> diff --git a/drivers/iio/accel/acpi-helpers.h b/drivers/iio/accel/acpi-helpers.h
> index a4357925bf07..4f4140694b59 100644
> --- a/drivers/iio/accel/acpi-helpers.h
> +++ b/drivers/iio/accel/acpi-helpers.h
> @@ -7,6 +7,13 @@
> #include <linux/sprintf.h>
>
> #ifdef CONFIG_ACPI
> +/*
> + * Parse mount matrixes defined in the ACPI "ROTM" format from:
> + * https://learn.microsoft.com/en-us/windows-hardware/drivers/sensors/sensors-acpi-entries
> + * This is a Microsoft extension and not part of the official ACPI spec.
> + * The method name is configurable because some dual-accel setups define 2 mount
> + * matrices in a single ACPI device using separate "ROMK" and "ROMS" methods.
LGTM
> + */
> static inline bool acpi_read_mount_matrix(struct device *dev,
> struct iio_mount_matrix *orientation,
> char *acpi_method)
>
> Regards,
>
> Hans
prev parent reply other threads:[~2024-04-22 17:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20240417164616.74651-1-hdegoede@redhat.com>
[not found] ` <20240417164616.74651-3-hdegoede@redhat.com>
2024-04-20 11:13 ` [PATCH 2/4] iio: accel: kxcjk-1013: Move ACPI ROTM parsing to new acpi-helpers.h Jonathan Cameron
2024-04-22 9:17 ` Hans de Goede
2024-04-22 9:18 ` Hans de Goede
2024-04-22 17:06 ` Jonathan Cameron [this message]
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=20240422180639.00007270@Huawei.com \
--to=jonathan.cameron@huawei.com \
--cc=hdegoede@redhat.com \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=sean@starlabs.systems \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).