From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Hans de Goede <hdegoede@redhat.com>,
Jonathan Cameron <jic23@kernel.org>,
Lars-Peter Clausen <lars@metafoo.de>,
Sean Rhodes <sean@starlabs.systems>, <linux-iio@vger.kernel.org>
Subject: Re: [PATCH 0/4] iio: accel: Share ACPI ROTM parsing between drivers and add it to mxc4005
Date: Mon, 22 Apr 2024 18:05:56 +0100 [thread overview]
Message-ID: <20240422180556.0000472d@Huawei.com> (raw)
In-Reply-To: <CAHp75VcpbQZZtw2ReLuGMoyOYy8sSEuVf7j1dopt6gkWecAoag@mail.gmail.com>
On Mon, 22 Apr 2024 15:28:48 +0300
Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
> On Mon, Apr 22, 2024 at 2:45 PM Hans de Goede <hdegoede@redhat.com> wrote:
> > On 4/22/24 1:33 PM, Andy Shevchenko wrote:
> > > On Mon, Apr 22, 2024 at 11:24 AM Hans de Goede <hdegoede@redhat.com> wrote:
> > >> On 4/22/24 9:55 AM, Andy Shevchenko wrote:
> > >>> Wed, Apr 17, 2024 at 06:46:12PM +0200, Hans de Goede kirjoitti:
>
> ...
>
> > >>> I have briefly looked into this and I like this, except the part of the big
> > >>> function being in the header. Why? Why can't it be in a C-file?
> > >>>
> > >>> Note, 3 users justify very well to me that shared code, should be shared in
> > >>> binary as well. (I.o.w. you may argue that IRL there will be no more than
> > >>> one of such device connected, but in case of DIY and prototyping it might
> > >>> still be the use case.)
> > >>
> > >> It is only 1 function and it is not that big. IMHO the static inline
> > >> in a header solution here is much better then making this a separate .ko
> > >> file with all the associated overhead.
> > >
> > > Look how the i8042 RTC header became a disaster. :-)
> > > Nevertheless, this can be part of the IIO core for the ACPI enabled
> > > kernels. Which eliminates a need for a separate module.
> >
> > Putting this in the IIO core, with an iio-prefix, so say something like:
> >
> > #ifdef CONFIG_ACPI
> > bool iio_read_acpi_mount_matrix(struct device *dev, struct iio_mount_matrix *matrix, const char *method_name);
> > #else
> > static inline bool
> > iio_read_acpi_mount_matrix(struct device *dev, struct iio_mount_matrix *matrix, const char *method_name)
> > {
> > return false;
> > }
> >
> > in include/linux/iio/iio.h ?
>
> Yes, like SPI, I²C, etc. do in similar cases.
>
> > works for me and that also avoids Jonathan's worry about using an acpi_
> > prefix in iio code.
> >
> > Jonathan how does that sound to you ?
>
Good
prev parent reply other threads:[~2024-04-22 17:06 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-17 16:46 [PATCH 0/4] iio: accel: Share ACPI ROTM parsing between drivers and add it to mxc4005 Hans de Goede
2024-04-17 16:46 ` [PATCH 1/4] iio: accel: kxcjk-1013: Simplify ACPI ROTM mount matrix retreival Hans de Goede
2024-04-17 16:46 ` [PATCH 2/4] iio: accel: kxcjk-1013: Move ACPI ROTM parsing to new acpi-helpers.h Hans de Goede
2024-04-20 11:13 ` 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
2024-04-17 16:46 ` [PATCH 3/4] iio: bmc150-accel-core: Use acpi_read_mount_matrix() helper Hans de Goede
2024-04-17 16:46 ` [PATCH 4/4] iio: accel: mxc4005: Read orientation matrix from ACPI ROTM method Hans de Goede
2024-04-19 7:36 ` [PATCH 0/4] iio: accel: Share ACPI ROTM parsing between drivers and add it to mxc4005 Hans de Goede
2024-04-22 7:51 ` Andy Shevchenko
2024-04-22 7:55 ` Andy Shevchenko
2024-04-22 8:24 ` Hans de Goede
2024-04-22 11:33 ` Andy Shevchenko
2024-04-22 11:45 ` Hans de Goede
2024-04-22 12:28 ` Andy Shevchenko
2024-04-22 17:05 ` 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=20240422180556.0000472d@Huawei.com \
--to=jonathan.cameron@huawei.com \
--cc=andy.shevchenko@gmail.com \
--cc=hdegoede@redhat.com \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.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