linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Pali Rohár" <pali.rohar@gmail.com>
To: Jean Delvare <jdelvare@suse.de>
Cc: "Wolfram Sang" <wsa@the-dreams.de>,
	"Andy Shevchenko" <andy.shevchenko@gmail.com>,
	"Jean Delvare" <jdelvare@suse.com>,
	"Michał Kępień" <kernel@kempniu.pl>,
	"Steven Honeyman" <stevenhoneyman@gmail.com>,
	"Valdis Kletnieks" <Valdis.Kletnieks@vt.edu>,
	"Jochen Eisinger" <jochen@penguin-breeder.org>,
	"Gabriele Mazzotta" <gabriele.mzt@gmail.com>,
	"Andy Lutomirski" <luto@kernel.org>,
	"Mario Limonciello" <Mario_Limonciello@dell.com>,
	"Alex Hung" <alex.hung@canonical.com>,
	"Takashi Iwai" <tiwai@suse.de>,
	linux-i2c <linux-i2c@vger.kernel.org>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	"Platform Driver" <platform-driver-x86@vger.kernel.org>
Subject: Re: [PATCH v2] i2c: i801: Register optional lis3lv02d i2c device on Dell machines
Date: Tue, 28 May 2019 11:41:32 +0200	[thread overview]
Message-ID: <20190528094132.ytsittb5hcgthoy2@pali> (raw)
In-Reply-To: <20190528111953.0e5415f4@endymion>

Hi! Thank you finally for response!

On Tuesday 28 May 2019 11:19:53 Jean Delvare wrote:
> On Mon, 26 Feb 2018 21:32:55 +0100, Wolfram Sang wrote:
> > > I'm not maintainer of i2c-i801.ko, Jean Delvare & Wolfram Sang are.
> > > Therefore instructing future contributors would be up to them.  
> > 
> > This is really Jean's realm.
> 
> Sorry for the delay. As a general rule I'm all in favor of
> instantiating I2C devices from i2c-i801 when we can, as it makes the
> user's life easier. However I agree with Andy that:
> 1* We want to have an explicit list of supported ACPI device IDs, not a
>    just a prefix.
> 2* We don't want to over-engineer it with a common header file or an
>    exported symbol. I see no problem with duplicating the lists if 2
>    drivers happen to be needed on the same set of devices. This is
>    easily managed by adding a comment before each list that the other
>    list may need to be kept in sync. It also gives us the flexibility
>    to *not* keep them in sync if needed.

Ok, I will then make list of supported ACPI devices and put them into
two places with comment about syncing.

> Instantiating the I2C device from dell-smo8800 doesn't seem practical
> because that driver has no idea about the i2c subsystem in the first
> place.

Yes. And in same way instantiating ACPI driver dell-smo8800 from
i2c-i801 is not practical too.

> What worries me is that we seem to have 2 drivers binding to the same
> device (the accelerometer), one natively (lis3lv02d), and one through
> an ACPI layer (dell-smo8800). I don't really understand why this is
> needed (don't they serve the same purpose?) nor how it can be safe
> (what guarantees that both drivers won't attempt to access the hardware
> at the same time?)

This is not a problem. lis3lv02d provides two things:

1) 3 axes accelerometer
2) optional interrupt and signal it to userspace via misc device

dell-smo8800 does not call any parts of lis2lv02d module. It just
provides for userspace same misc device API as lis3lv02d.

As lis3lv02d has misc device optional, registered i2c device from
i2c-i801 does not enable it.

So technically it is one device, but their functionality divided into
two modules. One which reports accelerometer axes and one which signals
disk fall interrupt. These two modules and functionalities does not have
to interact, so it is safe to have them separated.

-- 
Pali Rohár
pali.rohar@gmail.com

  reply	other threads:[~2019-05-28  9:41 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-27 13:32 [PATCH v2] i2c: i801: Register optional lis3lv02d i2c device on Dell machines Pali Rohár
2018-01-28 14:39 ` Andy Shevchenko
2018-01-28 14:45   ` Pali Rohár
2018-01-28 15:00     ` Andy Shevchenko
2018-01-31 12:03       ` Pali Rohár
2018-01-31 12:27         ` Andy Shevchenko
2018-02-12 15:30           ` Pali Rohár
2018-02-13 14:55             ` Andy Shevchenko
2018-02-13 15:00               ` Pali Rohár
2018-02-13 15:06                 ` Andy Shevchenko
2018-02-13 16:50                   ` Pali Rohár
2018-02-13 17:01                     ` Andy Shevchenko
2018-02-13 17:05                       ` Andy Shevchenko
2018-02-26 20:32                     ` Wolfram Sang
2018-03-08 22:53                       ` Pali Rohár
2018-04-18 11:46                         ` Pali Rohár
2019-04-27  6:48                           ` Pali Rohár
2019-05-28  9:19                       ` Jean Delvare
2019-05-28  9:41                         ` Pali Rohár [this message]
2019-05-28  9:50                           ` Jean Delvare
2019-05-28  9:54                             ` Pali Rohár
2019-05-28 10:00                               ` Jean Delvare
2018-02-11 22:03 ` Michał Kępień
2018-02-12 15:25   ` Andy Shevchenko
2019-06-02 13:20 ` [PATCH v3] " Pali Rohár
2019-06-04 14:57   ` Jean Delvare
2019-06-04 22:30     ` Pali Rohár

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=20190528094132.ytsittb5hcgthoy2@pali \
    --to=pali.rohar@gmail.com \
    --cc=Mario_Limonciello@dell.com \
    --cc=Valdis.Kletnieks@vt.edu \
    --cc=alex.hung@canonical.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=gabriele.mzt@gmail.com \
    --cc=jdelvare@suse.com \
    --cc=jdelvare@suse.de \
    --cc=jochen@penguin-breeder.org \
    --cc=kernel@kempniu.pl \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=stevenhoneyman@gmail.com \
    --cc=tiwai@suse.de \
    --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 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 NNTP newsgroup(s).