kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: Tomek The Messenger <tomekthemessenger@gmail.com>
To: kernelnewbies@kernelnewbies.org
Subject: two kernel modules for the same device address in dts
Date: Tue, 7 Apr 2020 15:26:06 +0200	[thread overview]
Message-ID: <CAA4NGyu1ALftwCyq98ahqQK0Nrg4UhbiGedxf7h6t+JbBjcLXQ@mail.gmail.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 1113 bytes --]

Hi
I am trying to design some functionality and I wonder if something like
that is supported in dts and linux:

&i2c1 {
default_device: default_device@75 {
    compatible = "some-name-never-mind";
     reg = <0x75>;
};
my_device: my_device@0 {
compatible = "my-device-which-do-only-some-minor-part";
reg = <0x75>;
};
};

You know what I mean, is it possible to declare in dts two kernel modules
for the same device with the same address? I don't want to extend
default_device functionality, I want put my functionality in separate
kernel module. I am currently in the middle of implementation but I wonder
if it has sense. Both kernel modules will have in fact:
probe(struct i2c_client *client, ...), I wonder if probe won't fail. At
least in user space shell "i2cdetect -r 1" returns UU for address 0x75 when
kernel module is loaded. So that is why I suspect probe might fail.

Another story is what in case somebody asks for access to device at the
same time from two kernel modules. I hope function:
i2c_smbus_write_byte_data
has some kind of spinlock, mutexes and just wait till bus is free, but who
knows.:)

[-- Attachment #1.2: Type: text/html, Size: 1359 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

             reply	other threads:[~2020-04-07 13:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-07 13:26 Tomek The Messenger [this message]
2020-04-10  9:46 ` two kernel modules for the same device address in dts Ezra Buehler

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=CAA4NGyu1ALftwCyq98ahqQK0Nrg4UhbiGedxf7h6t+JbBjcLXQ@mail.gmail.com \
    --to=tomekthemessenger@gmail.com \
    --cc=kernelnewbies@kernelnewbies.org \
    /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).